commit 49a57857aeea06ca831043acbb0fa5e0f50602fd Author: Linus Torvalds Date: Mon Jan 21 13:14:44 2019 +1300 Linux 5.0-rc3 commit 1e556ba3b673166e28d5489b80c11e0605a86403 Merge: dbcfc96193939 5631e8576a3ca Author: Linus Torvalds Date: Mon Jan 21 13:12:03 2019 +1300 Merge tag 'pstore-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull pstore fixes from Kees Cook: - Fix console ramoops to show the previous boot logs (Sai Prakash Ranjan) - Avoid allocation and leak of platform data * tag 'pstore-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: pstore/ram: Avoid allocation and leak of platform data pstore/ram: Fix console ramoops to show the previous boot logs commit dbcfc961939394152cbcf3f17144ff3df359f216 Merge: 7d0ae236ed13d 2c88c742d0117 Author: Linus Torvalds Date: Mon Jan 21 13:07:03 2019 +1300 Merge tag 'gcc-plugins-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull gcc-plugins fixes from Kees Cook: "Fix ARM per-task stack protector plugin under GCC 9 (Ard Biesheuvel)" * tag 'gcc-plugins-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: gcc-plugins: arm_ssp_per_task_plugin: fix for GCC 9+ gcc-plugins: arm_ssp_per_task_plugin: sign extend the SP mask commit 7d0ae236ed13d7645fb73b85e7c95deee46c4656 Merge: bb617b9b4519b 6436408e814b8 Author: Linus Torvalds Date: Mon Jan 21 12:52:31 2019 +1300 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net Pull networking fixes from David Miller: 1) Fix endless loop in nf_tables, from Phil Sutter. 2) Fix cross namespace ip6_gre tunnel hash list corruption, from Olivier Matz. 3) Don't be too strict in phy_start_aneg() otherwise we might not allow restarting auto negotiation. From Heiner Kallweit. 4) Fix various KMSAN uninitialized value cases in tipc, from Ying Xue. 5) Memory leak in act_tunnel_key, from Davide Caratti. 6) Handle chip errata of mv88e6390 PHY, from Andrew Lunn. 7) Remove linear SKB assumption in fou/fou6, from Eric Dumazet. 8) Missing udplite rehash callbacks, from Alexey Kodanev. 9) Log dirty pages properly in vhost, from Jason Wang. 10) Use consume_skb() in neigh_probe() as this is a normal free not a drop, from Yang Wei. Likewise in macvlan_process_broadcast(). 11) Missing device_del() in mdiobus_register() error paths, from Thomas Petazzoni. 12) Fix checksum handling of short packets in mlx5, from Cong Wang. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (96 commits) bpf: in __bpf_redirect_no_mac pull mac only if present virtio_net: bulk free tx skbs net: phy: phy driver features are mandatory isdn: avm: Fix string plus integer warning from Clang net/mlx5e: Fix cb_ident duplicate in indirect block register net/mlx5e: Fix wrong (zero) TX drop counter indication for representor net/mlx5e: Fix wrong error code return on FEC query failure net/mlx5e: Force CHECKSUM_UNNECESSARY for short ethernet frames tools: bpftool: Cleanup license mess bpf: fix inner map masking to prevent oob under speculation bpf: pull in pkt_sched.h header for tooling to fix bpftool build selftests: forwarding: Add a test case for externally learned FDB entries selftests: mlxsw: Test FDB offload indication mlxsw: spectrum_switchdev: Do not treat static FDB entries as sticky net: bridge: Mark FDB entries that were added by user as such mlxsw: spectrum_fid: Update dummy FID index mlxsw: pci: Return error on PCI reset timeout mlxsw: pci: Increase PCI SW reset timeout mlxsw: pci: Ring CQ's doorbell before RDQ's MAINTAINERS: update email addresses of liquidio driver maintainers ... commit 5631e8576a3caf606cdc375f97425a67983b420c Author: Kees Cook Date: Sun Jan 20 14:33:34 2019 -0800 pstore/ram: Avoid allocation and leak of platform data Yue Hu noticed that when parsing device tree the allocated platform data was never freed. Since it's not used beyond the function scope, this switches to using a stack variable instead. Reported-by: Yue Hu Fixes: 35da60941e44 ("pstore/ram: add Device Tree bindings") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook commit 2c88c742d011707b55da7b54b06a030c6f57233f Author: Ard Biesheuvel Date: Fri Jan 18 11:58:07 2019 +0100 gcc-plugins: arm_ssp_per_task_plugin: fix for GCC 9+ GCC 9 reworks the way the references to the stack canary are emitted, to prevent the value from being spilled to the stack before the final comparison in the epilogue, defeating the purpose, given that the spill slot is under control of the attacker that we are protecting ourselves from. Since our canary value address is obtained without accessing memory (as opposed to pre-v7 code that will obtain it from a literal pool), it is unlikely (although not guaranteed) that the compiler will spill the canary value in the same way, so let's just disable this improvement when building with GCC9+. Signed-off-by: Ard Biesheuvel Signed-off-by: Kees Cook commit 560706d5d2589ef510f5436d69ab510a351b8cf7 Author: Ard Biesheuvel Date: Fri Jan 18 11:58:06 2019 +0100 gcc-plugins: arm_ssp_per_task_plugin: sign extend the SP mask The ARM per-task stack protector GCC plugin hits an assert in the compiler in some case, due to the fact the the SP mask expression is not sign-extended as it should be. So fix that. Suggested-by: Kugan Vivekanandarajah Signed-off-by: Ard Biesheuvel Signed-off-by: Kees Cook commit bb617b9b4519b0cef939c9c8e9c41470749f0d51 Merge: 1be969f4682b0 8e5dadfe76cf2 Author: Linus Torvalds Date: Mon Jan 21 07:37:16 2019 +1300 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio/vhost fixes and cleanups from Michael Tsirkin: "Fixes and cleanups all over the place" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: vhost/scsi: Use copy_to_iter() to send control queue response vhost: return EINVAL if iovecs size does not match the message size virtio-balloon: tweak config_changed implementation virtio: don't allocate vqs when names[i] = NULL virtio_pci: use queue idx instead of array idx to set up the vq virtio: document virtio_config_ops restrictions virtio: fix virtio_config_ops description commit 1be969f4682b0aa1995e46fba51502de55f15ce8 Merge: 315a6d850a829 fd340d0f68cc8 Author: Linus Torvalds Date: Mon Jan 21 07:35:26 2019 +1300 Merge tag 'for-5.0-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "A handful of fixes (some of them in testing for a long time): - fix some test failures regarding cleanup after transaction abort - revert of a patch that could cause a deadlock - delayed iput fixes, that can help in ENOSPC situation when there's low space and a lot data to write" * tag 'for-5.0-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: wakeup cleaner thread when adding delayed iput btrfs: run delayed iputs before committing btrfs: wait on ordered extents on abort cleanup btrfs: handle delayed ref head accounting cleanup in abort Revert "btrfs: balance dirty metadata pages in btrfs_finish_ordered_io" commit 315a6d850a8290919c499cfbed08737f6164c7bd Merge: fbfaf851902cd 3e2ffd655cc6a 99e309b6ed75f Author: Linus Torvalds Date: Mon Jan 21 07:23:42 2019 +1300 Merge tags 'compiler-attributes-for-linus-v5.0-rc3' and 'clang-format-for-linus-v5.0-rc3' of git://github.com/ojeda/linux Pull misc clang fixes from Miguel Ojeda: - A fix for OPTIMIZER_HIDE_VAR from Michael S Tsirkin - Update clang-format with the latest for_each macro list from Jason Gunthorpe * tag 'compiler-attributes-for-linus-v5.0-rc3' of git://github.com/ojeda/linux: include/linux/compiler*.h: fix OPTIMIZER_HIDE_VAR * tag 'clang-format-for-linus-v5.0-rc3' of git://github.com/ojeda/linux: clang-format: Update .clang-format with the latest for_each macro list commit fbfaf851902cd9293f392f3a1735e0543016d530 Author: Florian La Roche Date: Sat Jan 19 16:14:50 2019 +0100 fix int_sqrt64() for very large numbers If an input number x for int_sqrt64() has the highest bit set, then fls64(x) is 64. (1UL << 64) is an overflow and breaks the algorithm. Subtracting 1 is a better guess for the initial value of m anyway and that's what also done in int_sqrt() implicitly [*]. [*] Note how int_sqrt() uses __fls() with two underscores, which already returns the proper raw bit number. In contrast, int_sqrt64() used fls64(), and that returns bit numbers illogically starting at 1, because of error handling for the "no bits set" case. Will points out that he bug probably is due to a copy-and-paste error from the regular int_sqrt() case. Signed-off-by: Florian La Roche Acked-by: Will Deacon Signed-off-by: Linus Torvalds commit 6e693b3ffecb0b478c7050b44a4842854154f715 Author: Will Deacon Date: Sat Jan 19 21:56:05 2019 +0000 x86: uaccess: Inhibit speculation past access_ok() in user_access_begin() Commit 594cc251fdd0 ("make 'user_access_begin()' do 'access_ok()'") makes the access_ok() check part of the user_access_begin() preceding a series of 'unsafe' accesses. This has the desirable effect of ensuring that all 'unsafe' accesses have been range-checked, without having to pick through all of the callsites to verify whether the appropriate checking has been made. However, the consolidated range check does not inhibit speculation, so it is still up to the caller to ensure that they are not susceptible to any speculative side-channel attacks for user addresses that ultimately fail the access_ok() check. This is an oversight, so use __uaccess_begin_nospec() to ensure that speculation is inhibited until the access_ok() check has passed. Reported-by: Julien Thierry Signed-off-by: Will Deacon Signed-off-by: Linus Torvalds commit b0f3e768a89bbc72195023c3db1db45c40e5b70c Merge: 5d5c303ea095b 7fa1e2e6afa7f Author: Linus Torvalds Date: Sun Jan 20 15:27:59 2019 +1200 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "Three arm64 fixes for -rc3. We've plugged a couple of nasty issues involving KASLR-enabled kernels, and removed a redundant #define that was introduced as part of the KHWASAN fixes from akpm at -rc2. - Fix broken kpti page-table rewrite in bizarre KASLR configuration - Fix module loading with KASLR - Remove redundant definition of ARCH_SLAB_MINALIGN" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: kasan, arm64: remove redundant ARCH_SLAB_MINALIGN define arm64: kaslr: ensure randomized quantities are clean to the PoC arm64: kpti: Update arm64_kernel_use_ng_mappings() when forced on commit 6436408e814b81046f4595245c1f9bc4409e945c Merge: df133f3f96257 e7c87bd6cc4ec Author: David S. Miller Date: Sat Jan 19 16:38:12 2019 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2019-01-20 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Fix a out-of-bounds access in __bpf_redirect_no_mac, from Willem. 2) Fix bpf_setsockopt to reset sock dst on SO_MARK changes, from Peter. 3) Fix map in map masking to prevent out-of-bounds access under speculative execution, from Daniel. 4) Fix bpf_setsockopt's SO_MAX_PACING_RATE to support TCP internal pacing, from Yuchung. 5) Fix json writer license in bpftool, from Thomas. 6) Fix AF_XDP to check if an actually queue exists during umem setup, from Krzysztof. 7) Several fixes to BPF stackmap's build id handling. Another fix for bpftool build to account for libbfd variations wrt linking requirements, from Stanislav. 8) Fix BPF samples build with clang by working around missing asm goto, from Yonghong. 9) Fix libbpf to retry program load on signal interrupt, from Lorenz. 10) Various minor compile warning fixes in BPF code, from Mathieu. ==================== Signed-off-by: David S. Miller commit e7c87bd6cc4ec7b0ac1ed0a88a58f8206c577488 Author: Willem de Bruijn Date: Tue Jan 15 20:19:22 2019 -0500 bpf: in __bpf_redirect_no_mac pull mac only if present Syzkaller was able to construct a packet of negative length by redirecting from bpf_prog_test_run_skb with BPF_PROG_TYPE_LWT_XMIT: BUG: KASAN: slab-out-of-bounds in memcpy include/linux/string.h:345 [inline] BUG: KASAN: slab-out-of-bounds in skb_copy_from_linear_data include/linux/skbuff.h:3421 [inline] BUG: KASAN: slab-out-of-bounds in __pskb_copy_fclone+0x2dd/0xeb0 net/core/skbuff.c:1395 Read of size 4294967282 at addr ffff8801d798009c by task syz-executor2/12942 kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267 memcpy+0x23/0x50 mm/kasan/kasan.c:302 memcpy include/linux/string.h:345 [inline] skb_copy_from_linear_data include/linux/skbuff.h:3421 [inline] __pskb_copy_fclone+0x2dd/0xeb0 net/core/skbuff.c:1395 __pskb_copy include/linux/skbuff.h:1053 [inline] pskb_copy include/linux/skbuff.h:2904 [inline] skb_realloc_headroom+0xe7/0x120 net/core/skbuff.c:1539 ipip6_tunnel_xmit net/ipv6/sit.c:965 [inline] sit_tunnel_xmit+0xe1b/0x30d0 net/ipv6/sit.c:1029 __netdev_start_xmit include/linux/netdevice.h:4325 [inline] netdev_start_xmit include/linux/netdevice.h:4334 [inline] xmit_one net/core/dev.c:3219 [inline] dev_hard_start_xmit+0x295/0xc90 net/core/dev.c:3235 __dev_queue_xmit+0x2f0d/0x3950 net/core/dev.c:3805 dev_queue_xmit+0x17/0x20 net/core/dev.c:3838 __bpf_tx_skb net/core/filter.c:2016 [inline] __bpf_redirect_common net/core/filter.c:2054 [inline] __bpf_redirect+0x5cf/0xb20 net/core/filter.c:2061 ____bpf_clone_redirect net/core/filter.c:2094 [inline] bpf_clone_redirect+0x2f6/0x490 net/core/filter.c:2066 bpf_prog_41f2bcae09cd4ac3+0xb25/0x1000 The generated test constructs a packet with mac header, network header, skb->data pointing to network header and skb->len 0. Redirecting to a sit0 through __bpf_redirect_no_mac pulls the mac length, even though skb->data already is at skb->network_header. bpf_prog_test_run_skb has already pulled it as LWT_XMIT !is_l2. Update the offset calculation to pull only if skb->data differs from skb->network_header, which is not true in this case. The test itself can be run only from commit 1cf1cae963c2 ("bpf: introduce BPF_PROG_TEST_RUN command"), but the same type of packets with skb at network header could already be built from lwt xmit hooks, so this fix is more relevant to that commit. Also set the mac header on redirect from LWT_XMIT, as even after this change to __bpf_redirect_no_mac that field is expected to be set, but is not yet in ip_finish_output2. Fixes: 3a0af8fd61f9 ("bpf: BPF for lightweight tunnel infrastructure") Reported-by: syzbot Signed-off-by: Willem de Bruijn Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit df133f3f96257ee29696c0ed8bd198ec801dc810 Author: Michael S. Tsirkin Date: Thu Jan 17 23:20:07 2019 -0500 virtio_net: bulk free tx skbs Use napi_consume_skb() to get bulk free. Note that napi_consume_skb is safe to call in a non-napi context as long as the napi_budget flag is correct. Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Signed-off-by: David S. Miller commit 5d5c303ea095bdd3a2b073075920bf159457069a Merge: 6a0141a0966cf 8a644c64a9f1a Author: Linus Torvalds Date: Sun Jan 20 10:33:18 2019 +1200 Merge tag 'mips_fixes_5.0_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fixes from Paul Burton: - Fix IPI handling for Lantiq SoCs, which was broken by changes made back in v4.12. - Enable OF/DT serial support in ath79_defconfig to give us working serial by default. - Fix 64b builds for the Jazz platform. - Set up a struct device for the BCM47xx SoC to allow BCM47xx drivers to perform DMA again following the major DMA mapping changes made in v4.19. - Disable MSI on Cavium Octeon systems when the pcie_disable command line parameter introduced in v3.3 is used, in order to avoid inadvetently accessing PCIe controller registers despite the command line. - Fix a build failure for Cavium Octeon kernels with kexec enabled, introduced in v4.20. - Fix a regression in the behaviour of semctl/shmctl/msgctl IPC syscalls for kernels including n32 support but not o32 support caused by some cleanup in v3.19. * tag 'mips_fixes_5.0_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: OCTEON: fix kexec support mips: fix n32 compat_ipc_parse_version Disable MSI also when pcie-octeon.pcie_disable on MIPS: BCM47XX: Setup struct device for the SoC MIPS: jazz: fix 64bit build MIPS: ath79: Enable OF serial ports in the default config MIPS: lantiq: Use CP0_LEGACY_COMPARE_IRQ MIPS: lantiq: Fix IPI interrupt handling commit 6a0141a0966cfbd765bff065c3eb61b09a92318e Merge: 26caabbcd7a5d 75a080cde08d2 Author: Linus Torvalds Date: Sun Jan 20 10:28:46 2019 +1200 Merge tag 'devicetree-fixes-for-5.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull Devicetree fix from Rob Herring: "A single build fix for powerpc due to device_node.type removal" * tag 'devicetree-fixes-for-5.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: powerpc: chrp: Use of_node_is_type to access device_type commit 26caabbcd7a5d10577fd59eded2ec1c44466659e Merge: f403d718ebde2 faa8bd6e12e6a Author: Linus Torvalds Date: Sun Jan 20 10:24:30 2019 +1200 Merge tag 'libnvdimm-fixes-5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm fixes from Dan Williams: "A crash fix, a build warning fix, a miscellaneous small cleanups. In case anyone is looking for them, there was a regression caught by testing that caused two patches to be dropped from this update. Those patches have been reworked and will soak for another week / re-target 5.0-rc4. - Fix driver initialization crash due to the inability to report an 'error' state for a DIMM's security capability. - Build warning fix for little-endian ARM64 builds - Fix a potential race between the EDAC driver's usage of the NFIT SMBIOS id for a DIMM and the driver shutdown path. - A small collection of one-line benign cleanups for duplicate variable assignments, a duplicate header include and a mis-typed function argument" * tag 'libnvdimm-fixes-5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: libnvdimm/security: Fix nvdimm_security_state() state request selection acpi/nfit: Remove duplicate set nd_set in acpi_nfit_init_interleave_set() acpi/nfit: Fix race accessing memdev in nfit_get_smbios_id() libnvdimm/dimm: Fix security capability detection for non-Intel NVDIMMs nfit: Mark some functions as __maybe_unused ACPI/nfit: delete the function to_acpi_nfit_desc ACPI/nfit: delete the redundant header file commit f403d718ebde2059de848ae7548392dfb25a13ae Merge: b0efca46b5707 4a22fc534f2f5 Author: Linus Torvalds Date: Sun Jan 20 09:58:52 2019 +1200 Merge tag 'linux-watchdog-5.0-rc-fixes' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog fixes from Wim Van Sebroeck: - mt7621_wdt/rt2880_wdt: Fix compilation problem - tqmx86: Fix a couple IS_ERR() vs NULL bugs * tag 'linux-watchdog-5.0-rc-fixes' of git://www.linux-watchdog.org/linux-watchdog: watchdog: tqmx86: Fix a couple IS_ERR() vs NULL bugs watchdog: mt7621_wdt/rt2880_wdt: Fix compilation problem commit b0efca46b57071e4c281034f04d2b56edf79843d Merge: 4d5f6e0201bc5 deaa5c96c2f7e Author: Linus Torvalds Date: Sun Jan 20 09:27:38 2019 +1200 Merge tag 'nfs-for-5.0-2' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client fixes from Anna Schumaker: "These are mostly fixes for SUNRPC bugs, with a single v4.2 copy_file_range() fix mixed in. Stable bugfixes: - Fix TCP receive code on archs with flush_dcache_page() Other bugfixes: - Fix error code in rpcrdma_buffer_create() - Fix a double free in rpcrdma_send_ctxs_create() - Fix kernel BUG at kernel/cred.c:825 - Fix unnecessary retry in nfs42_proc_copy_file_range() - Ensure rq_bytes_sent is reset before request transmission - Ensure we respect the RPCSEC_GSS sequence number limit - Address Kerberos performance/behavior regression" * tag 'nfs-for-5.0-2' of git://git.linux-nfs.org/projects/anna/linux-nfs: SUNRPC: Address Kerberos performance/behavior regression SUNRPC: Ensure we respect the RPCSEC_GSS sequence number limit SUNRPC: Ensure rq_bytes_sent is reset before request transmission NFSv4.2 fix unnecessary retry in nfs4_copy_file_range sunrpc: kernel BUG at kernel/cred.c:825! SUNRPC: Fix TCP receive code on archs with flush_dcache_page() xprtrdma: Double free in rpcrdma_sendctxs_create() xprtrdma: Fix error code in rpcrdma_buffer_create() commit 4d5f6e0201bc568c0758ed3f77a06648ec9fd482 Merge: 0facb892456ff 9e8f1c7983142 Author: Linus Torvalds Date: Sun Jan 20 09:15:04 2019 +1200 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "A set of 17 fixes. Most of these are minor or trivial. The one fix that may be serious is the isci one: the bug can cause hba parameters to be set from uninitialized memory. I don't think it's exploitable, but you never know" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: cxgb4i: add wait_for_completion() scsi: qla1280: set 64bit coherent mask scsi: ufs: Fix geometry descriptor size scsi: megaraid_sas: Retry reads of outbound_intr_status reg scsi: qedi: Add ep_state for login completion on un-reachable targets scsi: ufs: Fix system suspend status scsi: qla2xxx: Use correct number of vectors for online CPUs scsi: hisi_sas: Set protection parameters prior to adding SCSI host scsi: tcmu: avoid cmd/qfull timers updated whenever a new cmd comes scsi: isci: initialize shost fully before calling scsi_add_host() scsi: lpfc: lpfc_sli: Mark expected switch fall-throughs scsi: smartpqi_init: fix boolean expression in pqi_device_remove_start scsi: core: Synchronize request queue PM status only on successful resume scsi: pm80xx: reduce indentation scsi: qla4xxx: check return code of qla4xxx_copy_from_fwddb_param scsi: megaraid_sas: correct an info message scsi: target/iscsi: fix error msg typo when create lio_qr_cache failed scsi: sd: Fix cache_type_store() commit 0facb892456ff922924e704f78cafcaa7be85e8c Merge: 2339e91d0e660 38197ca176fc2 Author: Linus Torvalds Date: Sun Jan 20 09:12:50 2019 +1200 Merge tag 'for-linus-20190118' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - block size setting fixes for loop/nbd (Jan Kara) - md bio_alloc_mddev() cleanup (Marcos) - Ensure we don't lose the REQ_INTEGRITY flag (Ming) - Two NVMe fixes by way of Christoph: - Fix NVMe IRQ calculation (Ming) - Uninitialized variable in nvmet-tcp (Sagi) - BFQ comment fix (Paolo) - License cleanup for recently added blk-mq-debugfs-zoned (Thomas) * tag 'for-linus-20190118' of git://git.kernel.dk/linux-block: block: Cleanup license notice nvme-pci: fix nvme_setup_irqs() nvmet-tcp: fix uninitialized variable access block: don't lose track of REQ_INTEGRITY flag blockdev: Fix livelocks on loop device nbd: Use set_blocksize() to set device blocksize md: Make bio_alloc_mddev use bio_alloc_bioset block, bfq: fix comments on __bfq_deactivate_entity commit 99e309b6ed75fab4a43afd9e523441ecc5a1f511 Author: Jason Gunthorpe Date: Fri Jan 18 22:57:04 2019 +0000 clang-format: Update .clang-format with the latest for_each macro list Re-run the shell fragment that generated the original list. In particular this adds the missing xarray related functions. Signed-off-by: Jason Gunthorpe Signed-off-by: Miguel Ojeda commit 3e64cf7a435ed0500e3adaa8aada2272d3ae8abc Author: Camelia Groza Date: Thu Jan 17 14:22:36 2019 +0200 net: phy: phy driver features are mandatory Since phy driver features became a link_mode bitmap, phy drivers that don't have a list of features configured will cause the kernel to crash when probed. Prevent the phy driver from registering if the features field is missing. Fixes: 719655a14971 ("net: phy: Replace phy driver features u32 with link_mode bitmap") Reported-by: Scott Wood Signed-off-by: Camelia Groza Signed-off-by: David S. Miller commit 7afa81c55fca0cad589722cb4bce698b4803b0e1 Author: Nathan Chancellor Date: Wed Jan 9 22:41:08 2019 -0700 isdn: avm: Fix string plus integer warning from Clang A recent commit in Clang expanded the -Wstring-plus-int warning, showing some odd behavior in this file. drivers/isdn/hardware/avm/b1.c:426:30: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] cinfo->version[j] = "\0\0" + 1; ~~~~~~~^~~ drivers/isdn/hardware/avm/b1.c:426:30: note: use array indexing to silence this warning cinfo->version[j] = "\0\0" + 1; ^ & [ ] 1 warning generated. This is equivalent to just "\0". Nick pointed out that it is smarter to use "" instead of "\0" because "" is used elsewhere in the kernel and can be deduplicated at the linking stage. Link: https://github.com/ClangBuiltLinux/linux/issues/309 Suggested-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Signed-off-by: David S. Miller commit 75a080cde08d2dcba19ee864f9732094d93fab41 Author: Rob Herring Date: Fri Jan 18 08:12:10 2019 -0600 powerpc: chrp: Use of_node_is_type to access device_type Commit 8ce5f8415753 ("of: Remove struct device_node.type pointer") removed struct device_node.type pointer, but the conversion to use of_node_is_type() accessor was missed in chrp_init_IRQ(). Fixes: 8ce5f8415753 ("of: Remove struct device_node.type pointer") Reported-by: kbuild test robot Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org Acked-by: Michael Ellerman Signed-off-by: Rob Herring commit 8a7fa0c35027d1a3ec3c3e8612800a1b4738e3c3 Merge: efa8c819a6892 25f2d0e7791e7 Author: David S. Miller Date: Fri Jan 18 18:23:23 2019 -0800 Merge tag 'mlx5-fixes-2019-01-18' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== Mellanox, mlx5 fixes 2019-01-18 This series introduces some fixes to mlx5 driver. Please pull and let me know if there is any problem. For -stable v4.18 ('net/mlx5e: Force CHECKSUM_UNNECESSARY for short ethernet frames') The patch doesn't apply cleanly to 4.18.y, but it is very simple to resolve, what should be the procedure here ? ==================== Signed-off-by: David S. Miller commit 25f2d0e7791e71cc89c58a7c2231768ad200764b Author: Eli Britstein Date: Wed Dec 19 07:36:51 2018 +0200 net/mlx5e: Fix cb_ident duplicate in indirect block register Previously the identifier used for indirect block callback registry and for block rule cb registry (when done via indirect blocks) was the pointer to the tunnel netdev we were interested in receiving updates on. This worked fine if a single PF existed that registered one callback for the tunnel netdev of interest. However, if multiple PFs are in place then the 2nd PF tries to register with the same tunnel netdev identifier. This leads to EEXIST errors and/or incorrect cb deletions. Prevent this conflict by using the rpriv pointer as the identifier for netdev indirect block cb registry, allowing each PF to register a unique callback per tunnel netdev. For block cb registry, the same PF may register multiple cbs to the same block if using TC shared blocks. Instead of the rpriv, use the pointer to the allocated indr_priv data as the identifier here. This means that there can be a unique block callback for each PF/tunnel netdev combo. Fixes: f5bc2c5de101 ("net/mlx5e: Support TC indirect block notifications for eswitch uplink reprs") Signed-off-by: Eli Britstein Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 7fdc1adc52d3975740547a78c2df329bb207f15d Author: Tariq Toukan Date: Thu Nov 8 12:06:53 2018 +0200 net/mlx5e: Fix wrong (zero) TX drop counter indication for representor For representors, the TX dropped counter is not folded from the per-ring counters. Fix it. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 2eb1e42551a8128d9182480dfaea52fa861e26e8 Author: Shay Agroskin Date: Sun Dec 9 12:00:13 2018 +0200 net/mlx5e: Fix wrong error code return on FEC query failure Advertised and configured FEC query failure resulted in printing wrong error code. Fixes: 6cfa94605091 ("net/mlx5e: Ethtool driver callback for query/set FEC policy") Signed-off-by: Shay Agroskin Reported-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit e8c8b53ccaff568fef4c13a6ccaf08bf241aa01a Author: Cong Wang Date: Mon Dec 3 22:14:04 2018 -0800 net/mlx5e: Force CHECKSUM_UNNECESSARY for short ethernet frames When an ethernet frame is padded to meet the minimum ethernet frame size, the padding octets are not covered by the hardware checksum. Fortunately the padding octets are usually zero's, which don't affect checksum. However, we have a switch which pads non-zero octets, this causes kernel hardware checksum fault repeatedly. Prior to: commit '88078d98d1bb ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE ...")' skb checksum was forced to be CHECKSUM_NONE when padding is detected. After it, we need to keep skb->csum updated, like what we do for RXFCS. However, fixing up CHECKSUM_COMPLETE requires to verify and parse IP headers, it is not worthy the effort as the packets are so small that CHECKSUM_COMPLETE can't save anything. Fixes: 88078d98d1bb ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends"), Cc: Eric Dumazet Cc: Tariq Toukan Cc: Nikola Ciprich Signed-off-by: Cong Wang Signed-off-by: Saeed Mahameed commit 64cf5481262b9664ae3cdcb333f4a06af3e8fb58 Author: Thomas Gleixner Date: Fri Jan 18 00:14:24 2019 +0100 tools: bpftool: Cleanup license mess Precise and non-ambiguous license information is important. The recent relicensing of the bpftools introduced a license conflict. The files have now: SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause and * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version Amazingly about 20 people acked that change and neither they nor the committer noticed. Oh well. Digging deeper: The files were imported from the iproute2 repository with the GPL V2 or later boiler plate text in commit b66e907cfee2 ("tools: bpftool: copy JSON writer from iproute2 repository") Looking at the iproute2 repository at git://git.kernel.org/pub/scm/network/iproute2/iproute2.git the following commit is the equivivalent: commit d9d8c839 ("json_writer: add SPDX Identifier (GPL-2/BSD-2)") That commit explicitly removes the boiler plate and relicenses the code uner GPL-2.0-only and BSD-2-Clause. As Steven wrote the original code and also the relicensing commit, it's assumed that the relicensing was intended to do exaclty that. Just the kernel side update failed to remove the boiler plate. Do so now. Fixes: 907b22365115 ("tools: bpftool: dual license all files") Signed-off-by: Thomas Gleixner Cc: Jakub Kicinski Cc: Roman Gushchin Cc: YueHaibing Cc: Yonghong Song Cc: Stanislav Fomichev Cc: Sean Young Cc: Jiri Benc Cc: David Calavera Cc: Andrey Ignatov Cc: Joe Stringer Cc: David Ahern Cc: Alexei Starovoitov Cc: Petar Penkov Cc: Sandipan Das Cc: Prashant Bhole Cc: Stephen Hemminger Cc: John Fastabend Cc: Taeung Song Cc: Jiri Olsa Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Quentin Monnet CC: okash.khawaja@gmail.com Cc: netdev@vger.kernel.org Acked-by: Jakub Kicinski Signed-off-by: Alexei Starovoitov commit 9d5564ddcf2a0f5ba3fa1c3a1f8a1b59ad309553 Author: Daniel Borkmann Date: Thu Jan 17 16:34:45 2019 +0100 bpf: fix inner map masking to prevent oob under speculation During review I noticed that inner meta map setup for map in map is buggy in that it does not propagate all needed data from the reference map which the verifier is later accessing. In particular one such case is index masking to prevent out of bounds access under speculative execution due to missing the map's unpriv_array/index_mask field propagation. Fix this such that the verifier is generating the correct code for inlined lookups in case of unpriviledged use. Before patch (test_verifier's 'map in map access' dump): # bpftool prog dump xla id 3 0: (62) *(u32 *)(r10 -4) = 0 1: (bf) r2 = r10 2: (07) r2 += -4 3: (18) r1 = map[id:4] 5: (07) r1 += 272 | 6: (61) r0 = *(u32 *)(r2 +0) | 7: (35) if r0 >= 0x1 goto pc+6 | Inlined map in map lookup 8: (54) (u32) r0 &= (u32) 0 | with index masking for 9: (67) r0 <<= 3 | map->unpriv_array. 10: (0f) r0 += r1 | 11: (79) r0 = *(u64 *)(r0 +0) | 12: (15) if r0 == 0x0 goto pc+1 | 13: (05) goto pc+1 | 14: (b7) r0 = 0 | 15: (15) if r0 == 0x0 goto pc+11 16: (62) *(u32 *)(r10 -4) = 0 17: (bf) r2 = r10 18: (07) r2 += -4 19: (bf) r1 = r0 20: (07) r1 += 272 | 21: (61) r0 = *(u32 *)(r2 +0) | Index masking missing (!) 22: (35) if r0 >= 0x1 goto pc+3 | for inner map despite 23: (67) r0 <<= 3 | map->unpriv_array set. 24: (0f) r0 += r1 | 25: (05) goto pc+1 | 26: (b7) r0 = 0 | 27: (b7) r0 = 0 28: (95) exit After patch: # bpftool prog dump xla id 1 0: (62) *(u32 *)(r10 -4) = 0 1: (bf) r2 = r10 2: (07) r2 += -4 3: (18) r1 = map[id:2] 5: (07) r1 += 272 | 6: (61) r0 = *(u32 *)(r2 +0) | 7: (35) if r0 >= 0x1 goto pc+6 | Same inlined map in map lookup 8: (54) (u32) r0 &= (u32) 0 | with index masking due to 9: (67) r0 <<= 3 | map->unpriv_array. 10: (0f) r0 += r1 | 11: (79) r0 = *(u64 *)(r0 +0) | 12: (15) if r0 == 0x0 goto pc+1 | 13: (05) goto pc+1 | 14: (b7) r0 = 0 | 15: (15) if r0 == 0x0 goto pc+12 16: (62) *(u32 *)(r10 -4) = 0 17: (bf) r2 = r10 18: (07) r2 += -4 19: (bf) r1 = r0 20: (07) r1 += 272 | 21: (61) r0 = *(u32 *)(r2 +0) | 22: (35) if r0 >= 0x1 goto pc+4 | Now fixed inlined inner map 23: (54) (u32) r0 &= (u32) 0 | lookup with proper index masking 24: (67) r0 <<= 3 | for map->unpriv_array. 25: (0f) r0 += r1 | 26: (05) goto pc+1 | 27: (b7) r0 = 0 | 28: (b7) r0 = 0 29: (95) exit Fixes: b2157399cc98 ("bpf: prevent out-of-bounds speculation") Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov commit ad6dd7a9c47ba587c0aba57f73737764cd31136f Author: Daniel Borkmann Date: Thu Jan 17 16:15:09 2019 +0100 bpf: pull in pkt_sched.h header for tooling to fix bpftool build Dan reported that bpftool does not compile for him: $ make tools/bpf DESCEND bpf Auto-detecting system features: .. libbfd: [ on ] .. disassembler-four-args: [ OFF ] DESCEND bpftool Auto-detecting system features: .. libbfd: [ on ] .. disassembler-four-args: [ OFF ] CC /opt/linux.git/tools/bpf/bpftool/net.o In file included from /opt/linux.git/tools/include/uapi/linux/pkt_cls.h:6:0, from /opt/linux.git/tools/include/uapi/linux/tc_act/tc_bpf.h:14, from net.c:13: net.c: In function 'show_dev_tc_bpf': net.c:164:21: error: 'TC_H_CLSACT' undeclared (first use in this function) handle = TC_H_MAKE(TC_H_CLSACT, TC_H_MIN_INGRESS); [...] Fix it by importing pkt_sched.h header copy into tooling infrastructure. Fixes: 49a249c38726 ("tools/bpftool: copy a few net uapi headers to tools directory") Fixes: f6f3bac08ff9 ("tools/bpf: bpftool: add net support") Reported-by: Dan Gilson Reference: https://bugzilla.kernel.org/show_bug.cgi?id=202315 Signed-off-by: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov commit efa8c819a6892b03d5535b2ce1d8c85ea9850b58 Merge: 20f5248a502b6 479a2b761d61c Author: David S. Miller Date: Fri Jan 18 15:12:16 2019 -0800 Merge branch 'mlxsw-fixes' Ido Schimmel says: ==================== mlxsw: Various fixes This patchset contains small fixes in mlxsw and one fix in the bridge driver. Patches #1-#4 perform small adjustments in PCI and FID code following recent tests that were performed on the Spectrum-2 ASIC. Patch #5 fixes the bridge driver to mark FDB entries that were added by user as such. Otherwise, these entries will be ignored by underlying switch drivers. Patch #6 fixes a long standing issue in mlxsw where the driver incorrectly programmed static FDB entries as both static and sticky. Patches #7-#8 add test cases for above mentioned bugs. Please consider patches #1, #2 and #4 for stable. ==================== Signed-off-by: David S. Miller commit 479a2b761d61c04e2ae97325aa391a8a8c99c23e Author: Ido Schimmel Date: Fri Jan 18 15:58:03 2019 +0000 selftests: forwarding: Add a test case for externally learned FDB entries Test that externally learned FDB entries can roam, but not age out. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 72159272fc08230a76791dd5d0a0019ede1b802c Author: Ido Schimmel Date: Fri Jan 18 15:58:02 2019 +0000 selftests: mlxsw: Test FDB offload indication Test that externally learned FDB entries added from user space are marked as offloaded. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 64254a2054611205798e6bde634639bc704573ac Author: Ido Schimmel Date: Fri Jan 18 15:58:01 2019 +0000 mlxsw: spectrum_switchdev: Do not treat static FDB entries as sticky The driver currently treats static FDB entries as both static and sticky. This is incorrect and prevents such entries from being roamed to a different port via learning. Fix this by configuring static entries with ageing disabled and roaming enabled. In net-next we can add proper support for the newly introduced 'sticky' flag. Fixes: 56ade8fe3fe1 ("mlxsw: spectrum: Add initial support for Spectrum ASIC") Signed-off-by: Ido Schimmel Reported-by: Alexander Petrovskiy Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 710ae72877378e7cde611efd30fe90502a6e5b30 Author: Ido Schimmel Date: Fri Jan 18 15:58:00 2019 +0000 net: bridge: Mark FDB entries that were added by user as such Externally learned entries can be added by a user or by a switch driver that is notifying the bridge driver about entries that were learned in hardware. In the first case, the entries are not marked with the 'added_by_user' flag, which causes switch drivers to ignore them and not offload them. The 'added_by_user' flag can be set on externally learned FDB entries based on the 'swdev_notify' parameter in br_fdb_external_learn_add(), which effectively means if the created / updated FDB entry was added by a user or not. Fixes: 816a3bed9549 ("switchdev: Add fdb.added_by_user to switchdev notifications") Signed-off-by: Ido Schimmel Reported-by: Alexander Petrovskiy Reviewed-by: Petr Machata Cc: Roopa Prabhu Cc: Nikolay Aleksandrov Cc: bridge@lists.linux-foundation.org Signed-off-by: David S. Miller commit a11dcd6497915ba79d95ef4fe2541aaac27f6201 Author: Nir Dotan Date: Fri Jan 18 15:57:59 2019 +0000 mlxsw: spectrum_fid: Update dummy FID index When using a tc flower action of egress mirred redirect, the driver adds an implicit FID setting action. This implicit action sets a dummy FID to the packet and is used as part of a design for trapping unmatched flows in OVS. While this implicit FID setting action is supposed to be a NOP when a redirect action is added, in Spectrum-2 the FID record is consulted as the dummy FID index is an 802.1D FID index and the packet is dropped instead of being redirected. Set the dummy FID index value to be within 802.1Q range. This satisfies both Spectrum-1 which ignores the FID and Spectrum-2 which identifies it as an 802.1Q FID and will then follow the redirect action. Fixes: c3ab435466d5 ("mlxsw: spectrum: Extend to support Spectrum-2 ASIC") Signed-off-by: Nir Dotan Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 67c14cc9b35055264fc0efed00159a7de1819f1b Author: Nir Dotan Date: Fri Jan 18 15:57:57 2019 +0000 mlxsw: pci: Return error on PCI reset timeout Return an appropriate error in the case when the driver timeouts on waiting for firmware to go out of PCI reset. Fixes: 233fa44bd67a ("mlxsw: pci: Implement reset done check") Signed-off-by: Nir Dotan Acked-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit d2f372ba0914e5722ac28e15f2ed2db61bcf0e44 Author: Nir Dotan Date: Fri Jan 18 15:57:56 2019 +0000 mlxsw: pci: Increase PCI SW reset timeout Spectrum-2 PHY layer introduces a calibration period which is a part of the Spectrum-2 firmware boot process. Hence increase the SW timeout waiting for the firmware to come out of boot. This does not increase system boot time in cases where the firmware PHY calibration process is done quickly. Fixes: c3ab435466d5 ("mlxsw: spectrum: Extend to support Spectrum-2 ASIC") Signed-off-by: Nir Dotan Acked-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit c9ebea04cb1b0a84d08de00f4800f726ca544ad2 Author: Ido Schimmel Date: Fri Jan 18 15:57:55 2019 +0000 mlxsw: pci: Ring CQ's doorbell before RDQ's When a packet should be trapped to the CPU the device consumes a WQE (work queue element) from an RDQ (receive descriptor queue) and copies the packet to the address specified in the WQE. The device then tries to post a CQE (completion queue element) that contains various metadata (e.g., ingress port) about the packet to a CQ (completion queue). In case the device managed to consume a WQE, but did not manage to post the corresponding CQE, it will get stuck. This unlikely situation can be triggered due to the scheme the driver is currently using to process CQEs. The driver will consume up to 512 CQEs at a time and after processing each corresponding WQE it will ring the RDQ's doorbell, letting the device know that a new WQE was posted for it to consume. Only after processing all the CQEs (up to 512), the driver will ring the CQ's doorbell, letting the device know that new ones can be posted. Fix this by having the driver ring the CQ's doorbell for every processed CQE, but before ringing the RDQ's doorbell. This guarantees that whenever we post a new WQE, there is a corresponding CQE available. Copy the currently processed CQE to prevent the device from overwriting it with a new CQE after ringing the doorbell. Note that the driver still arms the CQ only after processing all the pending CQEs, so that interrupts for this CQ will only be delivered after the driver finished its processing. Before commit 8404f6f2e8ed ("mlxsw: pci: Allow to use CQEs of version 1 and version 2") the issue was virtually impossible to trigger since the number of CQEs was twice the number of WQEs and the number of CQEs processed at a time was equal to the number of available WQEs. Fixes: 8404f6f2e8ed ("mlxsw: pci: Allow to use CQEs of version 1 and version 2") Signed-off-by: Ido Schimmel Reported-by: Semion Lisyansky Tested-by: Semion Lisyansky Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 20f5248a502b6d41746c02c699ec9791a03a4e27 Author: Felix Manlunas Date: Thu Jan 17 18:07:45 2019 +0000 MAINTAINERS: update email addresses of liquidio driver maintainers Update email addresses of liquidio driver maintainers. Also remove a former maintainer. Signed-off-by: Felix Manlunas Acked-by: Derek Chickles Signed-off-by: David S. Miller commit 9437b629518866274d324122066a86ac6500c6b5 Author: Jonathan Neuschäfer Date: Thu Jan 17 18:02:18 2019 +0100 net: Fix typo in NET_FAILOVER help text "also enables" should not be spelled as one word. Fixes: cfc80d9a1163 ("net: Introduce net_failover driver") Signed-off-by: Jonathan Neuschäfer Signed-off-by: David S. Miller commit 6c57f0458022298e4da1729c67bd33ce41c14e7a Author: Ross Lagerwall Date: Thu Jan 17 15:34:38 2019 +0000 net: Fix usage of pskb_trim_rcsum In certain cases, pskb_trim_rcsum() may change skb pointers. Reinitialize header pointers afterwards to avoid potential use-after-frees. Add a note in the documentation of pskb_trim_rcsum(). Found by KASAN. Signed-off-by: Ross Lagerwall Signed-off-by: David S. Miller commit 2339e91d0e6609e17943a0ab3c3c8c4044760c05 Merge: d28f3e7219743 240809ef6630a Author: Linus Torvalds Date: Sat Jan 19 07:34:10 2019 +1200 Merge tag 'media/v5.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fixes from Mauro Carvalho Chehab: - a regression fix at v4l2 core, with affects multi-plane streams - a fix at vim2m driver * tag 'media/v5.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: vim2m: only cancel work if it is for right context media: v4l: ioctl: Validate num_planes for debug messages media: v4l: ioctl: Validate num_planes before using it media: v4l2-ioctl: Clear only per-plane reserved fields commit d28f3e721974378c404f16d17638d9ae5c0db0d2 Merge: 8b4fe58db6794 d2fd6e81912a6 Author: Linus Torvalds Date: Sat Jan 19 07:26:16 2019 +1200 Merge tag 'pci-v5.0-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI fixes from Bjorn Helgaas:: - Fix PCI kconfig menu organization (Rob Herring) - Fix pci_alloc_irq_vectors_affinity() error return to allow "reduce and retry" for drivers using IRQ sets (Ming Lei) - Fix "pci=disable_acs_redir" initdata use-after-free problem (Logan Gunthorpe) * tag 'pci-v5.0-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: Fix __initdata issue with "pci=disable_acs_redir" parameter PCI/MSI: Return -ENOSPC from pci_alloc_irq_vectors_affinity() PCI: Fix PCI kconfig menu organization commit 8b4fe58db67947b0c7195405ecb041a991580693 Merge: 3cdf680ea14d8 f29fd331aa055 Author: Linus Torvalds Date: Sat Jan 19 07:23:25 2019 +1200 Merge tag 'i3c/fixes-for-5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux Pull i3c fixes from Boris Brezillon: - Fix the error check on master->sysclk val in the Cadence driver - Fix reattach implementation in the Designware driver * tag 'i3c/fixes-for-5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: i3c: master: dw-i3c-master: fix i3c_attach/reattach i3c: master: Fix an error checking typo in 'cdns_i3c_master_probe()' commit 3cdf680ea14d8bd3460894eaae0a8bd6a048f705 Merge: 6e4673b42e68c d311e0c27b8fc Author: Linus Torvalds Date: Sat Jan 19 07:21:43 2019 +1200 Merge tag 'mtd/fixes-for-5.0-rc3' of git://git.infradead.org/linux-mtd Pull mtd fixes from Boris Brezillon: "Raw NAND changes: - jz4740: fix a compilation warning - fsmc: fix a regression introduced by ->select_chip() deprecation - denali: fix a regression introduced by NAND_KEEP_TIMINGS addition" * tag 'mtd/fixes-for-5.0-rc3' of git://git.infradead.org/linux-mtd: mtd: rawnand: denali: get ->setup_data_interface() working again mtd: nand: jz4740: fix '__iomem *' vs. '* __iomem' mtd: rawnand: fsmc: Keep bank enable bit set commit 6e4673b42e68c78e449f3f6bfe64ff615c90d0f0 Merge: c5b709804ed7d 7151449fe7fa5 Author: Linus Torvalds Date: Sat Jan 19 07:17:19 2019 +1200 Merge tag 'regmap-fix-v5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap fixes from Mark Brown: "The cleanups for the way we handle type information introduced during the merge window revealed that we'd been abusing the irq APIs for a long time, causing breakage for systems. This has a couple of minimal fixes for that which restore the previous behaviour for the time being, we'll fix it properly for v5.1 but that'd be a bit much to do as a bug fix" * tag 'regmap-fix-v5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap-irq: do not write mask register if mask_base is zero regmap: regmap-irq: silently ignore unsupported type settings commit e40e2a2e78664fa90ea4b9bdf4a84efce2fea9d9 Author: Thomas Petazzoni Date: Wed Jan 16 10:53:58 2019 +0100 net: phy: mdio_bus: add missing device_del() in mdiobus_register() error handling The current code in __mdiobus_register() doesn't properly handle failures returned by the devm_gpiod_get_optional() call: it returns immediately, without unregistering the device that was added by the call to device_register() earlier in the function. This leaves a stale device, which then causes a NULL pointer dereference in the code that handles deferred probing: [ 1.489982] Unable to handle kernel NULL pointer dereference at virtual address 00000074 [ 1.498110] pgd = (ptrval) [ 1.500838] [00000074] *pgd=00000000 [ 1.504432] Internal error: Oops: 17 [#1] SMP ARM [ 1.509133] Modules linked in: [ 1.512192] CPU: 1 PID: 51 Comm: kworker/1:3 Not tainted 4.20.0-00039-g3b73a4cc8b3e-dirty #99 [ 1.520708] Hardware name: Xilinx Zynq Platform [ 1.525261] Workqueue: events deferred_probe_work_func [ 1.530403] PC is at klist_next+0x10/0xfc [ 1.534403] LR is at device_for_each_child+0x40/0x94 [ 1.539361] pc : [] lr : [] psr: 200e0013 [ 1.545628] sp : ceeefe68 ip : 00000001 fp : ffffe000 [ 1.550863] r10: 00000000 r9 : c0c66790 r8 : 00000000 [ 1.556079] r7 : c0457d44 r6 : 00000000 r5 : ceeefe8c r4 : cfa2ec78 [ 1.562604] r3 : 00000064 r2 : c0457d44 r1 : ceeefe8c r0 : 00000064 [ 1.569129] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [ 1.576263] Control: 18c5387d Table: 0ed7804a DAC: 00000051 [ 1.582013] Process kworker/1:3 (pid: 51, stack limit = 0x(ptrval)) [ 1.588280] Stack: (0xceeefe68 to 0xceef0000) [ 1.592630] fe60: cfa2ec78 c0c03c08 00000000 c0457d44 00000000 c0c66790 [ 1.600814] fe80: 00000000 c0455d90 ceeefeac 00000064 00000000 0d7a542e cee9d494 cfa2ec78 [ 1.608998] fea0: cfa2ec78 00000000 c0457d44 c0457d7c cee9d494 c0c03c08 00000000 c0455dac [ 1.617182] fec0: cf98ba44 cf926a00 cee9d494 0d7a542e 00000000 cf935a10 cf935a10 cf935a10 [ 1.625366] fee0: c0c4e9b8 c0457d7c c0c4e80c 00000001 cf935a10 c0457df4 cf935a10 c0c4e99c [ 1.633550] ff00: c0c4e99c c045a27c c0c4e9c4 ced63f80 cfde8a80 cfdebc00 00000000 c013893c [ 1.641734] ff20: cfde8a80 cfde8a80 c07bd354 ced63f80 ced63f94 cfde8a80 00000008 c0c02d00 [ 1.649936] ff40: cfde8a98 cfde8a80 ffffe000 c0139a30 ffffe000 c0c6624a c07bd354 00000000 [ 1.658120] ff60: ffffe000 cee9e780 ceebfe00 00000000 ceeee000 ced63f80 c0139788 cf8cdea4 [ 1.666304] ff80: cee9e79c c013e598 00000001 ceebfe00 c013e44c 00000000 00000000 00000000 [ 1.674488] ffa0: 00000000 00000000 00000000 c01010e8 00000000 00000000 00000000 00000000 [ 1.682671] ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1.690855] ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [ 1.699058] [] (klist_next) from [] (device_for_each_child+0x40/0x94) [ 1.707241] [] (device_for_each_child) from [] (device_reorder_to_tail+0x38/0x88) [ 1.716476] [] (device_reorder_to_tail) from [] (device_for_each_child+0x5c/0x94) [ 1.725692] [] (device_for_each_child) from [] (device_reorder_to_tail+0x38/0x88) [ 1.734927] [] (device_reorder_to_tail) from [] (device_pm_move_to_tail+0x28/0x40) [ 1.744235] [] (device_pm_move_to_tail) from [] (deferred_probe_work_func+0x58/0x8c) [ 1.753746] [] (deferred_probe_work_func) from [] (process_one_work+0x210/0x4fc) [ 1.762888] [] (process_one_work) from [] (worker_thread+0x2a8/0x5c0) [ 1.771072] [] (worker_thread) from [] (kthread+0x14c/0x154) [ 1.778482] [] (kthread) from [] (ret_from_fork+0x14/0x2c) [ 1.785689] Exception stack(0xceeeffb0 to 0xceeefff8) [ 1.790739] ffa0: 00000000 00000000 00000000 00000000 [ 1.798923] ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 1.807107] ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 1.813724] Code: e92d47f0 e1a05000 e8900048 e1a00003 (e5937010) [ 1.819844] ---[ end trace 3c2c0c8b65399ec9 ]--- The actual error that we had from devm_gpiod_get_optional() was -EPROBE_DEFER, due to the GPIO being provided by a driver that is probed later than the Ethernet controller driver. To fix this, we simply add the missing device_del() invocation in the error path. Fixes: 69226896ad636 ("mdio_bus: Issue GPIO RESET to PHYs") Signed-off-by: Thomas Petazzoni Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 0e78f389a7cdc6de7dfd0778733f3b140c981c9e Author: Otto Sabart Date: Mon Jan 14 12:56:36 2019 +0100 doc: net: fix bad references to network drivers Fix "reference to nonexisting document" warnings. Fixes: b255e500c8dc ("net: documentation: build a directory structure for drivers") Signed-off-by: Otto Sabart Signed-off-by: David S. Miller commit c5b709804ed7d36c45b5efa170d9e3ea8c29b865 Merge: e6ec2fda2d464 7bea7ac0ca012 Author: Linus Torvalds Date: Sat Jan 19 05:55:42 2019 +1200 Merge tag 'powerpc-5.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: "A couple of weeks of fixes. There's one fix for an oops on Power9 machines with Open CAPI adapters. And a fix for probable memory corruption in some of the new NPU code, caught by smatch though and not seen in the wild. Plus a few other minor fixes. There's one non-fix which is the perf_regs change. That was sent during the merge window but I accidentally only merged the first of two patches in the series. It's been in linux-next so hopefully doesn't conflict with anything in acme's tree. Thanks to: Alexey Kardashevskiy, Andrew Donnellan, Breno Leitao, Christian Lamparter, Christophe Leroy, Dan Carpenter, Frederic Barrat, Greg Kurz, Jason A. Donenfeld, Madhavan Srinivasan" * tag 'powerpc-5.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/syscalls: Fix syscall tracing powerpc/pseries: Fix build break due to pnv_npu2_init() powerpc/4xx/ocm: Fix fix for phys_addr_t printf warnings powerpc/powernv/npu: Fix oops in pnv_try_setup_npu_table_group() powerpc/tm: Limit TM code inside PPC_TRANSACTIONAL_MEM powerpc/8xx: fix setting of pagetable for Abatron BDI debug tool. powerpc/powernv/npu: Allocate enough memory in pnv_try_setup_npu_table_group() powerpc/perf: Update perf_regs structure to include MMCRA commit e6ec2fda2d464938989ecd770be92e492ace3ae1 Merge: dc6fef2cc5797 867cefb4cb101 Author: Linus Torvalds Date: Sat Jan 19 05:53:41 2019 +1200 Merge tag 'for-linus-5.0-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: - Several fixes for the Xen pvcalls drivers (1 fix for the backend and 8 for the frontend). - A fix for a rather longstanding bug in the Xen sched_clock() interface which led to weird time jumps when migrating the system. - A fix for avoiding accesses to x2apic MSRs in Xen PV guests. * tag 'for-linus-5.0-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen: Fix x86 sched_clock() interface for xen pvcalls-front: fix potential null dereference always clear the X2APIC_ENABLE bit for PV guest pvcalls-front: Avoid get_free_pages(GFP_KERNEL) under spinlock xen/pvcalls: remove set but not used variable 'intf' pvcalls-back: set -ENOTCONN in pvcalls_conn_back_read pvcalls-front: don't return error when the ring is full pvcalls-front: properly allocate sk pvcalls-front: don't try to free unallocated rings pvcalls-front: read all data before closing the connection commit dc6fef2cc57972d4d64d9cd6d26b81060e1db0e6 Merge: 6e434bf2e36b8 d45a90cb5d061 Author: Linus Torvalds Date: Sat Jan 19 05:48:43 2019 +1200 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 the following issues: - Zero-length DMA mapping in caam - Invalidly mapping stack memory for DMA in talitos - Use after free in cavium/nitrox - Key parsing in authenc - Undefined shift in sm3 - Bogus completion call in authencesn - SHA support detection in caam" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: sm3 - fix undefined shift by >= width of value crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK crypto: talitos - reorder code in talitos_edesc_alloc() crypto: adiantum - initialize crypto_spawn::inst crypto: cavium/nitrox - Use after free in process_response_list() crypto: authencesn - Avoid twice completion call in decrypt path crypto: caam - fix SHA support detection crypto: caam - fix zero-length buffer DMA mapping crypto: ccree - convert to use crypto_authenc_extractkeys() crypto: bcm - convert to use crypto_authenc_extractkeys() crypto: authenc - fix parsing key with misaligned rta_len commit 6e434bf2e36b8a111c4dea6c1d1e355ad39ec01b Merge: 2a8cbf2a02784 11ee2a3808aeb Author: Linus Torvalds Date: Sat Jan 19 05:46:00 2019 +1200 Merge tag 'acpi-5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fixes from Rafael Wysocki: "These fix an ACPI initialization ordering issue introduced in the 4.17 time frame and causing functional problems to appear on multiple systems and fix some fallout of the recent change to enable building kernels with ACPI support and without PCI. Specifics: - Restore the ACPI initialization ordering changed implicitly by the module-level AML handling rework during the 4.17 development cycle that caused the EC address space handler based on information from ECDT to be set up before loading AML definition blocks, making it effectively not accessible by AML on some systems that don't work as expected any more (Rafael Wysocki). - Add direct dependencies on PCI to Kconfig in multiple places for code that depends on both ACPI and PCI, but the PCI dependency was implicitly satisfied by the ACPI dependency before, to prevent invalid configurations from being created, for example by randconfig (Sinan Kaya)" * tag 'acpi-5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: EC: Look for ECDT EC after calling acpi_load_tables() drivers: thermal: int340x_thermal: Make PCI dependency explicit x86/intel/lpss: Make PCI dependency explicit platform/x86: apple-gmux: Make PCI dependency explicit platform/x86: intel_pmc: Make PCI dependency explicit platform/x86: intel_ips: make PCI dependency explicit vga-switcheroo: make PCI dependency explicit ata: pata_acpi: Make PCI dependency explicit ACPI / LPSS: Make PCI dependency explicit commit 2a8cbf2a02784efc02f7093000010e20c4ebc9ea Merge: c3653ebdf8931 890d14d2d4b57 Author: Linus Torvalds Date: Sat Jan 19 05:43:05 2019 +1200 Merge tag 'fbdev-v5.0-rc3' of git://github.com/bzolnier/linux Pull fbdev fixes from Bartlomiej Zolnierkiewicz: - fix stack memory leak in omap2fb driver (Vlad Tsyrklevich) - fix OF node name handling v4.20 regression in offb driver (Rob Herring) - convert CONFIG_FB_LOGO_CENTER config option added in v5.0-rc1 into a kernel parameter (Peter Rosin) * tag 'fbdev-v5.0-rc3' of git://github.com/bzolnier/linux: fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line option fbdev: offb: Fix OF node name handling omap2fb: Fix stack memory disclosure commit c3653ebdf89315a3a683f03b8b181942e452d603 Merge: d7393226d15ad 9420151d88ca3 Author: Linus Torvalds Date: Sat Jan 19 05:41:38 2019 +1200 Merge tag 'drm-fixes-2019-01-18-1' of git://anongit.freedesktop.org/drm/drm Pull drm update from Dave Airlie: "Add nouveau TU102 (RTX 2080 Ti) support" * tag 'drm-fixes-2019-01-18-1' of git://anongit.freedesktop.org/drm/drm: drm/nouveau/core: recognise TU102 commit fd340d0f68cc87badfc9efcb226f23a5428826a0 Author: Josef Bacik Date: Fri Jan 11 10:21:02 2019 -0500 btrfs: wakeup cleaner thread when adding delayed iput The cleaner thread usually takes care of delayed iputs, with the exception of the btrfs_end_transaction_throttle path. Delaying iputs means we are potentially delaying the eviction of an inode and it's respective space. The cleaner thread only gets woken up every 30 seconds, or when we require space. If there are a lot of inodes that need to be deleted we could induce a serious amount of latency while we wait for these inodes to be evicted. So instead wakeup the cleaner if it's not already awake to process any new delayed iputs we add to the list. If we suddenly need space we will less likely be backed up behind a bunch of inodes that are waiting to be deleted, and we could possibly free space before we need to get into the flushing logic which will save us some latency. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 3ec9a4c81c8cc2a8d9673588dd84d9cc7c31019b Author: Josef Bacik Date: Fri Jan 11 10:21:01 2019 -0500 btrfs: run delayed iputs before committing Delayed iputs means we can have final iputs of deleted inodes in the queue, which could potentially generate a lot of pinned space that could be free'd. So before we decide to commit the transaction for ENOPSC reasons, run the delayed iputs so that any potential space is free'd up. If there is and we freed enough we can then commit the transaction and potentially be able to make our reservation. Reviewed-by: Omar Sandoval Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 74d5d229b1bf60f93bff244b2dfc0eb21ec32a07 Author: Josef Bacik Date: Wed Nov 21 14:05:45 2018 -0500 btrfs: wait on ordered extents on abort cleanup If we flip read-only before we initiate writeback on all dirty pages for ordered extents we've created then we'll have ordered extents left over on umount, which results in all sorts of bad things happening. Fix this by making sure we wait on ordered extents if we have to do the aborted transaction cleanup stuff. generic/475 can produce this warning: [ 8531.177332] WARNING: CPU: 2 PID: 11997 at fs/btrfs/disk-io.c:3856 btrfs_free_fs_root+0x95/0xa0 [btrfs] [ 8531.183282] CPU: 2 PID: 11997 Comm: umount Tainted: G W 5.0.0-rc1-default+ #394 [ 8531.185164] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),BIOS rel-1.11.2-0-gf9626cc-prebuilt.qemu-project.org 04/01/2014 [ 8531.187851] RIP: 0010:btrfs_free_fs_root+0x95/0xa0 [btrfs] [ 8531.193082] RSP: 0018:ffffb1ab86163d98 EFLAGS: 00010286 [ 8531.194198] RAX: ffff9f3449494d18 RBX: ffff9f34a2695000 RCX:0000000000000000 [ 8531.195629] RDX: 0000000000000002 RSI: 0000000000000001 RDI:0000000000000000 [ 8531.197315] RBP: ffff9f344e930000 R08: 0000000000000001 R09:0000000000000000 [ 8531.199095] R10: 0000000000000000 R11: ffff9f34494d4ff8 R12:ffffb1ab86163dc0 [ 8531.200870] R13: ffff9f344e9300b0 R14: ffffb1ab86163db8 R15:0000000000000000 [ 8531.202707] FS: 00007fc68e949fc0(0000) GS:ffff9f34bd800000(0000)knlGS:0000000000000000 [ 8531.204851] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 8531.205942] CR2: 00007ffde8114dd8 CR3: 000000002dfbd000 CR4:00000000000006e0 [ 8531.207516] Call Trace: [ 8531.208175] btrfs_free_fs_roots+0xdb/0x170 [btrfs] [ 8531.210209] ? wait_for_completion+0x5b/0x190 [ 8531.211303] close_ctree+0x157/0x350 [btrfs] [ 8531.212412] generic_shutdown_super+0x64/0x100 [ 8531.213485] kill_anon_super+0x14/0x30 [ 8531.214430] btrfs_kill_super+0x12/0xa0 [btrfs] [ 8531.215539] deactivate_locked_super+0x29/0x60 [ 8531.216633] cleanup_mnt+0x3b/0x70 [ 8531.217497] task_work_run+0x98/0xc0 [ 8531.218397] exit_to_usermode_loop+0x83/0x90 [ 8531.219324] do_syscall_64+0x15b/0x180 [ 8531.220192] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 8531.221286] RIP: 0033:0x7fc68e5e4d07 [ 8531.225621] RSP: 002b:00007ffde8116608 EFLAGS: 00000246 ORIG_RAX:00000000000000a6 [ 8531.227512] RAX: 0000000000000000 RBX: 00005580c2175970 RCX:00007fc68e5e4d07 [ 8531.229098] RDX: 0000000000000001 RSI: 0000000000000000 RDI:00005580c2175b80 [ 8531.230730] RBP: 0000000000000000 R08: 00005580c2175ba0 R09:00007ffde8114e80 [ 8531.232269] R10: 0000000000000000 R11: 0000000000000246 R12:00005580c2175b80 [ 8531.233839] R13: 00007fc68eac61c4 R14: 00005580c2175a68 R15:0000000000000000 Leaving a tree in the rb-tree: 3853 void btrfs_free_fs_root(struct btrfs_root *root) 3854 { 3855 iput(root->ino_cache_inode); 3856 WARN_ON(!RB_EMPTY_ROOT(&root->inode_tree)); CC: stable@vger.kernel.org Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik [ add stacktrace ] Signed-off-by: David Sterba commit 31890da0bfdd24b135a258404b93c58a65510c7a Author: Josef Bacik Date: Wed Nov 21 14:05:41 2018 -0500 btrfs: handle delayed ref head accounting cleanup in abort We weren't doing any of the accounting cleanup when we aborted transactions. Fix this by making cleanup_ref_head_accounting global and calling it from the abort code, this fixes the issue where our accounting was all wrong after the fs aborts. The test generic/475 on a 2G VM can trigger the problems eg.: [ 8502.136957] WARNING: CPU: 0 PID: 11064 at fs/btrfs/extent-tree.c:5986 btrfs_free_block_grou +ps+0x3dc/0x410 [btrfs] [ 8502.148372] CPU: 0 PID: 11064 Comm: umount Not tainted 5.0.0-rc1-default+ #394 [ 8502.150807] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.2-0-gf9626 +cc-prebuilt.qemu-project.org 04/01/2014 [ 8502.154317] RIP: 0010:btrfs_free_block_groups+0x3dc/0x410 [btrfs] [ 8502.160623] RSP: 0018:ffffb1ab84b93de8 EFLAGS: 00010206 [ 8502.161906] RAX: 0000000001000000 RBX: ffff9f34b1756400 RCX: 0000000000000000 [ 8502.163448] RDX: 0000000000000002 RSI: 0000000000000001 RDI: ffff9f34b1755400 [ 8502.164906] RBP: ffff9f34b7e8c000 R08: 0000000000000001 R09: 0000000000000000 [ 8502.166716] R10: 0000000000000000 R11: 0000000000000001 R12: ffff9f34b7e8c108 [ 8502.168498] R13: ffff9f34b7e8c158 R14: 0000000000000000 R15: dead000000000100 [ 8502.170296] FS: 00007fb1cf15ffc0(0000) GS:ffff9f34bd400000(0000) knlGS:0000000000000000 [ 8502.172439] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 8502.173669] CR2: 00007fb1ced507b0 CR3: 000000002f7a6000 CR4: 00000000000006f0 [ 8502.175094] Call Trace: [ 8502.175759] close_ctree+0x17f/0x350 [btrfs] [ 8502.176721] generic_shutdown_super+0x64/0x100 [ 8502.177702] kill_anon_super+0x14/0x30 [ 8502.178607] btrfs_kill_super+0x12/0xa0 [btrfs] [ 8502.179602] deactivate_locked_super+0x29/0x60 [ 8502.180595] cleanup_mnt+0x3b/0x70 [ 8502.181406] task_work_run+0x98/0xc0 [ 8502.182255] exit_to_usermode_loop+0x83/0x90 [ 8502.183113] do_syscall_64+0x15b/0x180 [ 8502.183919] entry_SYSCALL_64_after_hwframe+0x49/0xbe Corresponding to release_global_block_rsv() { ... WARN_ON(fs_info->delayed_refs_rsv.reserved > 0); CC: stable@vger.kernel.org Signed-off-by: Josef Bacik [ add log dump ] Signed-off-by: David Sterba commit 77b7aad195099e7c6da11e94b7fa6ef5e6fb0025 Author: David Sterba Date: Wed Jan 9 15:02:23 2019 +0100 Revert "btrfs: balance dirty metadata pages in btrfs_finish_ordered_io" This reverts commit e73e81b6d0114d4a303205a952ab2e87c44bd279. This patch causes a few problems: - adds latency to btrfs_finish_ordered_io - as btrfs_finish_ordered_io is used for free space cache, generating more work from btrfs_btree_balance_dirty_nodelay could end up in the same workque, effectively deadlocking 12260 kworker/u96:16+btrfs-freespace-write D [<0>] balance_dirty_pages+0x6e6/0x7ad [<0>] balance_dirty_pages_ratelimited+0x6bb/0xa90 [<0>] btrfs_finish_ordered_io+0x3da/0x770 [<0>] normal_work_helper+0x1c5/0x5a0 [<0>] process_one_work+0x1ee/0x5a0 [<0>] worker_thread+0x46/0x3d0 [<0>] kthread+0xf5/0x130 [<0>] ret_from_fork+0x24/0x30 [<0>] 0xffffffffffffffff Transaction commit will wait on the freespace cache: 838 btrfs-transacti D [<0>] btrfs_start_ordered_extent+0x154/0x1e0 [<0>] btrfs_wait_ordered_range+0xbd/0x110 [<0>] __btrfs_wait_cache_io+0x49/0x1a0 [<0>] btrfs_write_dirty_block_groups+0x10b/0x3b0 [<0>] commit_cowonly_roots+0x215/0x2b0 [<0>] btrfs_commit_transaction+0x37e/0x910 [<0>] transaction_kthread+0x14d/0x180 [<0>] kthread+0xf5/0x130 [<0>] ret_from_fork+0x24/0x30 [<0>] 0xffffffffffffffff And then writepages ends up waiting on transaction commit: 9520 kworker/u96:13+flush-btrfs-1 D [<0>] wait_current_trans+0xac/0xe0 [<0>] start_transaction+0x21b/0x4b0 [<0>] cow_file_range_inline+0x10b/0x6b0 [<0>] cow_file_range.isra.69+0x329/0x4a0 [<0>] run_delalloc_range+0x105/0x3c0 [<0>] writepage_delalloc+0x119/0x180 [<0>] __extent_writepage+0x10c/0x390 [<0>] extent_write_cache_pages+0x26f/0x3d0 [<0>] extent_writepages+0x4f/0x80 [<0>] do_writepages+0x17/0x60 [<0>] __writeback_single_inode+0x59/0x690 [<0>] writeback_sb_inodes+0x291/0x4e0 [<0>] __writeback_inodes_wb+0x87/0xb0 [<0>] wb_writeback+0x3bb/0x500 [<0>] wb_workfn+0x40d/0x610 [<0>] process_one_work+0x1ee/0x5a0 [<0>] worker_thread+0x1e0/0x3d0 [<0>] kthread+0xf5/0x130 [<0>] ret_from_fork+0x24/0x30 [<0>] 0xffffffffffffffff Eventually, we have every process in the system waiting on balance_dirty_pages(), and nobody is able to make progress on page writeback. The original patch tried to fix an OOM condition, that happened on 4.4 but no success reproducing that on later kernels (4.19 and 4.20). This is more likely a problem in OOM itself. Link: https://lore.kernel.org/linux-btrfs/20180528054821.9092-1-ethanlien@synology.com/ Reported-by: Chris Mason CC: stable@vger.kernel.org # 4.18+ CC: ethanlien Signed-off-by: David Sterba commit 11ee2a3808aebbec73096551a716dea03d417fcb Merge: b1c0330823fe8 6f9b5e70dfcde Author: Rafael J. Wysocki Date: Fri Jan 18 11:17:16 2019 +0100 Merge branch 'acpi-pci' * acpi-pci: drivers: thermal: int340x_thermal: Make PCI dependency explicit x86/intel/lpss: Make PCI dependency explicit platform/x86: apple-gmux: Make PCI dependency explicit platform/x86: intel_pmc: Make PCI dependency explicit platform/x86: intel_ips: make PCI dependency explicit vga-switcheroo: make PCI dependency explicit ata: pata_acpi: Make PCI dependency explicit ACPI / LPSS: Make PCI dependency explicit commit d311e0c27b8fcc27f707f8cac48cd8bdc4155224 Author: Masahiro Yamada Date: Fri Jan 18 14:30:38 2019 +0900 mtd: rawnand: denali: get ->setup_data_interface() working again Commit 7a08dbaedd36 ("mtd: rawnand: Move ->setup_data_interface() to nand_controller_ops") missed to invert the if-conditonal for denali. Since then, the Denali NAND driver cannnot invoke setup_data_interface. Fixes: 7a08dbaedd36 ("mtd: rawnand: Move ->setup_data_interface() to nand_controller_ops") Signed-off-by: Masahiro Yamada Acked-by: Miquel Raynal Signed-off-by: Boris Brezillon commit 01eeb927bbcc1952114b0aec1447699c4747c337 Author: Luc Van Oostenryck Date: Thu Jan 17 18:39:07 2019 +0100 mtd: nand: jz4740: fix '__iomem *' vs. '* __iomem' The function jz_nand_ioremap_resource() needs a pointer to an __iomem pointer as its last argument but this argument is declared as: void * __iomem *base Fix this by using the correct declaration: void __iomem **base which then also removes the following Sparse's warnings: 282:15: warning: incorrect type in assignment (different address spaces) 282:15: expected void *[noderef] 282:15: got void [noderef] * 322:57: warning: incorrect type in argument 4 (different address spaces) 322:57: expected void *[noderef] *base 322:57: got void [noderef] ** 402:67: warning: incorrect type in argument 4 (different address spaces) 402:67: expected void *[noderef] *base 402:67: got void [noderef] ** Signed-off-by: Luc Van Oostenryck Acked-by: Miquel Raynal Signed-off-by: Boris Brezillon commit bf97403ac4bfbc9f9f92f47e737aee983d9191f5 Author: Yang Wei Date: Thu Jan 17 23:30:03 2019 +0800 macvlan: replace kfree_skb by consume_skb for drop profiles Replace the kfree_skb() by consume_skb() to be drop monitor(dropwatch, perf) friendly. Signed-off-by: Yang Wei Signed-off-by: David S. Miller commit 87fff3cacd0112bcaf42f932c1e44ae32b42f1fb Author: Yang Wei Date: Thu Jan 17 23:11:30 2019 +0800 neighbour: Do not perturb drop profiles when neigh_probe Replace the kfree_skb() by consume_skb() to be drop monitor(dropwatch, perf) friendly. Signed-off-by: Yang Wei Signed-off-by: David S. Miller commit 5ab3121beeb76aa6090195b67d237115860dd9ec Author: Lendacky, Thomas Date: Thu Jan 17 14:20:14 2019 +0000 amd-xgbe: Fix mdio access for non-zero ports and clause 45 PHYs The XGBE hardware has support for performing MDIO operations using an MDIO command request. The driver mistakenly uses the mdio port address as the MDIO command request device address instead of the MDIO command request port address. Additionally, the driver does not properly check for and create a clause 45 MDIO command. Check the supplied MDIO register to determine if the request is a clause 45 operation (MII_ADDR_C45). For a clause 45 operation, extract the device address and register number from the supplied MDIO register and use them to set the MDIO command request device address and register number fields. For a clause 22 operation, the MDIO request device address is set to zero and the MDIO command request register number is set to the supplied MDIO register. In either case, the supplied MDIO port address is used as the MDIO command request port address. Fixes: 732f2ab7afb9 ("amd-xgbe: Add support for MDIO attached PHYs") Signed-off-by: Tom Lendacky Tested-by: Shyam Sundar S K Signed-off-by: David S. Miller commit 40f89ebfbd73fc9439ae8d4950f60226ad176690 Author: Camelia Groza Date: Thu Jan 17 14:33:33 2019 +0200 net: phy: add missing phy driver features The phy drivers for CS4340 and TN2020 are missing their features attributes. Add them. Fixes: 719655a14971 ("net: phy: Replace phy driver features u32 with link_mode bitmap") Reported-by: Scott Wood Signed-off-by: Camelia Groza Signed-off-by: David S. Miller commit c6ddfb9a963f0cac0f7365acfc87f3f3b33a3b69 Author: Madalin Bucur Date: Thu Jan 17 11:42:27 2019 +0200 dpaa_eth: NETIF_F_LLTX requires to do our own update of trans_start As txq_trans_update() only updates trans_start when the lock is held, trans_start does not get updated if NETIF_F_LLTX is declared. Signed-off-by: Madalin Bucur Signed-off-by: David S. Miller commit 28c1382fa28f2e2d9d0d6f25ae879b5af2ecbd03 Author: Yunjian Wang Date: Thu Jan 17 09:46:41 2019 +0800 net: bridge: Fix ethernet header pointer before check skb forwardable The skb header should be set to ethernet header before using is_skb_forwardable. Because the ethernet header length has been considered in is_skb_forwardable(including dev->hard_header_len length). To reproduce the issue: 1, add 2 ports on linux bridge br using following commands: $ brctl addbr br $ brctl addif br eth0 $ brctl addif br eth1 2, the MTU of eth0 and eth1 is 1500 3, send a packet(Data 1480, UDP 8, IP 20, Ethernet 14, VLAN 4) from eth0 to eth1 So the expect result is packet larger than 1500 cannot pass through eth0 and eth1. But currently, the packet passes through success, it means eth1's MTU limit doesn't take effect. Fixes: f6367b4660dd ("bridge: use is_skb_forwardable in forward path") Cc: bridge@lists.linux-foundation.org Cc: Nkolay Aleksandrov Cc: Roopa Prabhu Cc: Stephen Hemminger Signed-off-by: Yunjian Wang Signed-off-by: David S. Miller commit cc5e710759470bc7f3c61d11fd54586f15fdbdf4 Author: Jason Wang Date: Wed Jan 16 16:54:42 2019 +0800 vhost: log dirty page correctly Vhost dirty page logging API is designed to sync through GPA. But we try to log GIOVA when device IOTLB is enabled. This is wrong and may lead to missing data after migration. To solve this issue, when logging with device IOTLB enabled, we will: 1) reuse the device IOTLB translation result of GIOVA->HVA mapping to get HVA, for writable descriptor, get HVA through iovec. For used ring update, translate its GIOVA to HVA 2) traverse the GPA->HVA mapping to get the possible GPA and log through GPA. Pay attention this reverse mapping is not guaranteed to be unique, so we should log each possible GPA in this case. This fix the failure of scp to guest during migration. In -next, we will probably support passing GIOVA->GPA instead of GIOVA->HVA. Fixes: 6b1e6cc7855b ("vhost: new device IOTLB API") Reported-by: Jintack Lim Cc: Jintack Lim Signed-off-by: Jason Wang Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit f655f8b818684716b2ebe35760c9b96184587d56 Author: Jakub Kicinski Date: Sat Jan 12 12:51:05 2019 -0800 Documentation: timestamping: correct path to net_tstamp.h net_tstamp.h is an UAPI header, so it was moved under include/uapi. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 9420151d88ca35cd7f857774d90bfdca505a2cc1 Merge: df0219b4f9576 7ebec5f43134b Author: Dave Airlie Date: Fri Jan 18 15:38:13 2019 +1000 Merge branch 'linux-4.21' of git://github.com/skeggsb/linux into drm-fixes nouveau support for TU102 (RTX 2080 Ti) Signed-off-by: Dave Airlie From: Ben Skeggs Link: https://patchwork.freedesktop.org/patch/msgid/CABDvA=mQsRr0BpRpv3n6UjthHush4u_kQR3oUGHkBtAHTmyCYw@mail.gmail.com commit d7393226d15add056285c8fc86723d54d7e0c77d Merge: 1092a94fcbcde d6f4a21f309df Author: Linus Torvalds Date: Fri Jan 18 17:17:20 2019 +1200 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes frfom Jason Gunthorpe: "Not much so far. We have the usual batch of bugs and two fixes to code merged this cycle: - Restore valgrind support for the ioctl verbs interface merged this window, and fix a missed error code on an error path from that conversion - A user reported crash on obsolete mthca hardware - pvrdma was using the wrong command opcode toward the hypervisor - NULL pointer crash regression when dumping rdma-cm over netlink - Be conservative about exposing the global rkey" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/uverbs: Mark ioctl responses with UVERBS_ATTR_F_VALID_OUTPUT RDMA/mthca: Clear QP objects during their allocation RDMA/vmw_pvrdma: Return the correct opcode when creating WR RDMA/cma: Add cm_id restrack resource based on kernel or user cm_id type RDMA/nldev: Don't expose unsafe global rkey to regular user RDMA/uverbs: Fix post send success return value in case of error commit 1092a94fcbcde03a8c2cc554f305af48c95d5d58 Merge: 2451f3717c538 df0219b4f9576 Author: Linus Torvalds Date: Fri Jan 18 17:14:02 2019 +1200 Merge tag 'drm-fixes-2019-01-18' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "The rc3 fixes are a bit scattered: - meson, sun4i and rockchip all had missing of_node_put. - qxl and virtio both were advertising dma-buf to userspace when they really shouldn't have. Otherwise: meson: - modesetting regression fix i915 GVT: - one cmd parser failure fix - region cleanup fix in vGPU destroy amdgpu: - KFD fixes for arm64 mixed APU/DGPU - vega12 powerplay fix - raven DC fixes - freesync fix" * tag 'drm-fixes-2019-01-18' of git://anongit.freedesktop.org/drm/drm: drm/amd/display: Detach backlight from stream drm/sun4i: backend: add missing of_node_puts Revert "drm/amdgpu: validate user pitch alignment" Revert "drm/amdgpu: validate user GEM object size" drm/meson: Fix atomic mode switching regression drm/i915/gvt: Fix mmap range check drm/i915/gvt: free VFIO region space in vgpu detach drm/amd/display: Fix disabled cursor on top screen edge drm/amd/display: fix warning on raven hotplug drm/amd/display: fix PME notification not working in RV desktop drm/amd/display: Only get the connector state for VRR when toggled drm/amd/display: Pack DMCU iRAM alignment drm/amd/powerplay: run acg btc for Vega12 drm/amdkfd: Don't assign dGPUs to APU topology devices drm/amdkfd: Allow building KFD on ARM64 (v2) drm/meson: add missing of_node_put drm/virtio: drop prime import/export callbacks drm/qxl: drop prime import/export callbacks drm/i915/gvt: Allow F_CMD_ACCESS on mmio 0x21f0 drm/rockchip: add missing of_node_put commit 2451f3717c538795fc9fade46916683ebf7ea959 Merge: 0a2fbed84a962 248b57015f35c Author: Linus Torvalds Date: Fri Jan 18 16:58:07 2019 +1200 Merge tag 'led-fix-for-5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds Pull LED fix from Jacek Anaszewski. * tag 'led-fix-for-5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds: leds: lp5523: fix a missing check of return value of lp55xx_read commit 0a2fbed84a962c486a71d2c91c86a31332dcbf02 Merge: a3a80255d58d0 f422449b58548 Author: Linus Torvalds Date: Fri Jan 18 16:55:49 2019 +1200 Merge tag 'hwmon-for-v5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: "Minor fixes/regressions" * tag 'hwmon-for-v5.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (tmp421) Correct the misspelling of the tmp442 compatible attribute in OF device ID table hwmon: (occ) Fix potential integer overflow hwmon: (lm80) Fix missing unlock on error in set_fan_div() hwmon: (nct6775) Enable IO mapping for NCT6797D and NCT6798D hwmon: (nct6775) Fix chip ID for NCT6798D commit 38197ca176fc259fa4c871d07bcf8389d044a895 Author: Thomas Gleixner Date: Fri Jan 18 00:14:17 2019 +0100 block: Cleanup license notice Remove the imprecise and sloppy: "This files is licensed under the GPL." license notice in the top level comment. 1) The file already contains a SPDX license identifier which clearly states that the license of the file is GPL V2 only 2) The notice resolves to GPL v1 or later for scanners which is just contrary to the intent of SPDX identifiers to provide clear and non ambiguous license information. Aside of that the value add of this notice is below zero, Cc: Damien Le Moal Cc: Matias Bjorling Cc: Christoph Hellwig Cc: Jens Axboe Cc: linux-block@vger.kernel.org Fixes: 6a5ac9846508 ("block: Make struct request_queue smaller for CONFIG_BLK_DEV_ZONED=n") Reviewed-by: Bart Van Assche Signed-off-by: Thomas Gleixner Signed-off-by: Jens Axboe commit 7ebec5f43134bbf3dd5f20228ac4c1b55ee73284 Author: Ben Skeggs Date: Thu Jan 17 11:39:55 2019 +1000 drm/nouveau/core: recognise TU102 Would usually do this split-out, verifying each component indivitually, but this has been squashed together to be more palatable for merging in 5.0-rc. Signed-off-by: Ben Skeggs commit 88a8121dc1d3d0dbddd411b79ed236b6b6ea415c Author: Nicolas Dichtel Date: Thu Jan 17 11:27:22 2019 +0100 af_packet: fix raw sockets over 6in4 tunnel Since commit cb9f1b783850, scapy (which uses an AF_PACKET socket in SOCK_RAW mode) is unable to send a basic icmp packet over a sit tunnel: Here is a example of the setup: $ ip link set ntfp2 up $ ip addr add 10.125.0.1/24 dev ntfp2 $ ip tunnel add tun1 mode sit ttl 64 local 10.125.0.1 remote 10.125.0.2 dev ntfp2 $ ip addr add fd00:cafe:cafe::1/128 dev tun1 $ ip link set dev tun1 up $ ip route add fd00:200::/64 dev tun1 $ scapy >>> p = [] >>> p += IPv6(src='fd00:100::1', dst='fd00:200::1')/ICMPv6EchoRequest() >>> send(p, count=1, inter=0.1) >>> quit() $ ip -s link ls dev tun1 | grep -A1 "TX.*errors" TX: bytes packets errors dropped carrier collsns 0 0 1 0 0 0 The problem is that the network offset is set to the hard_header_len of the output device (tun1, ie 14 + 20) and in our case, because the packet is small (48 bytes) the pskb_inet_may_pull() fails (it tries to pull 40 bytes (ipv6 header) starting from the network offset). This problem is more generally related to device with variable hard header length. To avoid a too intrusive patch in the current release, a (ugly) workaround is proposed in this patch. It has to be cleaned up in net-next. Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=993675a3100b1 Link: http://patchwork.ozlabs.org/patch/1024489/ Fixes: cb9f1b783850 ("ip: validate header length on virtual device xmit") CC: Willem de Bruijn CC: Maxim Mikityanskiy Signed-off-by: Nicolas Dichtel Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit e224c390a6259c529f7b2a6bd215a087b3344f5c Author: Yuchung Cheng Date: Thu Jan 17 08:51:01 2019 -0800 bpf: fix SO_MAX_PACING_RATE to support TCP internal pacing If sch_fq packet scheduler is not used, TCP can fallback to internal pacing, but this requires sk_pacing_status to be properly set. Fixes: 8c4b4c7e9ff0 ("bpf: Add setsockopt helper function to bpf") Signed-off-by: Yuchung Cheng Signed-off-by: Eric Dumazet Cc: Lawrence Brakmo Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit f4924f24da8c7ef64195096817f3cde324091d97 Author: Peter Oskolkov Date: Wed Jan 16 08:47:54 2019 -0800 bpf: bpf_setsockopt: reset sock dst on SO_MARK changes In sock_setsockopt() (net/core/sock.h), when SO_MARK option is used to change sk_mark, sk_dst_reset(sk) is called. The same should be done in bpf_setsockopt(). Fixes: 8c4b4c7e9ff0 ("bpf: Add setsockopt helper function to bpf") Reported-by: Maciej Żenczykowski Signed-off-by: Peter Oskolkov Acked-by: Martin KaFai Lau Reviewed-by: Maciej Żenczykowski Signed-off-by: Daniel Borkmann commit df0219b4f9576c72b618db5edf7bb75c14829dbd Merge: 4ac4cb70d15a9 4bb0e6d725821 Author: Dave Airlie Date: Fri Jan 18 09:14:34 2019 +1000 Merge tag 'drm-misc-fixes-2019-01-17' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes drm-misc-fixes for v5.0-rc3: - Add missing calls to of_node_put to sun4i, meson, and rockchip. - Drop unimplemented prime callbacks in virtio and qxl, so support for prime is not advertised on those drivers. - Fix mode switching regression in meson. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/9af07312-f435-2fda-65a2-9fe92cdf5da4@linux.intel.com commit 4ac4cb70d15a94a2b11a0cebeee90806013f3bd0 Merge: 586cdb0db70ba 15c05196ff84a Author: Dave Airlie Date: Fri Jan 18 09:12:39 2019 +1000 Merge tag 'drm-intel-fixes-2019-01-17' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes drm/i915/gvt fixes for v5.0-rc3 "This contains one cmd parser failure fix to allow cmd access for one register, and fix region cleanup properly in vGPU destroy, and another fix for critical mmap size check mistake." Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87ef9bfusc.fsf@intel.com commit 586cdb0db70ba54482d8b217839d8fa4377ea077 Merge: 1c7fc5cbc3398 35dad45d5cad3 Author: Dave Airlie Date: Fri Jan 18 09:10:09 2019 +1000 Merge branch 'drm-fixes-5.0' of git://people.freedesktop.org/~agd5f/linux into drm-fixes Fixes for 5.0: - Fix KFD on ARM64 - Fix KFD topology with mixed APU and dGPU systems - Powerplay fix for vega12 - DC Raven fixes - Freesync fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20190116224524.3314-1-alexander.deucher@amd.com commit f7c46156f4a9d6ba5c6bcc5c48945e87b0f08c65 Author: Alexey Kodanev Date: Wed Jan 16 19:17:45 2019 +0300 udp6: add missing rehash callback to udplite After commit 23b0269e58ae ("net: udp6: prefer listeners bound to an address"), UDP-Lite only works when specifying a local address for the sockets. This is related to the problem addressed in the commit 719f835853a9 ("udp: add rehash on connect()"). Moreover, __udp6_lib_lookup() now looks for a socket immediately in the secondary hash table. And this issue was found with LTP/network tests as well. Fixes: 23b0269e58ae ("net: udp6: prefer listeners bound to an address") Signed-off-by: Alexey Kodanev Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 8f6b5392856a4b74224e257f3e0874a163b04603 Author: Alexey Kodanev Date: Wed Jan 16 19:17:44 2019 +0300 udp: add missing rehash callback to udplite After commit 4cdeeee9252a ("net: udp: prefer listeners bound to an address"), UDP-Lite only works when specifying a local address for the sockets. This is related to the problem addressed in the commit 719f835853a9 ("udp: add rehash on connect()"). Moreover, __udp4_lib_lookup() now looks for a socket immediately in the secondary hash table. The issue was found with LTP/network tests (UDP-Lite test-cases). Fixes: 4cdeeee9252a ("net: udp: prefer listeners bound to an address") Signed-off-by: Alexey Kodanev Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 2cddd20147826aef283115abb00012d4dafe3cdb Author: Ivan Vecera Date: Wed Jan 16 16:53:52 2019 +0100 net/sched: cls_flower: allocate mask dynamically in fl_change() Recent changes (especially 05cd271fd61a ("cls_flower: Support multiple masks per priority")) in the fl_flow_mask structure grow it and its current size e.g. on x86_64 with defconfig is 760 bytes and more than 1024 bytes with some debug options enabled. Prior the mentioned commit its size was 176 bytes (using defconfig on x86_64). With regard to this fact it's reasonable to allocate this structure dynamically in fl_change() to reduce its stack size. v2: - use kzalloc() instead of kcalloc() Fixes: 05cd271fd61a ("cls_flower: Support multiple masks per priority") Cc: Jiri Pirko Cc: Paul Blakey Acked-by: Jiri Pirko Signed-off-by: Ivan Vecera Signed-off-by: David S. Miller commit 3f1bb6abdf19cfa89860b3bc9e7f31b44b6a0ba1 Author: Johan Hovold Date: Wed Jan 16 11:27:08 2019 +0100 net: dsa: realtek-smi: fix OF child-node lookup Use the new of_get_compatible_child() helper to look up child nodes to avoid ever matching non-child nodes elsewhere in the tree. Also fix up the related struct device_node leaks. Fixes: d8652956cf37 ("net: dsa: realtek-smi: Add Realtek SMI driver") Cc: stable # 4.19: 36156f9241cb0 Cc: Linus Walleij Signed-off-by: Johan Hovold Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 248b57015f35c94d4eae2fdd8c6febf5cd703900 Author: Kangjie Lu Date: Tue Dec 25 22:18:23 2018 -0600 leds: lp5523: fix a missing check of return value of lp55xx_read When lp55xx_read() fails, "status" is an uninitialized variable and thus may contain random value; using it leads to undefined behaviors. The fix inserts a check for the return value of lp55xx_read: if it fails, returns with its error code. Signed-off-by: Kangjie Lu Signed-off-by: Jacek Anaszewski commit f422449b58548a41e98fc97b259a283718e527db Author: Cheng-Min Ao Date: Mon Jan 7 14:29:32 2019 +0800 hwmon: (tmp421) Correct the misspelling of the tmp442 compatible attribute in OF device ID table Correct a typo in OF device ID table The last one should be 'ti,tmp442' Signed-off-by: Cheng-Min Ao Signed-off-by: Yu-Hsiang Chen Signed-off-by: Guenter Roeck commit cb12d72b27a6f41325ae23a11033cf5fedfa1b97 Author: Colin Ian King Date: Tue Jan 15 18:03:38 2019 +0000 atm: he: fix sign-extension overflow on large shift Shifting the 1 by exp by an int can lead to sign-extension overlow when exp is 31 since 1 is an signed int and sign-extending this result to an unsigned long long will set the upper 32 bits. Fix this by shifting an unsigned long. Detected by cppcheck: (warning) Shifting signed 32-bit value by 31 bits is undefined behaviour Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit a3a80255d58d0f0d304ba877ae0313a264973a70 Merge: 6d060fa39035d 34fa47612bfe5 Author: Linus Torvalds Date: Fri Jan 18 06:27:24 2019 +1200 Merge tag 'afs-fixes-20190117' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull AFS fixes from David Howells: "Here's a set of fixes for AFS: - Use struct_size() for kzalloc() size calculation. - When calling YFS.CreateFile rather than AFS.CreateFile, it is possible to create a file with a file lock already held. The default value indicating no lock required is actually -1, not 0. - Fix an oops in inode/vnode validation if the target inode doesn't have a server interest assigned (ie. a server that will notify us of changes by third parties). - Fix refcounting of keys in file locking. - Fix a race in refcounting asynchronous operations in the event of an error during request transmission. The provision of a dedicated function to get an extra ref on a call is split into a separate commit" * tag 'afs-fixes-20190117' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: afs: Fix race in async call refcounting afs: Provide a function to get a ref on a call afs: Fix key refcounting in file locking code afs: Don't set vnode->cb_s_break in afs_validate() afs: Set correct lock type for the yfs CreateFile afs: Use struct_size() in kzalloc() commit 6d060fa39035d5ff6bb3e720a8119aeb50453e3b Merge: e4484a495586d 227a76b647188 Author: Linus Torvalds Date: Fri Jan 18 06:22:08 2019 +1200 Merge branch 'stable/for-linus-5.0' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb Pull swiotlb fix from Konrad Rzeszutek Wilk: "A tiny fix for v5.0-rc2: This fixes an issue with GPU cards not working anymore with the DMA mapping work Christopher did - as the SWIOTLB is initialized first and then free'd (as IOMMU is available) but we forgot to clear our start and end entries which are used and BOOM" * 'stable/for-linus-5.0' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb: swiotlb: clear io_tlb_start and io_tlb_end in swiotlb_exit commit e4484a495586dddf989380f89a7c16d43db6790b Merge: d471c4dfa19f4 e00d888048149 Author: Linus Torvalds Date: Fri Jan 18 06:20:09 2019 +1200 Merge tag 'kbuild-fixes-v5.0' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - clean generated files in scripts/kconfig/ by 'make mrproper' - fix conflict between dead code elimination and ftrace for GCC <= 4.7 - fix external module build with CONFIG_STACKPROTECTOR - remove unused code * tag 'kbuild-fixes-v5.0' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: mark prepare0 as PHONY to fix external module build openrisc: remove unneeded code in arch/openrisc/Makefile nds32: remove unneeded code in arch/nds32/Makefile ia64: remove redundant 'export AWK' kbuild: remove unused archmrproper kbuild: remove unused baseprereq kbuild: Disable LD_DEAD_CODE_DATA_ELIMINATION with ftrace & GCC <= 4.7 kconfig: clean generated *conf-cfg files commit d471c4dfa19f4d6de063256370a5be411a1f3149 Merge: 7fbfee7c80ded 3705add0b783e Author: Linus Torvalds Date: Fri Jan 18 06:15:28 2019 +1200 Merge tag 'devicetree-fixes-for-5.0' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull Devicetree fixes from Rob Herring: - Remove now unused struct device_node.type pointer - Fix meson-axg reset header SPDX tag - Add missing of_node_put in of_graph_get_remote_port_parent - Fix several binding doc file references and typos * tag 'devicetree-fixes-for-5.0' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: reset: meson-axg: fix SPDX license id dt-bindings: soc: qcom: Fix trivial language typos doc: gpio-mvebu: fix broken reference to cp110-system-controller0.txt file OF: properties: add missing of_node_put doc: bindings: fix bad reference to ARM CPU bindings dt-bindings: marvell,mmp2: fix typos in bindings doc of: Remove struct device_node.type pointer commit 6a4c9ab13feeacd3072175d7d1f1fcfabbb9fc90 Author: Sai Prakash Ranjan Date: Thu Jan 17 09:09:29 2019 -0800 pstore/ram: Fix console ramoops to show the previous boot logs commit b05c950698fe ("pstore/ram: Simplify ramoops_get_next_prz() arguments") changed update assignment in getting next persistent ram zone by adding a check for record type. But the check always returns true since the record type is assigned 0. And this breaks console ramoops by showing current console log instead of previous log on warm reset and hard reset (actually hard reset should not be showing any logs). Fix this by having persistent ram zone type check instead of record type check. Tested this on SDM845 MTP and dragonboard 410c. Reproducing this issue is simple as below: 1. Trigger hard reset and mount pstore. Will see console-ramoops record in the mounted location which is the current log. 2. Trigger warm reset and mount pstore. Will see the current console-ramoops record instead of previous record. Fixes: b05c950698fe ("pstore/ram: Simplify ramoops_get_next_prz() arguments") Signed-off-by: Sai Prakash Ranjan Acked-by: Joel Fernandes (Google) [kees: dropped local variable usage] Signed-off-by: Kees Cook commit c61c27687a5abce11431e6de1adb6e36099b9859 Author: Mathieu Malaterre Date: Wed Jan 16 20:35:41 2019 +0100 bpf: Correctly annotate implicit fall through in bpf_base_func_proto There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warnings (W=1). To preserve as much of the existing comment only change a ‘:’ into a ‘,’. This is enough change, to match the regular expression expected by GCC. This commit removes the following warning: net/core/filter.c:5310:6: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Mathieu Malaterre Signed-off-by: Daniel Borkmann commit c8dc79806e7f6cb6b0952aae1ce626c39905ad7e Author: Mathieu Malaterre Date: Wed Jan 16 20:35:29 2019 +0100 bpf: Annotate implicit fall through in cgroup_dev_func_proto There is a plan to build the kernel with -Wimplicit-fallthrough and this place in the code produced a warnings (W=1). This commit removes the following warning: kernel/bpf/cgroup.c:719:6: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Mathieu Malaterre Signed-off-by: Daniel Borkmann commit 583c53185399cea5c51195064564d1c9ddc70cf3 Author: Mathieu Malaterre Date: Wed Jan 16 20:29:40 2019 +0100 bpf: Make function btf_name_offset_valid static Initially in commit 69b693f0aefa ("bpf: btf: Introduce BPF Type Format (BTF)") the function 'btf_name_offset_valid' was introduced as static function it was later on changed to a non-static one, and then finally in commit 23127b33ec80 ("bpf: Create a new btf_name_by_offset() for non type name use case") the function prototype was removed. Revert back to original implementation and make the function static. Remove warning triggered with W=1: kernel/bpf/btf.c:470:6: warning: no previous prototype for 'btf_name_offset_valid' [-Wmissing-prototypes] Fixes: 23127b33ec80 ("bpf: Create a new btf_name_by_offset() for non type name use case") Signed-off-by: Mathieu Malaterre Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit f67ad87ab3120e82845521b18a2b99273a340308 Author: Stanislav Fomichev Date: Wed Jan 16 14:03:17 2019 -0800 selftests/bpf: retry tests that expect build-id While running test_progs in a loop I found out that I'm sometimes hitting "Didn't find expected build ID from the map" error. Looking at stack_map_get_build_id_offset() it seems that it is racy (by design) and can sometimes return BPF_STACK_BUILD_ID_IP (i.e. can't trylock current->mm->mmap_sem). Let's retry this test a single time. Fixes: 13790d1cc72c ("bpf: add selftest for stackmap with build_id in NMI context") Acked-by: Song Liu Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann commit 4af396ae4836c4ecab61e975b8e61270c551894d Author: Stanislav Fomichev Date: Wed Jan 16 14:03:16 2019 -0800 bpf: zero out build_id for BPF_STACK_BUILD_ID_IP When returning BPF_STACK_BUILD_ID_IP from stack_map_get_build_id_offset, make sure that build_id field is empty. Since we are using percpu free list, there is a possibility that we might reuse some previous bpf_stack_build_id with non-zero build_id. Fixes: 615755a77b24 ("bpf: extend stackmap to save binary_build_id+offset instead of address") Acked-by: Song Liu Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann commit 0b698005a9d11c0e91141ec11a2c4918a129f703 Author: Stanislav Fomichev Date: Wed Jan 16 14:03:15 2019 -0800 bpf: don't assume build-id length is always 20 bytes Build-id length is not fixed to 20, it can be (`man ld` /--build-id): * 128-bit (uuid) * 160-bit (sha1) * any length specified in ld --build-id=0xhexstring To fix the issue of missing BPF_STACK_BUILD_ID_VALID for shorter build-ids, assume that build-id is somewhere in the range of 1 .. 20. Set the remaining bytes to zero. v2: * don't introduce new "len = min(BPF_BUILD_ID_SIZE, nhdr->n_descsz)", we already know that nhdr->n_descsz <= BPF_BUILD_ID_SIZE if we enter this 'if' condition Fixes: 615755a77b24 ("bpf: extend stackmap to save binary_build_id+offset instead of address") Acked-by: Song Liu Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann commit 34fa47612bfe5d7de7fcaf658a6952b6aeec3b13 Author: David Howells Date: Thu Jan 10 15:40:50 2019 +0000 afs: Fix race in async call refcounting There's a race between afs_make_call() and afs_wake_up_async_call() in the case that an error is returned from rxrpc_kernel_send_data() after it has queued the final packet. afs_make_call() will try and clean up the mess, but the call state may have been moved on thereby causing afs_process_async_call() to also try and to delete the call. Fix this by: (1) Getting an extra ref for an asynchronous call for the call itself to hold. This makes sure the call doesn't evaporate on us accidentally and will allow the call to be retained by the caller in a future patch. The ref is released on leaving afs_make_call() or afs_wait_for_call_to_complete(). (2) In the event of an error from rxrpc_kernel_send_data(): (a) Don't set the call state to AFS_CALL_COMPLETE until *after* the call has been aborted and ended. This prevents afs_deliver_to_call() from doing anything with any notifications it gets. (b) Explicitly end the call immediately to prevent further callbacks. (c) Cancel any queued async_work and wait for the work if it's executing. This allows us to be sure the race won't recur when we change the state. We put the work queue's ref on the call if we managed to cancel it. (d) Put the call's ref that we got in (1). This belongs to us as long as the call is in state AFS_CALL_CL_REQUESTING. Fixes: 341f741f04be ("afs: Refcount the afs_call struct") Signed-off-by: David Howells commit 7a75b0079a1d54e342c502c3c8107ba97e05d3d3 Author: David Howells Date: Thu Jan 10 15:14:29 2019 +0000 afs: Provide a function to get a ref on a call Provide a function to get a reference on an afs_call struct. Signed-off-by: David Howells commit 59d49076ae3e6912e6d7df2fd68e2337f3d02036 Author: David Howells Date: Wed Jan 9 17:23:54 2019 +0000 afs: Fix key refcounting in file locking code Fix the refcounting of the authentication keys in the file locking code. The vnode->lock_key member points to a key on which it expects to be holding a ref, but it isn't always given an extra ref, however. Fixes: 0fafdc9f888b ("afs: Fix file locking") Signed-off-by: David Howells commit 4882a27cec24319d10f95e978ecc80050e3e3e15 Author: Marc Dionne Date: Wed Jan 9 17:23:54 2019 +0000 afs: Don't set vnode->cb_s_break in afs_validate() A cb_interest record is not necessarily attached to the vnode on entry to afs_validate(), which can cause an oops when we try to bring the vnode's cb_s_break up to date in the default case (ie. no current callback promise and the vnode has not been deleted). Fix this by simply removing the line, as vnode->cb_s_break will be set when needed by afs_register_server_cb_interest() when we next get a callback promise from RPC call. The oops looks something like: BUG: unable to handle kernel NULL pointer dereference at 0000000000000018 ... RIP: 0010:afs_validate+0x66/0x250 [kafs] ... Call Trace: afs_d_revalidate+0x8d/0x340 [kafs] ? __d_lookup+0x61/0x150 lookup_dcache+0x44/0x70 ? lookup_dcache+0x44/0x70 __lookup_hash+0x24/0xa0 do_unlinkat+0x11d/0x2c0 __x64_sys_unlink+0x23/0x30 do_syscall_64+0x4d/0xf0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: ae3b7361dc0e ("afs: Fix validation/callback interaction") Signed-off-by: Marc Dionne Signed-off-by: David Howells commit d2fd6e81912a665993b24dcdc1c1384a42a54f7e Author: Logan Gunthorpe Date: Thu Jan 17 08:46:34 2019 -0600 PCI: Fix __initdata issue with "pci=disable_acs_redir" parameter The disable_acs_redir parameter stores a pointer to the string passed to pci_setup(). However, the string passed to PCI setup is actually a temporary copy allocated in static __initdata memory. After init, once the memory is freed, it is no longer valid to reference this pointer. This bug was noticed in v5.0-rc1 after a change in commit c5eb1190074c ("PCI / PM: Allow runtime PM without callback functions") caused pci_disable_acs_redir() to be called during shutdown which manifested as an unable to handle kernel paging request at: RIP: 0010:pci_enable_acs+0x3f/0x1e0 Call Trace: pci_restore_state.part.44+0x159/0x3c0 pci_restore_standard_config+0x33/0x40 pci_pm_runtime_resume+0x2b/0xd0 ? pci_restore_standard_config+0x40/0x40 __rpm_callback+0xbc/0x1b0 rpm_callback+0x1f/0x70 ? pci_restore_standard_config+0x40/0x40 rpm_resume+0x4f9/0x710 ? pci_conf1_read+0xb6/0xf0 ? pci_conf1_write+0xb2/0xe0 __pm_runtime_resume+0x47/0x70 pci_device_shutdown+0x1e/0x60 device_shutdown+0x14a/0x1f0 kernel_restart+0xe/0x50 __do_sys_reboot+0x1ee/0x210 ? __fput+0x144/0x1d0 do_writev+0x5e/0xf0 ? do_writev+0x5e/0xf0 do_syscall_64+0x48/0xf0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 It was also likely possible to trigger this bug when hotplugging PCI devices. To fix this, instead of storing a pointer, we use kstrdup() to copy the disable_acs_redir_param to its own buffer which will never be freed. Fixes: aaca43fda742 ("PCI: Add "pci=disable_acs_redir=" parameter for peer-to-peer support") Tested-by: Jarkko Nikula Signed-off-by: Logan Gunthorpe Signed-off-by: Bjorn Helgaas Reviewed-by: Jarkko Nikula commit e00d8880481497474792d28c14479a9fb6752046 Author: Masahiro Yamada Date: Tue Jan 15 16:19:00 2019 +0900 kbuild: mark prepare0 as PHONY to fix external module build Commit c3ff2a5193fa ("powerpc/32: add stack protector support") caused kernel panic on PowerPC when an external module is used with CONFIG_STACKPROTECTOR because the 'prepare' target was not executed for the external module build. Commit e07db28eea38 ("kbuild: fix single target build for external module") turned it into a build error because the 'prepare' target is now executed but the 'prepare0' target is missing for the external module build. External module on arm/arm64 with CONFIG_STACKPROTECTOR_PER_TASK is also broken in the same way. Move 'PHONY += prepare0' to the common place. GNU Make is fine with missing rule for phony targets. I also removed the comment which is wrong irrespective of this commit. I minimize the change so it can be easily backported to 4.20.x To fix v4.20, please backport e07db28eea38 ("kbuild: fix single target build for external module"), and then this commit. Link: https://bugzilla.kernel.org/show_bug.cgi?id=201891 Fixes: e07db28eea38 ("kbuild: fix single target build for external module") Fixes: c3ff2a5193fa ("powerpc/32: add stack protector support") Fixes: 189af4657186 ("ARM: smp: add support for per-task stack canaries") Fixes: 0a1213fa7432 ("arm64: enable per-task stack canaries") Cc: linux-stable # v4.20 Reported-by: Samuel Holland Reported-by: Alexey Kardashevskiy Signed-off-by: Masahiro Yamada Acked-by: Ard Biesheuvel Tested-by: Alexey Kardashevskiy commit 1b504a7bb18fc32a324712a0fc56d667bdabe258 Author: Masahiro Yamada Date: Tue Jan 15 04:14:23 2019 +0900 openrisc: remove unneeded code in arch/openrisc/Makefile - LDFLAGS_vmlinux is cleared by the top Makefile - 'all: vmlinux' is specified by the top Makefile Signed-off-by: Masahiro Yamada commit 558ee616d177c8225e65c75b6b72952408e64a74 Author: Masahiro Yamada Date: Mon Jan 14 17:44:40 2019 +0900 nds32: remove unneeded code in arch/nds32/Makefile - scripts/Kbuild.include already defined 'comma' - The top Makefile has 'PHONY += FORCE' - include/asm-*/ was moved to arch/*/include/asm/ a decade ago Signed-off-by: Masahiro Yamada commit 15c05196ff84ab07d9b1d05289216de2d5bedcd7 Merge: 1c7fc5cbc3398 51b00d8509dc6 Author: Jani Nikula Date: Thu Jan 17 11:49:51 2019 +0200 Merge tag 'gvt-fixes-2018-01-17' of https://github.com/intel/gvt-linux into drm-intel-fixes gvt-fixes-2018-01-17 - Fix one register cmd parser failure (Colin) - Fix region cleanup for vGPU destroy (Henry) - Fix mmap size check (Zhenyu) Signed-off-by: Jani Nikula From: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20190117074604.GI18272@zhen-hp.sh.intel.com commit 7fbfee7c80ded94278f109aae4063741c323294a Merge: 47bfa6d9dc8c0 a5795fd38ee81 Author: Linus Torvalds Date: Thu Jan 17 16:54:58 2019 +1200 Merge branch 'fixes-v5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security Pull security subsystem fixes from James Morris: "Fixes for the security subsystem. The first (by Casey actually - it's misattributed) fixes a regression introduced with the LSM stacking changes" * 'fixes-v5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: LSM: Check for NULL cred-security on free Yama: Check for pid death before checking ancestry seccomp: fix UAF in user-trap code commit 0f149c9fec3cd720628ecde83bfc6f64c1e7dcb6 Author: Willem de Bruijn Date: Tue Jan 15 11:40:02 2019 -0500 udp: with udp_segment release on error path Failure __ip_append_data triggers udp_flush_pending_frames, but these tests happen later. The skb must be freed directly. Fixes: bec1f6f697362 ("udp: generate gso with UDP_SEGMENT") Reported-by: Eric Dumazet Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit 1a9352687c19e4937d861ff2c5c6fc45c0a08aff Author: Taehee Yoo Date: Wed Jan 16 01:35:22 2019 +0900 net: bpfilter: change section name of bpfilter UMH blob. The section of bpfilter UMH blob is the ".bpfilter_umh". but this is not an explicit section. so linking warning occurred at compile time for the powerpc. So, this patch makes use of the ".rodata" instead of the ".bpfilter_umh". Config condition: CONFIG_BPFILTER=y CONFIG_BPFILTER_UMH=y Result: ld: warning: orphan section `.bpfilter_umh' from `net/bpfilter/bpfilter_umh_blob.o' being placed in section `.bpfilter_umh' Fixes: 61fbf5933d42 ("net: bpfilter: restart bpfilter_umh when error occurred") Reported-by: Stephen Rothwell Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit a5795fd38ee8194451ba3f281f075301a3696ce2 Author: James Morris Date: Wed Jan 16 15:41:11 2019 -0800 LSM: Check for NULL cred-security on free From: Casey Schaufler Check that the cred security blob has been set before trying to clean it up. There is a case during credential initialization that could result in this. Signed-off-by: Casey Schaufler Acked-by: John Johansen Signed-off-by: James Morris Reported-by: syzbot+69ca07954461f189e808@syzkaller.appspotmail.com commit 9e857a40dc4eba15a739b4194d7db873d82c28a0 Author: Andrew Lunn Date: Tue Jan 15 16:55:30 2019 +0100 net: phy: Add missing features to PHY drivers The bcm87xx and micrel driver has PHYs which are missing the .features value. Add them. The bcm87xx is a 10G FEC only PHY. Add the needed features definition of this PHY. Fixes: 719655a14971 ("net: phy: Replace phy driver features u32 with link_mode bitmap") Reported-by: Scott Wood Reported-by: Camelia Groza Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 35dad45d5cad3c9ca8d6a338cbf668cd7ea86469 Author: David Francis Date: Tue Nov 20 09:42:58 2018 -0500 drm/amd/display: Detach backlight from stream [Why] Backlight is conceptually a property of links, not streams. All backlight programming is done on links, but there is a stream property bl_pwm_level that is used to restore backlight on dpms on and s3 resume. This is unnecessary, as backlight is already restored by hardware with no driver intervention. [How] Remove bl_pwm_level, and the stream argument to set_backlight Bug: https://bugs.freedesktop.org/show_bug.cgi?id=109375 Signed-off-by: David Francis Reviewed-by: Harry Wentland Acked-by: Anthony Koo Acked-by: Leo Li Signed-off-by: Alex Deucher (cherry picked from commit 923fe4951282cbdfce05186c10380bbc45b5e03b) commit a5a82d841186d13c4a6d500dfcf7d02b4195e3ff Author: Jakub Kicinski Date: Mon Jan 14 10:52:45 2019 -0800 ipv6: route: place a warning with duplicated string with correct extack "IPv6: " prefix is already added by pr_fmt, no need to include it again in the pr_warn() format. The message predates extack support, we can replace the whole thing with an extack message. Suggested-by: David Ahern Signed-off-by: Jakub Kicinski Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 91fa038d9446b5bf5ea80822790af7dd9bcbb5a2 Author: Davide Caratti Date: Mon Jan 14 18:16:44 2019 +0100 selftests: tc-testing: fix parsing of ife type In iproute2 commit 90c5c969f0b9 ("fix print_0xhex on 32 bit"), the format specifier for the ife type changed from 0x%X to %#llX, causing systematic failures in the following TDC test cases: 7682 - Create valid ife encode action with mark and pass control ef47 - Create valid ife encode action with mark and pipe control df43 - Create valid ife encode action with mark and continue control e4cf - Create valid ife encode action with mark and drop control ccba - Create valid ife encode action with mark and reclassify control a1cf - Create valid ife encode action with mark and jump control cb3d - Create valid ife encode action with mark value at 32-bit maximum 95ed - Create valid ife encode action with prio and pass control aa17 - Create valid ife encode action with prio and pipe control 74c7 - Create valid ife encode action with prio and continue control 7a97 - Create valid ife encode action with prio and drop control f66b - Create valid ife encode action with prio and reclassify control 3056 - Create valid ife encode action with prio and jump control 7dd3 - Create valid ife encode action with prio value at 32-bit maximum 05bb - Create valid ife encode action with tcindex and pass control ce65 - Create valid ife encode action with tcindex and pipe control 09cd - Create valid ife encode action with tcindex and continue control 8eb5 - Create valid ife encode action with tcindex and continue control 451a - Create valid ife encode action with tcindex and drop control d76c - Create valid ife encode action with tcindex and reclassify control e731 - Create valid ife encode action with tcindex and jump control b7b8 - Create valid ife encode action with tcindex value at 16-bit maximum 2a9c - Create valid ife encode action with mac src parameter cf5c - Create valid ife encode action with mac dst parameter 2353 - Create valid ife encode action with mac src and mac dst parameters 552c - Create valid ife encode action with mark and type parameters 0421 - Create valid ife encode action with prio and type parameters 4017 - Create valid ife encode action with tcindex and type parameters fac3 - Create valid ife encode action with index at 32-bit maximnum 7c25 - Create valid ife decode action with pass control dccb - Create valid ife decode action with pipe control 7bb9 - Create valid ife decode action with continue control d9ad - Create valid ife decode action with drop control 219f - Create valid ife decode action with reclassify control 8f44 - Create valid ife decode action with jump control b330 - Create ife encode action with cookie Change 'matchPattern' values, allowing '0' and '0x0' if ife type is equal to 0, and accepting both '0x' and '0X' otherwise, to let these tests pass both with old and new tc binaries. While at it, fix a small typo in test case fac3 ('maximnum'->'maximum'). Signed-off-by: Davide Caratti Acked-by: Stephen Hemminger Signed-off-by: David S. Miller commit 01b833ab44c9e484060aad72267fc7e71beb559b Author: Konstantin Khlebnikov Date: Mon Jan 14 13:38:43 2019 +0300 net/core/neighbour: fix kmemleak minimal reference count for hash tables This should be 1 for normal allocations, 0 disables leak reporting. Signed-off-by: Konstantin Khlebnikov Reported-by: Cong Wang Fixes: 85704cb8dcfd ("net/core/neighbour: tell kmemleak about hash tables") Signed-off-by: David S. Miller commit 400b8b9a2a17918f8ce00786f596f530e7f30d50 Author: Xin Long Date: Mon Jan 14 18:34:02 2019 +0800 sctp: allocate sctp_sockaddr_entry with kzalloc The similar issue as fixed in Commit 4a2eb0c37b47 ("sctp: initialize sin6_flowinfo for ipv6 addrs in sctp_inet6addr_event") also exists in sctp_inetaddr_event, as Alexander noticed. To fix it, allocate sctp_sockaddr_entry with kzalloc for both sctp ipv4 and ipv6 addresses, as does in sctp_v4/6_copy_addrlist(). Reported-by: Alexander Potapenko Signed-off-by: Xin Long Reported-by: syzbot+ae0c70c0c2d40c51bb92@syzkaller.appspotmail.com Acked-by: Marcelo Ricardo Leitner Acked-by: Neil Horman Signed-off-by: David S. Miller commit 20704bd1633dd5afb29a321d3a615c9c8e9c9d05 Author: Xin Long Date: Mon Jan 14 18:10:06 2019 +0800 erspan: build the header with the right proto according to erspan_ver As said in draft-foschiano-erspan-03#section4: Different frame variants known as "ERSPAN Types" can be distinguished based on the GRE "Protocol Type" field value: Type I and II's value is 0x88BE while Type III's is 0x22EB [ETYPES]. So set it properly in erspan_xmit() according to erspan_ver. While at it, also remove the unused parameter 'proto' in erspan_fb_xmit(). Fixes: 94d7d8f29287 ("ip6_gre: add erspan v2 support") Reported-by: Jianlin Shi Signed-off-by: Xin Long Signed-off-by: David S. Miller commit 04a4af334b971814eedf4e4a413343ad3287d9a9 Author: Ross Lagerwall Date: Mon Jan 14 09:16:56 2019 +0000 openvswitch: Avoid OOB read when parsing flow nlattrs For nested and variable attributes, the expected length of an attribute is not known and marked by a negative number. This results in an OOB read when the expected length is later used to check if the attribute is all zeros. Fix this by using the actual length of the attribute rather than the expected length. Signed-off-by: Ross Lagerwall Acked-by: Pravin B Shelar Signed-off-by: David S. Miller commit 9098f21f4cc0f13bc0caa747590e53479c267405 Author: Dmitry Bezrukov Date: Mon Jan 14 08:14:41 2019 +0000 net: usb: aqc111: Extend HWID table by TRENDnet device New device of TRENDnet based on aqc111u Add this ID to blacklist of cdc_ether driver as well Signed-off-by: Dmitry Bezrukov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit cd0c4e70fc0ccfa705cdf55efb27519ce9337a26 Author: Cong Wang Date: Fri Jan 11 18:55:42 2019 -0800 net_sched: refetch skb protocol for each filter Martin reported a set of filters don't work after changing from reclassify to continue. Looking into the code, it looks like skb protocol is not always fetched for each iteration of the filters. But, as demonstrated by Martin, TC actions could modify skb->protocol, for example act_vlan, this means we have to refetch skb protocol in each iteration, rather than using the one we fetch in the beginning of the loop. This bug is _not_ introduced by commit 3b3ae880266d ("net: sched: consolidate tc_classify{,_compat}"), technically, if act_vlan is the only action that modifies skb protocol, then it is commit c7e2b9689ef8 ("sched: introduce vlan action") which introduced this bug. Reported-by: Martin Olsson Cc: Jamal Hadi Salim Cc: Jiri Pirko Signed-off-by: Cong Wang Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 9474f4e7cd71a633fa1ef93b7daefd44bbdfd482 Author: Kees Cook Date: Wed Jan 16 10:31:09 2019 -0800 Yama: Check for pid death before checking ancestry It's possible that a pid has died before we take the rcu lock, in which case we can't walk the ancestry list as it may be detached. Instead, check for death first before doing the walk. Reported-by: syzbot+a9ac39bf55329e206219@syzkaller.appspotmail.com Fixes: 2d514487faf1 ("security: Yama LSM") Cc: stable@vger.kernel.org Suggested-by: Oleg Nesterov Signed-off-by: Kees Cook Signed-off-by: James Morris commit 3705add0b783e0deeb6646ba0311bf214fe52b0a Author: Jerome Brunet Date: Wed Jan 16 11:36:32 2019 +0100 dt-bindings: reset: meson-axg: fix SPDX license id As reported, the SPDX license id is not placed correctly and the variant of the BSD License used should be specified. Fixes: c16292578ffa ("dt-bindings: reset: Add bindings for the Meson-AXG SoC Reset Controller") Reported-by: Thomas Gleixner Signed-off-by: Jerome Brunet Reviewed-by: Thomas Gleixner Signed-off-by: Rob Herring commit 9eac0ae1683575375de8c63166b3596b11d3b56a Author: Krzysztof Kozlowski Date: Tue Jan 8 13:11:40 2019 +0100 dt-bindings: soc: qcom: Fix trivial language typos Fix few trivial language typos in bindings. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring commit 889f4ce60ed19cfd16216e96f90e64a0c1181c0d Author: Otto Sabart Date: Wed Jan 9 20:07:41 2019 +0100 doc: gpio-mvebu: fix broken reference to cp110-system-controller0.txt file The cp110-system-controller0.txt file was renamed to cp110-system-controller.txt. Fixes: 4aa5496980e4 ("dt-bindings: cp110: rename cp110 syscon file") Signed-off-by: Otto Sabart Signed-off-by: Rob Herring commit 28b170e88bc0c7509e6724717c15cb4b5686026e Author: Julia Lawall Date: Sun Jan 13 10:44:50 2019 +0100 OF: properties: add missing of_node_put Add an of_node_put when the result of of_graph_get_remote_port_parent is not available. The semantic match that finds this problem is as follows (http://coccinelle.lip6.fr): // @r exists@ local idexpression e; expression x; @@ e = of_graph_get_remote_port_parent(...); ... when != x = e when != true e == NULL when != of_node_put(e) when != of_fwnode_handle(e) ( return e; | *return ...; ) // Signed-off-by: Julia Lawall Cc: stable@vger.kernel.org Signed-off-by: Rob Herring commit 867cefb4cb1012f42cada1c7d1f35ac8dd276071 Author: Juergen Gross Date: Mon Jan 14 13:44:13 2019 +0100 xen: Fix x86 sched_clock() interface for xen Commit f94c8d11699759 ("sched/clock, x86/tsc: Rework the x86 'unstable' sched_clock() interface") broke Xen guest time handling across migration: [ 187.249951] Freezing user space processes ... (elapsed 0.001 seconds) done. [ 187.251137] OOM killer disabled. [ 187.251137] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. [ 187.252299] suspending xenstore... [ 187.266987] xen:grant_table: Grant tables using version 1 layout [18446743811.706476] OOM killer enabled. [18446743811.706478] Restarting tasks ... done. [18446743811.720505] Setting capacity to 16777216 Fix that by setting xen_sched_clock_offset at resume time to ensure a monotonic clock value. [boris: replaced pr_info() with pr_info_once() in xen_callback_vector() to avoid printing with incorrect timestamp during resume (as we haven't re-adjusted the clock yet)] Fixes: f94c8d11699759 ("sched/clock, x86/tsc: Rework the x86 'unstable' sched_clock() interface") Cc: # 4.11 Reported-by: Hans van Kranenburg Signed-off-by: Juergen Gross Tested-by: Hans van Kranenburg Signed-off-by: Boris Ostrovsky commit c45b1fa2433c65e44bdf48f513cb37289f3116b9 Author: Ming Lei Date: Thu Jan 3 09:34:39 2019 +0800 nvme-pci: fix nvme_setup_irqs() When -ENOSPC is returned from pci_alloc_irq_vectors_affinity(), we still try to allocate multiple irq vectors again, so irq queues covers the admin queue actually. But we don't consider that, then number of the allocated irq vector may be same with sum of io_queues[HCTX_TYPE_DEFAULT] and io_queues[HCTX_TYPE_READ], this way is obviously wrong, and finally breaks nvme_pci_map_queues(), and warning from pci_irq_get_affinity() is triggered. IRQ queues should cover admin queues, this patch makes this point explicitely in nvme_calc_io_queues(). We got severl boot failure internal report on aarch64, so please consider to fix it in v4.20. Fixes: 6451fe73fa0f ("nvme: fix irq vs io_queue calculations") Signed-off-by: Ming Lei Reviewed-by: Keith Busch Tested-by: fin4478 Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit fb8658581a150a859b654b154cefe3118ff4f1e0 Author: Sagi Grimberg Date: Wed Jan 9 14:56:32 2019 -0800 nvmet-tcp: fix uninitialized variable access If we end up in nvmet_tcp_try_recv_one with a bogus state queue receive state we will access result which is uninitialized. Initialize restult to 0 which will be considered as if no data was received by the tcp socket. Fixes: 872d26a391da ("nvmet-tcp: add NVMe over TCP target driver") Reported-by: Dan Carpenter Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 890d14d2d4b57ff5a149309da3ed36c8a529987f Author: Peter Rosin Date: Wed Jan 16 17:42:35 2019 +0100 fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line option A command line option is much more flexible than a config option and the supporting code is small. Gets rid of #ifdefs in the code too... Suggested-by: Geert Uytterhoeven Cc: Jonathan Corbet Signed-off-by: Peter Rosin Signed-off-by: Bartlomiej Zolnierkiewicz commit 240809ef6630a4ce57c273c2d79ffb657cd361eb Author: Hans Verkuil Date: Fri Jan 11 07:07:25 2019 -0500 media: vim2m: only cancel work if it is for right context cancel_delayed_work_sync() was called for any queue, but it should only be called for the queue that is associated with the currently running job. Otherwise, if two filehandles are streaming at the same time, then closing the first will cancel the work which might still be running for a job from the second filehandle. As a result the second filehandle will never be able to finish the job and an attempt to stop streaming on that second filehandle will stall. Fixes: 52117be68b82 ("media: vim2m: use cancel_delayed_work_sync instead of flush_schedule_work") Signed-off-by: Hans Verkuil Cc: # for v4.20 and up Signed-off-by: Mauro Carvalho Chehab commit 7fe9f01c04c2673bd6662c35b664f0f91888b96f Author: Sakari Ailus Date: Thu Jan 10 09:24:26 2019 -0500 media: v4l: ioctl: Validate num_planes for debug messages The num_planes field in struct v4l2_pix_format_mplane is used in a loop before validating it. As the use is printing a debug message in this case, just cap the value to the maximum allowed. Signed-off-by: Sakari Ailus Cc: stable@vger.kernel.org Reviewed-by: Thierry Reding Signed-off-by: Hans Verkuil Cc: # for v4.12 and up Signed-off-by: Mauro Carvalho Chehab commit 9048b2e15b11c591c649cc6edc7a64fa62c15419 Author: Sakari Ailus Date: Thu Jan 10 07:43:19 2019 -0500 media: v4l: ioctl: Validate num_planes before using it The for loop to reset the memory of the plane reserved fields runs over num_planes provided by the user without validating it. Ensure num_planes is no more than VIDEO_MAX_PLANES before the loop. Fixes: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields") Signed-off-by: Sakari Ailus Reviewed-by: Thierry Reding Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit dd91642ac71208fe972a9c577ed52b6b3ba7b732 Author: Thierry Reding Date: Thu Jan 10 05:48:39 2019 -0500 media: v4l2-ioctl: Clear only per-plane reserved fields Currently the IOCTL code clears everything after the per-plane bytesperline field in struct v4l2_format. The intent was to only clear the per-plane reserved fields since there is data in struct v4l2_format after the per-plane format data that userspace may have filled in. Fixes: 4e1e0eb0e074 ("media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields") Signed-off-by: Thierry Reding Signed-off-by: Hans Verkuil [hverkuil-cisco@xs4all.nl: fix checkpatch alignment warning] Signed-off-by: Mauro Carvalho Chehab commit 227a76b64718888c1687cc237463aa000ae6fb2b Author: Christoph Hellwig Date: Mon Jan 14 21:14:08 2019 +0100 swiotlb: clear io_tlb_start and io_tlb_end in swiotlb_exit Otherwise is_swiotlb_buffer will return false positives when we first initialize a swiotlb buffer, but then free it because we have an IOMMU available. Fixes: 55897af63091 ("dma-direct: merge swiotlb_dma_ops into the dma_direct code") Reported-by: Sibren Vasse Signed-off-by: Christoph Hellwig Tested-by: Sibren Vasse Signed-off-by: Konrad Rzeszutek Wilk commit be3bb599d84b50d27d6077085388afabdd2ee18a Author: Masahiro Yamada Date: Mon Jan 14 17:19:57 2019 +0900 ia64: remove redundant 'export AWK' This is exported by the top Makefile. Signed-off-by: Masahiro Yamada commit b421b8a6cb87f099466fff00d1870c2db778c617 Author: Masahiro Yamada Date: Mon Jan 14 17:29:29 2019 +0900 kbuild: remove unused archmrproper No one uses archmrproper. Signed-off-by: Masahiro Yamada commit 7809167da5c86fd6bf309b33dee7a797e263342f Author: Ming Lei Date: Wed Jan 16 19:08:15 2019 +0800 block: don't lose track of REQ_INTEGRITY flag We need to pass bio->bi_opf after bio intergrity preparing, otherwise the flag of REQ_INTEGRITY may not be set on the allocated request, then breaks block integrity. Fixes: f9afca4d367b ("blk-mq: pass in request/bio flags to queue mapping") Cc: Hannes Reinecke Cc: Keith Busch Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 7fa1e2e6afa7f4c9f46528e61de6a15d9e8dffd9 Author: Andrey Konovalov Date: Fri Jan 11 14:47:40 2019 +0100 kasan, arm64: remove redundant ARCH_SLAB_MINALIGN define Defining ARCH_SLAB_MINALIGN in arch/arm64/include/asm/cache.h when KASAN is off is not needed, as it is defined in defined in include/linux/slab.h as ifndef. Signed-off-by: Andrey Konovalov Signed-off-by: Will Deacon commit 1598ecda7b239e9232dda032bfddeed9d89fab6c Author: Ard Biesheuvel Date: Tue Jan 15 20:47:07 2019 +0100 arm64: kaslr: ensure randomized quantities are clean to the PoC kaslr_early_init() is called with the kernel mapped at its link time offset, and if it returns with a non-zero offset, the kernel is unmapped and remapped again at the randomized offset. During its execution, kaslr_early_init() also randomizes the base of the module region and of the linear mapping of DRAM, and sets two variables accordingly. However, since these variables are assigned with the caches on, they may get lost during the cache maintenance that occurs when unmapping and remapping the kernel, so ensure that these values are cleaned to the PoC. Acked-by: Catalin Marinas Fixes: f80fb3a3d508 ("arm64: add support for kernel ASLR") Cc: # v4.6+ Signed-off-by: Ard Biesheuvel Signed-off-by: Will Deacon commit 2f97967503df8e45bc256a348b6f050abd2a38ed Author: James Morse Date: Tue Jan 15 18:49:17 2019 +0000 arm64: kpti: Update arm64_kernel_use_ng_mappings() when forced on Since commit b89d82ef01b3 ("arm64: kpti: Avoid rewriting early page tables when KASLR is enabled"), a kernel built with CONFIG_RANDOMIZE_BASE can decide early whether to use non-global mappings by checking the kaslr_offset(). A kernel built without CONFIG_RANDOMIZE_BASE, instead checks the cpufeature static-key. This leaves a gap where CONFIG_RANDOMIZE_BASE was enabled, no kaslr seed was provided, but kpti was forced on using the cmdline option. When the decision is made late, kpti_install_ng_mappings() will re-write the page tables, but arm64_kernel_use_ng_mappings()'s value does not change as it only tests the cpufeature static-key if CONFIG_RANDOMIZE_BASE is disabled. This function influences PROT_DEFAULT via PTE_MAYBE_NG, and causes pgattr_change_is_safe() to catch nG->G transitions when the unchanged PROT_DEFAULT is used as part of PAGE_KERNEL_RO: [ 1.942255] alternatives: patching kernel code [ 1.998288] ------------[ cut here ]------------ [ 2.000693] kernel BUG at arch/arm64/mm/mmu.c:165! [ 2.019215] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 2.020257] Modules linked in: [ 2.020807] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.0.0-rc2 #51 [ 2.021917] Hardware name: linux,dummy-virt (DT) [ 2.022790] pstate: 40000005 (nZcv daif -PAN -UAO) [ 2.023742] pc : __create_pgd_mapping+0x508/0x6d0 [ 2.024671] lr : __create_pgd_mapping+0x500/0x6d0 [ 2.058059] Process swapper/0 (pid: 1, stack limit = 0x(____ptrval____)) [ 2.059369] Call trace: [ 2.059845] __create_pgd_mapping+0x508/0x6d0 [ 2.060684] update_mapping_prot+0x48/0xd0 [ 2.061477] mark_linear_text_alias_ro+0xdc/0xe4 [ 2.070502] smp_cpus_done+0x90/0x98 [ 2.071216] smp_init+0x100/0x114 [ 2.071878] kernel_init_freeable+0xd4/0x220 [ 2.072750] kernel_init+0x10/0x100 [ 2.073455] ret_from_fork+0x10/0x18 [ 2.075414] ---[ end trace 3572f3a7782292de ]--- [ 2.076389] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b If arm64_kernel_unmapped_at_el0() is true, arm64_kernel_use_ng_mappings() should also be true. Signed-off-by: James Morse CC: Ard Biesheuvel CC: John Garry CC: Will Deacon Signed-off-by: Will Deacon commit f2f98c1d7fa81e25a5cf910edc9db4d3c6f36c1b Author: Timotej Lazar Date: Sun Jan 13 01:22:55 2019 +0100 net: phy: meson-gxl: Use the genphy_soft_reset callback Since the referenced commit, Ethernet fails to come up at boot on the board meson-gxl-s905x-libretech-cc. Fix this by re-enabling the genphy_soft_reset callback for the Amlogic Meson GXL PHY driver. Fixes: 6e2d85ec0559 ("net: phy: Stop with excessive soft reset") Signed-off-by: Timotej Lazar Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit a6c7c7aac2de6be777b9805fe21848b9a323b8ff Author: yupeng Date: Fri Jan 11 15:07:24 2019 -0800 net: add document for several snmp counters add document for below counters: TcpEstabResets TcpAttemptFails TcpOutRsts TcpExtTCPSACKDiscard TcpExtTCPDSACKIgnoredOld TcpExtTCPDSACKIgnoredNoUndo TcpExtTCPSackShifted TcpExtTCPSackMerged TcpExtTCPSackShiftFallback TcpExtTCPWantZeroWindowAdv TcpExtTCPToZeroWindowAdv TcpExtTCPFromZeroWindowAdv TcpExtDelayedACKs TcpExtDelayedACKLocked TcpExtDelayedACKLost TcpExtTCPLossProbes TcpExtTCPLossProbeRecovery Signed-off-by: yupeng Signed-off-by: David S. Miller commit 26fc181e6cacacd4837da7ffe0c871134a421600 Author: Eric Dumazet Date: Fri Jan 11 06:27:35 2019 -0800 fou, fou6: do not assume linear skbs Both gue_err() and gue6_err() incorrectly assume linear skbs. Fix them to use pskb_may_pull(). BUG: KMSAN: uninit-value in gue6_err+0x475/0xc40 net/ipv6/fou6.c:101 CPU: 0 PID: 18083 Comm: syz-executor1 Not tainted 5.0.0-rc1+ #7 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+0x173/0x1d0 lib/dump_stack.c:113 kmsan_report+0x12e/0x2a0 mm/kmsan/kmsan.c:600 __msan_warning+0x82/0xf0 mm/kmsan/kmsan_instr.c:313 gue6_err+0x475/0xc40 net/ipv6/fou6.c:101 __udp6_lib_err_encap_no_sk net/ipv6/udp.c:434 [inline] __udp6_lib_err_encap net/ipv6/udp.c:491 [inline] __udp6_lib_err+0x18d0/0x2590 net/ipv6/udp.c:522 udplitev6_err+0x118/0x130 net/ipv6/udplite.c:27 icmpv6_notify+0x462/0x9f0 net/ipv6/icmp.c:784 icmpv6_rcv+0x18ac/0x3fa0 net/ipv6/icmp.c:872 ip6_protocol_deliver_rcu+0xb5a/0x23a0 net/ipv6/ip6_input.c:394 ip6_input_finish net/ipv6/ip6_input.c:434 [inline] NF_HOOK include/linux/netfilter.h:289 [inline] ip6_input+0x2b6/0x350 net/ipv6/ip6_input.c:443 dst_input include/net/dst.h:450 [inline] ip6_rcv_finish+0x4e7/0x6d0 net/ipv6/ip6_input.c:76 NF_HOOK include/linux/netfilter.h:289 [inline] ipv6_rcv+0x34b/0x3f0 net/ipv6/ip6_input.c:272 __netif_receive_skb_one_core net/core/dev.c:4973 [inline] __netif_receive_skb net/core/dev.c:5083 [inline] process_backlog+0x756/0x10e0 net/core/dev.c:5923 napi_poll net/core/dev.c:6346 [inline] net_rx_action+0x78b/0x1a60 net/core/dev.c:6412 __do_softirq+0x53f/0x93a kernel/softirq.c:293 do_softirq_own_stack+0x49/0x80 arch/x86/entry/entry_64.S:1039 do_softirq kernel/softirq.c:338 [inline] __local_bh_enable_ip+0x16f/0x1a0 kernel/softirq.c:190 local_bh_enable+0x36/0x40 include/linux/bottom_half.h:32 rcu_read_unlock_bh include/linux/rcupdate.h:696 [inline] ip6_finish_output2+0x1d64/0x25f0 net/ipv6/ip6_output.c:121 ip6_finish_output+0xae4/0xbc0 net/ipv6/ip6_output.c:154 NF_HOOK_COND include/linux/netfilter.h:278 [inline] ip6_output+0x5ca/0x710 net/ipv6/ip6_output.c:171 dst_output include/net/dst.h:444 [inline] ip6_local_out+0x164/0x1d0 net/ipv6/output_core.c:176 ip6_send_skb+0xfa/0x390 net/ipv6/ip6_output.c:1727 udp_v6_send_skb+0x1733/0x1d20 net/ipv6/udp.c:1169 udpv6_sendmsg+0x424e/0x45d0 net/ipv6/udp.c:1466 inet_sendmsg+0x54a/0x720 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg net/socket.c:631 [inline] ___sys_sendmsg+0xdb9/0x11b0 net/socket.c:2116 __sys_sendmmsg+0x580/0xad0 net/socket.c:2211 __do_sys_sendmmsg net/socket.c:2240 [inline] __se_sys_sendmmsg+0xbd/0xe0 net/socket.c:2237 __x64_sys_sendmmsg+0x56/0x70 net/socket.c:2237 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 RIP: 0033:0x457ec9 Code: 6d b7 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 3b b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f4a5204fc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000457ec9 RDX: 00000000040001ab RSI: 0000000020000240 RDI: 0000000000000003 RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f4a520506d4 R13: 00000000004c4ce5 R14: 00000000004d85d8 R15: 00000000ffffffff Uninit was created at: kmsan_save_stack_with_flags mm/kmsan/kmsan.c:205 [inline] kmsan_internal_poison_shadow+0x92/0x150 mm/kmsan/kmsan.c:159 kmsan_kmalloc+0xa6/0x130 mm/kmsan/kmsan_hooks.c:176 kmsan_slab_alloc+0xe/0x10 mm/kmsan/kmsan_hooks.c:185 slab_post_alloc_hook mm/slab.h:446 [inline] slab_alloc_node mm/slub.c:2754 [inline] __kmalloc_node_track_caller+0xe9e/0xff0 mm/slub.c:4377 __kmalloc_reserve net/core/skbuff.c:140 [inline] __alloc_skb+0x309/0xa20 net/core/skbuff.c:208 alloc_skb include/linux/skbuff.h:1012 [inline] alloc_skb_with_frags+0x1c7/0xac0 net/core/skbuff.c:5288 sock_alloc_send_pskb+0xafd/0x10a0 net/core/sock.c:2091 sock_alloc_send_skb+0xca/0xe0 net/core/sock.c:2108 __ip6_append_data+0x42ed/0x5dc0 net/ipv6/ip6_output.c:1443 ip6_append_data+0x3c2/0x650 net/ipv6/ip6_output.c:1619 icmp6_send+0x2f5c/0x3c40 net/ipv6/icmp.c:574 icmpv6_send+0xe5/0x110 net/ipv6/ip6_icmp.c:43 ip6_link_failure+0x5c/0x2c0 net/ipv6/route.c:2231 dst_link_failure include/net/dst.h:427 [inline] vti_xmit net/ipv4/ip_vti.c:229 [inline] vti_tunnel_xmit+0xf3b/0x1ea0 net/ipv4/ip_vti.c:265 __netdev_start_xmit include/linux/netdevice.h:4382 [inline] netdev_start_xmit include/linux/netdevice.h:4391 [inline] xmit_one net/core/dev.c:3278 [inline] dev_hard_start_xmit+0x604/0xc40 net/core/dev.c:3294 __dev_queue_xmit+0x2e48/0x3b80 net/core/dev.c:3864 dev_queue_xmit+0x4b/0x60 net/core/dev.c:3897 neigh_direct_output+0x42/0x50 net/core/neighbour.c:1511 neigh_output include/net/neighbour.h:508 [inline] ip6_finish_output2+0x1d4e/0x25f0 net/ipv6/ip6_output.c:120 ip6_finish_output+0xae4/0xbc0 net/ipv6/ip6_output.c:154 NF_HOOK_COND include/linux/netfilter.h:278 [inline] ip6_output+0x5ca/0x710 net/ipv6/ip6_output.c:171 dst_output include/net/dst.h:444 [inline] ip6_local_out+0x164/0x1d0 net/ipv6/output_core.c:176 ip6_send_skb+0xfa/0x390 net/ipv6/ip6_output.c:1727 udp_v6_send_skb+0x1733/0x1d20 net/ipv6/udp.c:1169 udpv6_sendmsg+0x424e/0x45d0 net/ipv6/udp.c:1466 inet_sendmsg+0x54a/0x720 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg net/socket.c:631 [inline] ___sys_sendmsg+0xdb9/0x11b0 net/socket.c:2116 __sys_sendmmsg+0x580/0xad0 net/socket.c:2211 __do_sys_sendmmsg net/socket.c:2240 [inline] __se_sys_sendmmsg+0xbd/0xe0 net/socket.c:2237 __x64_sys_sendmmsg+0x56/0x70 net/socket.c:2237 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 Fixes: b8a51b38e4d4 ("fou, fou6: ICMP error handlers for FoU and GUE") Signed-off-by: Eric Dumazet Reported-by: syzbot Cc: Stefano Brivio Cc: Sabrina Dubroca Signed-off-by: David S. Miller commit 5216bd77798e2ed773ecd45f3f368dcaec63e5dd Author: Davide Caratti Date: Fri Jan 11 15:08:23 2019 +0100 selftests: tc-testing: fix tunnel_key failure if dst_port is unspecified After commit 1c25324caf82 ("net/sched: act_tunnel_key: Don't dump dst port if it wasn't set"), act_tunnel_key doesn't dump anymore the destination port, unless it was explicitly configured. This caused systematic failures in the following TDC test case: 7a88 - Add tunnel_key action with cookie parameter Avoid matching zero values of TCA_TUNNEL_KEY_ENC_DST_PORT to let the test pass again. Signed-off-by: Davide Caratti Signed-off-by: David S. Miller commit e413615502a3324daba038f529932ba9a5248af0 Author: Davide Caratti Date: Fri Jan 11 11:49:58 2019 +0100 selftests: tc-testing: drop test on missing tunnel key id After merge of commit 80ef0f22ceda ("net/sched: act_tunnel_key: Allow key-less tunnels"), act_tunnel_key does not reject anymore requests to install 'set' rules where the key id is missing. Therefore, drop the following TDC testcase: ba4e - Add tunnel_key set action with missing mandatory id parameter because it's going to become a systematic fail as soon as userspace iproute2 will start supporting key-less tunnels. Signed-off-by: Davide Caratti Signed-off-by: David S. Miller commit e0a7328fad9979104f73e19bedca821ef3262ae1 Author: Andrew Lunn Date: Fri Jan 11 00:15:21 2019 +0100 net: phy: marvell: Fix deadlock from wrong locking m88e1318_set_wol() takes the lock as part of phy_select_page(). Don't take the lock again with phy_read(), use the unlocked __phy_read(). Fixes: 424ca4c55121 ("net: phy: marvell: fix paged access races") Reported-by: Åke Rehnman Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 8cbcdc1a51999ca81db2956608b917aacd28d837 Author: Andrew Lunn Date: Thu Jan 10 22:48:36 2019 +0100 net: phy: marvell: Errata for mv88e6390 internal PHYs The VOD can be out of spec, unless some magic value is poked into an undocumented register in an undocumented page. Fixes: e4cf8a38fc0d ("net: phy: Marvell: Add mv88e6390 internal PHY") Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit f275ee0fa3a06eb87edc229749cf1eb18f0663fa Author: Greg Kroah-Hartman Date: Thu Jan 10 21:24:13 2019 +0100 IN_BADCLASS: fix macro to actually work Commit 65cab850f0ee ("net: Allow class-e address assignment via ifconfig ioctl") modified the IN_BADCLASS macro a bit, but unfortunatly one too many '(' characters were added to the line, making any code that used it, not build properly. Also, the macro now compares an unsigned with a signed value, which isn't ok, so fix that up by making both types match properly. Reported-by: Christopher Ferris Fixes: 65cab850f0ee ("net: Allow class-e address assignment via ifconfig ioctl") Cc: Dave Taht Signed-off-by: Greg Kroah-Hartman Signed-off-by: David S. Miller commit 13d7f46386e060df31b727c9975e38306fa51e7a Author: Willem de Bruijn Date: Thu Jan 10 14:40:33 2019 -0500 tcp: allow MSG_ZEROCOPY transmission also in CLOSE_WAIT state TCP transmission with MSG_ZEROCOPY fails if the peer closes its end of the connection and so transitions this socket to CLOSE_WAIT state. Transmission in close wait state is acceptable. Other similar tests in the stack (e.g., in FastOpen) accept both states. Relax this test, too. Link: https://www.mail-archive.com/netdev@vger.kernel.org/msg276886.html Link: https://www.mail-archive.com/netdev@vger.kernel.org/msg227390.html Fixes: f214f915e7db ("tcp: enable MSG_ZEROCOPY") Reported-by: Marek Majkowski Signed-off-by: Willem de Bruijn CC: Yuchung Cheng CC: Neal Cardwell CC: Soheil Hassas Yeganeh CC: Alexey Kodanev Acked-by: Soheil Hassas Yeganeh Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 1d16073a326891c2a964e4cb95bc18fbcafb5f74 Author: Heiner Kallweit Date: Thu Jan 10 20:22:26 2019 +0100 net: phy: micrel: set soft_reset callback to genphy_soft_reset for KSZ9031 So far genphy_soft_reset was used automatically if the PHY driver didn't implement the soft_reset callback. This changed with the mentioned commit and broke KSZ9031. To fix this configure the KSZ9031 PHY driver to use genphy_soft_reset. Fixes: 6e2d85ec0559 ("net: phy: Stop with excessive soft reset") Reported-by: Tony Lindgren Signed-off-by: Heiner Kallweit Tested-by: Tony Lindgren Tested-by: Sekhar Nori Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 9174c3df1cd181c14913138d50ccbe539bb08335 Author: Davide Caratti Date: Thu Jan 10 20:21:02 2019 +0100 net/sched: act_tunnel_key: fix memory leak in case of action replace running the following TDC test cases: 7afc - Replace tunnel_key set action with all parameters 364d - Replace tunnel_key set action with all parameters and cookie it's possible to trigger kmemleak warnings like: unreferenced object 0xffff94797127ab40 (size 192): comm "tc", pid 3248, jiffies 4300565293 (age 1006.862s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 c0 93 f9 8a ff ff ff ff ................ 41 84 ee 89 ff ff ff ff 00 00 00 00 00 00 00 00 A............... backtrace: [<000000001e85b61c>] tunnel_key_init+0x31d/0x820 [act_tunnel_key] [<000000007f3f6ee7>] tcf_action_init_1+0x384/0x4c0 [<00000000e89e3ded>] tcf_action_init+0x12b/0x1a0 [<00000000c1c8c0f8>] tcf_action_add+0x73/0x170 [<0000000095a9fc28>] tc_ctl_action+0x122/0x160 [<000000004bebeac5>] rtnetlink_rcv_msg+0x263/0x2d0 [<000000009fd862dd>] netlink_rcv_skb+0x4a/0x110 [<00000000b55199e7>] netlink_unicast+0x1a0/0x250 [<000000004996cd21>] netlink_sendmsg+0x2c1/0x3c0 [<000000004d6a94b4>] sock_sendmsg+0x36/0x40 [<000000005d9f0208>] ___sys_sendmsg+0x280/0x2f0 [<00000000dec19023>] __sys_sendmsg+0x5e/0xa0 [<000000004b82ac81>] do_syscall_64+0x5b/0x180 [<00000000a0f1209a>] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [<000000002926b2ab>] 0xffffffffffffffff when the tunnel_key action is replaced, the kernel forgets to release the dst metadata: ensure they are released by tunnel_key_init(), the same way it's done in tunnel_key_release(). Fixes: d0f6dd8a914f4 ("net/sched: Introduce act_tunnel_key") Signed-off-by: Davide Caratti Acked-by: Cong Wang Signed-off-by: David S. Miller commit e122d845a01ece2ddd28b2f125ef2db66b8b627a Author: David Howells Date: Thu Jan 10 16:59:13 2019 +0000 Revert "rxrpc: Allow failed client calls to be retried" The changes introduced to allow rxrpc calls to be retried creates an issue when it comes to refcounting afs_call structs. The problem is that when rxrpc_send_data() queues the last packet for an asynchronous call, the following sequence can occur: (1) The notify_end_tx callback is invoked which causes the state in the afs_call to be changed from AFS_CALL_CL_REQUESTING or AFS_CALL_SV_REPLYING. (2) afs_deliver_to_call() can then process event notifications from rxrpc on the async_work queue. (3) Delivery of events, such as an abort from the server, can cause the afs_call state to be changed to AFS_CALL_COMPLETE on async_work. (4) For an asynchronous call, afs_process_async_call() notes that the call is complete and tried to clean up all the refs on async_work. (5) rxrpc_send_data() might return the amount of data transferred (success) or an error - which could in turn reflect a local error or a received error. Synchronising the clean up after rxrpc_kernel_send_data() returns an error with the asynchronous cleanup is then tricky to get right. Mostly revert commit c038a58ccfd6704d4d7d60ed3d6a0fca13cf13a4. The two API functions the original commit added aren't currently used. This makes rxrpc_kernel_send_data() always return successfully if it queued the data it was given. Note that this doesn't affect synchronous calls since their Rx notification function merely pokes a wait queue and does not refcounting. The asynchronous call notification function *has* to do refcounting and pass a ref over the work item to avoid the need to sync the workqueue in call cleanup. Signed-off-by: David Howells Signed-off-by: David S. Miller commit 47bfa6d9dc8c060bf56554a465c9031e286d2f80 Merge: 7939f8beecf1c 5b0e7310a2a33 Author: Linus Torvalds Date: Wed Jan 16 17:06:39 2019 +1200 Merge tag 'selinux-pr-20190115' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull SELinux fix from Paul Moore: "One small patch to fix a potential NULL dereference on a failed SELinux policy load" * tag 'selinux-pr-20190115' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: fix GPF on invalid policy commit 70a44f9f6e4297e013de29088608ab2c6fb642f7 Merge: d62f38c295e56 2753ca5d9009c Author: David S. Miller Date: Tue Jan 15 20:29:21 2019 -0800 Merge branch 'tipc-uninit-values' Ying Xue says: ==================== tipc: fix uninit-value issues reported by syzbot Recently, syzbot complained that TIPC module exits several issues associated with uninit-value type. So, in this series, we try to fix them as many as possible. ==================== Signed-off-by: David S. Miller commit 2753ca5d9009c180dbfd4c802c80983b4b6108d1 Author: Ying Xue Date: Mon Jan 14 17:22:29 2019 +0800 tipc: fix uninit-value in tipc_nl_compat_doit BUG: KMSAN: uninit-value in tipc_nl_compat_doit+0x404/0xa10 net/tipc/netlink_compat.c:335 CPU: 0 PID: 4514 Comm: syz-executor485 Not tainted 4.16.0+ #87 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x185/0x1d0 lib/dump_stack.c:53 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:683 tipc_nl_compat_doit+0x404/0xa10 net/tipc/netlink_compat.c:335 tipc_nl_compat_recv+0x164b/0x2700 net/tipc/netlink_compat.c:1153 genl_family_rcv_msg net/netlink/genetlink.c:599 [inline] genl_rcv_msg+0x1686/0x1810 net/netlink/genetlink.c:624 netlink_rcv_skb+0x378/0x600 net/netlink/af_netlink.c:2447 genl_rcv+0x63/0x80 net/netlink/genetlink.c:635 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x166b/0x1740 net/netlink/af_netlink.c:1337 netlink_sendmsg+0x1048/0x1310 net/netlink/af_netlink.c:1900 sock_sendmsg_nosec net/socket.c:630 [inline] sock_sendmsg net/socket.c:640 [inline] ___sys_sendmsg+0xec0/0x1310 net/socket.c:2046 __sys_sendmsg net/socket.c:2080 [inline] SYSC_sendmsg+0x2a3/0x3d0 net/socket.c:2091 SyS_sendmsg+0x54/0x80 net/socket.c:2087 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x3d/0xa2 RIP: 0033:0x43fda9 RSP: 002b:00007ffd0c184ba8 EFLAGS: 00000213 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043fda9 RDX: 0000000000000000 RSI: 0000000020023000 RDI: 0000000000000003 RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8 R10: 00000000004002c8 R11: 0000000000000213 R12: 00000000004016d0 R13: 0000000000401760 R14: 0000000000000000 R15: 0000000000000000 Uninit was created at: kmsan_save_stack_with_flags mm/kmsan/kmsan.c:278 [inline] kmsan_internal_poison_shadow+0xb8/0x1b0 mm/kmsan/kmsan.c:188 kmsan_kmalloc+0x94/0x100 mm/kmsan/kmsan.c:314 kmsan_slab_alloc+0x11/0x20 mm/kmsan/kmsan.c:321 slab_post_alloc_hook mm/slab.h:445 [inline] slab_alloc_node mm/slub.c:2737 [inline] __kmalloc_node_track_caller+0xaed/0x11c0 mm/slub.c:4369 __kmalloc_reserve net/core/skbuff.c:138 [inline] __alloc_skb+0x2cf/0x9f0 net/core/skbuff.c:206 alloc_skb include/linux/skbuff.h:984 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1183 [inline] netlink_sendmsg+0x9a6/0x1310 net/netlink/af_netlink.c:1875 sock_sendmsg_nosec net/socket.c:630 [inline] sock_sendmsg net/socket.c:640 [inline] ___sys_sendmsg+0xec0/0x1310 net/socket.c:2046 __sys_sendmsg net/socket.c:2080 [inline] SYSC_sendmsg+0x2a3/0x3d0 net/socket.c:2091 SyS_sendmsg+0x54/0x80 net/socket.c:2087 do_syscall_64+0x309/0x430 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x3d/0xa2 In tipc_nl_compat_recv(), when the len variable returned by nlmsg_attrlen() is 0, the message is still treated as a valid one, which is obviously unresonable. When len is zero, it means the message not only doesn't contain any valid TLV payload, but also TLV header is not included. Under this stituation, tlv_type field in TLV header is still accessed in tipc_nl_compat_dumpit() or tipc_nl_compat_doit(), but the field space is obviously illegal. Of course, it is not initialized. Reported-by: syzbot+bca0dc46634781f08b38@syzkaller.appspotmail.com Reported-by: syzbot+6bdb590321a7ae40c1a6@syzkaller.appspotmail.com Signed-off-by: Ying Xue Signed-off-by: David S. Miller commit 974cb0e3e7c963ced06c4e32c5b2884173fa5e01 Author: Ying Xue Date: Mon Jan 14 17:22:28 2019 +0800 tipc: fix uninit-value in tipc_nl_compat_name_table_dump syzbot reported: BUG: KMSAN: uninit-value in __arch_swab32 arch/x86/include/uapi/asm/swab.h:10 [inline] BUG: KMSAN: uninit-value in __fswab32 include/uapi/linux/swab.h:59 [inline] BUG: KMSAN: uninit-value in tipc_nl_compat_name_table_dump+0x4a8/0xba0 net/tipc/netlink_compat.c:826 CPU: 0 PID: 6290 Comm: syz-executor848 Not tainted 4.19.0-rc8+ #70 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+0x306/0x460 lib/dump_stack.c:113 kmsan_report+0x1a2/0x2e0 mm/kmsan/kmsan.c:917 __msan_warning+0x7c/0xe0 mm/kmsan/kmsan_instr.c:500 __arch_swab32 arch/x86/include/uapi/asm/swab.h:10 [inline] __fswab32 include/uapi/linux/swab.h:59 [inline] tipc_nl_compat_name_table_dump+0x4a8/0xba0 net/tipc/netlink_compat.c:826 __tipc_nl_compat_dumpit+0x59e/0xdb0 net/tipc/netlink_compat.c:205 tipc_nl_compat_dumpit+0x63a/0x820 net/tipc/netlink_compat.c:270 tipc_nl_compat_handle net/tipc/netlink_compat.c:1151 [inline] tipc_nl_compat_recv+0x1402/0x2760 net/tipc/netlink_compat.c:1210 genl_family_rcv_msg net/netlink/genetlink.c:601 [inline] genl_rcv_msg+0x185c/0x1a20 net/netlink/genetlink.c:626 netlink_rcv_skb+0x394/0x640 net/netlink/af_netlink.c:2454 genl_rcv+0x63/0x80 net/netlink/genetlink.c:637 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x166d/0x1720 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x1391/0x1420 net/netlink/af_netlink.c:1908 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg net/socket.c:631 [inline] ___sys_sendmsg+0xe47/0x1200 net/socket.c:2116 __sys_sendmsg net/socket.c:2154 [inline] __do_sys_sendmsg net/socket.c:2163 [inline] __se_sys_sendmsg+0x307/0x460 net/socket.c:2161 __x64_sys_sendmsg+0x4a/0x70 net/socket.c:2161 do_syscall_64+0xbe/0x100 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 RIP: 0033:0x440179 Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 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 0f 83 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ffecec49318 EFLAGS: 00000213 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440179 RDX: 0000000000000000 RSI: 0000000020000100 RDI: 0000000000000003 RBP: 00000000006ca018 R08: 0000000000000000 R09: 00000000004002c8 R10: 0000000000000000 R11: 0000000000000213 R12: 0000000000401a00 R13: 0000000000401a90 R14: 0000000000000000 R15: 0000000000000000 Uninit was created at: kmsan_save_stack_with_flags mm/kmsan/kmsan.c:255 [inline] kmsan_internal_poison_shadow+0xc8/0x1d0 mm/kmsan/kmsan.c:180 kmsan_kmalloc+0xa4/0x120 mm/kmsan/kmsan_hooks.c:104 kmsan_slab_alloc+0x10/0x20 mm/kmsan/kmsan_hooks.c:113 slab_post_alloc_hook mm/slab.h:446 [inline] slab_alloc_node mm/slub.c:2727 [inline] __kmalloc_node_track_caller+0xb43/0x1400 mm/slub.c:4360 __kmalloc_reserve net/core/skbuff.c:138 [inline] __alloc_skb+0x422/0xe90 net/core/skbuff.c:206 alloc_skb include/linux/skbuff.h:996 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1189 [inline] netlink_sendmsg+0xcaf/0x1420 net/netlink/af_netlink.c:1883 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg net/socket.c:631 [inline] ___sys_sendmsg+0xe47/0x1200 net/socket.c:2116 __sys_sendmsg net/socket.c:2154 [inline] __do_sys_sendmsg net/socket.c:2163 [inline] __se_sys_sendmsg+0x307/0x460 net/socket.c:2161 __x64_sys_sendmsg+0x4a/0x70 net/socket.c:2161 do_syscall_64+0xbe/0x100 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 We cannot take for granted the thing that the length of data contained in TLV is longer than the size of struct tipc_name_table_query in tipc_nl_compat_name_table_dump(). Reported-by: syzbot+06e771a754829716a327@syzkaller.appspotmail.com Signed-off-by: Ying Xue Signed-off-by: David S. Miller commit edf5ff04a45750ac8ce2435974f001dc9cfbf055 Author: Ying Xue Date: Mon Jan 14 17:22:27 2019 +0800 tipc: fix uninit-value in tipc_nl_compat_link_set syzbot reports following splat: BUG: KMSAN: uninit-value in strlen+0x3b/0xa0 lib/string.c:486 CPU: 1 PID: 9306 Comm: syz-executor172 Not tainted 4.20.0-rc7+ #2 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+0x173/0x1d0 lib/dump_stack.c:113 kmsan_report+0x12e/0x2a0 mm/kmsan/kmsan.c:613 __msan_warning+0x82/0xf0 mm/kmsan/kmsan_instr.c:313 strlen+0x3b/0xa0 lib/string.c:486 nla_put_string include/net/netlink.h:1154 [inline] __tipc_nl_compat_link_set net/tipc/netlink_compat.c:708 [inline] tipc_nl_compat_link_set+0x929/0x1220 net/tipc/netlink_compat.c:744 __tipc_nl_compat_doit net/tipc/netlink_compat.c:311 [inline] tipc_nl_compat_doit+0x3aa/0xaf0 net/tipc/netlink_compat.c:344 tipc_nl_compat_handle net/tipc/netlink_compat.c:1107 [inline] tipc_nl_compat_recv+0x14d7/0x2760 net/tipc/netlink_compat.c:1210 genl_family_rcv_msg net/netlink/genetlink.c:601 [inline] genl_rcv_msg+0x185f/0x1a60 net/netlink/genetlink.c:626 netlink_rcv_skb+0x444/0x640 net/netlink/af_netlink.c:2477 genl_rcv+0x63/0x80 net/netlink/genetlink.c:637 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline] netlink_unicast+0xf40/0x1020 net/netlink/af_netlink.c:1336 netlink_sendmsg+0x127f/0x1300 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg net/socket.c:631 [inline] ___sys_sendmsg+0xdb9/0x11b0 net/socket.c:2116 __sys_sendmsg net/socket.c:2154 [inline] __do_sys_sendmsg net/socket.c:2163 [inline] __se_sys_sendmsg+0x305/0x460 net/socket.c:2161 __x64_sys_sendmsg+0x4a/0x70 net/socket.c:2161 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 The uninitialised access happened in nla_put_string(skb, TIPC_NLA_LINK_NAME, lc->name) This is because lc->name string is not validated before it's used. Reported-by: syzbot+d78b8a29241a195aefb8@syzkaller.appspotmail.com Signed-off-by: Ying Xue Signed-off-by: David S. Miller commit 0762216c0ad2a2fccd63890648eca491f2c83d9a Author: Ying Xue Date: Mon Jan 14 17:22:26 2019 +0800 tipc: fix uninit-value in tipc_nl_compat_bearer_enable syzbot reported: BUG: KMSAN: uninit-value in strlen+0x3b/0xa0 lib/string.c:484 CPU: 1 PID: 6371 Comm: syz-executor652 Not tainted 4.19.0-rc8+ #70 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+0x306/0x460 lib/dump_stack.c:113 kmsan_report+0x1a2/0x2e0 mm/kmsan/kmsan.c:917 __msan_warning+0x7c/0xe0 mm/kmsan/kmsan_instr.c:500 strlen+0x3b/0xa0 lib/string.c:484 nla_put_string include/net/netlink.h:1011 [inline] tipc_nl_compat_bearer_enable+0x238/0x7b0 net/tipc/netlink_compat.c:389 __tipc_nl_compat_doit net/tipc/netlink_compat.c:311 [inline] tipc_nl_compat_doit+0x39f/0xae0 net/tipc/netlink_compat.c:344 tipc_nl_compat_recv+0x147c/0x2760 net/tipc/netlink_compat.c:1107 genl_family_rcv_msg net/netlink/genetlink.c:601 [inline] genl_rcv_msg+0x185c/0x1a20 net/netlink/genetlink.c:626 netlink_rcv_skb+0x394/0x640 net/netlink/af_netlink.c:2454 genl_rcv+0x63/0x80 net/netlink/genetlink.c:637 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x166d/0x1720 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x1391/0x1420 net/netlink/af_netlink.c:1908 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg net/socket.c:631 [inline] ___sys_sendmsg+0xe47/0x1200 net/socket.c:2116 __sys_sendmsg net/socket.c:2154 [inline] __do_sys_sendmsg net/socket.c:2163 [inline] __se_sys_sendmsg+0x307/0x460 net/socket.c:2161 __x64_sys_sendmsg+0x4a/0x70 net/socket.c:2161 do_syscall_64+0xbe/0x100 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 RIP: 0033:0x440179 Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 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 0f 83 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fffef7beee8 EFLAGS: 00000213 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440179 RDX: 0000000000000000 RSI: 0000000020000100 RDI: 0000000000000003 RBP: 00000000006ca018 R08: 0000000000000000 R09: 00000000004002c8 R10: 0000000000000000 R11: 0000000000000213 R12: 0000000000401a00 R13: 0000000000401a90 R14: 0000000000000000 R15: 0000000000000000 Uninit was created at: kmsan_save_stack_with_flags mm/kmsan/kmsan.c:255 [inline] kmsan_internal_poison_shadow+0xc8/0x1d0 mm/kmsan/kmsan.c:180 kmsan_kmalloc+0xa4/0x120 mm/kmsan/kmsan_hooks.c:104 kmsan_slab_alloc+0x10/0x20 mm/kmsan/kmsan_hooks.c:113 slab_post_alloc_hook mm/slab.h:446 [inline] slab_alloc_node mm/slub.c:2727 [inline] __kmalloc_node_track_caller+0xb43/0x1400 mm/slub.c:4360 __kmalloc_reserve net/core/skbuff.c:138 [inline] __alloc_skb+0x422/0xe90 net/core/skbuff.c:206 alloc_skb include/linux/skbuff.h:996 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1189 [inline] netlink_sendmsg+0xcaf/0x1420 net/netlink/af_netlink.c:1883 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg net/socket.c:631 [inline] ___sys_sendmsg+0xe47/0x1200 net/socket.c:2116 __sys_sendmsg net/socket.c:2154 [inline] __do_sys_sendmsg net/socket.c:2163 [inline] __se_sys_sendmsg+0x307/0x460 net/socket.c:2161 __x64_sys_sendmsg+0x4a/0x70 net/socket.c:2161 do_syscall_64+0xbe/0x100 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 The root cause is that we don't validate whether bear name is a valid string in tipc_nl_compat_bearer_enable(). Meanwhile, we also fix the same issue in the following functions: tipc_nl_compat_bearer_disable() tipc_nl_compat_link_stat_dump() tipc_nl_compat_media_set() tipc_nl_compat_bearer_set() Reported-by: syzbot+b33d5cae0efd35dbfe77@syzkaller.appspotmail.com Signed-off-by: Ying Xue Signed-off-by: David S. Miller commit 8b66fee7f8ee18f9c51260e7a43ab37db5177a05 Author: Ying Xue Date: Mon Jan 14 17:22:25 2019 +0800 tipc: fix uninit-value in tipc_nl_compat_link_reset_stats syzbot reports following splat: BUG: KMSAN: uninit-value in strlen+0x3b/0xa0 lib/string.c:486 CPU: 1 PID: 11057 Comm: syz-executor0 Not tainted 4.20.0-rc7+ #2 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+0x173/0x1d0 lib/dump_stack.c:113 kmsan_report+0x12e/0x2a0 mm/kmsan/kmsan.c:613 __msan_warning+0x82/0xf0 mm/kmsan/kmsan_instr.c:295 strlen+0x3b/0xa0 lib/string.c:486 nla_put_string include/net/netlink.h:1154 [inline] tipc_nl_compat_link_reset_stats+0x1f0/0x360 net/tipc/netlink_compat.c:760 __tipc_nl_compat_doit net/tipc/netlink_compat.c:311 [inline] tipc_nl_compat_doit+0x3aa/0xaf0 net/tipc/netlink_compat.c:344 tipc_nl_compat_handle net/tipc/netlink_compat.c:1107 [inline] tipc_nl_compat_recv+0x14d7/0x2760 net/tipc/netlink_compat.c:1210 genl_family_rcv_msg net/netlink/genetlink.c:601 [inline] genl_rcv_msg+0x185f/0x1a60 net/netlink/genetlink.c:626 netlink_rcv_skb+0x444/0x640 net/netlink/af_netlink.c:2477 genl_rcv+0x63/0x80 net/netlink/genetlink.c:637 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline] netlink_unicast+0xf40/0x1020 net/netlink/af_netlink.c:1336 netlink_sendmsg+0x127f/0x1300 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg net/socket.c:631 [inline] ___sys_sendmsg+0xdb9/0x11b0 net/socket.c:2116 __sys_sendmsg net/socket.c:2154 [inline] __do_sys_sendmsg net/socket.c:2163 [inline] __se_sys_sendmsg+0x305/0x460 net/socket.c:2161 __x64_sys_sendmsg+0x4a/0x70 net/socket.c:2161 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 RIP: 0033:0x457ec9 Code: 6d b7 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 3b b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f2557338c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457ec9 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000003 RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f25573396d4 R13: 00000000004cb478 R14: 00000000004d86c8 R15: 00000000ffffffff Uninit was created at: kmsan_save_stack_with_flags mm/kmsan/kmsan.c:204 [inline] kmsan_internal_poison_shadow+0x92/0x150 mm/kmsan/kmsan.c:158 kmsan_kmalloc+0xa6/0x130 mm/kmsan/kmsan_hooks.c:176 kmsan_slab_alloc+0xe/0x10 mm/kmsan/kmsan_hooks.c:185 slab_post_alloc_hook mm/slab.h:446 [inline] slab_alloc_node mm/slub.c:2759 [inline] __kmalloc_node_track_caller+0xe18/0x1030 mm/slub.c:4383 __kmalloc_reserve net/core/skbuff.c:137 [inline] __alloc_skb+0x309/0xa20 net/core/skbuff.c:205 alloc_skb include/linux/skbuff.h:998 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1182 [inline] netlink_sendmsg+0xb82/0x1300 net/netlink/af_netlink.c:1892 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg net/socket.c:631 [inline] ___sys_sendmsg+0xdb9/0x11b0 net/socket.c:2116 __sys_sendmsg net/socket.c:2154 [inline] __do_sys_sendmsg net/socket.c:2163 [inline] __se_sys_sendmsg+0x305/0x460 net/socket.c:2161 __x64_sys_sendmsg+0x4a/0x70 net/socket.c:2161 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 The uninitialised access happened in tipc_nl_compat_link_reset_stats: nla_put_string(skb, TIPC_NLA_LINK_NAME, name) This is because name string is not validated before it's used. Reported-by: syzbot+e01d94b5a4c266be6e4c@syzkaller.appspotmail.com Signed-off-by: Ying Xue Signed-off-by: David S. Miller commit a88289f4ddee4165d5f796bd99e09eec3133c16b Author: Ying Xue Date: Mon Jan 14 17:22:24 2019 +0800 tipc: fix uninit-value in in tipc_conn_rcv_sub syzbot reported: BUG: KMSAN: uninit-value in tipc_conn_rcv_sub+0x184/0x950 net/tipc/topsrv.c:373 CPU: 0 PID: 66 Comm: kworker/u4:4 Not tainted 4.17.0-rc3+ #88 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: tipc_rcv tipc_conn_recv_work Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x185/0x1d0 lib/dump_stack.c:113 kmsan_report+0x142/0x240 mm/kmsan/kmsan.c:1067 __msan_warning_32+0x6c/0xb0 mm/kmsan/kmsan_instr.c:683 tipc_conn_rcv_sub+0x184/0x950 net/tipc/topsrv.c:373 tipc_conn_rcv_from_sock net/tipc/topsrv.c:409 [inline] tipc_conn_recv_work+0x3cd/0x560 net/tipc/topsrv.c:424 process_one_work+0x12c6/0x1f60 kernel/workqueue.c:2145 worker_thread+0x113c/0x24f0 kernel/workqueue.c:2279 kthread+0x539/0x720 kernel/kthread.c:239 ret_from_fork+0x35/0x40 arch/x86/entry/entry_64.S:412 Local variable description: ----s.i@tipc_conn_recv_work Variable was created at: tipc_conn_recv_work+0x65/0x560 net/tipc/topsrv.c:419 process_one_work+0x12c6/0x1f60 kernel/workqueue.c:2145 In tipc_conn_rcv_from_sock(), it always supposes the length of message received from sock_recvmsg() is not smaller than the size of struct tipc_subscr. However, this assumption is false. Especially when the length of received message is shorter than struct tipc_subscr size, we will end up touching uninitialized fields in tipc_conn_rcv_sub(). Reported-by: syzbot+8951a3065ee7fd6d6e23@syzkaller.appspotmail.com Reported-by: syzbot+75e6e042c5bbf691fc82@syzkaller.appspotmail.com Signed-off-by: Ying Xue Signed-off-by: David S. Miller commit d62f38c295e56147e8298af1e0e0ec9e7cc14937 Merge: 80b3671e93779 8c6c37fdc20ec Author: David S. Miller Date: Tue Jan 15 20:12:01 2019 -0800 Merge branch 'sch_cake-leaf-qdisc-fixes' Toke Høiland-Jørgensen says: ==================== sched: Fix qdisc interactions exposed by using sch_cake as a leaf qdisc This series fixes a couple of issues exposed by running sch_cake as a leaf qdisc in an HFSC tree, which were discovered and reported by Pete Heist. The interaction between CAKE's GSO splitting and the parent qdisc's notion of its own queue length could cause queue stalls. While investigating the report, I also noticed that several qdiscs would dereference the skb pointer after dequeue, which is potentially problematic since the GSO splitting code also frees the original skb. See the individual patches in the series for details. ==================== Signed-off-by: David S. Miller commit 8c6c37fdc20ec9ffaa342f827a8e20afe736fb0c Author: Toke Høiland-Jørgensen Date: Wed Jan 9 17:09:44 2019 +0100 sch_cake: Correctly update parent qlen when splitting GSO packets To ensure parent qdiscs have the same notion of the number of enqueued packets even after splitting a GSO packet, update the qdisc tree with the number of packets that was added due to the split. Reported-by: Pete Heist Tested-by: Pete Heist Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 37d9cf1a3ce35de3df6f7d209bfb1f50cf188cea Author: Toke Høiland-Jørgensen Date: Wed Jan 9 17:09:43 2019 +0100 sched: Fix detection of empty queues in child qdiscs Several qdiscs check on enqueue whether the packet was enqueued to a class with an empty queue, in which case the class is activated. This is done by checking if the qlen is exactly 1 after enqueue. However, if GSO splitting is enabled in the child qdisc, a single packet can result in a qlen longer than 1. This means the activation check fails, leading to a stalled queue. Fix this by checking if the queue is empty *before* enqueue, and running the activation logic if this was the case. Reported-by: Pete Heist Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit f6bab199315b70fd83fe3ee0947bc84c7a35f3d4 Author: Toke Høiland-Jørgensen Date: Wed Jan 9 17:09:42 2019 +0100 sched: Avoid dereferencing skb pointer after child enqueue Parent qdiscs may dereference the pointer to the enqueued skb after enqueue. However, both CAKE and TBF call consume_skb() on the original skb when splitting GSO packets, leading to a potential use-after-free in the parent. Fix this by avoiding dereferencing the skb pointer after enqueueing to the child. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller commit 6e8ccb4f624a73c56fc6ef0c45bcf91ca80703c3 Author: Stanislav Fomichev Date: Tue Jan 15 14:03:27 2019 -0800 tools/bpf: properly account for libbfd variations On some platforms, in order to link against libbfd, we need to link against liberty and even possibly libz. Account for that in the bpftool Makefile. We now have proper feature detection for each case, so handle each one separately. See recent commit 14541b1e7e72 ("perf build: Don't unconditionally link the libbfd feature test to -liberty and -lz") where I fixed feature detection. v2 (addressed Jakub's nits): * better syntax for 'else ifeq' * no space between ifeq args v3: * use LIBS, not EXTLIBS for -DHAVE_LIBBFD_SUPPORT Fixes: 29a9c10e4110 ("bpftool: make libbfd optional") Signed-off-by: Stanislav Fomichev Acked-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 77f88abd4a6f73a1a68dbdc0e3f21575fd508fc3 Author: Ming Lei Date: Tue Jan 15 17:31:29 2019 -0600 PCI/MSI: Return -ENOSPC from pci_alloc_irq_vectors_affinity() The API of pci_alloc_irq_vectors_affinity() says it returns -ENOSPC if fewer than @min_vecs interrupt vectors are available for @dev. However, if a device supports MSI-X but not MSI and a caller requests @min_vecs that can't be satisfied by MSI-X, we previously returned -EINVAL (from the failed attempt to enable MSI), not -ENOSPC. When -ENOSPC is returned, callers may reduce the number IRQs they request and try again. Most callers can use the @min_vecs and @max_vecs parameters to avoid this retry loop, but that doesn't work when using IRQ affinity "nr_sets" because rebalancing the sets is driver-specific. This return value bug has been present since pci_alloc_irq_vectors() was added in v4.10 by aff171641d18 ("PCI: Provide sensible IRQ vector alloc/free routines"), but it wasn't an issue because @min_vecs/@max_vecs removed the need for callers to iteratively reduce the number of IRQs requested and retry the allocation, so they didn't need to distinguish -ENOSPC from -EINVAL. In v5.0, 6da4b3ab9a6e ("genirq/affinity: Add support for allocating interrupt sets") added IRQ sets to the interface, which reintroduced the need to check for -ENOSPC and possibly reduce the number of IRQs requested and retry the allocation. Signed-off-by: Ming Lei [bhelgaas: changelog] Signed-off-by: Bjorn Helgaas Cc: Jens Axboe Cc: Keith Busch Cc: Christoph Hellwig commit b1c0330823fe842dbb34641f1410f0afa51c29d3 Author: Rafael J. Wysocki Date: Wed Jan 9 00:34:37 2019 +0100 ACPI: EC: Look for ECDT EC after calling acpi_load_tables() Some systems have had functional issues since commit 5a8361f7ecce (ACPICA: Integrate package handling with module-level code) that, among other things, changed the initial values of the acpi_gbl_group_module_level_code and acpi_gbl_parse_table_as_term_list global flags in ACPICA which implicitly caused acpi_ec_ecdt_probe() to be called before acpi_load_tables() on the vast majority of platforms. Namely, before commit 5a8361f7ecce, acpi_load_tables() was called from acpi_early_init() if acpi_gbl_parse_table_as_term_list was FALSE and acpi_gbl_group_module_level_code was TRUE, which almost always was the case as FALSE and TRUE were their initial values, respectively. The acpi_gbl_parse_table_as_term_list value would be changed to TRUE for a couple of platforms in acpi_quirks_dmi_table[], but it remained FALSE in the vast majority of cases. After commit 5a8361f7ecce, the initial values of the two flags have been reversed, so in effect acpi_load_tables() has not been called from acpi_early_init() any more. That, in turn, affects acpi_ec_ecdt_probe() which is invoked before acpi_load_tables() now and it is not possible to evaluate the _REG method for the EC address space handler installed by it. That effectively causes the EC address space to be inaccessible to AML on platforms with an ECDT matching the EC device definition in the DSDT and functional problems ensue in there. Because the default behavior before commit 5a8361f7ecce was to call acpi_ec_ecdt_probe() after acpi_load_tables(), it should be safe to do that again. Moreover, the EC address space handler installed by acpi_ec_ecdt_probe() is only needed for AML to be able to access the EC address space and the only AML that can run during acpi_load_tables() is module-level code which only is allowed to access address spaces with default handlers (memory, I/O and PCI config space). For this reason, move the acpi_ec_ecdt_probe() invocation back to acpi_bus_init(), from where it was taken away by commit d737f333b211 (ACPI: probe ECDT before loading AML tables regardless of module-level code flag), and put it after the invocation of acpi_load_tables() to restore the original code ordering from before commit 5a8361f7ecce. Fixes: 5a8361f7ecce ("ACPICA: Integrate package handling with module-level code") Link: https://bugzilla.kernel.org/show_bug.cgi?id=199981 Reported-by: step-ali Reported-by: Charles Stanhope Tested-by: Charles Stanhope Reported-by: Paulo Nascimento Reported-by: David Purton Reported-by: Adam Harvey Reported-by: Zhang Rui Tested-by: Zhang Rui Tested-by: Jean-Marc Lenoir Signed-off-by: Rafael J. Wysocki commit 6f9b5e70dfcde983192155549f584472aa9f54cd Author: Sinan Kaya Date: Sat Jan 5 10:06:06 2019 +0000 drivers: thermal: int340x_thermal: Make PCI dependency explicit After commit 5d32a66541c4 (PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set) dependencies on CONFIG_PCI that previously were satisfied implicitly through dependencies on CONFIG_ACPI have to be specified directly. IOSF_CORE depends on PCI. For this reason, add a direct dependency on CONFIG_PCI. Fixes: 5d32a66541c46 ("PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set") Signed-off-by: Sinan Kaya Signed-off-by: Rafael J. Wysocki commit e9820d6b0a6c85f753e8d6626320367ef12ebe15 Author: Sinan Kaya Date: Sat Jan 5 10:06:05 2019 +0000 x86/intel/lpss: Make PCI dependency explicit After commit 5d32a66541c4 (PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set) dependencies on CONFIG_PCI that previously were satisfied implicitly through dependencies on CONFIG_ACPI have to be specified directly. LPSS code relies on PCI infrastructure but this dependency has not been called out explicitly yet. Fixes: 5d32a66541c46 ("PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set") Signed-off-by: Sinan Kaya Signed-off-by: Rafael J. Wysocki commit 7934d76c88816f12ac991540eeece403204f8a1c Author: Sinan Kaya Date: Sat Jan 5 10:06:01 2019 +0000 platform/x86: apple-gmux: Make PCI dependency explicit After commit 5d32a66541c4 (PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set) dependencies on CONFIG_PCI that previously were satisfied implicitly through dependencies on CONFIG_ACPI have to be specified directly. This driver depends on the PCI infrastructure but the dependency has not been called out explicitly yet. Fixes: 5d32a66541c46 ("PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set") Signed-off-by: Sinan Kaya Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 737ee5824d91292682be7e0c0771ad67992c199f Author: Sinan Kaya Date: Sat Jan 5 10:06:00 2019 +0000 platform/x86: intel_pmc: Make PCI dependency explicit After commit 5d32a66541c4 (PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set) dependencies on CONFIG_PCI that previously were satisfied implicitly through dependencies on CONFIG_ACPI have to be specified directly. Some code in intel_pmc relies on PCI for execution. Specify this in the Kconfig. [ Andy S: For sake of a quick fix this introduces a new mandatory dependency to the driver which may survive without it. Otherwise we need to revisit the driver architecture to address this properly. ] Fixes: 5d32a66541c46 ("PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set") Signed-off-by: Sinan Kaya Signed-off-by: Rafael J. Wysocki commit 63680e0d625be8f4bd570d30aaf3562551e179e3 Author: Sinan Kaya Date: Sat Jan 5 10:05:59 2019 +0000 platform/x86: intel_ips: make PCI dependency explicit After commit 5d32a66541c4 (PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set) dependencies on CONFIG_PCI that previously were satisfied implicitly through dependencies on CONFIG_ACPI have to be specified directly. intel_ips is a PCI device driver but this has not been mentioned anywhere in Kconfig. Fixes: 5d32a66541c46 ("PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set") Signed-off-by: Sinan Kaya Acked-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 94e8e8e97661dc3c2a4c253755f6bfe9e2e697f3 Author: Sinan Kaya Date: Sat Jan 5 10:05:58 2019 +0000 vga-switcheroo: make PCI dependency explicit This driver depends on the PCI infrastructure, but the dependency has not been explicitly called out. Fixes: 5d32a66541c46 ("PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set") Signed-off-by: Sinan Kaya Reviewed-by: Lukas Wunner Acked-by: Daniel Vetter Signed-off-by: Rafael J. Wysocki commit 995592bc531992d4a93c37d86e7f9635ee823258 Author: Sinan Kaya Date: Sat Jan 5 10:05:57 2019 +0000 ata: pata_acpi: Make PCI dependency explicit After commit 5d32a66541c4 (PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set) dependencies on CONFIG_PCI that previously were satisfied implicitly through dependencies on CONFIG_ACPI have to be specified directly. PATA_ACPI is a PCI device driver but the PCI dependency has not been explicitly called out. Fixes: 5d32a66541c46 ("PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set") Acked-by: Bartlomiej Zolnierkiewicz Signed-off-by: Sinan Kaya Reviewed-by: Jens Axboe Signed-off-by: Rafael J. Wysocki commit 1622745551db05071ed7263abf768007f7cbd3ae Author: Sinan Kaya Date: Sat Jan 5 10:05:56 2019 +0000 ACPI / LPSS: Make PCI dependency explicit After commit 5d32a66541c4 (PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set), it is possible to build ACPI without any PCI support. This code depends on PCI. Compile only when PCI is present. Fixes: 5d32a66541c46 ("PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set") Signed-off-by: Sinan Kaya Signed-off-by: Rafael J. Wysocki commit faa8bd6e12e6aeea289d8e6ba74777b72a69434c Author: Dave Jiang Date: Tue Jan 15 11:26:21 2019 -0700 libnvdimm/security: Fix nvdimm_security_state() state request selection The input parameter should be enum nvdimm_passphrase_type instead of bool for selection of master/user for selection of extended master passphrase state or the regular user passphrase state. Fixes: 89fa9d8ea7bdf ("...add Intel DSM 1.8 master passphrase support") Signed-off-by: Dave Jiang Signed-off-by: Dan Williams commit 80b3671e9377916bf2b02e56113fa7377ce5705a Author: Hangbin Liu Date: Thu Jan 10 11:17:42 2019 +0800 ip6_gre: update version related info when changing link We forgot to update ip6erspan version related info when changing link, which will cause setting new hwid failed. Reported-by: Jianlin Shi Fixes: 94d7d8f292870 ("ip6_gre: add erspan v2 support") Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller commit d9f903f6af3dc6d13b21c0eca8f4a169aa70d80d Author: Heiner Kallweit Date: Wed Jan 9 20:34:56 2019 +0100 net: phy: fix too strict check in phy_start_aneg When adding checks to detect wrong usage of the phylib API we added a check to phy_start_aneg() which is too strict. If the phylib state machine is in state PHY_HALTED we should allow reconfiguring and restarting aneg, and just don't touch the state. Fixes: 2b3e88ea6528 ("net: phy: improve phy state checking") Reported-by: Chris Wilson Signed-off-by: Heiner Kallweit Tested-by: Chris Wilson Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 5642e27bf6a935c1d0d9149e83d625dfba286463 Author: Jeff Kirsher Date: Wed Jan 9 09:10:53 2019 -0800 Revert "igb: reduce CPU0 latency when updating statistics" This reverts commit 59361316afcb08569af21e1af83e89c7051c055a. Due to problems found in additional testing, this causes an illegal context switch in the RCU read-side critical section. CC: Dave Jones CC: Cong Wang CC: Jan Jablonsky Signed-off-by: Jeff Kirsher Signed-off-by: David S. Miller commit 5be99560c6a0c24b7a0cc3bb4f26051c92cdff2a Author: Dan Carpenter Date: Wed Jan 9 13:50:07 2019 +0300 selftests/txtimestamp: Fix an equals vs assign bug This should be == instead of =. Fixes: b52354aa068e ("selftests: expand txtimestamp with ipv6 dgram + raw and pf_packet") Signed-off-by: Dan Carpenter Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit f97f4dd8b3bb9d0993d2491e0f22024c68109184 Author: Ido Schimmel Date: Wed Jan 9 09:57:39 2019 +0000 net: ipv4: Fix memory leak in network namespace dismantle IPv4 routing tables are flushed in two cases: 1. In response to events in the netdev and inetaddr notification chains 2. When a network namespace is being dismantled In both cases only routes associated with a dead nexthop group are flushed. However, a nexthop group will only be marked as dead in case it is populated with actual nexthops using a nexthop device. This is not the case when the route in question is an error route (e.g., 'blackhole', 'unreachable'). Therefore, when a network namespace is being dismantled such routes are not flushed and leaked [1]. To reproduce: # ip netns add blue # ip -n blue route add unreachable 192.0.2.0/24 # ip netns del blue Fix this by not skipping error routes that are not marked with RTNH_F_DEAD when flushing the routing tables. To prevent the flushing of such routes in case #1, add a parameter to fib_table_flush() that indicates if the table is flushed as part of namespace dismantle or not. Note that this problem does not exist in IPv6 since error routes are associated with the loopback device. [1] unreferenced object 0xffff888066650338 (size 56): comm "ip", pid 1206, jiffies 4294786063 (age 26.235s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 b0 1c 62 61 80 88 ff ff ..........ba.... e8 8b a1 64 80 88 ff ff 00 07 00 08 fe 00 00 00 ...d............ backtrace: [<00000000856ed27d>] inet_rtm_newroute+0x129/0x220 [<00000000fcdfc00a>] rtnetlink_rcv_msg+0x397/0xa20 [<00000000cb85801a>] netlink_rcv_skb+0x132/0x380 [<00000000ebc991d2>] netlink_unicast+0x4c0/0x690 [<0000000014f62875>] netlink_sendmsg+0x929/0xe10 [<00000000bac9d967>] sock_sendmsg+0xc8/0x110 [<00000000223e6485>] ___sys_sendmsg+0x77a/0x8f0 [<000000002e94f880>] __sys_sendmsg+0xf7/0x250 [<00000000ccb1fa72>] do_syscall_64+0x14d/0x610 [<00000000ffbe3dae>] entry_SYSCALL_64_after_hwframe+0x49/0xbe [<000000003a8b605b>] 0xffffffffffffffff unreferenced object 0xffff888061621c88 (size 48): comm "ip", pid 1206, jiffies 4294786063 (age 26.235s) hex dump (first 32 bytes): 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk 6b 6b 6b 6b 6b 6b 6b 6b d8 8e 26 5f 80 88 ff ff kkkkkkkk..&_.... backtrace: [<00000000733609e3>] fib_table_insert+0x978/0x1500 [<00000000856ed27d>] inet_rtm_newroute+0x129/0x220 [<00000000fcdfc00a>] rtnetlink_rcv_msg+0x397/0xa20 [<00000000cb85801a>] netlink_rcv_skb+0x132/0x380 [<00000000ebc991d2>] netlink_unicast+0x4c0/0x690 [<0000000014f62875>] netlink_sendmsg+0x929/0xe10 [<00000000bac9d967>] sock_sendmsg+0xc8/0x110 [<00000000223e6485>] ___sys_sendmsg+0x77a/0x8f0 [<000000002e94f880>] __sys_sendmsg+0xf7/0x250 [<00000000ccb1fa72>] do_syscall_64+0x14d/0x610 [<00000000ffbe3dae>] entry_SYSCALL_64_after_hwframe+0x49/0xbe [<000000003a8b605b>] 0xffffffffffffffff Fixes: 8cced9eff1d4 ("[NETNS]: Enable routing configuration in non-initial namespace.") Signed-off-by: Ido Schimmel Reviewed-by: David Ahern Signed-off-by: David S. Miller commit ab5098fa25b91cb6fe0a0676f17abb64f2bbf024 Author: Olivier Matz Date: Wed Jan 9 10:57:21 2019 +0100 ip6_gre: fix tunnel list corruption for x-netns In changelink ops, the ip6gre_net pointer is retrieved from dev_net(dev), which is wrong in case of x-netns. Thus, the tunnel is not unlinked from its current list and is relinked into another net namespace. This corrupts the tunnel lists and can later trigger a kernel oops. Fix this by retrieving the netns from device private area. Fixes: c8632fc30bb0 ("net: ip6_gre: Split up ip6gre_changelink()") Cc: Petr Machata Signed-off-by: Olivier Matz Acked-by: Nicolas Dichtel Signed-off-by: David S. Miller commit 72f6d4d14c2e23c8ad416ccbe5cfc744ba703d0a Merge: 7939f8beecf1c 2314e879747e8 Author: David S. Miller Date: Tue Jan 15 13:31:46 2019 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net This is the first batch of Netfilter fixes for your net tree: 1) Fix endless loop in nf_tables rules netlink dump, from Phil Sutter. 2) Reference counter leak in object from the error path, from Taehee Yoo. 3) Selective rule dump requires table and chain. 4) Fix DNAT with nft_flow_offload reverse route lookup, from wenxu. 5) Use GFP_KERNEL_ACCOUNT in vmalloc allocation from ebtables, from Shakeel Butt. 6) Set ifindex from route to fix interaction with VRF slave device, also from wenxu. 7) Use nfct_help() to check for conntrack helper, IPS_HELPER status flag is only set from explicit helpers via -j CT, from Henry Yen. ==================== Signed-off-by: David S. Miller commit b4711098066f1cf808d4dc11a1a842860a3292fe Author: Wen Yang Date: Tue Jan 15 10:31:27 2019 +0800 pvcalls-front: fix potential null dereference static checker warning: drivers/xen/pvcalls-front.c:373 alloc_active_ring() error: we previously assumed 'map->active.ring' could be null (see line 357) drivers/xen/pvcalls-front.c 351 static int alloc_active_ring(struct sock_mapping *map) 352 { 353 void *bytes; 354 355 map->active.ring = (struct pvcalls_data_intf *) 356 get_zeroed_page(GFP_KERNEL); 357 if (!map->active.ring) ^^^^^^^^^^^^^^^^^ Check 358 goto out; 359 360 map->active.ring->ring_order = PVCALLS_RING_ORDER; 361 bytes = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, 362 PVCALLS_RING_ORDER); 363 if (!bytes) 364 goto out; 365 366 map->active.data.in = bytes; 367 map->active.data.out = bytes + 368 XEN_FLEX_RING_SIZE(PVCALLS_RING_ORDER); 369 370 return 0; 371 372 out: --> 373 free_active_ring(map); ^^^ Add null check on map->active.ring before dereferencing it to avoid any NULL pointer dereferences. Fixes: 9f51c05dc41a ("pvcalls-front: Avoid get_free_pages(GFP_KERNEL) under spinlock") Reported-by: Dan Carpenter Suggested-by: Boris Ostrovsky Signed-off-by: Wen Yang Reviewed-by: Boris Ostrovsky CC: Boris Ostrovsky CC: Juergen Gross CC: Stefano Stabellini CC: Dan Carpenter CC: xen-devel@lists.xenproject.org CC: linux-kernel@vger.kernel.org Signed-off-by: Boris Ostrovsky commit 4bb0e6d7258213d4893c2c876712fbba40e712fe Author: Julia Lawall Date: Sun Jan 13 09:47:44 2019 +0100 drm/sun4i: backend: add missing of_node_puts The device node iterators perform an of_node_get on each iteration, so a jump out of the loop requires an of_node_put. Remote and port also have augmented reference counts, so drop them on each iteration and at the end of the function, respectively. Remote is only used for the address it contains, not for the contents of that address, so the reference count can be dropped immediately. The semantic patch that fixes the first part of this problem is as follows (http://coccinelle.lip6.fr): // @@ expression root,e; local idexpression child; iterator name for_each_child_of_node; @@ for_each_available_child_of_node(root, child) { ... when != of_node_put(child) when != e = child + of_node_put(child); ? break; ... } ... when != child // Signed-off-by: Julia Lawall Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/1547369264-24831-5-git-send-email-Julia.Lawall@lip6.fr commit deaa5c96c2f7e8b934088a1e70a0fe8797bd1149 Author: Chuck Lever Date: Wed Jan 9 10:04:57 2019 -0500 SUNRPC: Address Kerberos performance/behavior regression When using Kerberos with v4.20, I've observed frequent connection loss on heavy workloads. I traced it down to the client underrunning the GSS sequence number window -- NFS servers are required to drop the RPC with the low sequence number, and also drop the connection to signal that an RPC was dropped. Bisected to commit 918f3c1fe83c ("SUNRPC: Improve latency for interactive tasks"). I've got a one-line workaround for this issue, which is easy to backport to v4.20 while a more permanent solution is being derived. Essentially, tk_owner-based sorting is disabled for RPCs that carry a GSS sequence number. Fixes: 918f3c1fe83c ("SUNRPC: Improve latency for interactive ... ") Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 86edaed379632e216a97e6bcef9f498b64522d50 Author: Lorenz Bauer Date: Tue Jan 8 13:58:00 2019 +0000 bpf: libbpf: retry loading program on EAGAIN Commit c3494801cd17 ("bpf: check pending signals while verifying programs") makes it possible for the BPF_PROG_LOAD to fail with EAGAIN. Retry unconditionally in this case. Fixes: c3494801cd17 ("bpf: check pending signals while verifying programs") Signed-off-by: Lorenz Bauer Signed-off-by: Daniel Borkmann commit 97b78ae96ba76f4ca2d8f5afee6a2e567ccb8f45 Author: Trond Myklebust Date: Wed Jan 2 17:53:13 2019 -0500 SUNRPC: Ensure we respect the RPCSEC_GSS sequence number limit According to RFC2203, the RPCSEC_GSS sequence numbers are bounded to an upper limit of MAXSEQ = 0x80000000. Ensure that we handle that correctly. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit e66721f0436396f779291a29616858b76bfd9415 Author: Trond Myklebust Date: Wed Jan 2 17:53:10 2019 -0500 SUNRPC: Ensure rq_bytes_sent is reset before request transmission When we resend a request, ensure that the 'rq_bytes_sent' is reset to zero. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 6bf3bbe1f4d4cf405e3c2bf07bbdff56d3223ec8 Author: Yonghong Song Date: Sat Jan 12 15:04:30 2019 -0800 samples/bpf: workaround clang asm goto compilation errors x86 compilation has required asm goto support since 4.17. Since clang does not support asm goto, at 4.17, Commit b1ae32dbab50 ("x86/cpufeature: Guard asm_volatile_goto usage for BPF compilation") worked around the issue by permitting an alternative implementation without asm goto for clang. At 5.0, more asm goto usages appeared. [yhs@148 x86]$ egrep -r asm_volatile_goto include/asm/cpufeature.h: asm_volatile_goto("1: jmp 6f\n" include/asm/jump_label.h: asm_volatile_goto("1:" include/asm/jump_label.h: asm_volatile_goto("1:" include/asm/rmwcc.h: asm_volatile_goto (fullop "; j" #cc " %l[cc_label]" \ include/asm/uaccess.h: asm_volatile_goto("\n" \ include/asm/uaccess.h: asm_volatile_goto("\n" \ [yhs@148 x86]$ Compiling samples/bpf directories, most bpf programs failed compilation with error messages like: In file included from /home/yhs/work/bpf-next/samples/bpf/xdp_sample_pkts_kern.c:2: In file included from /home/yhs/work/bpf-next/include/linux/ptrace.h:6: In file included from /home/yhs/work/bpf-next/include/linux/sched.h:15: In file included from /home/yhs/work/bpf-next/include/linux/sem.h:5: In file included from /home/yhs/work/bpf-next/include/uapi/linux/sem.h:5: In file included from /home/yhs/work/bpf-next/include/linux/ipc.h:9: In file included from /home/yhs/work/bpf-next/include/linux/refcount.h:72: /home/yhs/work/bpf-next/arch/x86/include/asm/refcount.h:70:9: error: 'asm goto' constructs are not supported yet return GEN_BINARY_SUFFIXED_RMWcc(LOCK_PREFIX "subl", ^ /home/yhs/work/bpf-next/arch/x86/include/asm/rmwcc.h:67:2: note: expanded from macro 'GEN_BINARY_SUFFIXED_RMWcc' __GEN_RMWcc(op " %[val], %[var]\n\t" suffix, var, cc, \ ^ /home/yhs/work/bpf-next/arch/x86/include/asm/rmwcc.h:21:2: note: expanded from macro '__GEN_RMWcc' asm_volatile_goto (fullop "; j" #cc " %l[cc_label]" \ ^ /home/yhs/work/bpf-next/include/linux/compiler_types.h:188:37: note: expanded from macro 'asm_volatile_goto' #define asm_volatile_goto(x...) asm goto(x) Most implementation does not even provide an alternative implementation. And it is also not practical to make changes for each call site. This patch workarounded the asm goto issue by redefining the macro like below: #define asm_volatile_goto(x...) asm volatile("invalid use of asm_volatile_goto") If asm_volatile_goto is not used by bpf programs, which is typically the case, nothing bad will happen. If asm_volatile_goto is used by bpf programs, which is incorrect, the compiler will issue an error since "invalid use of asm_volatile_goto" is not valid assembly codes. With this patch, all bpf programs under samples/bpf can pass compilation. Note that bpf programs under tools/testing/selftests/bpf/ compiled fine as they do not access kernel internal headers. Fixes: e769742d3584 ("Revert "x86/jump-labels: Macrofy inline assembly code to work around GCC inlining bugs"") Fixes: 18fe58229d80 ("x86, asm: change the GEN_*_RMWcc() macros to not quote the condition") Acked-by: Alexei Starovoitov Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 1be72f29bfb98be27a95309f18b4ab5249967b59 Author: Stanislav Fomichev Date: Mon Jan 14 09:41:41 2019 -0800 selftests/bpf: install with_tunnels.sh for test_flow_dissector.sh test_flow_dissector.sh depends on both with_addr.sh and with_tunnels.sh However, we install only with_addr.sh. Add with_tunnels.sh to TEST_PROGS_EXTENDED to make sure it gets installed as well. Tested with: make TARGETS=bpf install INSTALL_PATH=$PWD/x Fixes: ef4ab8447aa26 ("selftests: bpf: install script with_addr.sh") Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann commit cc5b5d3565048ae57d14e5674a5fb085b2ab0193 Author: Krzysztof Kazimierczak Date: Thu Jan 10 20:29:02 2019 +0100 xsk: Check if a queue exists during umem setup In the xdp_umem_assign_dev() path, the xsk code does not check if a queue for which umem is to be created exists. It leads to a situation where umem is not assigned to any Tx/Rx queue of a netdevice, without notifying the stack about an error. This affects both XDP_SKB and XDP_DRV modes - in case of XDP_DRV_ZC, queue index is checked by the driver. This patch fixes xsk code, so that in both XDP_SKB and XDP_DRV mode of AF_XDP, an error is returned when requested queue index exceedes an existing maximum. Fixes: c9b47cc1fabca ("xsk: fix bug when trying to use both copy and zero-copy on one queue id") Reported-by: Jakub Spizewski Signed-off-by: Krzysztof Kazimierczak Acked-by: Björn Töpel Signed-off-by: Daniel Borkmann commit a811dc61559e0c8003f1086c2a4dc8e4d5ae4cb8 Author: Tycho Andersen Date: Sat Jan 12 11:24:20 2019 -0700 seccomp: fix UAF in user-trap code On the failure path, we do an fput() of the listener fd if the filter fails to install (e.g. because of a TSYNC race that's lost, or if the thread is killed, etc.). fput() doesn't actually release the fd, it just ads it to a work queue. Then the thread proceeds to free the filter, even though the listener struct file has a reference to it. To fix this, on the failure path let's set the private data to null, so we know in ->release() to ignore the filter. Reported-by: syzbot+981c26489b2d1c6316ba@syzkaller.appspotmail.com Fixes: 6a21cc50f0c7 ("seccomp: add a return code to trap to userspace") Signed-off-by: Tycho Andersen Acked-by: Kees Cook Signed-off-by: James Morris commit 663ec3a2c2d02775bc723b20a1af33262f790f50 Author: Linus Walleij Date: Wed Jan 9 22:51:44 2019 +0100 mtd: rawnand: fsmc: Keep bank enable bit set Hammering the "bank enable" (PBKEN) bit on and off between every command crashes the Nomadik NHK15 with this message: Scanning device for bad blocks Unhandled fault: external abort on non-linefetch (0x008) at 0xcc95e000 pgd = (ptrval) [cc95e000] *pgd=0b808811, *pte=40000653, *ppte=40000552 Internal error: : 8 [#1] PREEMPT ARM Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.20.0-rc2+ #72 Hardware name: Nomadik STn8815 PC is at fsmc_exec_op+0x194/0x204 (...) After a discussion we (me and Boris Brezillon) start to suspect that this bit does not immediately control the chip select line at all, it rather enables access to the bank and the hardware will drive the CS autonomously. If there is a NAND chip connected, we should keep this enabled. As fsmc_nand_setup() sets this bit, we can simply remove the offending code. Fixes: 550b9fc4e3af ("mtd: rawnand: fsmc: Stop implementing ->select_chip()") Signed-off-by: Linus Walleij Acked-by: Miquel Raynal Signed-off-by: Boris Brezillon commit 7939f8beecf1cfb10d255be65bfbd3793fae82a1 Merge: e8746440bf682 8b05a3a7503c2 Author: Linus Torvalds Date: Wed Jan 16 05:28:26 2019 +1200 Merge tag 'trace-v5.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fix from Steven Rostedt: "Andrea Righi fixed a NULL pointer dereference in trace_kprobe_create() It is possible to trigger a NULL pointer dereference by writing an incorrectly formatted string to the krpobe_events file" * tag 'trace-v5.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing/kprobes: Fix NULL pointer dereference in trace_kprobe_create() commit e8746440bf68212f19688f1454dad593c74abee1 Merge: fe76fc6aaf538 2f960bd056408 Author: Linus Torvalds Date: Wed Jan 16 05:13:36 2019 +1200 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net Pull networking fixes from David Miller: 1) Fix regression in multi-SKB responses to RTM_GETADDR, from Arthur Gautier. 2) Fix ipv6 frag parsing in openvswitch, from Yi-Hung Wei. 3) Unbounded recursion in ipv4 and ipv6 GUE tunnels, from Stefano Brivio. 4) Use after free in hns driver, from Yonglong Liu. 5) icmp6_send() needs to handle the case of NULL skb, from Eric Dumazet. 6) Missing rcu read lock in __inet6_bind() when operating on mapped addresses, from David Ahern. 7) Memory leak in tipc-nl_compat_publ_dump(), from Gustavo A. R. Silva. 8) Fix PHY vs r8169 module loading ordering issues, from Heiner Kallweit. 9) Fix bridge vlan memory leak, from Ido Schimmel. 10) Dev refcount leak in AF_PACKET, from Jason Gunthorpe. 11) Infoleak in ipv6_local_error(), flow label isn't completely initialized. From Eric Dumazet. 12) Handle mv88e6390 errata, from Andrew Lunn. 13) Making vhost/vsock CID hashing consistent, from Zha Bin. 14) Fix lack of UMH cleanup when it unexpectedly exits, from Taehee Yoo. 15) Bridge forwarding must clear skb->tstamp, from Paolo Abeni. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (87 commits) bnxt_en: Fix context memory allocation. bnxt_en: Fix ring checking logic on 57500 chips. mISDN: hfcsusb: Use struct_size() in kzalloc() net: clear skb->tstamp in bridge forwarding path net: bpfilter: disallow to remove bpfilter module while being used net: bpfilter: restart bpfilter_umh when error occurred net: bpfilter: use cleanup callback to release umh_info umh: add exit routine for UMH process isdn: i4l: isdn_tty: Fix some concurrency double-free bugs vhost/vsock: fix vhost vsock cid hashing inconsistent net: stmmac: Prevent RX starvation in stmmac_napi_poll() net: stmmac: Fix the logic of checking if RX Watchdog must be enabled net: stmmac: Check if CBS is supported before configuring net: stmmac: dwxgmac2: Only clear interrupts that are active net: stmmac: Fix PCI module removal leak tools/bpf: fix bpftool map dump with bitfields tools/bpf: test btf bitfield with >=256 struct member offset bpf: fix bpffs bitfield pretty print net: ethernet: mediatek: fix warning in phy_start_aneg tcp: change txhash on SYN-data timeout ... commit 8b05a3a7503c2a982c9c462eae96cfbd59506783 Author: Andrea Righi Date: Fri Jan 11 07:01:13 2019 +0100 tracing/kprobes: Fix NULL pointer dereference in trace_kprobe_create() It is possible to trigger a NULL pointer dereference by writing an incorrectly formatted string to krpobe_events (trying to create a kretprobe omitting the symbol). Example: echo "r:event_1 " >> /sys/kernel/debug/tracing/kprobe_events That triggers this: BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 #PF error: [normal kernel read fault] PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI CPU: 6 PID: 1757 Comm: bash Not tainted 5.0.0-rc1+ #125 Hardware name: Dell Inc. XPS 13 9370/0F6P3V, BIOS 1.5.1 08/09/2018 RIP: 0010:kstrtoull+0x2/0x20 Code: 28 00 00 00 75 17 48 83 c4 18 5b 41 5c 5d c3 b8 ea ff ff ff eb e1 b8 de ff ff ff eb da e8 d6 36 bb ff 66 0f 1f 44 00 00 31 c0 <80> 3f 2b 55 48 89 e5 0f 94 c0 48 01 c7 e8 5c ff ff ff 5d c3 66 2e RSP: 0018:ffffb5d482e57cb8 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000001 RCX: ffffffff82b12720 RDX: ffffb5d482e57cf8 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffb5d482e57d70 R08: ffffa0c05e5a7080 R09: ffffa0c05e003980 R10: 0000000000000000 R11: 0000000040000000 R12: ffffa0c04fe87b08 R13: 0000000000000001 R14: 000000000000000b R15: ffffa0c058d749e1 FS: 00007f137c7f7740(0000) GS:ffffa0c05e580000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000000497d46004 CR4: 00000000003606e0 Call Trace: ? trace_kprobe_create+0xb6/0x840 ? _cond_resched+0x19/0x40 ? _cond_resched+0x19/0x40 ? __kmalloc+0x62/0x210 ? argv_split+0x8f/0x140 ? trace_kprobe_create+0x840/0x840 ? trace_kprobe_create+0x840/0x840 create_or_delete_trace_kprobe+0x11/0x30 trace_run_command+0x50/0x90 trace_parse_run_command+0xc1/0x160 probes_write+0x10/0x20 __vfs_write+0x3a/0x1b0 ? apparmor_file_permission+0x1a/0x20 ? security_file_permission+0x31/0xf0 ? _cond_resched+0x19/0x40 vfs_write+0xb1/0x1a0 ksys_write+0x55/0xc0 __x64_sys_write+0x1a/0x20 do_syscall_64+0x5a/0x120 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fix by doing the proper argument checks in trace_kprobe_create(). Cc: Ingo Molnar Link: https://lore.kernel.org/lkml/20190111095108.b79a2ee026185cbd62365977@kernel.org Link: http://lkml.kernel.org/r/20190111060113.GA22841@xps-13 Fixes: 6212dd29683e ("tracing/kprobes: Use dyn_event framework for kprobe events") Acked-by: Masami Hiramatsu Signed-off-by: Andrea Righi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 45ac486ecf2dc998e25cf32f0cabf2deaad875be Author: Olga Kornievskaia Date: Fri Jan 11 19:04:44 2019 -0500 NFSv4.2 fix unnecessary retry in nfs4_copy_file_range Currently nfs42_proc_copy_file_range() can not return EAGAIN. Fixes: e4648aa4f98a ("NFS recover from destination server reboot for copies") Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 92b0730eaf2d549fdfb10ecc8b71f34b9f472c12 Author: Michel Dänzer Date: Fri Jan 11 16:21:02 2019 +0100 Revert "drm/amdgpu: validate user pitch alignment" The check turned out to be too strict in some cases. Reviewed-by: Alex Deucher Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 25ec429e86bb790e40387a550f0501d0ac55a47c Author: Alex Deucher Date: Thu Jan 10 12:16:57 2019 +0100 Revert "drm/amdgpu: validate user GEM object size" It was at the same time too strict (for linear tiling modes, where no height alignment is required) and too lenient (for 2D tiling modes, where height may need to be aligned to values > 8). Acked-by: Alex Deucher Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 04906b2f542c23626b0ef6219b808406f8dddbe9 Author: Jan Kara Date: Mon Jan 14 09:48:10 2019 +0100 blockdev: Fix livelocks on loop device bd_set_size() updates also block device's block size. This is somewhat unexpected from its name and at this point, only blkdev_open() uses this functionality. Furthermore, this can result in changing block size under a filesystem mounted on a loop device which leads to livelocks inside __getblk_gfp() like: Sending NMI from CPU 0 to CPUs 1: NMI backtrace for cpu 1 CPU: 1 PID: 10863 Comm: syz-executor0 Not tainted 4.18.0-rc5+ #151 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__sanitizer_cov_trace_pc+0x3f/0x50 kernel/kcov.c:106 ... Call Trace: init_page_buffers+0x3e2/0x530 fs/buffer.c:904 grow_dev_page fs/buffer.c:947 [inline] grow_buffers fs/buffer.c:1009 [inline] __getblk_slow fs/buffer.c:1036 [inline] __getblk_gfp+0x906/0xb10 fs/buffer.c:1313 __bread_gfp+0x2d/0x310 fs/buffer.c:1347 sb_bread include/linux/buffer_head.h:307 [inline] fat12_ent_bread+0x14e/0x3d0 fs/fat/fatent.c:75 fat_ent_read_block fs/fat/fatent.c:441 [inline] fat_alloc_clusters+0x8ce/0x16e0 fs/fat/fatent.c:489 fat_add_cluster+0x7a/0x150 fs/fat/inode.c:101 __fat_get_block fs/fat/inode.c:148 [inline] ... Trivial reproducer for the problem looks like: truncate -s 1G /tmp/image losetup /dev/loop0 /tmp/image mkfs.ext4 -b 1024 /dev/loop0 mount -t ext4 /dev/loop0 /mnt losetup -c /dev/loop0 l /mnt Fix the problem by moving initialization of a block device block size into a separate function and call it when needed. Thanks to Tetsuo Handa for help with debugging the problem. Reported-by: syzbot+9933e4476f365f5d5a1b@syzkaller.appspotmail.com Signed-off-by: Jan Kara Signed-off-by: Jens Axboe commit c8a83a6b54d0ca078de036aafb3f6af58c1dc5eb Author: Jan Kara Date: Mon Jan 14 09:48:09 2019 +0100 nbd: Use set_blocksize() to set device blocksize NBD can update block device block size implicitely through bd_set_size(). Make it explicitely set blocksize with set_blocksize() as this behavior of bd_set_size() is going away. CC: Josef Bacik Signed-off-by: Jan Kara Signed-off-by: Jens Axboe commit ce0210c12433031aba3bbacd75f4c02ab77f2004 Author: Neil Armstrong Date: Mon Jan 14 16:31:18 2019 +0100 drm/meson: Fix atomic mode switching regression Since commit 2bcd3ecab773 when switching mode from X11 (ubuntu mate for example) the display gets blurry, looking like an invalid framebuffer width. This commit fixed atomic crtc modesetting in a totally wrong way and introduced a local unnecessary ->enabled crtc state. This commit reverts the crctc _begin() and _enable() changes and simply adds drm_atomic_helper_commit_tail_rpm as helper. Reported-by: Tony McKahan Suggested-by: Daniel Vetter Fixes: 2bcd3ecab773 ("drm/meson: Fixes for drm_crtc_vblank_on/off support") Signed-off-by: Neil Armstrong Acked-by: Daniel Vetter [narmstrong: fixed blank line issue from checkpatch] Link: https://patchwork.freedesktop.org/patch/msgid/20190114153118.8024-1-narmstrong@baylibre.com commit 51b00d8509dc69c98740da2ad07308b630d3eb7d Author: Zhenyu Wang Date: Fri Jan 11 13:58:53 2019 +0800 drm/i915/gvt: Fix mmap range check This is to fix missed mmap range check on vGPU bar2 region and only allow to map vGPU allocated GMADDR range, which means user space should support sparse mmap to get proper offset for mmap vGPU aperture. And this takes care of actual pgoff in mmap request as original code always does from beginning of vGPU aperture. Fixes: 659643f7d814 ("drm/i915/gvt/kvmgt: add vfio/mdev support to KVMGT") Cc: "Monroy, Rodrigo Axel" Cc: "Orrala Contreras, Alfredo" Cc: stable@vger.kernel.org # v4.10+ Reviewed-by: Hang Yuan Signed-off-by: Zhenyu Wang commit 7bea7ac0ca0121798f3618d16201ca4dc4e67a00 Author: Michael Ellerman Date: Tue Jan 15 17:37:28 2019 +1100 powerpc/syscalls: Fix syscall tracing Recently in commit fbf508da7440 ("powerpc: split compat syscall table out from native table") we changed the layout of the system call table. Instead of having two entries for each syscall number, one for the regular entry point and one for the compat entry point, we now have separate tables for regular and compat entry points. This inadvertently broke syscall tracing (CONFIG_FTRACE_SYSCALLS), because our implementation of arch_syscall_addr() knew about the layout of the table (it did nr * 2). We can fix it just by dropping our version of arch_syscall_addr() and using the generic version which does: return (unsigned long)sys_call_table[nr]; Fixes: fbf508da7440 ("powerpc: split compat syscall table out from native table") Signed-off-by: Michael Ellerman commit 6c2d0f9976ad19eca6d03dad5d726f8eff848b70 Author: Hang Yuan Date: Mon Jan 14 18:43:39 2019 +0800 drm/i915/gvt: free VFIO region space in vgpu detach VFIO region space is allocated when one region is registered for one vgpu. So free the space when destroy the vgpu. Also change the parameter of detach_vgpu callback to use vgpu directly. Fixes: b851adeac0858c7d257b3 ("drm/i915/gvt: Add opregion support") Reviewed-by: Zhenyu Wang Signed-off-by: Hang Yuan Signed-off-by: Zhenyu Wang commit da727097a482a93645ba5beea8d389ebab11fc64 Author: Jason A. Donenfeld Date: Mon Jan 14 16:47:45 2019 -0800 powerpc/pseries: Fix build break due to pnv_npu2_init() Commit 3be2df00e299 ("powerpc/pseries/npu: Enable platform support") added a call to pnv_npu2_init() in pseries code. This causes a build break if we build with CONFIG_PPC_PSERIES && !CONFIG_PPC_POWERNV: powerpc64le-pc-linux-gnu-ld: arch/powerpc/platforms/pseries/pci.o: in function `pSeries_final_fixup': pci.c:(.init.text+0x1b0): undefined reference to `pnv_npu2_init' This commit therefore wraps that line in an ifdef, so that pseries builds without powernv. Fixes: 3be2df00e299 ("powerpc/pseries/npu: Enable platform support") Signed-off-by: Jason A. Donenfeld Reviewed-by: Alexey Kardashevskiy [mpe: Frob change log a bit to blame a different commit] Signed-off-by: Michael Ellerman commit f29fd331aa055fbeb5a496b4af937b7952111b6b Author: Vitor Soares Date: Thu Jan 10 16:34:59 2019 +0100 i3c: master: dw-i3c-master: fix i3c_attach/reattach This patch fix i3c_attach/reattach functions. During the i3c_attach the driver ignores the static address used for SETDASA CCC command. During the i3c_reattach the driver doesn't update master->addrs[data->index] with new address if old_dyn_addr = 0. Fixes: 1dd728f5d4d4 ("i3c: master: Add driver for Synopsys DesignWare IP") Signed-off-by: Vitor Soares Signed-off-by: Boris Brezillon commit fe76fc6aaf538df27708ffa3e5d549a6c8e16142 Author: Ming Lei Date: Tue Jan 15 11:59:52 2019 +0800 sbitmap: Protect swap_lock from hardirq Because we may call blk_mq_get_driver_tag() directly from blk_mq_dispatch_rq_list() without holding any lock, then HARDIRQ may come and the above DEADLOCK is triggered. Commit ab53dcfb3e7b ("sbitmap: Protect swap_lock from hardirq") tries to fix this issue by using 'spin_lock_bh', which isn't enough because we complete request from hardirq context direclty in case of multiqueue. Cc: Clark Williams Fixes: ab53dcfb3e7b ("sbitmap: Protect swap_lock from hardirq") Cc: Jens Axboe Cc: Ming Lei Cc: Guenter Roeck Cc: Steven Rostedt (VMware) Signed-off-by: Ming Lei Signed-off-by: Linus Torvalds commit b4fe30e45a660efa8f122070fc7173715d0e1d00 Author: Wei Yang Date: Tue Jan 15 11:09:46 2019 +0800 acpi/nfit: Remove duplicate set nd_set in acpi_nfit_init_interleave_set() We allocate nd_set in acpi_nfit_init_interleave_set() and assignn it to ndr_desc, while the assignment is done twice in this function. This patch removes the first assignment. No functional change. Signed-off-by: Wei Yang Signed-off-by: Dan Williams commit 8e5dadfe76cf2862ebf3e4f22adef29982df7766 Author: Bijan Mottahedeh Date: Mon Dec 3 16:48:23 2018 -0800 vhost/scsi: Use copy_to_iter() to send control queue response Uses copy_to_iter() instead of __copy_to_user() in order to ensure we support arbitrary layouts and an input buffer split across iov entries. Fixes: 0d02dbd68c47b ("vhost/scsi: Respond to control queue operations") Signed-off-by: Bijan Mottahedeh Signed-off-by: Michael S. Tsirkin commit 74ad7419489ddade8044e3c9ab064ad656520306 Author: Pavel Tikhomirov Date: Thu Dec 13 17:53:50 2018 +0300 vhost: return EINVAL if iovecs size does not match the message size We've failed to copy and process vhost_iotlb_msg so let userspace at least know about it. For instance before these patch the code below runs without any error: int main() { struct vhost_msg msg; struct iovec iov; int fd; fd = open("/dev/vhost-net", O_RDWR); if (fd == -1) { perror("open"); return 1; } iov.iov_base = &msg; iov.iov_len = sizeof(msg)-4; if (writev(fd, &iov,1) == -1) { perror("writev"); return 1; } return 0; } Signed-off-by: Pavel Tikhomirov Signed-off-by: Michael S. Tsirkin commit bf4dc0b2beebfd9338df7c0bcf473b356f67cf66 Author: Wei Wang Date: Mon Jan 7 15:01:04 2019 +0800 virtio-balloon: tweak config_changed implementation virtio-ccw has deadlock issues with reading the config space inside the interrupt context, so we tweak the virtballoon_changed implementation by moving the config read operations into the related workqueue contexts. The config_read_bitmap is used as a flag to the workqueue callbacks about the related config fields that need to be read. The cmd_id_received is also renamed to cmd_id_received_cache, and the value should be obtained via virtio_balloon_cmd_id_received. Reported-by: Christian Borntraeger Signed-off-by: Wei Wang Reviewed-by: Cornelia Huck Reviewed-by: Halil Pasic Signed-off-by: Michael S. Tsirkin Cc: stable@vger.kernel.org Fixes: 86a559787e6f ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT") Tested-by: Christian Borntraeger commit a229989d975eb926076307c1f2f5e4c6111768e7 Author: Wei Wang Date: Fri Dec 28 10:26:26 2018 +0800 virtio: don't allocate vqs when names[i] = NULL Some vqs may not need to be allocated when their related feature bits are disabled. So callers may pass in such vqs with "names = NULL". Then we skip such vq allocations. Signed-off-by: Wei Wang Signed-off-by: Michael S. Tsirkin Signed-off-by: Wei Wang Signed-off-by: Wei Wang Reviewed-by: Cornelia Huck Cc: stable@vger.kernel.org Fixes: 86a559787e6f ("virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT") commit ddbeac07a39a81d82331a312d0578fab94fccbf1 Author: Wei Wang Date: Fri Dec 28 10:26:25 2018 +0800 virtio_pci: use queue idx instead of array idx to set up the vq When find_vqs, there will be no vq[i] allocation if its corresponding names[i] is NULL. For example, the caller may pass in names[i] (i=4) with names[2] being NULL because the related feature bit is turned off, so technically there are 3 queues on the device, and name[4] should correspond to the 3rd queue on the device. So we use queue_idx as the queue index, which is increased only when the queue exists. Signed-off-by: Wei Wang Signed-off-by: Michael S. Tsirkin Signed-off-by: Wei Wang Signed-off-by: Wei Wang commit d1c1dad89e7a8be2cfdc7b92deca2c8048f0d263 Author: Cornelia Huck Date: Thu Jan 3 17:08:04 2019 +0100 virtio: document virtio_config_ops restrictions Some transports (e.g. virtio-ccw) implement virtio operations that seem to be a simple read/write as something more involved that cannot be done from an atomic context. Give at least a hint about that. Signed-off-by: Cornelia Huck Signed-off-by: Michael S. Tsirkin commit b89a07c4373b27321b1f6d4b4fdc369fd45ef79d Author: Cornelia Huck Date: Thu Jan 3 17:08:03 2019 +0100 virtio: fix virtio_config_ops description - get_features has returned 64 bits since commit d025477368792 ("virtio: add support for 64 bit features.") - properly mark all optional callbacks Signed-off-by: Cornelia Huck Signed-off-by: Michael S. Tsirkin Reviewed-by: Halil Pasic commit 2e8cb2cf1bd6e90f58bd517eb9ca1938e64fa51c Author: Rob Herring Date: Mon Jan 14 15:35:46 2019 -0600 PCI: Fix PCI kconfig menu organization After commit eb01d42a7778 ("PCI: consolidate PCI config entry in drivers/pci"), all the PCI kconfig options appear below "PCI support" rather than within a sub-menu. This is because menuconfig expects all kconfig entries to be enclosed in an if/endif section. Add the missing if/endif. With this, "depends on PCI" is redundant in the sub-menu entries and can be removed. Fixes: eb01d42a7778 ("PCI: consolidate PCI config entry in drivers/pci") Signed-off-by: Rob Herring Signed-off-by: Bjorn Helgaas Reviewed-by: Christoph Hellwig commit 7151449fe7fa5962c6153355f9779d6be99e8e97 Author: Mark Zhang Date: Mon Jan 14 17:32:58 2019 +0800 regmap-irq: do not write mask register if mask_base is zero If client have not provided the mask base register then do not write into the mask register. Signed-off-by: Laxman Dewangan Signed-off-by: Jinyoung Park Signed-off-by: Venkat Reddy Talla Signed-off-by: Mark Zhang Signed-off-by: Mark Brown commit 8a644c64a9f1aefb99fdc4413e6b7fee17809e38 Author: Aurelien Jarno Date: Sat Jan 12 20:37:28 2019 +0100 MIPS: OCTEON: fix kexec support Commit 62cac480f33f ("MIPS: kexec: Make a framework for both jumping and halting on nonboot CPUs") broke the build of the OCTEON platform as the relocated_kexec_smp_wait() is now static and not longer exported in kexec.h. Replace it by kexec_reboot() like it has been done in other places. Fixes: 62cac480f33f ("MIPS: kexec: Make a framework for both jumping and halting on nonboot CPUs") Signed-off-by: Aurelien Jarno Signed-off-by: Paul Burton Cc: linux-mips@vger.kernel.org Cc: Dengcheng Zhu Cc: ralf@linux-mips.org Cc: stable@vger.kernel.org # 4.20+ commit d6f4a21f309dfe10a5693ad236358dd6fcc46f7a Author: Jason Gunthorpe Date: Fri Jan 11 08:21:44 2019 +0200 RDMA/uverbs: Mark ioctl responses with UVERBS_ATTR_F_VALID_OUTPUT When the ioctl interface for the write commands was introduced it did not mark the core response with UVERBS_ATTR_F_VALID_OUTPUT. This causes rdma-core in userspace to not mark the buffers as written for valgrind. Along the same lines it turns out we have always missed marking the driver data. Fixing both of these makes valgrind work properly with rdma-core and ioctl. Fixes: 4785860e04bc ("RDMA/uverbs: Implement an ioctl that can call write and write_ex handlers") Signed-off-by: Jason Gunthorpe Reviewed-by: Artemy Kovalyov Signed-off-by: Leon Romanovsky commit ae1cf20df7a9c60ff5ef41c3315c33c1a5fafd77 Author: Nicholas Kazlauskas Date: Tue Dec 11 12:35:56 2018 -0500 drm/amd/display: Fix disabled cursor on top screen edge [Why] The cursor vanishes when touching the top of edge of the screen for Raven on Linux. This occurs because the cursor height is not taken into account when deciding to disable the cursor. [How] Factor in the cursor height into the cursor calculations - and mimic the existing x position calculations. Fixes: 94a4ffd1d40b ("drm/amd/display: fix PIP bugs on Dal3") Signed-off-by: Nicholas Kazlauskas Reviewed-by: Harry Wentland Acked-by: Leo Li Signed-off-by: Alex Deucher commit f5c412ac596fbe1508514257fef3d48e263f40a7 Author: Roman Li Date: Wed Dec 19 09:24:06 2018 -0500 drm/amd/display: fix warning on raven hotplug [Why] Hotplug on raven results in REG_WAIT_TIMEOUT warning due to failing attempt to lock disabled otg for the hubp interdependent pipes programming. [How] Don't setup pipe interdependencies for disabled otg. Also removed the unnecessary duplicate logic checks. Signed-off-by: Roman Li Reviewed-by: Dmytro Laktyushkin Acked-by: Leo Li Signed-off-by: Alex Deucher commit 20300db4aec5ba5edf6f0ad6f7111a51fbea7e10 Author: Charlene Liu Date: Wed Dec 12 18:09:16 2018 -0500 drm/amd/display: fix PME notification not working in RV desktop [Why] PPLIB not receive the PME when unplug. Signed-off-by: Charlene Liu Reviewed-by: Chris Park Acked-by: Leo Li Signed-off-by: Alex Deucher commit dddce8b490051018f8d5d1457af47483064c7e09 Author: Nicholas Kazlauskas Date: Thu Jan 10 15:12:48 2019 -0500 drm/amd/display: Only get the connector state for VRR when toggled [Why] This fixes a stuttering issue that occurs when moving a hardware cursor when VRR is enabled. Previously when VRR is enabled atomic check will grab the connector state for every atomic update. This has to lock the connector in order to do so. The locking is bad enough by itself for performance, but it gets worse with what we do just below that - add all the planes for the CRTC to the commit. This prevents the cursor fast path from working - there's more than one plane now. With state->allow_modeset = true on top of this, it also adds and removes all the planes from the DC context triggering a full (very slow) update in DC. [How] We need the connector state to get the VRR min/max capbilities, but we only need them when there's a CRTC mode change or when VRR is toggled. The condition has been updated accordingly. Fixes: 3cc22f281318 ("drm/amdgpu: Set FreeSync state using drm VRR properties") Signed-off-by: Nicholas Kazlauskas Reviewed-by: Leo Li Signed-off-by: Alex Deucher commit 099139bef026faefebc508ddb77d397cf55f1b15 Author: Josip Pavic Date: Tue Dec 11 15:13:08 2018 -0500 drm/amd/display: Pack DMCU iRAM alignment [Why] When the DMCU's iRAM definition was moved to the newly created power_helpers, a #pragma pack was lost, causing the iRAM to be misaligned [How] Restore the #pragma pack Signed-off-by: Josip Pavic Reviewed-by: Anthony Koo Acked-by: Leo Li Signed-off-by: Alex Deucher commit a29b01a1313d20a6d45c0f25858f31701cee625d Author: Kenneth Feng Date: Wed Jan 9 14:39:48 2019 +0800 drm/amd/powerplay: run acg btc for Vega12 acg btc was added to Vega12 Signed-off-by: Kenneth Feng Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit bbdf514fe5648566b0754476cbcb92ac3422dde2 Author: Felix Kuehling Date: Wed Jan 2 17:47:39 2019 -0500 drm/amdkfd: Don't assign dGPUs to APU topology devices dGPUs need their own topology devices. Don't assign them to APU topology devices with CPU cores. Bug: https://github.com/RadeonOpenCompute/ROCK-Kernel-Driver/issues/66 Signed-off-by: Felix Kuehling Tested-by: Elias Konstantinidis Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit d1c234e2cd1091b816c990a1848d88a8697f97b4 Author: Felix Kuehling Date: Wed Jan 2 14:52:13 2019 -0500 drm/amdkfd: Allow building KFD on ARM64 (v2) ifdef x86_64 specific code. Allow enabling CONFIG_HSA_AMD on ARM64. v2: Fixed a compiler warning due to an unused variable CC: Mark Nutter Signed-off-by: Felix Kuehling Tested-by: Mark Nutter Acked-by: Alex Deucher Acked-by: Christian König Signed-off-by: Alex Deucher commit 3719876809e745b9db5293d418600c194bbf5c23 Author: Steven Rostedt (VMware) Date: Mon Jan 14 12:25:40 2019 -0500 sbitmap: Protect swap_lock from softirqs The swap_lock used by sbitmap has a chain with locks taken from softirq, but the swap_lock is not protected from being preempted by softirqs. A chain exists of: sbq->ws[i].wait -> dispatch_wait_lock -> swap_lock Where the sbq->ws[i].wait lock can be taken from softirq context, which means all locks below it in the chain must also be protected from softirqs. Reported-by: Clark Williams Fixes: 58ab5e32e6fd ("sbitmap: silence bogus lockdep IRQ warning") Fixes: ea86ea2cdced ("sbitmap: amortize cost of clearing bits") Cc: Jens Axboe Cc: Ming Lei Cc: Guenter Roeck Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Linus Torvalds commit c962cb323ec260652cff9331e7bf3d606292db88 Merge: 9deb9e1637761 e3e4767bd550b Author: Linus Torvalds Date: Tue Jan 15 06:26:28 2019 +1200 Merge tag 'gpio-v5.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio Pull GPIO fixes from Linus Walleij: "The patch hitting the MMC/SD subsystem is fixing up my own mess when moving semantics from MMC/SD over to gpiolib. Ulf is on vacation but I managed to reach him on chat and obtain his ACK. The other two are early-rc fixes that are not super serious but pretty annoying so I'd like to get rid of them. Summary: - Get rid of some WARN_ON() from the ACPI code - Staticize a symbol - Fix MMC polarity detection" * tag 'gpio-v5.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: mmc: core: don't override the CD GPIO level when "cd-inverted" is set gpio: pca953x: Make symbol 'pca953x_i2c_regmap' static gpiolib-acpi: Remove unnecessary WARN_ON from acpi_gpiochip_free_interrupts commit 9deb9e1637761cc4e6df5104a34197ef0bae1358 Merge: 3a73e73a10a79 3f2d347e851ef Author: Linus Torvalds Date: Tue Jan 15 06:24:36 2019 +1200 Merge tag 'mfd-next-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Device Support - Add support for Power Supply to AXP813 - Add support for GPIO, ADC, AC and Battery Power Supply to AXP803 - Add support for UART to Exynos LPASS Fix-ups: - Use supplied MACROS; ti_am335x_tscadc - Trivial spelling/whitespace/alignment; tmio, axp20x, rave-sp - Regmap changes; bd9571mwv, wm5110-tables - Kconfig dependencies; MFD_AT91_USART - Supply shared data for child-devices; madera-core - Use new of_node_name_eq() API call; max77620, stmpe - Use managed resources (devm_*); tps65218 - Comment descriptions; ingenic-tcu - Coding style; madera-core Bug Fixes: - Fix section mismatches; twl-core, db8500-prcmu - Correct error path related issues; mt6397-core, ab8500-core, mc13xxx-core - IRQ related fixes; tps6586x - Ensure proper initialisation sequence; qcom_rpm - Repair potential memory leak; cros_ec_dev" * tag 'mfd-next-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (25 commits) mfd: exynos-lpass: Enable UART module support mfd: mc13xxx: Fix a missing check of a register-read failure mfd: cros_ec: Add commands to control codec mfd: madera: Remove spurious semicolon in while loop mfd: rave-sp: Fix typo in rave_sp_checksum comment mfd: ingenic-tcu: Fix bit field description in header mfd: tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe() mfd: Use of_node_name_eq() for node name comparisons mfd: cros_ec_dev: Add missing mfd_remove_devices() call in remove mfd: axp20x: Add supported cells for AXP803 mfd: axp20x: Re-align MFD cell entries mfd: axp20x: Add AC power supply cell for AXP813 mfd: wm5110: Add missing ASRC rate register mfd: qcom_rpm: write fw_version to CTRL_REG mfd: tps6586x: Handle interrupts on suspend mfd: madera: Add shared data for accessory detection mfd: at91-usart: Add platform dependency mfd: bd9571mwv: Add volatile register to make DVFS work mfd: ab8500-core: Return zero in get_register_interruptible() mfd: tmio: Typo s/use use/use/ ... commit 3a73e73a10a791344587103a1adbe0c5f02fedeb Merge: 1c7fc5cbc3398 3cee7a7d05b11 Author: Linus Torvalds Date: Tue Jan 15 06:21:10 2019 +1200 Merge tag 'backlight-next-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: "Fix-ups: - Use new of_node_name_eq() API call Bug Fixes: - Internally track 'enabled' state in pwm_bl - Fix auto-generated pwm_bl brightness tables parsed by DT * tag 'backlight-next-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: 88pm860x_bl: Use of_node_name_eq for node name comparisons backlight: pwm_bl: Fix devicetree parsing with auto-generated brightness tables backlight: pwm_bl: Re-add driver internal enabled tracking commit f672b93e4a0a4947d2e1103ed8780e01e13eadb6 Author: Julia Lawall Date: Sun Jan 13 10:44:51 2019 +0100 drm/meson: add missing of_node_put Add an of_node_put when the result of of_graph_get_remote_port_parent is not available. An of_node_put is also needed when meson_probe_remote completes. This was present at the recursive call, but not in the call from meson_drv_probe. The semantic match that finds this problem is as follows (http://coccinelle.lip6.fr): // @r exists@ local idexpression e; expression x; @@ e = of_graph_get_remote_port_parent(...); ... when != x = e when != true e == NULL when != of_node_put(e) when != of_fwnode_handle(e) ( return e; | *return ...; ) // Signed-off-by: Julia Lawall Acked-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/1547372691-28324-4-git-send-email-Julia.Lawall@lip6.fr commit 5268c8f39e0efef81af2aaed160272d9eb507beb Author: Talons Lee Date: Mon Dec 10 18:03:00 2018 +0800 always clear the X2APIC_ENABLE bit for PV guest Commit e657fcc clears cpu capability bit instead of using fake cpuid value, the EXTD should always be off for PV guest without depending on cpuid value. So remove the cpuid check in xen_read_msr_safe() to always clear the X2APIC_ENABLE bit. Signed-off-by: Talons Lee Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit 6251691a92170d3a781aaf7b5f2c31b50d669809 Author: Marcos Paulo de Souza Date: Mon Jan 14 06:31:56 2019 -0700 md: Make bio_alloc_mddev use bio_alloc_bioset bio_alloc_bioset returns a bio pointer or NULL, so we can avoid storing the returned data into a new variable. Acked-by: Guoqing Jiang Acked-by: Artur Paszkiewicz Signed-off-by: Marcos Paulo de Souza Signed-off-by: Jens Axboe commit 5bf859081f6a7575a3f7509d7a70d0a9baa88ce3 Author: Paolo Valente Date: Thu Dec 6 19:18:19 2018 +0100 block, bfq: fix comments on __bfq_deactivate_entity Comments on function __bfq_deactivate_entity contains two imprecise or wrong statements: 1) The function performs the deactivation of the entity. 2) The function must be invoked only if the entity is on a service tree. This commits replaces both statements with the correct ones: 1) The functions updates sched_data and service trees for the entity, so as to represent entity as inactive (which is only part of the steps needed for the deactivation of the entity). 2) The function must be invoked on every entity being deactivated. Signed-off-by: Paolo Valente Signed-off-by: Jens Axboe commit 2314e879747e82896f51cce4488f6a00f3e1af7b Author: Henry Yen Date: Mon Jan 14 17:59:43 2019 +0800 netfilter: nft_flow_offload: fix checking method of conntrack helper This patch uses nfct_help() to detect whether an established connection needs conntrack helper instead of using test_bit(IPS_HELPER_BIT, &ct->status). The reason is that IPS_HELPER_BIT is only set when using explicit CT target. However, in the case that a device enables conntrack helper via command "echo 1 > /proc/sys/net/netfilter/nf_conntrack_helper", the status of IPS_HELPER_BIT will not present any change, and consequently it loses the checking ability in the context. Signed-off-by: Henry Yen Reviewed-by: Ryder Lee Tested-by: John Crispin Signed-off-by: Pablo Neira Ayuso commit b318e3ff7ca065d6b107e424c85a63d7a6798a69 Author: Gerd Hoffmann Date: Thu Jan 10 12:15:45 2019 +0100 drm/virtio: drop prime import/export callbacks Also set prime_handle_to_fd and prime_fd_to_handle to NULL, so drm will not advertive DRM_PRIME_CAP_{IMPORT,EXPORT} to userspace. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko Reviewed-by: Dave Airlie Link: http://patchwork.freedesktop.org/patch/msgid/20190110111545.26768-1-kraxel@redhat.com commit f4c34b1e2a37d5676180901fa6ff188bcb6371f8 Author: Gerd Hoffmann Date: Thu Jan 10 09:17:50 2019 +0100 drm/qxl: drop prime import/export callbacks Also set prime_handle_to_fd and prime_fd_to_handle to NULL, so drm will not advertive DRM_PRIME_CAP_{IMPORT,EXPORT} to userspace. Signed-off-by: Gerd Hoffmann Reviewed-by: Dave Airlie Link: http://patchwork.freedesktop.org/patch/msgid/20190110081750.11358-1-kraxel@redhat.com commit ba0a64bcf8fc491f73e4646069d97abb4374beb3 Author: Colin Xu Date: Fri Jan 11 14:25:54 2019 +0800 drm/i915/gvt: Allow F_CMD_ACCESS on mmio 0x21f0 The newly updated guest driver could program 0x21f0 via lri and srm, without F_CMD_ACCESS flag cmd parser will stop parser reset cmd. 0x21f0 applies to BDW, SKL, KBL, BXT and CFL. Reviewed-by: Yan Zhao Signed-off-by: Colin Xu Signed-off-by: Zhenyu Wang commit bd352a739fde9834d48379e8eca428fe897144ac Author: Masahiro Yamada Date: Mon Jan 14 12:16:45 2019 +0900 kbuild: remove unused baseprereq Commit eea199b445f6 ("kbuild: remove unnecessary LEX_PREFIX and YACC_PREFIX") removed the last users of this macro. Signed-off-by: Masahiro Yamada commit 16fd20aa98080c2fa666dc384036ec08c80af710 Author: Paul Burton Date: Fri Jan 11 19:06:44 2019 +0000 kbuild: Disable LD_DEAD_CODE_DATA_ELIMINATION with ftrace & GCC <= 4.7 When building using GCC 4.7 or older, -ffunction-sections & the -pg flag used by ftrace are incompatible. This causes warnings or build failures (where -Werror applies) such as the following: arch/mips/generic/init.c: error: -ffunction-sections disabled; it makes profiling impossible This used to be taken into account by the ordering of calls to cc-option from within the top-level Makefile, which was introduced by commit 90ad4052e85c ("kbuild: avoid conflict between -ffunction-sections and -pg on gcc-4.7"). Unfortunately this was broken when the CONFIG_LD_DEAD_CODE_DATA_ELIMINATION cc-option check was moved to Kconfig in commit e85d1d65cd8a ("kbuild: test dead code/data elimination support in Kconfig"), because the flags used by this check no longer include -pg. Fix this by not allowing CONFIG_LD_DEAD_CODE_DATA_ELIMINATION to be enabled at the same time as ftrace/CONFIG_FUNCTION_TRACER when building using GCC 4.7 or older. Signed-off-by: Paul Burton Fixes: e85d1d65cd8a ("kbuild: test dead code/data elimination support in Kconfig") Reported-by: Geert Uytterhoeven Cc: Nicholas Piggin Cc: stable@vger.kernel.org # v4.19+ Signed-off-by: Masahiro Yamada commit 2648ca1859bb48cacdbbaf60bbc0bfef74f13330 Author: Masahiro Yamada Date: Fri Jan 11 11:51:48 2019 +0900 kconfig: clean generated *conf-cfg files I accidentally dropped '*' in the previous renaming patch. Revive it so that 'make mrproper' can clean the generated files. Fixes: d86271af6460 ("kconfig: rename generated .*conf-cfg to *conf-cfg") Signed-off-by: Masahiro Yamada commit 1c7fc5cbc33980acd13d668f1c8f0313d6ae9fd8 Author: Linus Torvalds Date: Mon Jan 14 10:41:12 2019 +1200 Linux 5.0-rc2 commit b7285b425318331c2de4af2a784a18e6dccef484 Author: Jonathan Neuschäfer Date: Sat Jan 12 18:14:30 2019 +0100 kernel/sys.c: Clarify that UNAME26 does not generate unique versions anymore UNAME26 is a mechanism to report Linux's version as 2.6.x, for compatibility with old/broken software. Due to the way it is implemented, it would have to be updated after 5.0, to keep the resulting versions unique. Linus Torvalds argued: "Do we actually need this? I'd rather let it bitrot, and just let it return random versions. It will just start again at 2.4.60, won't it? Anybody who uses UNAME26 for a 5.x kernel might as well think it's still 4.x. The user space is so old that it can't possibly care about differences between 4.x and 5.x, can it? The only thing that matters is that it shows "2.4.", which it will do regardless" Signed-off-by: Jonathan Neuschäfer Signed-off-by: Linus Torvalds commit dbc3c09b819f2bd42460b148e55ac5a9d83aaeaf Merge: 6b529fb0a3eab 465612178b448 Author: Linus Torvalds Date: Mon Jan 14 10:34:14 2019 +1200 Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC fixes from Olof Johansson: "A bigger batch than I anticipated this week, for two reasons: - Some fallout on Davinci from board file -> DTB conversion, that also includes a few longer-standing fixes (i.e. not recent regressions). - drivers/reset material that has been in linux-next for a while, but didn't get sent to us until now for a variety of reasons (maintainer out sick, holidays, etc). There's a functional dependency in there such that one platform (Altera's SoCFPGA) won't boot without one of the patches; instead of reverting the patch that got merged, I looked at this set and decided it was small enough that I'll pick it up anyway. If you disagree I can revisit with a smaller set. That being said, there's also a handful of the usual stuff: - Fix for a crash on Armada 7K/8K when the kernel touches PSCI-reserved memory - Fix for PCIe reset on Macchiatobin (Armada 8K development board, what this email is sent from in fact :) - Enable a few new-merged modules for Amlogic in arm64 defconfig - Error path fixes on Integrator - Build fix for Renesas and Qualcomm - Initialization fix for Renesas RZ/G2E .. plus a few more fixlets" * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (28 commits) ARM: integrator: impd1: use struct_size() in devm_kzalloc() qcom-scm: Include header gpio: pl061: handle failed allocations ARM: dts: kirkwood: Fix polarity of GPIO fan lines arm64: dts: marvell: mcbin: fix PCIe reset signal arm64: dts: marvell: armada-ap806: reserve PSCI area ARM: dts: da850-lcdk: Correct the sound card name ARM: dts: da850-lcdk: Correct the audio codec regulators ARM: dts: da850-evm: Correct the sound card name ARM: dts: da850-evm: Correct the audio codec regulators ARM: davinci: omapl138-hawk: fix label names in GPIO lookup entries ARM: davinci: dm644x-evm: fix label names in GPIO lookup entries ARM: davinci: dm355-evm: fix label names in GPIO lookup entries ARM: davinci: da850-evm: fix label names in GPIO lookup entries ARM: davinci: da830-evm: fix label names in GPIO lookup entries arm64: defconfig: enable modules for amlogic s400 sound card reset: uniphier-glue: Add AHCI reset control support in glue layer dt-bindings: reset: uniphier: Add AHCI core reset description reset: uniphier-usb3: Rename to reset-uniphier-glue dt-bindings: reset: uniphier: Replace the expression of USB3 with generic peripherals ... commit a17ce9960b3628b9f546c454741a1cad551d5695 Author: Julia Lawall Date: Sun Jan 13 09:47:43 2019 +0100 drm/rockchip: add missing of_node_put The device node iterators perform an of_node_get on each iteration, so a jump out of the loop requires an of_node_put. The semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @@ expression root,e; local idexpression child; iterator name for_each_child_of_node; @@ for_each_child_of_node(root, child) { ... when != of_node_put(child) when != e = child + of_node_put(child); ? break; ... } ... when != child // Fixes: 1f0f01515172 ("drm/rockchip: Add support for Rockchip Soc RGB output interface") Cc: stable@vger.kernel.org Signed-off-by: Julia Lawall [added fixes and cc-stable] Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/1547369264-24831-4-git-send-email-Julia.Lawall@lip6.fr commit 6b529fb0a3eabf9c4cc3e94c11477250379ce6d8 Merge: 72d657dd21158 1b3922a8bc742 Author: Linus Torvalds Date: Mon Jan 14 05:55:51 2019 +1200 Merge tag 'for-5.0-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - two regression fixes in clone/dedupe ioctls, the generic check callback needs to lock extents properly and wait for io to avoid problems with writeback and relocation - fix deadlock when using free space tree due to block group creation - a recently added check refuses a valid fileystem with seeding device, make that work again with a quickfix, proper solution needs more intrusive changes * tag 'for-5.0-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: Use real device structure to verify dev extent Btrfs: fix deadlock when using free space tree due to block group creation Btrfs: fix race between reflink/dedupe and relocation Btrfs: fix race between cloning range ending at eof and writeback commit 72d657dd2115804b93bde4b77e426cc2de70eebf Merge: f7c1038bc7597 735df0ff6ece7 Author: Linus Torvalds Date: Mon Jan 14 05:51:08 2019 +1200 Merge tag 'driver-core-5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core fixes from Greg KH: "Here is one small sysfs change, and a documentation update for 5.0-rc2 The sysfs change moves from using BUG_ON to WARN_ON, as discussed in an email thread on lkml while trying to track down another driver bug. sysfs should not be crashing and preventing people from seeing where they went wrong. Now it properly recovers and warns the developer. The documentation update removes the use of BUS_ATTR() as the kernel is moving away from this to use the specific BUS_ATTR_RW() and friends instead. There are pending patches in all of the different subsystems to remove the last users of this macro, but for now, don't advertise it should be used anymore to keep new ones from being introduced. Both have been in linux-next with no reported issues" * tag 'driver-core-5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: Documentation: driver core: remove use of BUS_ATTR sysfs: convert BUG_ON to WARN_ON commit f7c1038bc7597af5d6809c5b3e0352627cef5c07 Merge: 437e878a6c480 06382deac2b8a Author: Linus Torvalds Date: Mon Jan 14 05:49:35 2019 +1200 Merge tag 'staging-5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver fixes from Greg KH: "Here are some small staging driver fixes for some reported issues. One reverts a patch that was made to the rtl8723bs driver that turned out to not be needed at all as it was a bug in clang. The others fix up some reported issues in the rtl8188eu driver and update the MAINTAINERS file to point to Larry for this driver so he can get the bug reports easier. All have been in linux-next with no reported issues" * tag 'staging-5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: Revert "staging: rtl8723bs: Mark ACPI table declaration as used" staging: rtl8188eu: Fix module loading from tasklet for WEP encryption staging: rtl8188eu: Fix module loading from tasklet for CCMP encryption MAINTAINERS: Add entry for staging driver r8188eu commit 437e878a6c48028273e4b06be7e09d235b189e62 Merge: 1dd8a3f6c6197 d3736d82e8169 Author: Linus Torvalds Date: Mon Jan 14 05:47:48 2019 +1200 Merge tag 'tty-5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial fixes from Greg KH: "Here are 2 tty and serial fixes for 5.0-rc2 that resolve some reported issues. The first is a simple serial driver fix for a regression that showed up in 5.0-rc1. The second one resolves a number of reported issues with the recent tty locking fixes that went into 5.0-rc1. Lots of people have tested the second one and say it resolves their issues. Both have been in linux-next with no reported issues" * tag 'tty-5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: tty: Don't hold ldisc lock in tty_reopen() if ldisc present serial: lantiq: Do not swap register read/writes commit 1dd8a3f6c619723ab442d6a27247d2f2153f3b11 Merge: 0f9d140a56653 b9fcb0e6b7052 Author: Linus Torvalds Date: Mon Jan 14 05:45:28 2019 +1200 Merge tag 'usb-5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "Here are some small USB driver fixes and quirk updates for 5.0-rc2. The majority here are some quirks for some storage devices to get them to work properly. There's also a fix here to resolve the reported issues with some audio devices that say they are UAC3 compliant, but really are not. And a fix up for the MAINTAINERS file to remove a dead url. All have been in linux-next with no reported issues" * tag 'usb-5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: storage: Remove outdated URL from MAINTAINERS USB: Add USB_QUIRK_DELAY_CTRL_MSG quirk for Corsair K70 RGB usbcore: Select only first configuration for non-UAC3 compliant devices USB: storage: add quirk for SMI SM3350 USB: storage: don't insert sane sense for SPC3+ when bad sense specified usb: cdc-acm: send ZLP for Telit 3G Intel based modems commit 0f9d140a566532175b4555401ee47ed58b01f9c9 Merge: e1706720408e7 48d2ba6257013 Author: Linus Torvalds Date: Mon Jan 14 05:43:40 2019 +1200 Merge tag '5.0-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: "A set of cifs/smb3 fixes, 4 for stable, most from Pavel. His patches fix an important set of crediting (flow control) problems, and also two problems in cifs_writepages, ddressing some large i/o and also compounding issues" * tag '5.0-rc1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: update internal module version number CIFS: Fix error paths in writeback code CIFS: Move credit processing to mid callbacks for SMB3 CIFS: Fix credits calculation for cancelled requests cifs: Fix potential OOB access of lock element array cifs: Limit memory used by lock request calls to a page cifs: move large array from stack to heap CIFS: Do not hide EINTR after sending network packets CIFS: Fix credit computation for compounded requests CIFS: Do not set credits to 1 if the server didn't grant anything CIFS: Fix adjustment of credits for MTU requests cifs: Fix a tiny potential memory leak cifs: Fix a debug message commit 465612178b44840b2066e62c3bcfae80862011d4 Merge: 56acb3ef76177 d0c2d2101b4c1 Author: Olof Johansson Date: Sat Jan 12 22:06:54 2019 -0800 Merge tag 'reset-for-5.0-rc2' of git://git.pengutronix.de/git/pza/linux into fixes Late reset controller changes for v5.0 This adds missing deassert functionality to the ARC HSDK reset driver, fixes some indentation and grammar issues in the kernel docs, adds a helper to count the number of resets on a device for the non-DT case as well, adds an early reset driver for SoCFPGA and simple reset driver support for Stratix10, and generalizes the uniphier USB3 glue layer reset to also cover AHCI. * tag 'reset-for-5.0-rc2' of git://git.pengutronix.de/git/pza/linux: reset: uniphier-glue: Add AHCI reset control support in glue layer dt-bindings: reset: uniphier: Add AHCI core reset description reset: uniphier-usb3: Rename to reset-uniphier-glue dt-bindings: reset: uniphier: Replace the expression of USB3 with generic peripherals ARM: socfpga: dts: document "altr,stratix10-rst-mgr" binding reset: socfpga: add an early reset driver for SoCFPGA reset: fix null pointer dereference on dev by dev_name reset: Add reset_control_get_count() reset: Improve reset controller kernel docs ARC: HSDK: improve reset driver Signed-off-by: Olof Johansson commit 56acb3ef76177a5aabe6613bf27348d34f1e65c0 Merge: 2ec472edcd729 b5f034845e709 Author: Olof Johansson Date: Sat Jan 12 22:03:59 2019 -0800 Merge tag 'mvebu-fixes-5.0-1' of git://git.infradead.org/linux-mvebu into fixes mvebu fixes for 5.0 They are all device tree fixes which also worth being in stable: - Reserve PSCI area on Armada 7K/8K preventing the kernel accessing this area and crashing while doing it. - Use correct PCIe reset signal on MACCHIATOBin (Armada 8040 based) - Fix polarity of GPIO fan line D-Link DNS NASes(kikwood based) * tag 'mvebu-fixes-5.0-1' of git://git.infradead.org/linux-mvebu: ARM: dts: kirkwood: Fix polarity of GPIO fan lines arm64: dts: marvell: mcbin: fix PCIe reset signal arm64: dts: marvell: armada-ap806: reserve PSCI area Signed-off-by: Olof Johansson commit 2ec472edcd72947b031ec998d646dd7a6be958dd Merge: 431a8b73de584 21face6f0d4d0 Author: Olof Johansson Date: Sat Jan 12 22:03:18 2019 -0800 Merge tag 'integrator-fixes-armsoc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator into fixes Fixes for the Integrator: - Handle failed allocations in the IM/PC bus attachment. - Use struct_size() for allocation. * tag 'integrator-fixes-armsoc' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator: ARM: integrator: impd1: use struct_size() in devm_kzalloc() gpio: pl061: handle failed allocations Signed-off-by: Olof Johansson commit 431a8b73de58448227515767c757cb6731ab5854 Merge: f4f8aa6de35a8 19a220dd1e8a1 Author: Olof Johansson Date: Sat Jan 12 22:02:28 2019 -0800 Merge tag 'amlogic-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into fixes Amlogic DT fixes for v5.0-rc - arm64: defconfig: enable modules for amlogic s400 sound card * tag 'amlogic-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: arm64: defconfig: enable modules for amlogic s400 sound card Signed-off-by: Olof Johansson commit f4f8aa6de35a86c2207fca0f4c48542ce4ef9e14 Merge: 98a5f673119b9 2076607a20bd4 Author: Olof Johansson Date: Sat Jan 12 22:01:49 2019 -0800 Merge tag 'qcom-fixes-for-5.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into fixes Qualcomm Driver Fixes for 5.0-rc1 * Add required includes into qcom_scm.h * tag 'qcom-fixes-for-5.0-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux: qcom-scm: Include header Signed-off-by: Olof Johansson commit 98a5f673119b918272894fe3fecf5136fe786e13 Merge: 70bf439a9492e c25748acc5c20 Author: Olof Johansson Date: Sat Jan 12 22:00:36 2019 -0800 Merge tag 'davinci-fixes-for-v5.0' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into fixes This pull request fixes some more regressions on legacy DaVinci board support due to GPIO driver clean-up introduced in v4.20 kernel. These are marked for stable. Also has fixes for some long standing Audio issues on DA850 boards. * tag 'davinci-fixes-for-v5.0' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci: ARM: dts: da850-lcdk: Correct the sound card name ARM: dts: da850-lcdk: Correct the audio codec regulators ARM: dts: da850-evm: Correct the sound card name ARM: dts: da850-evm: Correct the audio codec regulators ARM: davinci: omapl138-hawk: fix label names in GPIO lookup entries ARM: davinci: dm644x-evm: fix label names in GPIO lookup entries ARM: davinci: dm355-evm: fix label names in GPIO lookup entries ARM: davinci: da850-evm: fix label names in GPIO lookup entries ARM: davinci: da830-evm: fix label names in GPIO lookup entries Signed-off-by: Olof Johansson commit 70bf439a9492e7687bf2b9e8576f609160b21200 Merge: bfeffd1552837 a64597227d0de Author: Olof Johansson Date: Sat Jan 12 21:59:42 2019 -0800 Merge tag 'renesas-fixes-for-v5.0' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into fixes Renesas ARM Based SoC Fixes for v5.0 Renesas SoCs: * Fix build regressions caused by move of Kconfig symbols RZ/G2E (r8a774c0) SoC: * Correct initialization order of 3DG-{A,B} in SYSC driver * tag 'renesas-fixes-for-v5.0' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: soc: renesas: r8a774c0-sysc: Fix initialization order of 3DG-{A,B} ARM: shmobile: fix build regressions Signed-off-by: Olof Johansson commit e1706720408e72fb883f6b151c2b3b23d8e7e5b2 Author: John Hubbard Date: Sat Jan 12 17:29:09 2019 -0800 phy: fix build breakage: add PHY_MODE_SATA Commit 49e54187ae0b ("ata: libahci_platform: comply to PHY framework") uses the PHY_MODE_SATA, but that enum had not yet been added. This caused a build failure for me, with today's linux.git. Also, there is a potentially conflicting (mis-named) PHY_MODE_SATA, hiding in the Marvell Berlin SATA PHY driver. Fix the build by: 1) Renaming Marvell's defined value to a more scoped name, in order to avoid any potential conflicts: PHY_BERLIN_MODE_SATA. 2) Adding the missing enum, which was going to be added anyway as part of [1]. [1] https://lkml.kernel.org/r/20190108163124.6409-3-miquel.raynal@bootlin.com Fixes: 49e54187ae0b ("ata: libahci_platform: comply to PHY framework") Signed-off-by: John Hubbard Acked-by: Jens Axboe Acked-by: Olof Johansson Cc: Grzegorz Jaszczyk Cc: Miquel Raynal Cc: Hans de Goede Signed-off-by: Linus Torvalds commit b8c3b8992ff2827482ac1543f84f5024a72c4f2e Merge: 66c56cfa64d9d bde0b5c109e8b Author: Linus Torvalds Date: Sat Jan 12 13:40:51 2019 -0800 Merge tag 'for-linus-20190112' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - NVMe pull request from Christoph, with little fixes all over the map - Loop caching fix for offset/bs change (Jaegeuk Kim) - Block documentation tweaks (Jeff, Jon, Weiping, John) - null_blk zoned tweak (John) - ahch mvebu suspend/resume support. Should have gone into the merge window, but there was some confusion on which tree had it. (Miquel) * tag 'for-linus-20190112' of git://git.kernel.dk/linux-block: (22 commits) ata: ahci: mvebu: request PHY suspend/resume for Armada 3700 ata: ahci: mvebu: add Armada 3700 initialization needed for S2RAM ata: ahci: mvebu: do Armada 38x configuration only on relevant SoCs ata: ahci: mvebu: remove stale comment ata: libahci_platform: comply to PHY framework loop: drop caches if offset or block_size are changed block: fix kerneldoc comment for blk_attempt_plug_merge() nvme: don't initlialize ctrl->cntlid twice nvme: introduce NVME_QUIRK_IGNORE_DEV_SUBNQN nvme: pad fake subsys NQN vid and ssvid with zeros nvme-multipath: zero out ANA log buffer nvme-fabrics: unset write/poll queues for discovery controllers nvme-tcp: don't ask if controller is fabrics nvme-tcp: remove dead code nvme-pci: fix out of bounds access in nvme_cqe_pending nvme-pci: rerun irq setup on IO queue init errors nvme-pci: use the same attributes when freeing host_mem_desc_bufs. nvme-pci: fix the wrong setting of nr_maps block: doc: add slice_idle_us to bfq documentation block: clarify documentation for blk_{start|finish}_plug ... commit 66c56cfa64d9dbb9efa8a06c1aece77e8d57ea19 Merge: 473348891c36f dfd32cad146e3 Author: Linus Torvalds Date: Sat Jan 12 10:52:40 2019 -0800 Merge tag 'remove-dma_zalloc_coherent-5.0' of git://git.infradead.org/users/hch/dma-mapping Pull dma_zalloc_coherent() removal from Christoph Hellwig: "We've always had a weird situation around dma_zalloc_coherent. To safely support mapping the allocations to userspace major architectures like x86 and arm have always zeroed allocations from dma_alloc_coherent, but a couple other architectures were missing that zeroing either always or in corner cases. Then later we grew anothe dma_zalloc_coherent interface to explicitly request zeroing, but that just added __GFP_ZERO to the allocation flags, which for some allocators that didn't end up using the page allocator ended up being a no-op and still not zeroing the allocations. So for this merge window I fixed up all remaining architectures to zero the memory in dma_alloc_coherent, and made dma_zalloc_coherent a no-op wrapper around dma_alloc_coherent, which fixes all of the above issues. dma_zalloc_coherent is now pointless and can go away, and Luis helped me writing a cocchinelle script and patch series to kill it, which I think we should apply now just after -rc1 to finally settle these issue" * tag 'remove-dma_zalloc_coherent-5.0' of git://git.infradead.org/users/hch/dma-mapping: dma-mapping: remove dma_zalloc_coherent() cross-tree: phase out dma_zalloc_coherent() on headers cross-tree: phase out dma_zalloc_coherent() commit 2f960bd0564081ff85d2eea54890b0d2356934f8 Merge: 8d008e64a2ebe 6ef982dec7eda Author: David S. Miller Date: Sat Jan 12 10:51:39 2019 -0800 Merge branch 'bnxt_en-Bug-fixes-for-57500-chips' Michael Chan says: ==================== bnxt_en: Bug fixes for 57500 chips. Two small bug fixes for ring checking and context memory allocation that affect the new 57500 chips. ==================== Signed-off-by: David S. Miller commit 6ef982dec7eda9affa81a2bb84f75441deb56d06 Author: Michael Chan Date: Sat Jan 12 00:13:05 2019 -0500 bnxt_en: Fix context memory allocation. When allocating memory pages for context memory, if the last page table should be fully populated, the current code will set nr_pages to 0 when calling bnxt_alloc_ctx_mem_blk(). This will cause the last page table to be completely blank and causing some RDMA failures. Fix it by setting the last page table's nr_pages to the remainder only if it is non-zero. Fixes: 08fe9d181606 ("bnxt_en: Add Level 2 context memory paging support.") Reported-by: Eric Davis Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 0b815023a1d479aa8f8851ee880d5388e53b7ae5 Author: Michael Chan Date: Sat Jan 12 00:13:04 2019 -0500 bnxt_en: Fix ring checking logic on 57500 chips. In bnxt_hwrm_check_pf_rings(), add the proper flag to test the NQ resources. Without the proper flag, the firmware will change the NQ resource allocation and remap the IRQ, causing missing IRQs. This issue shows up when adding MQPRIO TX queues, for example. Fixes: 36d65be9a880 ("bnxt_en: Disable MSIX before re-reserving NQs/CMPL rings.") Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 473348891c36ff6de3e224fefa0b3fc86a629178 Merge: 7b5c8f5226bd0 826c1362e79ab Author: Linus Torvalds Date: Sat Jan 12 10:39:43 2019 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull KVM fixes from Radim Krčmář: "Minor fixes for new code, corner cases, and documentation" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: x86/kvm/nVMX: don't skip emulated instruction twice when vmptr address is not backed Documentation/virtual/kvm: Update URL for AMD SEV API specification KVM/VMX: Avoid return error when flush tlb successfully in the hv_remote_flush_tlb_with_range() kvm: sev: Fail KVM_SEV_INIT if already initialized KVM: validate userspace input in kvm_clear_dirty_log_protect() KVM: x86: Fix bit shifting in update_intel_pt_cfg commit 7b5c8f5226bd0eb77da8a055f43b2f1a06e92ba8 Merge: 4b3c31c8d4dda e2d3c414ec0f9 Author: Linus Torvalds Date: Sat Jan 12 10:30:43 2019 -0800 Merge tag 'drm-fixes-2019-01-11-1' of git://anongit.freedesktop.org/drm/drm Pull more drm fixes from Daniel Vetter: "Dave sends out his pull, everybody remembers holidays are over :-) Since Dave's already in weekend mode and it was quite a few patches I figured better to apply all the pulls and forward them to you. Hence here 2nd part of bugfixes for -rc2. nouveau: - backlight fix - falcon register access fix - fan fix. i915: - Disable PSR for Apple panels - Broxton ERR_PTR error state fix - Kabylake VECS workaround fix - Unwind failure on pinning the gen7 ppgtt - GVT workload request allocation fix core: - Fix fb-helper to work correctly with SDL 1.2 bugs - Fix lockdep warning in the atomic ioctl and setproperty" * tag 'drm-fixes-2019-01-11-1' of git://anongit.freedesktop.org/drm/drm: drm/nouveau/falcon: avoid touching registers if engine is off drm/nouveau: Don't disable polling in fallback mode drm/nouveau: register backlight on pascal and newer drm: Fix documentation generation for DP_DPCD_QUIRK_NO_PSR drm/i915: init per-engine WAs for all engines drm/i915: Unwind failure on pinning the gen7 ppgtt drm/i915: Skip the ERR_PTR error state drm/i915: Disable PSR in Apple panels gpu/drm: Fix lock held when returning to user space. drm/fb-helper: Ignore the value of fb_var_screeninfo.pixclock drm/fb-helper: Partially bring back workaround for bugs of SDL 1.2 drm/i915/gvt: Fix workload request allocation before request add commit 9e8f1c79831424d30c0e3df068be7f4a244157c9 Author: Varun Prakash Date: Thu Jan 10 23:29:28 2019 +0530 scsi: cxgb4i: add wait_for_completion() In case of ->set_param() and ->bind_conn() cxgb4i driver does not wait for cmd completion, this can create race conditions, to avoid this add wait_for_completion(). Signed-off-by: Varun Prakash Signed-off-by: Martin K. Petersen commit 4a01ab60f55041b1ccc760e43258a5b3aeeca1bc Author: Thomas Bogendoerfer Date: Wed Jan 9 15:09:02 2019 +0100 scsi: qla1280: set 64bit coherent mask After Commit 54aed4dd3526 ("MIPS: IP27: use dma_direct_ops") qla1280 driver failed on SGI IP27 machines with qla1280: QLA1040 found on PCI bus 0, dev 0 qla1280 0000:00:00.0: enabling device (0006 -> 0007) qla1280: Failed to get request memory qla1280: probe of 0000:00:00.0 failed with error -12 Reason is that SGI IP27 always generates 64bit DMA addresses and has no fallback mode for 32bit DMA addresses implemented. QLA1280 supports 64bit addressing for all DMA accesses so setting coherent mask to 64bit fixes the issue. Signed-off-by: Thomas Bogendoerfer Signed-off-by: Martin K. Petersen commit 9be9db9f78f52ef03ee90063730cb9d730e7032b Author: Avri Altman Date: Thu Jan 10 13:31:26 2019 +0200 scsi: ufs: Fix geometry descriptor size Albeit we no longer rely on those hard-coded descriptor sizes, we still use them as our defaults, so better get it right. While adding its sysfs entries, we forgot to update the geometry descriptor size. It is 0x48 according to UFS2.1, and wasn't changed in UFS3.0. [mkp: typo] Fixes: c720c091222e (scsi: ufs: sysfs: geometry descriptor) Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit c65bfc8163696dd171e081488b0321beb630b708 Author: Shivasharan S Date: Wed Jan 9 05:08:37 2019 -0800 scsi: megaraid_sas: Retry reads of outbound_intr_status reg commit 272652fcbf1a ("scsi: megaraid_sas: add retry logic in megasas_readl") missed changing readl to megasas_readl in megasas_clear_intr_fusion(). For Aero controllers, reads of outbound_intr_status register needs to be retried. Reported-by: Tomas Henzl Signed-off-by: Shivasharan S Signed-off-by: Martin K. Petersen commit 34a2ce887668db9dda4b56e6f155c49ac13f3e54 Author: Manish Rangankar Date: Wed Jan 9 01:39:07 2019 -0800 scsi: qedi: Add ep_state for login completion on un-reachable targets When the driver finds invalid destination MAC for the first un-reachable target, and before completes the PATH_REQ operation, set new ep_state to OFFLDCONN_NONE so that as part of driver ep_poll mechanism, the upper open-iscsi layer is notified to complete the login process on the first un-reachable target and thus proceed login to other reachable targets. Signed-off-by: Manish Rangankar Signed-off-by: Martin K. Petersen commit ce9e7bce43526626f7cffe2e657953997870197e Author: Stanley Chu Date: Mon Jan 7 22:19:34 2019 +0800 scsi: ufs: Fix system suspend status hba->is_sys_suspended is set after successful system suspend but not clear after successful system resume. According to current behavior, hba->is_sys_suspended will not be set if host is runtime-suspended but not system-suspended. Thus we shall aligh the same policy: clear this flag even if host remains runtime-suspended after ufshcd_system_resume is successfully returned. Simply fix this flag to correct host status logs. Signed-off-by: Stanley Chu Reviewed-by: Avri Altman Signed-off-by: Martin K. Petersen commit f0783d43dde4bb349fcd667df0afabbdbab8b477 Author: Ming Lei Date: Fri Jan 11 09:40:47 2019 -0800 scsi: qla2xxx: Use correct number of vectors for online CPUs When SCSI-MQ is enabled, in some case system would present nr_possible_cpus() which is greater than requested vectors by the driver. This results into driver being able to get larger number of MSI-X vectors than actual online CPUs. Driver then uses pci_alloc_irq_vectors_affinity() to assign 1:1 mapping and affinity for each MSI-x vector to CPUs. When the command is submitted using MSI-x vector, assigned to offline CPU, it results in an ABTS and system hang. This hang is result of a driver not being able to process interrupt on a vector assigned to an Off-line CPUs This patch fixes this issue by setting irq_offset value for the blk_mq_pci_map_queues() to use only those CPUs which has CPU mask affinity assigned and are online. By using the irq_offset value, driver will allow online cpumask to decide which vectors are used in blk_mq_pci_map_queues(). Fixes: 5601236b6f794 ("scsi: qla2xxx: Add Block Multi Queue functionality.") Cc: #4.19 Signed-off-by: Ming Lei Reviewed-by: Himanshu Madhani Tested-by: Himanshu Madhani Reviewed-by: Ewan D. Milne Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 8d008e64a2ebe6567c3f5e048b05842a0297350b Author: Gustavo A. R. Silva Date: Tue Jan 8 15:27:05 2019 -0600 mISDN: hfcsusb: Use struct_size() in kzalloc() 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 foo { int stuff; void *entry[]; }; instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL); Instead of leaving these open-coded and prone to type mistakes, we can now use the new struct_size() helper: instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL); This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 7bb25a89aad2cc96de188c9ecc89a175360f6fb4 Author: John Garry Date: Thu Jan 10 21:32:41 2019 +0800 scsi: hisi_sas: Set protection parameters prior to adding SCSI host Currently we set the protection parameters after calling scsi_add_host() for v3 hw. They should be set beforehand, so make this change. Appearantly this fixes our DIX issue (not mainline yet) also, but more testing required. Fixes: d6a9000b81be ("scsi: hisi_sas: Add support for DIF feature for v2 hw") Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 41d1c8839e5f8cb781cc635f12791decee8271b7 Author: Paolo Abeni Date: Tue Jan 8 18:45:05 2019 +0100 net: clear skb->tstamp in bridge forwarding path Matteo reported forwarding issues inside the linux bridge, if the enslaved interfaces use the fq qdisc. Similar to commit 8203e2d844d3 ("net: clear skb->tstamp in forwarding paths"), we need to clear the tstamp field in the bridge forwarding path. Fixes: 80b14dee2bea ("net: Add a new socket option for a future transmit time.") Fixes: fb420d5d91c1 ("tcp/fq: move back to CLOCK_MONOTONIC") Reported-and-tested-by: Matteo Croce Signed-off-by: Paolo Abeni Acked-by: Nikolay Aleksandrov Acked-by: Roopa Prabhu Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 3f4261d4e62fb2fe7eb5238b12fb22f06aed6e21 Merge: 2ff33d6637393 71a8508402b57 Author: David S. Miller Date: Fri Jan 11 18:05:41 2019 -0800 Merge branch 'bpfilter-fixes' Taehee Yoo says: ==================== net: bpfilter: fix two bugs in bpfilter This patches fix two bugs in the bpfilter_umh which are related in iptables command. The first patch adds an exit code for UMH process. This provides an opportunity to cleanup members of the umh_info to modules which use the UMH. In order to identify UMH processes, a new flag PF_UMH is added. The second patch makes the bpfilter_umh use UMH cleanup callback. The third patch adds re-start routine for the bpfilter_umh. The bpfilter_umh does not re-start after error occurred. because there is no re-start routine in the module. The fourth patch ensures that the bpfilter.ko module will not removed while it's being used. The bpfilter.ko is not protected by locks or module reference counter. Therefore that can be removed while module is being used. In order to protect that, mutex is used. The first and second patch are preparation patches for the third and fourth patch. TEST #1 while : do modprobe bpfilter kill -9 iptables -vnL done TEST #2 while : do iptables -I FORWARD -m string --string ap --algo kmp & iptables -F & modprobe -rv bpfilter & done TEST #3 while : do modprobe bpfilter & modprobe -rv bpfilter & done The TEST1 makes a failure of iptables command. This is fixed by the third patch. The TEST2 makes a panic because of a race condition in the bpfilter_umh module. This is fixed by the fourth patch. The TEST3 makes a double-create UMH process. This is fixed by the third and fourth patch. v4 : - declare the exit_umh() as static inline - check stop flag in the load_umh() to avoid a double-create UMH v3 : - Avoid unnecessary list lookup for non-UMH processes - Add a new PF_UMH flag v2 : add the first and second patch v1 : Initial patch ==================== Signed-off-by: David S. Miller commit 71a8508402b570127d6500c1ad456bbd33ccf187 Author: Taehee Yoo Date: Wed Jan 9 02:25:10 2019 +0900 net: bpfilter: disallow to remove bpfilter module while being used The bpfilter.ko module can be removed while functions of the bpfilter.ko are executing. so panic can occurred. in order to protect that, locks can be used. a bpfilter_lock protects routines in the __bpfilter_process_sockopt() but it's not enough because __exit routine can be executed concurrently. Now, the bpfilter_umh can not run in parallel. So, the module do not removed while it's being used and it do not double-create UMH process. The members of the umh_info and the bpfilter_umh_ops are protected by the bpfilter_umh_ops.lock. test commands: while : do iptables -I FORWARD -m string --string ap --algo kmp & modprobe -rv bpfilter & done splat looks like: [ 298.623435] BUG: unable to handle kernel paging request at fffffbfff807440b [ 298.628512] #PF error: [normal kernel read fault] [ 298.633018] PGD 124327067 P4D 124327067 PUD 11c1a3067 PMD 119eb2067 PTE 0 [ 298.638859] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN PTI [ 298.638859] CPU: 0 PID: 2997 Comm: iptables Not tainted 4.20.0+ #154 [ 298.638859] RIP: 0010:__mutex_lock+0x6b9/0x16a0 [ 298.638859] Code: c0 00 00 e8 89 82 ff ff 80 bd 8f fc ff ff 00 0f 85 d9 05 00 00 48 8b 85 80 fc ff ff 48 bf 00 00 00 00 00 fc ff df 48 c1 e8 03 <80> 3c 38 00 0f 85 1d 0e 00 00 48 8b 85 c8 fc ff ff 49 39 47 58 c6 [ 298.638859] RSP: 0018:ffff88810e7777a0 EFLAGS: 00010202 [ 298.638859] RAX: 1ffffffff807440b RBX: ffff888111bd4d80 RCX: 0000000000000000 [ 298.638859] RDX: 1ffff110235ff806 RSI: ffff888111bd5538 RDI: dffffc0000000000 [ 298.638859] RBP: ffff88810e777b30 R08: 0000000080000002 R09: 0000000000000000 [ 298.638859] R10: 0000000000000000 R11: 0000000000000000 R12: fffffbfff168a42c [ 298.638859] R13: ffff888111bd4d80 R14: ffff8881040e9a05 R15: ffffffffc03a2000 [ 298.638859] FS: 00007f39e3758700(0000) GS:ffff88811ae00000(0000) knlGS:0000000000000000 [ 298.638859] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 298.638859] CR2: fffffbfff807440b CR3: 000000011243e000 CR4: 00000000001006f0 [ 298.638859] Call Trace: [ 298.638859] ? mutex_lock_io_nested+0x1560/0x1560 [ 298.638859] ? kasan_kmalloc+0xa0/0xd0 [ 298.638859] ? kmem_cache_alloc+0x1c2/0x260 [ 298.638859] ? __alloc_file+0x92/0x3c0 [ 298.638859] ? alloc_empty_file+0x43/0x120 [ 298.638859] ? alloc_file_pseudo+0x220/0x330 [ 298.638859] ? sock_alloc_file+0x39/0x160 [ 298.638859] ? __sys_socket+0x113/0x1d0 [ 298.638859] ? __x64_sys_socket+0x6f/0xb0 [ 298.638859] ? do_syscall_64+0x138/0x560 [ 298.638859] ? entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 298.638859] ? __alloc_file+0x92/0x3c0 [ 298.638859] ? init_object+0x6b/0x80 [ 298.638859] ? cyc2ns_read_end+0x10/0x10 [ 298.638859] ? cyc2ns_read_end+0x10/0x10 [ 298.638859] ? hlock_class+0x140/0x140 [ 298.638859] ? sched_clock_local+0xd4/0x140 [ 298.638859] ? sched_clock_local+0xd4/0x140 [ 298.638859] ? check_flags.part.37+0x440/0x440 [ 298.638859] ? __lock_acquire+0x4f90/0x4f90 [ 298.638859] ? set_rq_offline.part.89+0x140/0x140 [ ... ] Fixes: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module") Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit 61fbf5933d42b02f552123af5a87a06335a3b4db Author: Taehee Yoo Date: Wed Jan 9 02:24:53 2019 +0900 net: bpfilter: restart bpfilter_umh when error occurred The bpfilter_umh will be stopped via __stop_umh() when the bpfilter error occurred. The bpfilter_umh() couldn't start again because there is no restart routine. The section of the bpfilter_umh_{start/end} is no longer .init.rodata because these area should be reused in the restart routine. hence the section name is changed to .bpfilter_umh. The bpfilter_ops->start() is restart callback. it will be called when bpfilter_umh is stopped. The stop bit means bpfilter_umh is stopped. this bit is set by both start and stop routine. Before this patch, Test commands: $ iptables -vnL $ kill -9 $ iptables -vnL [ 480.045136] bpfilter: write fail -32 $ iptables -vnL All iptables commands will fail. After this patch, Test commands: $ iptables -vnL $ kill -9 $ iptables -vnL $ iptables -vnL Now, all iptables commands will work. Fixes: d2ba09c17a06 ("net: add skeleton of bpfilter kernel module") Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit 5b4cb650e569db2e6a09d2fa0ef8eb789a0ac5d8 Author: Taehee Yoo Date: Wed Jan 9 02:24:34 2019 +0900 net: bpfilter: use cleanup callback to release umh_info Now, UMH process is killed, do_exit() calls the umh_info->cleanup callback to release members of the umh_info. This patch makes bpfilter_umh's cleanup routine to use the umh_info->cleanup callback. Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit 73ab1cb2de9e3efe7f818d5453de271e5371df1d Author: Taehee Yoo Date: Wed Jan 9 02:23:56 2019 +0900 umh: add exit routine for UMH process A UMH process which is created by the fork_usermode_blob() such as bpfilter needs to release members of the umh_info when process is terminated. But the do_exit() does not release members of the umh_info. hence module which uses UMH needs own code to detect whether UMH process is terminated or not. But this implementation needs extra code for checking the status of UMH process. it eventually makes the code more complex. The new PF_UMH flag is added and it is used to identify UMH processes. The exit_umh() does not release members of the umh_info. Hence umh_info->cleanup callback should release both members of the umh_info and the private data. Suggested-by: David S. Miller Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller commit a94a2572b97744d3a35a1996df0e5cf6b2461a4a Author: Xiubo Li Date: Fri Nov 23 09:15:30 2018 +0800 scsi: tcmu: avoid cmd/qfull timers updated whenever a new cmd comes Currently there is one cmd timeout timer and one qfull timer for each udev, and whenever any new command is coming in we will update the cmd timer or qfull timer. For some corner cases the timers are always working only for the ringbuffer's and full queue's newest cmd. That's to say the timer won't be fired even if one cmd has been stuck for a very long time and the deadline is reached. This fix will keep the cmd/qfull timers to be pended for the oldest cmd in ringbuffer and full queue, and will update them with the next cmd's deadline only when the old cmd's deadline is reached or removed from the ringbuffer and full queue. Signed-off-by: Xiubo Li Acked-by: Mike Christie Signed-off-by: Martin K. Petersen commit 2ff33d6637393fe9348357285931811b76e1402f Author: Jia-Ju Bai Date: Tue Jan 8 21:04:48 2019 +0800 isdn: i4l: isdn_tty: Fix some concurrency double-free bugs The functions isdn_tty_tiocmset() and isdn_tty_set_termios() may be concurrently executed. isdn_tty_tiocmset isdn_tty_modem_hup line 719: kfree(info->dtmf_state); line 721: kfree(info->silence_state); line 723: kfree(info->adpcms); line 725: kfree(info->adpcmr); isdn_tty_set_termios isdn_tty_modem_hup line 719: kfree(info->dtmf_state); line 721: kfree(info->silence_state); line 723: kfree(info->adpcms); line 725: kfree(info->adpcmr); Thus, some concurrency double-free bugs may occur. These possible bugs are found by a static tool written by myself and my manual code review. To fix these possible bugs, the mutex lock "modem_info_mutex" used in isdn_tty_tiocmset() is added in isdn_tty_set_termios(). Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 7fbe078c37aba3088359c9256c1a1d0c3e39ee81 Author: Zha Bin Date: Tue Jan 8 16:07:03 2019 +0800 vhost/vsock: fix vhost vsock cid hashing inconsistent The vsock core only supports 32bit CID, but the Virtio-vsock spec define CID (dst_cid and src_cid) as u64 and the upper 32bits is reserved as zero. This inconsistency causes one bug in vhost vsock driver. The scenarios is: 0. A hash table (vhost_vsock_hash) is used to map an CID to a vsock object. And hash_min() is used to compute the hash key. hash_min() is defined as: (sizeof(val) <= 4 ? hash_32(val, bits) : hash_long(val, bits)). That means the hash algorithm has dependency on the size of macro argument 'val'. 0. In function vhost_vsock_set_cid(), a 64bit CID is passed to hash_min() to compute the hash key when inserting a vsock object into the hash table. 0. In function vhost_vsock_get(), a 32bit CID is passed to hash_min() to compute the hash key when looking up a vsock for an CID. Because the different size of the CID, hash_min() returns different hash key, thus fails to look up the vsock object for an CID. To fix this bug, we keep CID as u64 in the IOCTLs and virtio message headers, but explicitly convert u64 to u32 when deal with the hash table and vsock core. Fixes: 834e772c8db0 ("vhost/vsock: fix use-after-free in network stack callers") Link: https://github.com/stefanha/virtio/blob/vsock/trunk/content.tex Signed-off-by: Zha Bin Reviewed-by: Liu Jiang Reviewed-by: Stefan Hajnoczi Acked-by: Jason Wang Signed-off-by: David S. Miller commit 5fea7f1091d725bd0601c931f237fed210d37dad Merge: e8b108b050e84 fa0be0a43f101 Author: David S. Miller Date: Fri Jan 11 15:35:06 2019 -0800 Merge branch 'stmmac-fixes' Jose Abreu says: ==================== net: stmmac: Misc Fixes Some small fixes for stmmac targeting -net. Detailed info in commit log. ==================== Signed-off-by: David S. Miller commit fa0be0a43f101888ac677dba31b590963eafeaa1 Author: Jose Abreu Date: Wed Jan 9 10:06:00 2019 +0100 net: stmmac: Prevent RX starvation in stmmac_napi_poll() Currently, TX is given a budget which is consumed by stmmac_tx_clean() and stmmac_rx() is given the remaining non-consumed budget. This is wrong and in case we are sending a large number of packets this can starve RX because remaining budget will be low. Let's give always the same budget for RX and TX clean. While at it, check if we missed any interrupts while we were in NAPI callback by looking at DMA interrupt status. Cc: Joao Pinto Cc: David S. Miller Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: Jose Abreu Signed-off-by: David S. Miller commit 3b5094665e273c4a2a99f7f5f16977c0f1e19095 Author: Jose Abreu Date: Wed Jan 9 10:05:59 2019 +0100 net: stmmac: Fix the logic of checking if RX Watchdog must be enabled RX Watchdog can be disabled by platform definitions but currently we are initializing the descriptors before checking if Watchdog must be disabled or not. Fix this by checking earlier if user wants Watchdog disabled or not. Cc: Joao Pinto Cc: David S. Miller Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: Jose Abreu Signed-off-by: David S. Miller commit 0650d4017f4d2eee67230a02285a7ae5204240c2 Author: Jose Abreu Date: Wed Jan 9 10:05:58 2019 +0100 net: stmmac: Check if CBS is supported before configuring Check if CBS is currently supported before trying to configure it in HW. Cc: Joao Pinto Cc: David S. Miller Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: Jose Abreu Signed-off-by: David S. Miller commit fcc509eb10ff4794641e6ad3082118287a750d0a Author: Jose Abreu Date: Wed Jan 9 10:05:57 2019 +0100 net: stmmac: dwxgmac2: Only clear interrupts that are active In DMA interrupt handler we were clearing all interrupts status, even the ones that were not active. Fix this and only clear the active interrupts. Cc: Joao Pinto Cc: David S. Miller Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Signed-off-by: Jose Abreu Signed-off-by: David S. Miller commit 6dea7e1881fd86b80da64e476ac398008daed857 Author: Jose Abreu Date: Wed Jan 9 10:05:56 2019 +0100 net: stmmac: Fix PCI module removal leak Since commit b7d0f08e9129, the enable / disable of PCI device is not managed which will result in IO regions not being automatically unmapped. As regions continue mapped it is currently not possible to remove and then probe again the PCI module of stmmac. Fix this by manually unmapping regions on remove callback. Changes from v1: - Fix build error Cc: Joao Pinto Cc: David S. Miller Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Fixes: b7d0f08e9129 ("net: stmmac: Fix WoL for PCI-based setups") Signed-off-by: Jose Abreu Signed-off-by: David S. Miller commit 8217724eb7c51bbec351b23cbc924577b2f4b8e6 Author: Otto Sabart Date: Wed Jan 9 00:46:55 2019 +0100 doc: bindings: fix bad reference to ARM CPU bindings The primecell.txt and cpus.txt files were converted into YAML. This patch updates old references with new ones. Fixes: d3c207eeb905 ("dt-bindings: arm: Convert primecell binding to json-schema") Fixes: 672951cbd1b7 ("dt-bindings: arm: Convert cpu binding to json-schema") Signed-off-by: Otto Sabart Signed-off-by: Rob Herring commit 0919871ac37fdcf46c7657da0f1742efe096b399 Author: Tony Luck Date: Fri Jan 11 14:46:37 2019 -0800 acpi/nfit: Fix race accessing memdev in nfit_get_smbios_id() Possible race accessing memdev structures after dropping the mutex. Dan Williams says this could race against another thread that is doing: # echo "ACPI0012:00" > /sys/bus/acpi/drivers/nfit/unbind Reported-by: Jane Chu Fixes: 23222f8f8dce ("acpi, nfit: Add function to look up nvdimm...") Signed-off-by: Tony Luck Signed-off-by: Dan Williams commit bde0b5c109e8b22b57745e3b9914f9e87ad857ea Author: Miquel Raynal Date: Tue Dec 4 20:28:29 2018 +0100 ata: ahci: mvebu: request PHY suspend/resume for Armada 3700 A feature has been added in the libahci driver: the possibility to set a new flag in hpriv->flags to let the core handle PHY suspend/resume automatically. Make use of this feature to make suspend to RAM work with SATA drives on A3700. Signed-off-by: Miquel Raynal Signed-off-by: Jens Axboe commit 2f558bc3f33ca344489cec2218545741028b6a70 Author: Miquel Raynal Date: Tue Dec 4 20:28:28 2018 +0100 ata: ahci: mvebu: add Armada 3700 initialization needed for S2RAM A3700 comphy initialization is done in the firmware (TF-A). Looking at the SATA PHY initialization routine, there is a comment about "vendor specific" registers. Two registers are mentioned. They are not initialized there in the firmware because they are AHCI related, while the firmware at this location does only PHY configuration. The solution to avoid doing such initialization is relying on U-Boot. While this work at boot time, U-Boot is definitely not going to run during a resume after suspending to RAM. Two possible solutions were considered: * Fixing the firmware. * Fixing the kernel driver. The first solution would take ages to propagate, while the second solution is easy to implement as the driver as been a little bit reworked to prepare for such platform configuration. Hence, this patch adds an Armada 3700 configuration function to set these two registers both at boot time (in the probe) and after a suspend (in the resume path). Signed-off-by: Miquel Raynal Signed-off-by: Jens Axboe commit 96dbcb40e4b1a387cdb9b21f43638c759aebb5a4 Author: Miquel Raynal Date: Tue Dec 4 20:28:27 2018 +0100 ata: ahci: mvebu: do Armada 38x configuration only on relevant SoCs At the beginning, only Armada 38x SoCs where supported by the ahci_mvebu.c driver. Commit 15d3ce7b63bd ("ata: ahci_mvebu: add support for Armada 3700 variant") introduced Armada 3700 support. As opposed to Armada 38x SoCs, the 3700 variants do not have to configure mbus and the regret option. This patch took care of avoiding such configuration when not needed in the probe function, but failed to do the same in the resume path. While doing so looks harmless by experience, let's clean the driver logic and avoid doing this useless configuration with Armada 3700 SoCs. Because the logic is very similar between these two places, it has been decided to factorize this code and put it in a "Armada 38x configuration function". This function is part of a new (per-compatible) platform data structure, so that the addition of such configuration function for Armada 3700 will be eased. Fixes: 15d3ce7b63bd ("ata: ahci_mvebu: add support for Armada 3700 variant") Signed-off-by: Miquel Raynal Signed-off-by: Jens Axboe commit c9bc136791ba0eefe07ed57d3850b8c5cee6471b Author: Miquel Raynal Date: Tue Dec 4 20:28:26 2018 +0100 ata: ahci: mvebu: remove stale comment For Armada-38x (32-bit) SoCs, PM platform support has been added since: commit 32f9494c9dfd ("ARM: mvebu: prepare pm-board.c for the introduction of Armada 38x support") commit 3cbd6a6ca81c ("ARM: mvebu: Add standby support") For Armada 64-bit SoCs, like the A3700 also using this AHCI driver, PM platform support has always existed. There are even suspend/resume hooks in this driver since: commit d6ecf15814888 ("ata: ahci_mvebu: add suspend/resume support") Remove the stale comment at the end of this driver stating that all the above does not exist yet. Fixes: d6ecf15814888 ("ata: ahci_mvebu: add suspend/resume support") Signed-off-by: Miquel Raynal Signed-off-by: Jens Axboe commit 49e54187ae0b2f9b5c0760e568a103baf4481610 Author: Miquel Raynal Date: Tue Dec 4 20:28:25 2018 +0100 ata: libahci_platform: comply to PHY framework Current implementation of the libahci does not take into account the new PHY framework. Correct the situation by adding a call to phy_set_mode() before phy_power_on(). PHYs should also be handled at suspend/resume time. For this, call ahci_platform_enable/disable_phys() at suspend/resume_host() time. These calls are guarded by a HFLAG (AHCI_HFLAG_SUSPEND_PHYS) that the user of the libahci driver must set manually in hpriv->flags at probe time. This is to avoid breaking users that have not been tested with this change. Reviewed-by: Hans de Goede Suggested-by: Grzegorz Jaszczyk Signed-off-by: Miquel Raynal Signed-off-by: Jens Axboe commit e8b108b050e84b6d7497d2cd29fe7623d0a33ed6 Merge: b19bce0335e25 fb4129b9279dc Author: David S. Miller Date: Fri Jan 11 12:51:49 2019 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2019-01-11 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Fix TCP-BPF support for correctly setting the initial window via TCP_BPF_IW on an active TFO sender, from Yuchung. 2) Fix a panic in BPF's stack_map_get_build_id()'s ELF parsing on 32 bit archs caused by page_address() returning NULL, from Song. 3) Fix BTF pretty print in kernel and bpftool when bitfield member offset is greater than 256. Also add test cases, from Yonghong. 4) Fix improper argument handling in xdp1 sample, from Ioana. 5) Install missing tcp_server.py and tcp_client.py files from BPF selftests, from Anders. 6) Add test_libbpf to gitignore in libbpf and BPF selftests, from Stanislav. ==================== Signed-off-by: David S. Miller commit 4b3c31c8d4dda4d70f3f24a165f3be99499e0328 Merge: c3405d6899745 b67d4530cdade Author: Linus Torvalds Date: Fri Jan 11 12:28:01 2019 -0800 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "I2C has one core and one driver bugfix for you" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: tegra: Fix Maximum transfer size i2c: dev: prevent adapter retries and timeout being set as minus value commit c3405d689974555532c12a4f3a5e72dedc660c0b Merge: f87092c4337fc 279667212ab2a Author: Linus Torvalds Date: Fri Jan 11 12:25:40 2019 -0800 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "Another handful of arm64 fixes here. Most of the complication comes from improving our kpti code to avoid lengthy pauses (30+ seconds) during boot when we rewrite the page tables. There are also a couple of IORT fixes that came in via Lorenzo. Summary: - Don't error in kexec_file_load if kaslr-seed is missing in device-tree - Fix incorrect argument type passed to iort_match_node_callback() - Fix IORT build failure when CONFIG_IOMMU_API=n - Fix kpti performance regression with new rodata default option - Typo fix" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: kexec_file: return successfully even if kaslr-seed doesn't exist ACPI/IORT: Fix rc_dma_get_range() arm64: kpti: Avoid rewriting early page tables when KASLR is enabled arm64: asm-prototypes: Fix fat-fingered typo in comment ACPI/IORT: Fix build when CONFIG_IOMMU_API=n commit f87092c4337fc064b52bfad1df499a5b82f6d088 Merge: 40a31da414c39 85f5a4d666fd9 Author: Linus Torvalds Date: Fri Jan 11 12:17:30 2019 -0800 Merge tag 'ceph-for-5.0-rc2' of git://github.com/ceph/ceph-client Pull ceph updates from Ilya Dryomov: "A patch to allow setting abort_on_full and a fix for an old "rbd unmap" edge case, marked for stable" * tag 'ceph-for-5.0-rc2' of git://github.com/ceph/ceph-client: rbd: don't return 0 on unmap if RBD_DEV_FLAG_REMOVING is set ceph: use vmf_error() in ceph_filemap_fault() libceph: allow setting abort_on_full for rbd commit ef4efa14560adf7cdc77022c86e659d910c5c6fc Author: Lubomir Rintel Date: Fri Jan 4 22:56:56 2019 +0100 dt-bindings: marvell,mmp2: fix typos in bindings doc A pair of rather trivial ones. Signed-off-by: Lubomir Rintel Signed-off-by: Rob Herring commit 5a9372f751b5350e0ce3d2ee91832f1feae2c2e5 Author: Arnd Bergmann Date: Thu Jan 10 17:24:31 2019 +0100 mips: fix n32 compat_ipc_parse_version While reading through the sysvipc implementation, I noticed that the n32 semctl/shmctl/msgctl system calls behave differently based on whether o32 support is enabled or not: Without o32, the IPC_64 flag passed by user space is rejected but calls without that flag get IPC_64 behavior. As far as I can tell, this was inadvertently changed by a cleanup patch but never noticed by anyone, possibly nobody has tried using sysvipc on n32 after linux-3.19. Change it back to the old behavior now. Fixes: 78aaf956ba3a ("MIPS: Compat: Fix build error if CONFIG_MIPS32_COMPAT but no compat ABI.") Signed-off-by: Arnd Bergmann Signed-off-by: Paul Burton Cc: linux-mips@vger.kernel.org Cc: stable@vger.kernel.org # 3.19+ commit 40a31da414c39e3cd8c4137c1ceedf59b7ffd4ce Merge: e8af37f3f488e 4e72ee8872279 Author: Linus Torvalds Date: Fri Jan 11 09:44:05 2019 -0800 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf tooling updates from Ingo Molnar: "Tooling changes only: fixes and a few stray improvements. Most of the diffstat is dominated by a PowerPC related fix of system call trace output beautification that allows us to (again) use the UAPI header version and sync up with the kernel's version of PowerPC system call names in the arch/powerpc/kernel/syscalls/syscall.tbl header" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits) tools headers powerpc: Remove unistd.h perf powerpc: Rework syscall table generation perf symbols: Add 'arch_cpu_idle' to the list of kernel idle symbols tools include uapi: Sync linux/if_link.h copy with the kernel sources tools include uapi: Sync linux/vhost.h with the kernel sources tools include uapi: Sync linux/fs.h copy with the kernel sources perf beauty: Switch from using uapi/linux/fs.h to uapi/linux/mount.h tools include uapi: Grab a copy of linux/mount.h perf top: Lift restriction on using callchains without "sym" in --sort tools lib traceevent: Remove tep_data_event_from_type() API tools lib traceevent: Rename tep_is_file_bigendian() to tep_file_bigendian() tools lib traceevent: Changed return logic of tep_register_event_handler() API tools lib traceevent: Changed return logic of trace_seq_printf() and trace_seq_vprintf() APIs tools lib traceevent: Rename struct cmdline to struct tep_cmdline tools lib traceevent: Initialize host_bigendian at tep_handle allocation tools lib traceevent: Introduce new libtracevent API: tep_override_comm() perf tests: Add a test for the ARM 32-bit [vectors] page perf tools: Make find_vdso_map() more modular perf trace: Fix alignment for [continued] lines perf trace: Fix ')' placement in "interrupted" syscall lines ... commit 826c1362e79abcd36f99092acd083b5a2d576676 Author: Vitaly Kuznetsov Date: Wed Jan 9 18:22:56 2019 +0100 x86/kvm/nVMX: don't skip emulated instruction twice when vmptr address is not backed Since commit 09abb5e3e5e50 ("KVM: nVMX: call kvm_skip_emulated_instruction in nested_vmx_{fail,succeed}") nested_vmx_failValid() results in kvm_skip_emulated_instruction() so doing it again in handle_vmptrld() when vmptr address is not backed is wrong, we end up advancing RIP twice. Fixes: fca91f6d60b6e ("kvm: nVMX: Set VM instruction error for VMPTRLD of unbacked page") Reported-by: Cornelia Huck Signed-off-by: Vitaly Kuznetsov Reviewed-by: Sean Christopherson Reviewed-by: Cornelia Huck Signed-off-by: Radim Krčmář commit cf1754c2a1d6e92688f7353aa7f598f5ad6d8f78 Author: Christophe de Dinechin Date: Mon Jan 7 18:52:38 2019 +0100 Documentation/virtual/kvm: Update URL for AMD SEV API specification The URL of [api-spec] in Documentation/virtual/kvm/amd-memory-encryption.rst is no longer valid, replaced space with underscore. Signed-off-by: Christophe de Dinechin Reviewed-by: Brijesh Singh Signed-off-by: Radim Krčmář commit b7c1c226f9403c52bf58b0bceef24501429c7351 Author: Lan Tianyu Date: Fri Jan 4 15:20:44 2019 +0800 KVM/VMX: Avoid return error when flush tlb successfully in the hv_remote_flush_tlb_with_range() The "ret" is initialized to be ENOTSUPP. The return value of __hv_remote_flush_tlb_with_range() will be Or with "ret" when ept table potiners are mismatched. This will cause return ENOTSUPP even if flush tlb successfully. This patch is to fix the issue and set "ret" to 0. Fixes: a5c214dad198 ("KVM/VMX: Change hv flush logic when ept tables are mismatched.") Signed-off-by: Lan Tianyu Signed-off-by: Radim Krčmář commit 3f14a89d1132dcae3c8ce6721c6ef51f6e6d9b5f Author: David Rientjes Date: Wed Jan 2 12:56:33 2019 -0800 kvm: sev: Fail KVM_SEV_INIT if already initialized By code inspection, it was found that multiple calls to KVM_SEV_INIT could deplete asid bits and overwrite kvm_sev_info's regions_list. Multiple calls to KVM_SVM_INIT is not likely to occur with QEMU, but this should likely be fixed anyway. This code is serialized by kvm->lock. Fixes: 1654efcbc431 ("KVM: SVM: Add KVM_SEV_INIT command") Reported-by: Cfir Cohen Signed-off-by: David Rientjes Signed-off-by: Radim Krčmář commit 98938aa8edd66dc95024d7c936a4bc315f6615ff Author: Tomas Bortoli Date: Wed Jan 2 18:29:37 2019 +0100 KVM: validate userspace input in kvm_clear_dirty_log_protect() The function at issue does not fully validate the content of the structure pointed by the log parameter, though its content has just been copied from userspace and lacks validation. Fix that. Moreover, change the type of n to unsigned long as that is the type returned by kvm_dirty_bitmap_bytes(). Signed-off-by: Tomas Bortoli Reported-by: syzbot+028366e52c9ace67deb3@syzkaller.appspotmail.com [Squashed the fix from Paolo. - Radim.] Signed-off-by: Radim Krčmář commit d14eff1bc53e6a268c3b48da5cdb469f26832d1a Author: Gustavo A. R. Silva Date: Wed Dec 26 14:40:59 2018 -0600 KVM: x86: Fix bit shifting in update_intel_pt_cfg ctl_bitmask in pt_desc is of type u64. When an integer like 0xf is being left shifted more than 32 bits, the behavior is undefined. Fix this by adding suffix ULL to integer 0xf. Addresses-Coverity-ID: 1476095 ("Bad bit shift operation") Fixes: 6c0f0bba85a0 ("KVM: x86: Introduce a function to initialize the PT configuration") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Wei Yang Reviewed-by: Luwei Kang Signed-off-by: Radim Krčmář commit e8af37f3f488e7adce2b5c6f6dfe8c83c2662e1f Merge: 8e1b295b693cb e4f358916d528 Author: Linus Torvalds Date: Fri Jan 11 09:07:19 2019 -0800 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Ingo Molnar: "A 32-bit build fix, CONFIG_RETPOLINE fixes and rename CONFIG_RESCTRL to CONFIG_X86_RESCTRL" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86, modpost: Replace last remnants of RETPOLINE with CONFIG_RETPOLINE x86/cache: Rename config option to CONFIG_X86_RESCTRL samples/seccomp: Fix 32-bit build commit 8e1b295b693cbf2d8499c24fbb1f8f50c58771e3 Merge: f4f31fff32252 65a4f3a1efda8 Author: Linus Torvalds Date: Fri Jan 11 09:04:36 2019 -0800 Merge tag 'acpi-5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fixes from Rafael Wysocki: "Fix a build failure introduced recently, fix the xpower PMIC ACPI driver, clean up the handling of duplicate entries in _PRx power resource lists and fix addresses in NUMA-related messages on 32-bit with PAE. Specifics: - Fix build failures with both CONFIG_NLS and CONFIG_PCI unset that can occur since ACPI can be built without PCI now (Sinan Kaya). - Clean up the handling of duplicate entries in power resource lists returned by _PRx evaluation to avoid triggering WARN_ON() on attempts to add duplicate symlinks in sysfs (Hans de Goede). - Fix issues with the TS current-source switching on systems using the xpower PMIC by avoiding to update unrelated bits in the TS pin-ctrl register and avoiding to unconditionally enable TS current-source on systems where it is not used (Hans de Goede). - Fix addresses in NUMA-related messages on 32-bit with PAE which can be truncated due to integer type conversions (Chao Fan)" * tag 'acpi-5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / PMIC: xpower: Fix TS-pin current-source handling ACPI: NUMA: Use correct type for printing addresses on i386-PAE ACPI: power: Skip duplicate power resource references in _PRx ACPI: Fix build failure when CONFIG_NLS is set to 'n' commit f4f31fff32252da3791e9d901adb44f963a79153 Merge: 385c59c7baaa4 343e60e52a3a0 Author: Linus Torvalds Date: Fri Jan 11 09:01:43 2019 -0800 Merge tag 'pm-5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management updates from Rafael Wysocki: "These fix fallout after starting to use hrtimers in the runtime PM framework, fix a few cpufreq issues, fix a recently broken reference to cpuidle documentation, update MAINTAINERS entries for cpufreq and cpuidle and make the recently added system suspend and resume support in devfreq actually work. Specifics: - Prevent integer overflows from occurring on 32-bit when converting milliseconds to nanoseconds in the runtime PM framework and update comments that still refer to jiffies in it (Vincent Guittot, Ladislav Michl). - Fix the SCMI cpufreq driver to always use the same frequency units for arch_set_freq_scale() and make the scale-invariant load tracking acutally work with this driver (Quentin Perret). - Fix freeing of dynamic OPPs in the SCPI and SCMI cpufreq drivers broken during the 4.20 defelopment cycle (Viresh Kumar). - Prevent the cpufreq core from attempting to return the current frequency of offline CPUs (Sudeep Holla). - Add devfreq suspend and resume hooks (missed previously) to the PM core to make the recently added system suspend and resume support in devfreq actually work (Lukasz Luba). - Update MAINTAINERS entries for cpufreq and cpuidle, mostly to add references to new/current documentation to them (Rafael Wysocki). - Fix a recently broken reference to cpuidle documentation (Otto Sabart)" * tag 'pm-5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM-runtime: Fix autosuspend_delay on 32bits arch PM-runtime: Fix 'jiffies' in comments after switch to hrtimers cpufreq: scmi: Fix frequency invariance in slow path doc: trace: fix reference to cpuidle documentation file cpufreq: check if policy is inactive early in __cpufreq_get() cpufreq: scpi/scmi: Fix freeing of dynamic OPPs cpuidle / Documentation: Update cpuidle MAINTAINERS entry cpufreq / Documentation: Update cpufreq MAINTAINERS entry PM: sleep: call devfreq suspend/resume commit 385c59c7baaa4626f5c01888d50e86e5636e655e Merge: de6629eb262e0 f34c48e06ddcc Author: Linus Torvalds Date: Fri Jan 11 08:58:02 2019 -0800 Merge tag 'drm-fixes-2019-01-11' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Not a huge amount for rc2, assume the usual quiet period, and rc3 will be most of it. amdgpu: - Powerplay fixes - Virtual display pinning fixes - Golden register updates for Vega - Pitch and gem size validation fixes - SR-IOV init error fix - Pagetables in system RAM disable for some Raven system - DP-MST resume fixes tc358767 bridge: - fix to work with displayport connector" * tag 'drm-fixes-2019-01-11' of git://anongit.freedesktop.org/drm/drm: (26 commits) drm/amdgpu: disable system memory page tables for now drm/amdgpu: set WRITE_BURST_LENGTH to 64B to workaround SDMA1 hang drm/amdgpu: fix CPDMA hang in PRT mode for VEGA20 drm/bridge: tc358767: use DP connector if no panel set drm/bridge: tc358767: fix output H/V syncs drm/bridge: tc358767: reject modes which require too much BW drm/bridge: tc358767: fix initial DP0/1_SRCCTRL value drm/bridge: tc358767: fix single lane configuration drm/bridge: tc358767: add defines for DP1_SRCCTRL & PHY_2LANE drm/bridge: tc358767: add bus flags drm/dp_mst: Add __must_check to drm_dp_mst_topology_mgr_resume() drm/amdgpu: Don't fail resume process if resuming atomic state fails drm/amdgpu: Don't ignore rc from drm_dp_mst_topology_mgr_resume() drm/amdgpu: validate user GEM object size drm/amdgpu: validate user pitch alignment drm/amd/powerplay: drop the unnecessary uclk hard min setting drm/amd/powerplay: avoid possible buffer overflow drm/amd/powerplay: create pp_od_clk_voltage device file under OD support drm/amd/powerplay: update OD support flag for SKU with no OD capabilities drm/amdgpu: make gfx9 enter into rlc safe mode when set MGCG ... commit d3736d82e8169768218ee0ef68718875918091a0 Author: Dmitry Safonov <0x7f454c46@gmail.com> Date: Wed Jan 9 01:17:40 2019 +0000 tty: Don't hold ldisc lock in tty_reopen() if ldisc present Try to get reference for ldisc during tty_reopen(). If ldisc present, we don't need to do tty_ldisc_reinit() and lock the write side for line discipline semaphore. Effectively, it optimizes fast-path for tty_reopen(), but more importantly it won't interrupt ongoing IO on the tty as no ldisc change is needed. Fixes user-visible issue when tty_reopen() interrupted login process for user with a long password, observed and reported by Lukas. Fixes: c96cf923a98d ("tty: Don't block on IO when ldisc change is pending") Fixes: 83d817f41070 ("tty: Hold tty_ldisc_lock() during tty_reopen()") Cc: Jiri Slaby Reported-by: Lukas F. Hartmann Tested-by: Lukas F. Hartmann Cc: stable Signed-off-by: Dmitry Safonov Signed-off-by: Greg Kroah-Hartman commit e3e4767bd550b3f19278e42bcce143e0d2316ba2 Author: Martin Blumenstingl Date: Tue Jan 1 20:44:14 2019 +0100 mmc: core: don't override the CD GPIO level when "cd-inverted" is set Since commit 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device tree") gpiolib-of parses the "cd-gpios" property and flips the polarity if "cd-inverted" is also set. This results in the "cd-inverted" property being evaluated twice, which effectively makes it a no-op: - first in drivers/gpio/gpiolib-of.c (of_xlate_and_get_gpiod_flags) when setting up the CD GPIO - then again in drivers/mmc/core/slot-gpio.c (mmc_gpio_get_cd) when reading the CD GPIO value at runtime On boards which are using device-tree with the "cd-inverted" property being set any inserted card are not detected anymore. This is due to the MMC core treating the CD GPIO with the wrong polarity. Disable "override_cd_active_level" for the card detection GPIO which is parsed using mmc_of_parse. This fixes SD card detection on the boards which are currently using the "cd-inverted" device-tree property (tested on Meson8b Odroid-C1 and Meson8b EC-100). This does not remove the CD GPIO inversion logic from the MMC core because there's at least one driver (sdhci-pci-core for Intel BayTrail based boards) which still passes "override_cd_active_level = true" to mmc_gpiod_request_cd(). Due to lack of hardware for testing this is left untouched. In the future the GPIO inversion logic for both, card and read-only detection can be removed once no driver is using it anymore. Fixes: 89a5e15bcba87d ("gpio/mmc/of: Respect polarity in the device tree") Signed-off-by: Martin Blumenstingl Tested-by: Anand Moon Tested-by: Loys Ollivier Acked-by: Ulf Hansson Signed-off-by: Linus Walleij commit 00257e0cc550c4a8df5f99c0a4fc74fec0656144 Author: Rob Herring Date: Fri Jan 11 14:34:39 2019 +0100 fbdev: offb: Fix OF node name handling Commit 5c63e407aaab ("fbdev: Convert to using %pOFn instead of device_node.name") changed how the OF FB driver handles the OF node name. This missed the case where the node name is passed to offb_init_palette_hacks(). This results in a NULL ptr dereference in strncmp and breaks any system except ones using bootx with no display node. Fix this by making offb_init_palette_hacks() use the OF node pointer and use of_node_name_prefix() helper function instead for node name comparisons. This helps in moving all OF node name accesses to helper functions in preparation to remove struct device_node.name pointer. Fixes: 5c63e407aaab ("fbdev: Convert to using %pOFn instead of device_node.name") Reported-by: Mathieu Malaterre Tested-by: Mathieu Malaterre Cc: stable@vger.kernel.org # v4.19+ Cc: Elimar Riesebieter Signed-off-by: Rob Herring Signed-off-by: Bartlomiej Zolnierkiewicz commit a01421e4484327fe44f8e126793ed5a48a221e24 Author: Vlad Tsyrklevich Date: Fri Jan 11 14:34:38 2019 +0100 omap2fb: Fix stack memory disclosure Using [1] for static analysis I found that the OMAPFB_QUERY_PLANE, OMAPFB_GET_COLOR_KEY, OMAPFB_GET_DISPLAY_INFO, and OMAPFB_GET_VRAM_INFO cases could all leak uninitialized stack memory--either due to uninitialized padding or 'reserved' fields. Fix them by clearing the shared union used to store copied out data. [1] https://github.com/vlad902/kernel-uninitialized-memory-checker Signed-off-by: Vlad Tsyrklevich Reviewed-by: Kees Cook Fixes: b39a982ddecf ("OMAP: DSS2: omapfb driver") Cc: security@kernel.org [b.zolnierkie: prefix patch subject with "omap2fb: "] Signed-off-by: Bartlomiej Zolnierkiewicz commit 48d2ba6257013676e57ff69444d5212031aee763 Author: Steve French Date: Sat Jan 5 19:46:35 2019 -0600 cifs: update internal module version number To 2.16 Signed-off-by: Steve French commit 9a66396f1857cc1de06f4f4771797315e1a4ea56 Author: Pavel Shilovsky Date: Tue Jan 8 11:15:28 2019 -0800 CIFS: Fix error paths in writeback code This patch aims to address writeback code problems related to error paths. In particular it respects EINTR and related error codes and stores and returns the first error occurred during writeback. Signed-off-by: Pavel Shilovsky Acked-by: Jeff Layton Signed-off-by: Steve French commit ee258d79159afed52ca9372aeb9c1a51e89b32ee Author: Pavel Shilovsky Date: Thu Jan 3 15:53:10 2019 -0800 CIFS: Move credit processing to mid callbacks for SMB3 Currently we account for credits in the thread initiating a request and waiting for a response. The demultiplex thread receives the response, wakes up the thread and the latter collects credits from the response buffer and add them to the server structure on the client. This approach is not accurate, because it may race with reconnect events in the demultiplex thread which resets the number of credits. Fix this by moving credit processing to new mid callbacks that collect credits granted by the server from the response in the demultiplex thread. Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French commit 8a26f0f781f56d3016b34a2217e346973d067e7b Author: Pavel Shilovsky Date: Thu Jan 3 16:45:27 2019 -0800 CIFS: Fix credits calculation for cancelled requests If a request is cancelled, we can't assume that the server returns 1 credit back. Instead we need to wait for a response and process the number of credits granted by the server. Create a separate mid callback for cancelled request, parse the number of credits in a response buffer and add them to the client's credits. If the didn't get a response (no response buffer available) assume 0 credits granted. The latter most probably happens together with session reconnect, so the client's credits are adjusted anyway. Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French commit b9a74cde94957d82003fb9f7ab4777938ca851cd Author: Ross Lagerwall Date: Tue Jan 8 18:30:57 2019 +0000 cifs: Fix potential OOB access of lock element array If maxBuf is small but non-zero, it could result in a zero sized lock element array which we would then try and access OOB. Signed-off-by: Ross Lagerwall Signed-off-by: Steve French CC: Stable commit 92a8109e4d3a34fb6b115c9098b51767dc933444 Author: Ross Lagerwall Date: Tue Jan 8 18:30:56 2019 +0000 cifs: Limit memory used by lock request calls to a page The code tries to allocate a contiguous buffer with a size supplied by the server (maxBuf). This could fail if memory is fragmented since it results in high order allocations for commonly used server implementations. It is also wasteful since there are probably few locks in the usual case. Limit the buffer to be no larger than a page to avoid memory allocation failures due to fragmentation. Signed-off-by: Ross Lagerwall Signed-off-by: Steve French commit 15bc77f94e9f0e3cfd6972f3b84bb7aaa4c36b1b Author: Aurelien Aptel Date: Tue Jan 8 13:41:00 2019 +0100 cifs: move large array from stack to heap This addresses some compile warnings that you can see depending on configuration settings. Signed-off-by: Aurelien Aptel Signed-off-by: Steve French commit ee13919c2e8d1f904e035ad4b4239029a8994131 Author: Pavel Shilovsky Date: Thu Jan 10 11:27:28 2019 -0800 CIFS: Do not hide EINTR after sending network packets Currently we hide EINTR code returned from sock_sendmsg() and return 0 instead. This makes a caller think that we successfully completed the network operation which is not true. Fix this by properly returning EINTR to callers. Cc: Signed-off-by: Pavel Shilovsky Reviewed-by: Jeff Layton Signed-off-by: Steve French commit fcf5036f09694d09d946c0455f329894a6482a4d Author: Michael Ellerman Date: Fri Jan 11 23:53:46 2019 +1100 powerpc/4xx/ocm: Fix fix for phys_addr_t printf warnings My recent commit to fix the printf warnings in ocm.c got the format specifier wrong, because I copied it from the documentation without realising the square brackets are not meant as literals. This results in the address being suffixed with a literal "[p]". Actually tested this time: # cat info /sys/kernel/debug/ppc4xx_ocm PhysAddr : 0x0000000400040000 ... NC.PhysAddr : 0x0000000400040000 ... C.PhysAddr : 0x0000000000000000 Fixes: 52b88fa1e8c7 ("powerpc/4xx/ocm: Fix phys_addr_t printf warnings") Reported-by: Christian Lamparter Tested-by: Christian Lamparter Signed-off-by: Michael Ellerman commit 6bca515917515b66b7e1dfc1d1d3b7bd8058315c Author: Frederic Barrat Date: Wed Jan 9 16:13:42 2019 +0100 powerpc/powernv/npu: Fix oops in pnv_try_setup_npu_table_group() With a recent change around IOMMU group, a system with an opencapi adapter is no longer booting and we get a kernel oops: BUG: Kernel NULL pointer dereference at 0x00000028 Faulting instruction address: 0xc0000000000aa38c ... NIP pnv_try_setup_npu_table_group+0x1c/0x1a0 LR pnv_pci_ioda_fixup+0x1f8/0x660 Call Trace: pnv_try_setup_npu_table_group+0x60/0x pnv_pci_ioda_fixup+0x20c/0x660 pcibios_resource_survey+0x2c8/0x31c pcibios_init+0xb0/0xe4 do_one_initcall+0x64/0x264 kernel_init_freeable+0x36c/0x468 kernel_init+0x2c/0x148 ret_from_kernel_thread+0x5c/0x68 An opencapi device is using a device PE, so the current code breaks because pe->pbus is not defined. More generally, there's no need to define an IOMMU group for opencapi, as the device sends real addresses directly (admittedly, the virtualization story is yet to be written). So let's fix it by skipping the IOMMU group setup for opencapi PHBs. Fixes: 0bd971676e68 ("powerpc/powernv/npu: Add compound IOMMU groups") Signed-off-by: Frederic Barrat Reviewed-by: Greg Kurz Reviewed-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit 897bc3df8c5aebb54c32d831f917592e873d0559 Author: Breno Leitao Date: Wed Jan 9 11:16:45 2019 -0200 powerpc/tm: Limit TM code inside PPC_TRANSACTIONAL_MEM Commit e1c3743e1a20 ("powerpc/tm: Set MSR[TS] just prior to recheckpoint") moved a code block around and this block uses a 'msr' variable outside of the CONFIG_PPC_TRANSACTIONAL_MEM, however the 'msr' variable is declared inside a CONFIG_PPC_TRANSACTIONAL_MEM block, causing a possible error when CONFIG_PPC_TRANSACTION_MEM is not defined. error: 'msr' undeclared (first use in this function) This is not causing a compilation error in the mainline kernel, because 'msr' is being used as an argument of MSR_TM_ACTIVE(), which is defined as the following when CONFIG_PPC_TRANSACTIONAL_MEM is *not* set: #define MSR_TM_ACTIVE(x) 0 This patch just fixes this issue avoiding the 'msr' variable usage outside the CONFIG_PPC_TRANSACTIONAL_MEM block, avoiding trusting in the MSR_TM_ACTIVE() definition. Cc: stable@vger.kernel.org Reported-by: Christoph Biedl Fixes: e1c3743e1a20 ("powerpc/tm: Set MSR[TS] just prior to recheckpoint") Signed-off-by: Breno Leitao Signed-off-by: Michael Ellerman commit fb0bdec51a4901b7dd088de0a1e365e1b9f5cd21 Author: Christophe Leroy Date: Wed Jan 9 20:30:07 2019 +0000 powerpc/8xx: fix setting of pagetable for Abatron BDI debug tool. Commit 8c8c10b90d88 ("powerpc/8xx: fix handling of early NULL pointer dereference") moved the loading of r6 earlier in the code. As some functions are called inbetween, r6 needs to be loaded again with the address of swapper_pg_dir in order to set PTE pointers for the Abatron BDI. Fixes: 8c8c10b90d88 ("powerpc/8xx: fix handling of early NULL pointer dereference") Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit d7b6cc199b2dea602b4a2a681cf6d3223a61e2be Author: Dan Carpenter Date: Wed Jan 9 13:23:29 2019 +0300 powerpc/powernv/npu: Allocate enough memory in pnv_try_setup_npu_table_group() There is a typo so we accidentally allocate enough memory for a pointer when we wanted to allocate enough for a struct. Fixes: 0bd971676e68 ("powerpc/powernv/npu: Add compound IOMMU groups") Signed-off-by: Dan Carpenter Reviewed-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit 21face6f0d4d033d949d5517f307a15f76a9d9f2 Author: Gustavo A. R. Silva Date: Fri Jan 4 23:55:27 2019 -0600 ARM: integrator: impd1: use struct_size() in devm_kzalloc() 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 foo { int stuff; void *entry[]; }; instance = devm_kzalloc(dev, sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL); Instead of leaving these open-coded and prone to type mistakes, we can now use the new struct_size() helper: instance = devm_kzalloc(dev, struct_size(instance, entry, count), GFP_KERNEL); This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva commit 279667212ab2a4f36c3b0347657ddcc11f9cfa25 Author: AKASHI Takahiro Date: Fri Jan 11 16:40:21 2019 +0900 arm64: kexec_file: return successfully even if kaslr-seed doesn't exist In kexec_file_load, kaslr-seed property of the current dtb will be deleted any way before setting a new value if possible. It doesn't matter whether it exists in the current dtb. So "ret" should be reset to 0 here. Fixes: commit 884143f60c89 ("arm64: kexec_file: add kaslr support") Signed-off-by: AKASHI Takahiro Signed-off-by: Will Deacon commit c7777236dd8f587f6a8d6800c03df318fd4d2627 Author: Jean-Philippe Brucker Date: Thu Jan 10 18:41:51 2019 +0000 ACPI/IORT: Fix rc_dma_get_range() When executed for a PCI_ROOT_COMPLEX type, iort_match_node_callback() expects the opaque pointer argument to be a PCI bus device. At the moment rc_dma_get_range() passes the PCI endpoint instead of the bus, and we've been lucky to have pci_domain_nr(ptr) return 0 instead of crashing. Pass the bus device to iort_scan_node(). Fixes: 5ac65e8c8941 ("ACPI/IORT: Support address size limit for root complexes") Reported-by: Eric Auger Signed-off-by: Jean-Philippe Brucker Signed-off-by: Lorenzo Pieralisi Reviewed-by: Eric Auger Acked-by: Robin Murphy Cc: stable@vger.kernel.org Cc: Will Deacon Cc: Hanjun Guo Cc: Sudeep Holla Cc: Catalin Marinas Cc: "Rafael J. Wysocki" Signed-off-by: Will Deacon commit fb4129b9279dc40be51060004e8f5e4b360739b8 Merge: beaf3d1901f4e 298e59d322954 Author: Daniel Borkmann Date: Fri Jan 11 10:40:55 2019 +0100 Merge branch 'bpf-fix-bitfield-printing' Yonghong Song says: ==================== The previous BTF kind_flag support patch set introduced a bug for kernel bpffs pretty printing and another bug for bpftool map pretty printing. If a bitfield struct member offset is greater than 256 bits, printed value for that struct member will be incorrect. - Patch #1 fixed the bug in kernel bpffs pretty printing. - Patch #2 enhanced the test_btf test case to cover the issue exposed by patch #1. - Patch #3 fixed the bug in bpftool map pretty printing. ==================== Signed-off-by: Daniel Borkmann commit 298e59d322954e89ed2a556c601a04a4c007d1b3 Author: Yonghong Song Date: Thu Jan 10 11:14:02 2019 -0800 tools/bpf: fix bpftool map dump with bitfields Commit 8772c8bc093b ("tools: bpftool: support pretty print with kind_flag set") added bpftool map dump with kind_flag support. When bitfield_size can be retrieved directly from btf_member, function btf_dumper_bitfield() is called to dump the bitfield. The implementation passed the wrong parameter "bit_offset" to the function. The excepted value is the bit_offset within a byte while the passed-in value is the struct member offset. This commit fixed the bug with passing correct "bit_offset" with adjusted data pointer. Fixes: 8772c8bc093b ("tools: bpftool: support pretty print with kind_flag set") Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit e43207fa2e6130e39e3aca4c55e2ee21cfb46828 Author: Yonghong Song Date: Thu Jan 10 11:14:01 2019 -0800 tools/bpf: test btf bitfield with >=256 struct member offset This patch modified test_btf pretty print test to cover the bitfield with struct member equal to or greater 256. Without the previous kernel patch fix, the modified test will fail: $ test_btf -p ...... BTF pretty print array(#1)......unexpected pprint output expected: 0: {0,0,0,0x3,0x0,0x3,{0|[0,0,0,0,0,0,0,0]},ENUM_ZERO,4,0x1} read: 0: {0,0,0,0x3,0x0,0x3,{0|[0,0,0,0,0,0,0,0]},ENUM_ZERO,4,0x0} BTF pretty print array(#2)......unexpected pprint output expected: 0: {0,0,0,0x3,0x0,0x3,{0|[0,0,0,0,0,0,0,0]},ENUM_ZERO,4,0x1} read: 0: {0,0,0,0x3,0x0,0x3,{0|[0,0,0,0,0,0,0,0]},ENUM_ZERO,4,0x0} PASS:6 SKIP:0 FAIL:2 With the kernel fix, the modified test will succeed: $ test_btf -p ...... BTF pretty print array(#1)......OK BTF pretty print array(#2)......OK PASS:8 SKIP:0 FAIL:0 Fixes: 9d5f9f701b18 ("bpf: btf: fix struct/union/fwd types with kind_flag") Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 17e3ac812541f73224299d8958ddb420c2d5bbd8 Author: Yonghong Song Date: Thu Jan 10 11:14:00 2019 -0800 bpf: fix bpffs bitfield pretty print Commit 9d5f9f701b18 ("bpf: btf: fix struct/union/fwd types with kind_flag") introduced kind_flag and used bitfield_size in the btf_member to directly pretty print member values. The commit contained a bug where the incorrect parameters could be passed to function btf_bitfield_seq_show(). The bits_offset parameter in the function expects a value less than 8. Instead, the member offset in the structure is passed. The below is btf_bitfield_seq_show() func signature: void btf_bitfield_seq_show(void *data, u8 bits_offset, u8 nr_bits, struct seq_file *m) both bits_offset and nr_bits are u8 type. If the bitfield member offset is greater than 256, incorrect value will be printed. This patch fixed the issue by calculating correct proper data offset and bits_offset similar to non kind_flag case. Fixes: 9d5f9f701b18 ("bpf: btf: fix struct/union/fwd types with kind_flag") Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 06382deac2b8a49bbc5aaa3c9118fed6da4a1ac1 Author: Greg Kroah-Hartman Date: Fri Jan 11 10:40:13 2019 +0100 Revert "staging: rtl8723bs: Mark ACPI table declaration as used" This reverts commit e6d093719e22a09e778edde192dfd89a0cd77b5c. Turns out it is not needed at all, a fix for clang was made and accepted upstream in that project that makes this change unnecessary. So revert it. Reported-by: Nick Desaulniers Cc: Nathan Chancellor Signed-off-by: Greg Kroah-Hartman commit e2d3c414ec0f9d1557c8c5ff2c32166e68bbc4ad Merge: 95681cda8dcc3 f299e0bdbaeb6 Author: Daniel Vetter Date: Fri Jan 11 10:26:21 2019 +0100 Merge tag 'drm-intel-fixes-2019-01-11' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes i915 fixes for v5.0-rc2: - Disable PSR for Apple panels - Broxton ERR_PTR error state fix - Kabylake VECS workaround fix - Unwind failure on pinning the gen7 ppgtt - GVT workload request allocation fix Signed-off-by: Daniel Vetter From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87pnt35z8h.fsf@intel.com commit 95681cda8dcc3e90f25b3e0c84c49778dae43346 Merge: ae5e5ae90d326 4089e272ac616 Author: Daniel Vetter Date: Fri Jan 11 10:25:05 2019 +0100 Merge tag 'drm-misc-fixes-2019-01-10-1' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Second pull request, drm-misc-fixes for v5.0-rc2: - Fix fb-helper to work correctly with SDL 1.2 bugs. - Fix lockdep warning in the atomic ioctl and setproperty. Signed-off-by: Daniel Vetter From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/2cf24f5c-2b1f-befa-8d08-058661146b61@linux.intel.com commit 65a4f3a1efda8e0cc2516301fc3ad64e3eca716c Merge: 2b531d71595d2 2e61069b056f7 7d7b467cb95bf b9ced18acf68d Author: Rafael J. Wysocki Date: Fri Jan 11 10:12:07 2019 +0100 Merge branches 'acpi-pci', 'acpi-power' and 'acpi-misc' * acpi-pci: ACPI: Fix build failure when CONFIG_NLS is set to 'n' * acpi-power: ACPI: power: Skip duplicate power resource references in _PRx * acpi-misc: ACPI: NUMA: Use correct type for printing addresses on i386-PAE commit 343e60e52a3a093bb7baeca441789724fcac4bb5 Merge: ca27e4cd0bdd8 7604bf0920985 0e141d1c65c1d 6e863844ad6ef Author: Rafael J. Wysocki Date: Fri Jan 11 10:09:51 2019 +0100 Merge branches 'pm-cpuidle', 'pm-cpufreq' and 'pm-sleep' * pm-cpuidle: doc: trace: fix reference to cpuidle documentation file cpuidle / Documentation: Update cpuidle MAINTAINERS entry * pm-cpufreq: cpufreq: scmi: Fix frequency invariance in slow path cpufreq: check if policy is inactive early in __cpufreq_get() cpufreq: scpi/scmi: Fix freeing of dynamic OPPs cpufreq / Documentation: Update cpufreq MAINTAINERS entry * pm-sleep: PM: sleep: call devfreq suspend/resume commit d04e779fb1dbeedf8a60b66d0d0048be4e65d366 Author: Wei Yongjun Date: Thu Jan 10 14:07:42 2019 +0000 gpio: pca953x: Make symbol 'pca953x_i2c_regmap' static Fixes the following sparse warning: drivers/gpio/gpio-pca953x.c:292:28: warning: symbol 'pca953x_i2c_regmap' was not declared. Should it be static? Fixes: 49427232764d ("gpio: pca953x: Perform basic regmap conversion") Signed-off-by: Wei Yongjun Reviewed-by: Marek Vasut Signed-off-by: Linus Walleij commit ae5e5ae90d32667e107ba0bd2f1dc9e20a08dfaf Merge: f34c48e06ddcc a5176a4cb85bb Author: Dave Airlie Date: Fri Jan 11 17:25:00 2019 +1000 Merge branch 'linux-4.21' of git://github.com/skeggsb/linux into drm-fixes 3 nouveau fixes: one backlight, falcon register access, and a fan fix. Signed-off-by: Dave Airlie From: Ben Skeggs Link: https://patchwork.freedesktop.org/patch/msgid/CACAvsv4MHr=Rq3FkZFTYWPc7o5-dTWFysXB=wN2L91SYeFbzkQ@mail.gmail.com commit 4e72ee8872279a70ebe973172133b98e8acbf54e Merge: 576b50ea23569 15c03092a9fbc Author: Ingo Molnar Date: Fri Jan 11 08:12:09 2019 +0100 Merge tag 'perf-core-for-mingo-5.0-20190110' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent Pull perf/core fixes and improvements from Arnaldo Carvalho de Melo: perf trace: Ravi Bangoria: - Rework PowerPC syscall table generation, now using a .tbl file just like x86_64 and S/390, also silencing a tools build warning about headers out of sync with the kernel sources. tools include uapi: Arnaldo Carvalho de Melo: - Sync linux/if_link.h copy with the kernel sources, silencing a build warning. perf top: Arnaldo Carvalho de Melo: - Add 'arch_cpu_idle' to the list of kernel idle symbols, noticed on a Orange Pi Zero ARM board, just like with other symbols in other arches. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar commit a5176a4cb85bb6213daadf691097cf411da35df2 Author: Ilia Mirkin Date: Thu Dec 13 22:44:08 2018 -0500 drm/nouveau/falcon: avoid touching registers if engine is off Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108980 Signed-off-by: Ilia Mirkin Signed-off-by: Ben Skeggs commit 118780066e30c34de3d9349710b51780bfa0ba83 Author: Takashi Iwai Date: Wed Sep 12 12:58:43 2018 +0200 drm/nouveau: Don't disable polling in fallback mode When a fan is controlled via linear fallback without cstate, we shouldn't stop polling. Otherwise it won't be adjusted again and keeps running at an initial crazy pace. Fixes: 800efb4c2857 ("drm/nouveau/drm/therm/fan: add a fallback if no fan control is specified in the vbios") Bugzilla: https://bugzilla.suse.com/show_bug.cgi?id=1103356 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107447 Reported-by: Thomas Blume Signed-off-by: Takashi Iwai Reviewed-by: Martin Peres Signed-off-by: Ben Skeggs commit 15f77c4ade3364106a3a397f0a8d6fce9d6a6326 Author: Ben Skeggs Date: Fri Jan 11 16:08:20 2019 +1000 drm/nouveau: register backlight on pascal and newer Signed-off-by: Ben Skeggs commit 5b0e7310a2a33c06edc7eb81ffc521af9b2c5610 Author: Stephen Smalley Date: Wed Jan 9 10:55:10 2019 -0500 selinux: fix GPF on invalid policy levdatum->level can be NULL if we encounter an error while loading the policy during sens_read prior to initializing it. Make sure sens_destroy handles that case correctly. Reported-by: syzbot+6664500f0f18f07a5c0e@syzkaller.appspotmail.com Signed-off-by: Stephen Smalley Signed-off-by: Paul Moore commit 9d9f59b4204bc41896c866b3e5856e5b416aa199 Author: Leon Romanovsky Date: Thu Jan 10 08:15:45 2019 +0200 RDMA/mthca: Clear QP objects during their allocation As part of audit process to update drivers to use rdma_restrack_add() ensure that QP objects is cleared before access. Such change fixes the crash observed with uninitialized non zero sgid attr accessed by ib_destroy_qp(). CPU: 3 PID: 74 Comm: kworker/u16:1 Not tainted 4.19.10-300.fc29.x86_64 Workqueue: ipoib_wq ipoib_cm_tx_reap [ib_ipoib] RIP: 0010:rdma_put_gid_attr+0x9/0x30 [ib_core] RSP: 0018:ffffb7ad819dbde8 EFLAGS: 00010202 RAX: 0000000000000000 RBX: ffff8d1bdf5a2e00 RCX: 0000000000002699 RDX: 206c656e72656af8 RSI: ffff8d1bf7ae6160 RDI: 206c656e72656b20 RBP: 0000000000000000 R08: 0000000000026160 R09: ffffffffc06b45bf R10: ffffe849887da000 R11: 0000000000000002 R12: ffff8d1be30cb400 R13: ffff8d1bdf681800 R14: ffff8d1be2272400 R15: ffff8d1be30ca000 FS: 0000000000000000(0000) GS:ffff8d1bf7ac0000(0000) knlGS:0000000000000000 Trace: ib_destroy_qp+0xc9/0x240 [ib_core] ipoib_cm_tx_reap+0x1f9/0x4e0 [ib_ipoib] process_one_work+0x1a1/0x3a0 worker_thread+0x30/0x380 ? pwq_unbound_release_workfn+0xd0/0xd0 kthread+0x112/0x130 ? kthread_create_worker_on_cpu+0x70/0x70 ret_from_fork+0x22/0x40 Reported-by: Alexander Murashkin Tested-by: Alexander Murashkin Fixes: 1a1f460ff151 ("RDMA: Hold the sgid_attr inside the struct ib_ah/qp") Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 6325e01b6cdf4636b721cf7259c1616e3cf28ce2 Author: Adit Ranadive Date: Wed Jan 9 23:08:49 2019 +0000 RDMA/vmw_pvrdma: Return the correct opcode when creating WR Since the IB_WR_REG_MR opcode value changed, let's set the PVRDMA device opcodes explicitly. Reported-by: Ruishuang Wang Fixes: 9a59739bd01f ("IB/rxe: Revise the ib_wr_opcode enum") Cc: stable@vger.kernel.org Reviewed-by: Bryan Tan Reviewed-by: Ruishuang Wang Reviewed-by: Vishnu Dasa Signed-off-by: Adit Ranadive Signed-off-by: Jason Gunthorpe commit 10f4e765879e514e1ce7f52ed26603047af196e2 Author: wenxu Date: Thu Jan 10 14:51:35 2019 +0800 netfilter: nft_flow_offload: fix interaction with vrf slave device In the forward chain, the iif is changed from slave device to master vrf device. Thus, flow offload does not find a match on the lower slave device. This patch uses the cached route, ie. dst->dev, to update the iif and oif fields in the flow entry. After this patch, the following example works fine: # ip addr add dev eth0 1.1.1.1/24 # ip addr add dev eth1 10.0.0.1/24 # ip link add user1 type vrf table 1 # ip l set user1 up # ip l set dev eth0 master user1 # ip l set dev eth1 master user1 # nft add table firewall # nft add flowtable f fb1 { hook ingress priority 0 \; devices = { eth0, eth1 } \; } # nft add chain f ftb-all {type filter hook forward priority 0 \; policy accept \; } # nft add rule f ftb-all ct zone 1 ip protocol tcp flow offload @fb1 # nft add rule f ftb-all ct zone 1 ip protocol udp flow offload @fb1 Signed-off-by: wenxu Signed-off-by: Pablo Neira Ayuso commit e2c8d550a973bb34fc28bc8d0ec996f84562fb8a Author: Shakeel Butt Date: Wed Jan 2 19:14:31 2019 -0800 netfilter: ebtables: account ebt_table_info to kmemcg The [ip,ip6,arp]_tables use x_tables_info internally and the underlying memory is already accounted to kmemcg. Do the same for ebtables. The syzbot, by using setsockopt(EBT_SO_SET_ENTRIES), was able to OOM the whole system from a restricted memcg, a potential DoS. By accounting the ebt_table_info, the memory used for ebt_table_info can be contained within the memcg of the allocating process. However the lifetime of ebt_table_info is independent of the allocating process and is tied to the network namespace. So, the oom-killer will not be able to relieve the memory pressure due to ebt_table_info memory. The memory for ebt_table_info is allocated through vmalloc. Currently vmalloc does not handle the oom-killed allocating process correctly and one large allocation can bypass memcg limit enforcement. So, with this patch, at least the small allocations will be contained. For large allocations, we need to fix vmalloc. Reported-by: syzbot+7713f3aa67be76b1552c@syzkaller.appspotmail.com Signed-off-by: Shakeel Butt Reviewed-by: Kirill Tkhai Signed-off-by: Pablo Neira Ayuso commit b67d4530cdade7ebfafa2c6b46f2a0dad3e41bcb Author: Sowjanya Komatineni Date: Tue Jan 8 13:59:10 2019 -0800 i2c: tegra: Fix Maximum transfer size Tegra194 supports maximum 64K Bytes transfer per packet. Tegra186 and prior supports maximum 4K Bytes transfer per packet. This patch fixes this payload difference between Tegra194 and prior Tegra chipsets using separate i2c_adapter_quirks. Signed-off-by: Sowjanya Komatineni Acked-by: Thierry Reding Signed-off-by: Wolfram Sang commit 6ebec961d59bccf65d08b13fc1ad4e6272a89338 Author: Yi Zeng Date: Wed Jan 9 15:33:07 2019 +0800 i2c: dev: prevent adapter retries and timeout being set as minus value If adapter->retries is set to a minus value from user space via ioctl, it will make __i2c_transfer and __i2c_smbus_xfer skip the calling to adapter->algo->master_xfer and adapter->algo->smbus_xfer that is registered by the underlying bus drivers, and return value 0 to all the callers. The bus driver will never be accessed anymore by all users, besides, the users may still get successful return value without any error or information log print out. If adapter->timeout is set to minus value from user space via ioctl, it will make the retrying loop in __i2c_transfer and __i2c_smbus_xfer always break after the the first try, due to the time_after always returns true. Signed-off-by: Yi Zeng [wsa: minor grammar updates to commit message] Signed-off-by: Wolfram Sang Cc: stable@kernel.org commit 2076607a20bd4dfba699185616cbbbce06d3fa59 Author: Fabio Estevam Date: Wed Dec 26 10:06:19 2018 -0200 qcom-scm: Include header Since commit e6f6d63ed14c ("drm/msm: add headless gpu device for imx5") the DRM_MSM symbol can be selected by SOC_IMX5 causing the following error when building imx_v6_v7_defconfig: In file included from ../drivers/gpu/drm/msm/adreno/a5xx_gpu.c:17:0: ../include/linux/qcom_scm.h: In function 'qcom_scm_set_cold_boot_addr': ../include/linux/qcom_scm.h:73:10: error: 'ENODEV' undeclared (first use in this function) return -ENODEV; Include the header file to fix this problem. Reported-by: kernelci.org bot Fixes: e6f6d63ed14c ("drm/msm: add headless gpu device for imx5") Signed-off-by: Fabio Estevam Reviewed-by: Bjorn Andersson Tested-by: Guenter Roeck Signed-off-by: Andy Gross commit a39c330d7436530151a619319f7ff6e9b3a6d8c6 Merge: 5db470e229e22 b8a38ea64dc71 Author: Jens Axboe Date: Thu Jan 10 15:29:57 2019 -0700 Merge branch 'nvme-5.0' of git://git.infradead.org/nvme into for-linus Pull NVMe fixes from Christoph. * 'nvme-5.0' of git://git.infradead.org/nvme: nvme: don't initlialize ctrl->cntlid twice nvme: introduce NVME_QUIRK_IGNORE_DEV_SUBNQN nvme: pad fake subsys NQN vid and ssvid with zeros nvme-multipath: zero out ANA log buffer nvme-fabrics: unset write/poll queues for discovery controllers nvme-tcp: don't ask if controller is fabrics nvme-tcp: remove dead code nvme-pci: fix out of bounds access in nvme_cqe_pending nvme-pci: rerun irq setup on IO queue init errors nvme-pci: use the same attributes when freeing host_mem_desc_bufs. nvme-pci: fix the wrong setting of nr_maps commit 8ce5f84157530ffa64b3e0acf00b9261f41c8da8 Author: Rob Herring Date: Tue Dec 11 14:31:05 2018 -0600 of: Remove struct device_node.type pointer Now that all users of device_node.type pointer have been removed in favor of accessor functions, we can remove it. Cc: Frank Rowand Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring commit de6629eb262e0dc52a2367db38e3d2780cff5427 Merge: 4f548c25a38ef a3869d43c9800 Author: Linus Torvalds Date: Thu Jan 10 14:16:47 2019 -0800 Merge tag 'pci-v5.0-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI fix from Bjorn Helgaas: "Fix Amlogic Meson host controller driver build failure (Corentin Labbe)" * tag 'pci-v5.0-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: amlogic: Fix build failure due to missing gpio header commit b19bce0335e25b9069ddb10d234e673bbd46d2f4 Author: Heiner Kallweit Date: Wed Jan 9 08:20:28 2019 +0100 net: ethernet: mediatek: fix warning in phy_start_aneg linux 5.0-rc1 shows following warning on bpi-r2/mt7623 bootup: [ 5.170597] WARNING: CPU: 3 PID: 1 at drivers/net/phy/phy.c:548 phy_start_aneg+0x110/0x144 [ 5.178826] called from state READY .... [ 5.264111] [] (phy_start_aneg) from [] (mtk_init+0x414/0x47c) [ 5.271630] r7:df5f5eec r6:c0f08c48 r5:00000000 r4:dea67800 [ 5.277256] [] (mtk_init) from [] (register_netdevice+0x98/0x51c) [ 5.285035] r8:00000000 r7:00000000 r6:c0f97080 r5:c0f08c48 r4:dea67800 [ 5.291693] [] (register_netdevice) from [] (register_netdev+0x2c/0x44) [ 5.299989] r8:00000000 r7:dea2e608 r6:deacea00 r5:dea2e604 r4:dea67800 [ 5.306646] [] (register_netdev) from [] (mtk_probe+0x668/0x7ac) [ 5.314336] r5:dea2e604 r4:dea2e040 [ 5.317890] [] (mtk_probe) from [] (platform_drv_probe+0x58/0xa8) [ 5.325670] r10:c0f86bac r9:00000000 r8:c0fbe578 r7:00000000 r6:c0f86bac r5:00000000 [ 5.333445] r4:deacea10 [ 5.335963] [] (platform_drv_probe) from [] (really_probe+0x2d8/0x424) maybe other boards using this generic driver are affected v2: optimization: - phy_set_max_speed() is only needed if you want to reduce the max speed, typically if the PHY supports 1Gbps but the MAC supports 100Mbps only. - The pause parameters are autonegotiated. Except you have a specific need you normally don't need to manually fiddle with this. - phy_start_aneg() is called implicitly by the phylib state machine, you shouldn't call it manually except you have a good excuse. - netif_carrier_on/netif_carrier_off in mtk_phy_link_adjust() isn't needed. It's done by phy_link_change() in phylib. Signed-off-by: Frank Wunderlich Reviewed-by: Heiner Kallweit Acked-by: Sean Wang Signed-off-by: David S. Miller commit c5715b8fabfca0ef85903f8bad2189940ed41cc8 Author: Yuchung Cheng Date: Tue Jan 8 18:14:28 2019 -0800 tcp: change txhash on SYN-data timeout Previously upon SYN timeouts the sender recomputes the txhash to try a different path. However this does not apply on the initial timeout of SYN-data (active Fast Open). Therefore an active IPv6 Fast Open connection may incur one second RTO penalty to take on a new path after the second SYN retransmission uses a new flow label. This patch removes this undesirable behavior so Fast Open changes the flow label just like the regular connections. This also helps avoid falsely disabling Fast Open on the sender which triggers after two consecutive SYN timeouts on Fast Open. Signed-off-by: Yuchung Cheng Reviewed-by: Neal Cardwell Signed-off-by: David S. Miller commit ea89098ef9a574bceca00d3b5df14aaf0b3f9ccf Author: Andrew Lunn Date: Wed Jan 9 00:24:03 2019 +0100 net: dsa: mv88x6xxx: mv88e6390 errata The 6390 copper ports have an errata which require poking magic values into undocumented magic registers and then performing a software reset. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 001e465f09a18857443489a57e74314a3368c805 Author: Willem de Bruijn Date: Tue Jan 8 12:32:42 2019 -0500 bonding: update nest level on unlink A network device stack with multiple layers of bonding devices can trigger a false positive lockdep warning. Adding lockdep nest levels fixes this. Update the level on both enslave and unlink, to avoid the following series of events .. ip netns add test ip netns exec test bash ip link set dev lo addr 00:11:22:33:44:55 ip link set dev lo down ip link add dev bond1 type bond ip link add dev bond2 type bond ip link set dev lo master bond1 ip link set dev bond1 master bond2 ip link set dev bond1 nomaster ip link set dev bond2 master bond1 .. from still generating a splat: [ 193.652127] ====================================================== [ 193.658231] WARNING: possible circular locking dependency detected [ 193.664350] 4.20.0 #8 Not tainted [ 193.668310] ------------------------------------------------------ [ 193.674417] ip/15577 is trying to acquire lock: [ 193.678897] 00000000a40e3b69 (&(&bond->stats_lock)->rlock#3/3){+.+.}, at: bond_get_stats+0x58/0x290 [ 193.687851] but task is already holding lock: [ 193.693625] 00000000807b9d9f (&(&bond->stats_lock)->rlock#2/2){+.+.}, at: bond_get_stats+0x58/0x290 [..] [ 193.851092] lock_acquire+0xa7/0x190 [ 193.855138] _raw_spin_lock_nested+0x2d/0x40 [ 193.859878] bond_get_stats+0x58/0x290 [ 193.864093] dev_get_stats+0x5a/0xc0 [ 193.868140] bond_get_stats+0x105/0x290 [ 193.872444] dev_get_stats+0x5a/0xc0 [ 193.876493] rtnl_fill_stats+0x40/0x130 [ 193.880797] rtnl_fill_ifinfo+0x6c5/0xdc0 [ 193.885271] rtmsg_ifinfo_build_skb+0x86/0xe0 [ 193.890091] rtnetlink_event+0x5b/0xa0 [ 193.894320] raw_notifier_call_chain+0x43/0x60 [ 193.899225] netdev_change_features+0x50/0xa0 [ 193.904044] bond_compute_features.isra.46+0x1ab/0x270 [ 193.909640] bond_enslave+0x141d/0x15b0 [ 193.913946] do_set_master+0x89/0xa0 [ 193.918016] do_setlink+0x37c/0xda0 [ 193.921980] __rtnl_newlink+0x499/0x890 [ 193.926281] rtnl_newlink+0x48/0x70 [ 193.930238] rtnetlink_rcv_msg+0x171/0x4b0 [ 193.934801] netlink_rcv_skb+0xd1/0x110 [ 193.939103] rtnetlink_rcv+0x15/0x20 [ 193.943151] netlink_unicast+0x3b5/0x520 [ 193.947544] netlink_sendmsg+0x2fd/0x3f0 [ 193.951942] sock_sendmsg+0x38/0x50 [ 193.955899] ___sys_sendmsg+0x2ba/0x2d0 [ 193.960205] __x64_sys_sendmsg+0xad/0x100 [ 193.964687] do_syscall_64+0x5a/0x460 [ 193.968823] entry_SYSCALL_64_after_hwframe+0x49/0xbe Fixes: 7e2556e40026 ("bonding: avoid lockdep confusion in bond_get_stats()") Reported-by: syzbot Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit f34c48e06ddcc197f2cf7cbc006ceb74e28e1ccf Merge: bd86c9e66c838 1c1eba86339c8 Author: Dave Airlie Date: Fri Jan 11 07:37:56 2019 +1000 Merge branch 'drm-fixes-5.0' of git://people.freedesktop.org/~agd5f/linux into drm-fixes - Powerplay fixes - Virtual display pinning fixes - Golden register updates for vega - Pitch and gem size validation fixes - Fix for error case in sr-iov init - Disable page tables in system memory on RV due to issues with IOMMU reported on some platforms Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20190109204336.3315-1-alexander.deucher@amd.com commit 4f548c25a38efb3589c4e797a6e87f6900345dc0 Merge: 1bdbe22749207 27de1f541f1f9 Author: Linus Torvalds Date: Thu Jan 10 13:36:53 2019 -0800 Merge tag 'riscv-for-linus-4.21-rc2-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux Pull RISC-V updates from Palmer Dabbelt: "This tag contains a handful of updates that slipped through the cracks during the merge window due to the holidays. The fixes are mostly independent, with the exception of one larger audit-related branch. Core RISC-V updates: - The BSS has been moved, which shrinks flat images. - A fix to test-bpf so it compiles on RV64I-based systems. - A fix to respect the kernel commandline when there is no device tree. - A fix to prevent CPUs from trying to put themselves to sleep when bringing down the system. - Support for MODULE_SECTIONS on RV32I-based systems. - [new in v2] The addition of an SBI earlycon driver. This is definately a new feature, but I'd like to include it now because I dropped this patch when submitting the merge window PR that removed our EARLY_PRINTK support. RISC-V audit updates: - The addition of NR_syscalls into unistd.h, which is necessary for CONFIG_FTRACE_SYSCALLS. - The definition of CREATE_TRACE_POINTS so __tracepoint_sys_{enter,exit} get defined. - A fix for trace_sys_exit() so we can enable HAVE_SYSCALL_TRACEPOINTS As usual, I've tested this by booting a Fedora-based image on a recent QEMU (this time just whatever I had lying around). * tag 'riscv-for-linus-4.21-rc2-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux: tty/serial: Add RISC-V SBI earlycon support riscv: add HAVE_SYSCALL_TRACEPOINTS to Kconfig riscv: fix trace_sys_exit hook riscv: define CREATE_TRACE_POINTS in ptrace.c riscv: define NR_syscalls in unistd.h riscv: audit: add audit hook in do_syscall_trace_enter/exit() riscv: add audit support RISC-V: Support MODULE_SECTIONS mechanism on RV32 MAINTAINERS: SiFive drivers: add myself as a SiFive driver maintainer MAINTAINERS: SiFive drivers: change the git tree to a SiFive git tree riscv: don't stop itself in smp_send_stop arch: riscv: support kernel command line forcing when no DTB passed tools uapi: fix RISC-V 64-bit support RISC-V: Make BSS section as the last section in vmlinux.lds.S commit bd86c9e66c8385fb437c5ad506243304a8814b65 Merge: bfeffd1552837 f8c15790e4d8b Author: Dave Airlie Date: Fri Jan 11 06:32:37 2019 +1000 Merge tag 'drm-misc-fixes-2019-01-10' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Pull request for drm-misc-fixes for v5.0-rc2: - Fixes for the tc358767 bridge to work correctly with tc358867 using a DP connector. - Make resume work on amdgpu when a DP-MST display is unplugged. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/1c47722d-c416-184d-4340-0dc6a614d685@linux.intel.com commit 8544f4aa9dd19a04d1244dae10feecc813ccf175 Author: Pavel Shilovsky Date: Sat Dec 22 12:40:05 2018 -0800 CIFS: Fix credit computation for compounded requests In SMB3 protocol every part of the compound chain consumes credits individually, so we need to call wait_for_free_credits() for each of the PDUs in the chain. If an operation is interrupted, we must ensure we return all credits taken from the server structure back. Without this patch server can sometimes disconnect the session due to credit mismatches, especially when first operation(s) are large writes. Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French CC: Stable commit 33fa5c8b8a7dbe6353a56eaa654b790348890d42 Author: Pavel Shilovsky Date: Thu Jan 3 16:45:13 2019 -0800 CIFS: Do not set credits to 1 if the server didn't grant anything Currently we reset the number of total credits granted by the server to 1 if the server didn't grant us anything int the response. This violates the SMB3 protocol - we need to trust the server and use the credit values from the response. Fix this by removing the corresponding code. Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French CC: Stable commit b983f7e92348d7e7d091db1b78b7915e9dd3d63a Author: Pavel Shilovsky Date: Wed Dec 19 22:49:09 2018 +0000 CIFS: Fix adjustment of credits for MTU requests Currently for MTU requests we allocate maximum possible credits in advance and then adjust them according to the request size. While we were adjusting the number of credits belonging to the server, we were skipping adjustment of credits belonging to the request. This patch fixes it by setting request credits to CreditCharge field value of SMB2 packet header. Also ask 1 credit more for async read and write operations to increase parallelism and match the behavior of other operations. Signed-off-by: Pavel Shilovsky Signed-off-by: Steve French CC: Stable commit c715f89c4dab76317c773df2611af2dac4dea2b7 Author: Dan Carpenter Date: Sat Jan 5 21:18:03 2019 +0300 cifs: Fix a tiny potential memory leak The most recent "it" allocation is leaked on this error path. I believe that small allocations always succeed in current kernels so this doesn't really affect run time. Fixes: 54be1f6c1c37 ("cifs: Add DFS cache routines") Signed-off-by: Dan Carpenter Signed-off-by: Steve French commit 8428817dc40006dca0a531cfa06e89cb3b41790d Author: Dan Carpenter Date: Sat Jan 5 15:25:29 2019 +0300 cifs: Fix a debug message This debug message was never shown because it was checking for NULL returns but extract_hostname() returns error pointers. Fixes: 93d5cb517db3 ("cifs: Add support for failover in cifs_reconnect()") Signed-off-by: Dan Carpenter Signed-off-by: Steve French Reviewed-by: Paulo Alcantara commit a214720cbf50cd8c3f76bbb9c3f5c283910e9d33 Author: YunQiang Su Date: Tue Jan 8 13:45:10 2019 +0800 Disable MSI also when pcie-octeon.pcie_disable on Octeon has an boot-time option to disable pcie. Since MSI depends on PCI-E, we should also disable MSI also with this option is on in order to avoid inadvertently accessing PCIe registers. Signed-off-by: YunQiang Su Signed-off-by: Paul Burton Cc: pburton@wavecomp.com Cc: linux-mips@vger.kernel.org Cc: aaro.koskinen@iki.fi Cc: stable@vger.kernel.org # v3.3+ commit b89d82ef01b33bc50cbaa8ff05607879b40d0704 Author: Will Deacon Date: Tue Jan 8 16:19:01 2019 +0000 arm64: kpti: Avoid rewriting early page tables when KASLR is enabled A side effect of commit c55191e96caa ("arm64: mm: apply r/o permissions of VM areas to its linear alias as well") is that the linear map is created with page granularity, which means that transitioning the early page table from global to non-global mappings when enabling kpti can take a significant amount of time during boot. Given that most CPU implementations do not require kpti, this mainly impacts KASLR builds where kpti is forcefully enabled. However, in these situations we know early on that non-global mappings are required and can avoid the use of global mappings from the beginning. The only gotcha is Cavium erratum #27456, which we must detect based on the MIDR value of the boot CPU. Reviewed-by: Ard Biesheuvel Reported-by: John Garry Signed-off-by: Will Deacon commit 1bdbe227492075d058e37cb3d400e6468d0095b5 Merge: f0ebbe9b18e0d 58fec830fc192 Author: Linus Torvalds Date: Thu Jan 10 09:20:46 2019 -0800 Merge tag 'vfio-v5.0-rc2' of git://github.com/awilliam/linux-vfio Pull VFIO fixes from Alex Williamson: - Fix trace header include path for in-tree builds (Masahiro Yamada) - Fix overflow in unmap wrap-around test (Alex Williamson) * tag 'vfio-v5.0-rc2' of git://github.com/awilliam/linux-vfio: vfio/type1: Fix unmap overflow off-by-one vfio/pci: set TRACE_INCLUDE_PATH to fix the build error commit f0ebbe9b18e0d2bb79c7963faf847b949d4f5720 Merge: e7446be4468bb d1dd42110d272 Author: Linus Torvalds Date: Thu Jan 10 09:17:48 2019 -0800 Merge tag 'sound-5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of small fixes for USB-audio, HD-audio and cs46xx. The USB-audio fixes are for out-of-bound accesses and a regression in the recent cleanup, while HD-audio fixes are usual device-specific quirks" * tag 'sound-5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/realtek - Disable headset Mic VREF for headset mode of ALC225 ALSA: hda/realtek - Add unplug function into unplug state of Headset Mode for ALC225 ALSA: usb-audio: fix CM6206 register definitions ALSA: cs46xx: Potential NULL dereference in probe ALSA: hda/realtek - Support Dell headset mode for New AIO platform ALSA: usb-audio: Fix an out-of-bound read in create_composite_quirks ALSA: usb-audio: Always check descriptor sizes in parser code ALSA: usb-audio: Check mixer unit descriptors more strictly ALSA: usb-audio: Avoid access before bLength check in build_audio_procunit() commit e7446be4468bb24c9e45a153bcc9f29ec0372a6f Merge: 70c25259537c0 81d9bdf59092e Author: Linus Torvalds Date: Thu Jan 10 09:14:12 2019 -0800 Merge tag 'mtd/fixes-for-5.0-rc2' of git://git.infradead.org/linux-mtd Pull mtd fixes from Boris Brezillon: "Core MTD Fixes: - Fix a bug introduced when exposing MTD devs as NVMEM providers and check for add_mtd_device() return code everywhere raw NAND fixes: - Fix a memory corruption in the QCOM driver" * tag 'mtd/fixes-for-5.0-rc2' of git://git.infradead.org/linux-mtd: mtd: rawnand: qcom: fix memory corruption that causes panic mtd: Check add_mtd_device() ret code mtd: Fix the check on nvmem_register() ret code commit 5edc22cc1d33d6a88d175d25adc38d2a5cee134d Author: Marc Dionne Date: Wed Jan 9 17:23:54 2019 +0000 afs: Set correct lock type for the yfs CreateFile A lock type of 0 is "LockRead", which makes the fileserver record an unintentional read lock on the new file. This will cause problems later on if the file is the subject of locking operations. The correct default value should be -1 ("LockNone"). Fix the operation marshalling code to set the value and provide an enum to symbolise the values whilst we're at it. Fixes: 30062bd13e36 ("afs: Implement YFS support in the fs client") Signed-off-by: Marc Dionne Signed-off-by: David Howells commit c2b8bd49d35a768d3966c5e14e8f6971f2a63439 Author: Gustavo A. R. Silva Date: Wed Jan 9 17:23:54 2019 +0000 afs: Use struct_size() in kzalloc() 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 foo { int stuff; void *entry[]; }; instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL); Instead of leaving these open-coded and prone to type mistakes, we can now use the new struct_size() helper: instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL); This code was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: David Howells commit 1b3922a8bc74231f9a767d1be6d9a061a4d4eeab Author: Qu Wenruo Date: Tue Jan 8 14:08:18 2019 +0800 btrfs: Use real device structure to verify dev extent [BUG] Linux v5.0-rc1 will fail fstests/btrfs/163 with the following kernel message: BTRFS error (device dm-6): dev extent devid 1 physical offset 13631488 len 8388608 is beyond device boundary 0 BTRFS error (device dm-6): failed to verify dev extents against chunks: -117 BTRFS error (device dm-6): open_ctree failed [CAUSE] Commit cf90d884b347 ("btrfs: Introduce mount time chunk <-> dev extent mapping check") introduced strict check on dev extents. We use btrfs_find_device() with dev uuid and fs uuid set to NULL, and only dependent on @devid to find the real device. For seed devices, we call clone_fs_devices() in open_seed_devices() to allow us search seed devices directly. However clone_fs_devices() just populates devices with devid and dev uuid, without populating other essential members, like disk_total_bytes. This makes any device returned by btrfs_find_device(fs_info, devid, NULL, NULL) is just a dummy, with 0 disk_total_bytes, and any dev extents on the seed device will not pass the device boundary check. [FIX] This patch will try to verify the device returned by btrfs_find_device() and if it's a dummy then re-search in seed devices. Fixes: cf90d884b347 ("btrfs: Introduce mount time chunk <-> dev extent mapping check") CC: stable@vger.kernel.org # 4.19+ Reported-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit beaf3d1901f4ea46fbd5c9d857227d99751de469 Author: Song Liu Date: Tue Jan 8 14:20:44 2019 -0800 bpf: fix panic in stack_map_get_build_id() on i386 and arm32 As Naresh reported, test_stacktrace_build_id() causes panic on i386 and arm32 systems. This is caused by page_address() returns NULL in certain cases. This patch fixes this error by using kmap_atomic/kunmap_atomic instead of page_address. Fixes: 615755a77b24 (" bpf: extend stackmap to save binary_build_id+offset instead of address") Reported-by: Naresh Kamboju Signed-off-by: Song Liu Signed-off-by: Daniel Borkmann commit f98937c6bb73ae11717a15aec85c187d33ca5d34 Author: Anders Roxell Date: Tue Jan 8 10:23:03 2019 +0100 selftests: bpf: install files tcp_(server|client)*.py When test_tcpbpf_user runs it complains that it can't find files tcp_server.py and tcp_client.py. Rework so that tcp_server.py and tcp_client.py gets installed, added them to the variable TEST_PROGS_EXTENDED. Fixes: d6d4f60c3a09 ("bpf: add selftest for tcpbpf") Signed-off-by: Anders Roxell Signed-off-by: Daniel Borkmann commit df209c43a0e8258e096fb722dfbdae4f0dd13fde Author: Nicholas Mc Guire Date: Sat Dec 1 12:57:18 2018 +0100 gpio: pl061: handle failed allocations devm_kzalloc(), devm_kstrdup() and devm_kasprintf() all can fail internal allocation and return NULL. Using any of the assigned objects without checking is not safe. As this is early in the boot phase and these allocations really should not fail, any failure here is probably an indication of a more serious issue so it makes little sense to try and rollback the previous allocated resources or try to continue; but rather the probe function is simply exited with -ENOMEM. Signed-off-by: Nicholas Mc Guire Fixes: 684284b64aae ("ARM: integrator: add MMCI device to IM-PD1") Signed-off-by: Linus Walleij commit 11b36abc249f5e100d532c5271dae938fde85175 Author: Ioana Ciornei Date: Wed Jan 9 17:06:55 2019 +0000 samples: bpf: user proper argument index Use optind as index for argv instead of a hardcoded value. When the program has options this leads to improper parameter handling. Fixes: dc378a1ab5b6 ("samples: bpf: get ifindex from ifname") Signed-off-by: Ioana Ciornei Acked-by: Matteo Croce Signed-off-by: Daniel Borkmann commit e3ca63de8ade75757a067f6a5bd111d30cdcadb5 Author: Stanislav Fomichev Date: Tue Jan 8 16:07:28 2019 -0800 selftests/bpf: add missing executables to .gitignore We build test_libbpf with CXX to make sure linking against C++ works. $ make -s -C tools/lib/bpf $ git status -sb ? tools/lib/bpf/test_libbpf $ make -s -C tools/testing/selftests/bpf $ git status -sb ? tools/lib/bpf/test_libbpf ? tools/testing/selftests/bpf/test_libbpf Fixes: 8c4905b995c6 ("libbpf: make sure bpf headers are c++ include-able") Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann commit 7d033c9f6a7fd3821af75620a0257db87c2b552a Author: Eric Dumazet Date: Tue Jan 8 04:06:14 2019 -0800 ipv6: fix kernel-infoleak in ipv6_local_error() This patch makes sure the flow label in the IPv6 header forged in ipv6_local_error() is initialized. BUG: KMSAN: kernel-infoleak in _copy_to_user+0x16b/0x1f0 lib/usercopy.c:32 CPU: 1 PID: 24675 Comm: syz-executor1 Not tainted 4.20.0-rc7+ #4 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+0x173/0x1d0 lib/dump_stack.c:113 kmsan_report+0x12e/0x2a0 mm/kmsan/kmsan.c:613 kmsan_internal_check_memory+0x455/0xb00 mm/kmsan/kmsan.c:675 kmsan_copy_to_user+0xab/0xc0 mm/kmsan/kmsan_hooks.c:601 _copy_to_user+0x16b/0x1f0 lib/usercopy.c:32 copy_to_user include/linux/uaccess.h:177 [inline] move_addr_to_user+0x2e9/0x4f0 net/socket.c:227 ___sys_recvmsg+0x5d7/0x1140 net/socket.c:2284 __sys_recvmsg net/socket.c:2327 [inline] __do_sys_recvmsg net/socket.c:2337 [inline] __se_sys_recvmsg+0x2fa/0x450 net/socket.c:2334 __x64_sys_recvmsg+0x4a/0x70 net/socket.c:2334 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 RIP: 0033:0x457ec9 Code: 6d b7 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 3b b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f8750c06c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002f RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457ec9 RDX: 0000000000002000 RSI: 0000000020000400 RDI: 0000000000000005 RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f8750c076d4 R13: 00000000004c4a60 R14: 00000000004d8140 R15: 00000000ffffffff Uninit was stored to memory at: kmsan_save_stack_with_flags mm/kmsan/kmsan.c:204 [inline] kmsan_save_stack mm/kmsan/kmsan.c:219 [inline] kmsan_internal_chain_origin+0x134/0x230 mm/kmsan/kmsan.c:439 __msan_chain_origin+0x70/0xe0 mm/kmsan/kmsan_instr.c:200 ipv6_recv_error+0x1e3f/0x1eb0 net/ipv6/datagram.c:475 udpv6_recvmsg+0x398/0x2ab0 net/ipv6/udp.c:335 inet_recvmsg+0x4fb/0x600 net/ipv4/af_inet.c:830 sock_recvmsg_nosec net/socket.c:794 [inline] sock_recvmsg+0x1d1/0x230 net/socket.c:801 ___sys_recvmsg+0x4d5/0x1140 net/socket.c:2278 __sys_recvmsg net/socket.c:2327 [inline] __do_sys_recvmsg net/socket.c:2337 [inline] __se_sys_recvmsg+0x2fa/0x450 net/socket.c:2334 __x64_sys_recvmsg+0x4a/0x70 net/socket.c:2334 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 Uninit was created at: kmsan_save_stack_with_flags mm/kmsan/kmsan.c:204 [inline] kmsan_internal_poison_shadow+0x92/0x150 mm/kmsan/kmsan.c:158 kmsan_kmalloc+0xa6/0x130 mm/kmsan/kmsan_hooks.c:176 kmsan_slab_alloc+0xe/0x10 mm/kmsan/kmsan_hooks.c:185 slab_post_alloc_hook mm/slab.h:446 [inline] slab_alloc_node mm/slub.c:2759 [inline] __kmalloc_node_track_caller+0xe18/0x1030 mm/slub.c:4383 __kmalloc_reserve net/core/skbuff.c:137 [inline] __alloc_skb+0x309/0xa20 net/core/skbuff.c:205 alloc_skb include/linux/skbuff.h:998 [inline] ipv6_local_error+0x1a7/0x9e0 net/ipv6/datagram.c:334 __ip6_append_data+0x129f/0x4fd0 net/ipv6/ip6_output.c:1311 ip6_make_skb+0x6cc/0xcf0 net/ipv6/ip6_output.c:1775 udpv6_sendmsg+0x3f8e/0x45d0 net/ipv6/udp.c:1384 inet_sendmsg+0x54a/0x720 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg net/socket.c:631 [inline] __sys_sendto+0x8c4/0xac0 net/socket.c:1788 __do_sys_sendto net/socket.c:1800 [inline] __se_sys_sendto+0x107/0x130 net/socket.c:1796 __x64_sys_sendto+0x6e/0x90 net/socket.c:1796 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 Bytes 4-7 of 28 are uninitialized Memory access of size 28 starts at ffff8881937bfce0 Data copied to user address 0000000020000000 Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit 85704cb8dcfd88d351bfc87faaeba1c8214f3177 Author: Konstantin Khlebnikov Date: Tue Jan 8 12:30:00 2019 +0300 net/core/neighbour: tell kmemleak about hash tables This fixes false-positive kmemleak reports about leaked neighbour entries: unreferenced object 0xffff8885c6e4d0a8 (size 1024): comm "softirq", pid 0, jiffies 4294922664 (age 167640.804s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 20 2c f3 83 ff ff ff ff ........ ,...... 08 c0 ef 5f 84 88 ff ff 01 8c 7d 02 01 00 00 00 ..._......}..... backtrace: [<00000000748509fe>] ip6_finish_output2+0x887/0x1e40 [<0000000036d7a0d8>] ip6_output+0x1ba/0x600 [<0000000027ea7dba>] ip6_send_skb+0x92/0x2f0 [<00000000d6e2111d>] udp_v6_send_skb.isra.24+0x680/0x15e0 [<000000000668a8be>] udpv6_sendmsg+0x18c9/0x27a0 [<000000004bd5fa90>] sock_sendmsg+0xb3/0xf0 [<000000008227b29f>] ___sys_sendmsg+0x745/0x8f0 [<000000008698009d>] __sys_sendmsg+0xde/0x170 [<00000000889dacf1>] do_syscall_64+0x9b/0x400 [<0000000081cdb353>] entry_SYSCALL_64_after_hwframe+0x49/0xbe [<000000005767ed39>] 0xffffffffffffffff Signed-off-by: Konstantin Khlebnikov Signed-off-by: David S. Miller commit fd21c89b876565df76051eca395018de2280f8e1 Author: Colin Ian King Date: Mon Jan 7 23:48:09 2019 +0000 net: cxgb4: fix various indentation issues There are some lines that have indentation issues, fix these. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 2acc0abc882ac3be47719e189f3db006493ab640 Author: Colin Ian King Date: Mon Jan 7 23:39:24 2019 +0000 net: cxgb3: fix various indentation issues There are handful of lines that have indentation issues, fix these. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 4a06fa67c4da20148803525151845276cdb995c1 Author: Willem de Bruijn Date: Mon Jan 7 16:47:33 2019 -0500 ip: on queued skb use skb_header_pointer instead of pskb_may_pull Commit 2efd4fca703a ("ip: in cmsg IP(V6)_ORIGDSTADDR call pskb_may_pull") avoided a read beyond the end of the skb linear segment by calling pskb_may_pull. That function can trigger a BUG_ON in pskb_expand_head if the skb is shared, which it is when when peeking. It can also return ENOMEM. Avoid both by switching to safer skb_header_pointer. Fixes: 2efd4fca703a ("ip: in cmsg IP(V6)_ORIGDSTADDR call pskb_may_pull") Reported-by: syzbot Suggested-by: Eric Dumazet Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit 0b7959b6257322f7693b08a459c505d4938646f2 Author: Stanislav Fomichev Date: Mon Jan 7 13:38:38 2019 -0800 tun: publish tfile after it's fully initialized BUG: unable to handle kernel NULL pointer dereference at 00000000000000d1 Call Trace: ? napi_gro_frags+0xa7/0x2c0 tun_get_user+0xb50/0xf20 tun_chr_write_iter+0x53/0x70 new_sync_write+0xff/0x160 vfs_write+0x191/0x1e0 __x64_sys_write+0x5e/0xd0 do_syscall_64+0x47/0xf0 entry_SYSCALL_64_after_hwframe+0x44/0xa9 I think there is a subtle race between sending a packet via tap and attaching it: CPU0: CPU1: tun_chr_ioctl(TUNSETIFF) tun_set_iff tun_attach rcu_assign_pointer(tfile->tun, tun); tun_fops->write_iter() tun_chr_write_iter tun_napi_alloc_frags napi_get_frags napi->skb = napi_alloc_skb tun_napi_init netif_napi_add napi->skb = NULL napi->skb is NULL here napi_gro_frags napi_frags_skb skb = napi->skb skb_reset_mac_header(skb) panic() Move rcu_assign_pointer(tfile->tun) and rcu_assign_pointer(tun->tfiles) to be the last thing we do in tun_attach(); this should guarantee that when we call tun_get() we always get an initialized object. v2 changes: * remove extra napi_mutex locks/unlocks for napi operations Reported-by: syzbot Fixes: 90e33d459407 ("tun: enable napi_gro_frags() for TUN/TAP driver") Signed-off-by: Stanislav Fomichev Signed-off-by: David S. Miller commit 9f51c05dc41a6d69423e3d03d18eb7ab22f9ec19 Author: Wen Yang Date: Wed Dec 5 10:35:50 2018 +0800 pvcalls-front: Avoid get_free_pages(GFP_KERNEL) under spinlock The problem is that we call this with a spin lock held. The call tree is: pvcalls_front_accept() holds bedata->socket_lock. -> create_active() -> __get_free_pages() uses GFP_KERNEL The create_active() function is only called from pvcalls_front_accept() with a spin_lock held, The allocation is not allowed to sleep and GFP_KERNEL is not sufficient. This issue was detected by using the Coccinelle software. v2: Add a function doing the allocations which is called outside the lock and passing the allocated data to create_active(). v3: Use the matching deallocators i.e., free_page() and free_pages(), respectively. v4: It would be better to pre-populate map (struct sock_mapping), rather than introducing one more new struct. v5: Since allocating the data outside of this call it should also be freed outside, when create_active() fails. Move kzalloc(sizeof(*map2), GFP_ATOMIC) outside spinlock and use GFP_KERNEL instead. v6: Drop the superfluous calls. Suggested-by: Juergen Gross Suggested-by: Boris Ostrovsky Suggested-by: Stefano Stabellini Signed-off-by: Wen Yang Acked-by: Stefano Stabellini CC: Julia Lawall CC: Boris Ostrovsky CC: Juergen Gross CC: Stefano Stabellini CC: xen-devel@lists.xenproject.org CC: linux-kernel@vger.kernel.org Signed-off-by: Boris Ostrovsky commit 15c03092a9fbcdd041f58e5f832bf76c21c42e6a Author: Ravi Bangoria Date: Thu Jan 10 15:19:36 2019 +0530 tools headers powerpc: Remove unistd.h We use syscall.tbl to generate system call table on powerpc. The unistd.h copy is no longer required now. Remove it. Signed-off-by: Ravi Bangoria Cc: Jiri Olsa Cc: Michael Ellerman Cc: Namhyung Kim Cc: linuxppc-dev@lists.ozlabs.org Link: http://lkml.kernel.org/r/20190110094936.3132-2-ravi.bangoria@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit d45a90cb5d061fa7d411b974b950fe0b8bc5f265 Author: Eric Biggers Date: Tue Jan 8 22:12:41 2019 -0800 crypto: sm3 - fix undefined shift by >= width of value sm3_compress() calls rol32() with shift >= 32, which causes undefined behavior. This is easily detected by enabling CONFIG_UBSAN. Explicitly AND with 31 to make the behavior well defined. Fixes: 4f0fc1600edb ("crypto: sm3 - add OSCCA SM3 secure hash") Cc: # v4.15+ Cc: Gilad Ben-Yossef Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 1bea445b0a022ee126ca328b3705cd4df18ebc14 Author: Christophe Leroy Date: Tue Jan 8 06:56:48 2019 +0000 crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK [ 2.364486] WARNING: CPU: 0 PID: 60 at ./arch/powerpc/include/asm/io.h:837 dma_nommu_map_page+0x44/0xd4 [ 2.373579] CPU: 0 PID: 60 Comm: cryptomgr_test Tainted: G W 4.20.0-rc5-00560-g6bfb52e23a00-dirty #531 [ 2.384740] NIP: c000c540 LR: c000c584 CTR: 00000000 [ 2.389743] REGS: c95abab0 TRAP: 0700 Tainted: G W (4.20.0-rc5-00560-g6bfb52e23a00-dirty) [ 2.400042] MSR: 00029032 CR: 24042204 XER: 00000000 [ 2.406669] [ 2.406669] GPR00: c02f2244 c95abb60 c6262990 c95abd80 0000256a 00000001 00000001 00000001 [ 2.406669] GPR08: 00000000 00002000 00000010 00000010 24042202 00000000 00000100 c95abd88 [ 2.406669] GPR16: 00000000 c05569d4 00000001 00000010 c95abc88 c0615664 00000004 00000000 [ 2.406669] GPR24: 00000010 c95abc88 c95abc88 00000000 c61ae210 c7ff6d40 c61ae210 00003d68 [ 2.441559] NIP [c000c540] dma_nommu_map_page+0x44/0xd4 [ 2.446720] LR [c000c584] dma_nommu_map_page+0x88/0xd4 [ 2.451762] Call Trace: [ 2.454195] [c95abb60] [82000808] 0x82000808 (unreliable) [ 2.459572] [c95abb80] [c02f2244] talitos_edesc_alloc+0xbc/0x3c8 [ 2.465493] [c95abbb0] [c02f2600] ablkcipher_edesc_alloc+0x4c/0x5c [ 2.471606] [c95abbd0] [c02f4ed0] ablkcipher_encrypt+0x20/0x64 [ 2.477389] [c95abbe0] [c02023b0] __test_skcipher+0x4bc/0xa08 [ 2.483049] [c95abe00] [c0204b60] test_skcipher+0x2c/0xcc [ 2.488385] [c95abe20] [c0204c48] alg_test_skcipher+0x48/0xbc [ 2.494064] [c95abe40] [c0205cec] alg_test+0x164/0x2e8 [ 2.499142] [c95abf00] [c0200dec] cryptomgr_test+0x48/0x50 [ 2.504558] [c95abf10] [c0039ff4] kthread+0xe4/0x110 [ 2.509471] [c95abf40] [c000e1d0] ret_from_kernel_thread+0x14/0x1c [ 2.515532] Instruction dump: [ 2.518468] 7c7e1b78 7c9d2378 7cbf2b78 41820054 3d20c076 8089c200 3d20c076 7c84e850 [ 2.526127] 8129c204 7c842e70 7f844840 419c0008 <0fe00000> 2f9e0000 54847022 7c84fa14 [ 2.533960] ---[ end trace bf78d94af73fe3b8 ]--- [ 2.539123] talitos ff020000.crypto: master data transfer error [ 2.544775] talitos ff020000.crypto: TEA error: ISR 0x20000000_00000040 [ 2.551625] alg: skcipher: encryption failed on test 1 for ecb-aes-talitos: ret=22 IV cannot be on stack when CONFIG_VMAP_STACK is selected because the stack cannot be DMA mapped anymore. This patch copies the IV into the extended descriptor. Fixes: 4de9d0b547b9 ("crypto: talitos - Add ablkcipher algorithms") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy Reviewed-by: Horia Geantă Signed-off-by: Herbert Xu commit c56c2e173773097a248fd3bace91ac8f6fc5386d Author: Christophe Leroy Date: Tue Jan 8 06:56:46 2019 +0000 crypto: talitos - reorder code in talitos_edesc_alloc() This patch moves the mapping of IV after the kmalloc(). This avoids having to unmap in case kmalloc() fails. Signed-off-by: Christophe Leroy Reviewed-by: Horia Geantă Cc: stable@vger.kernel.org Signed-off-by: Herbert Xu commit 6db43410179bc40419a9859ebb333f178a49829d Author: Eric Biggers Date: Sun Jan 6 12:46:05 2019 -0800 crypto: adiantum - initialize crypto_spawn::inst crypto_grab_*() doesn't set crypto_spawn::inst, so templates must set it beforehand. Otherwise it will be left NULL, which causes a crash in certain cases where algorithms are dynamically loaded/unloaded. E.g. with CONFIG_CRYPTO_CHACHA20_X86_64=m, the following caused a crash: insmod chacha-x86_64.ko python -c 'import socket; socket.socket(socket.AF_ALG, 5, 0).bind(("skcipher", "adiantum(xchacha12,aes)"))' rmmod chacha-x86_64.ko python -c 'import socket; socket.socket(socket.AF_ALG, 5, 0).bind(("skcipher", "adiantum(xchacha12,aes)"))' Fixes: 059c2a4d8e16 ("crypto: adiantum - add Adiantum support") Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 06bbf753476dab23eb262cb5fbab6d6d277a0ba3 Author: Dan Carpenter Date: Fri Jan 4 09:46:11 2019 +0300 crypto: cavium/nitrox - Use after free in process_response_list() We free "sr" and then dereference it on the next line. Fixes: c9613335bf4f ("crypto: cavium/nitrox - Added AEAD cipher support") Signed-off-by: Dan Carpenter Signed-off-by: Herbert Xu commit a7773363624b034ab198c738661253d20a8055c2 Author: Harsh Jain Date: Thu Jan 3 14:21:05 2019 +0530 crypto: authencesn - Avoid twice completion call in decrypt path Authencesn template in decrypt path unconditionally calls aead_request_complete after ahash_verify which leads to following kernel panic in after decryption. [ 338.539800] BUG: unable to handle kernel NULL pointer dereference at 0000000000000004 [ 338.548372] PGD 0 P4D 0 [ 338.551157] Oops: 0000 [#1] SMP PTI [ 338.554919] CPU: 0 PID: 0 Comm: swapper/0 Kdump: loaded Tainted: G W I 4.19.7+ #13 [ 338.564431] Hardware name: Supermicro X8ST3/X8ST3, BIOS 2.0 07/29/10 [ 338.572212] RIP: 0010:esp_input_done2+0x350/0x410 [esp4] [ 338.578030] Code: ff 0f b6 68 10 48 8b 83 c8 00 00 00 e9 8e fe ff ff 8b 04 25 04 00 00 00 83 e8 01 48 98 48 8b 3c c5 10 00 00 00 e9 f7 fd ff ff <8b> 04 25 04 00 00 00 83 e8 01 48 98 4c 8b 24 c5 10 00 00 00 e9 3b [ 338.598547] RSP: 0018:ffff911c97803c00 EFLAGS: 00010246 [ 338.604268] RAX: 0000000000000002 RBX: ffff911c4469ee00 RCX: 0000000000000000 [ 338.612090] RDX: 0000000000000000 RSI: 0000000000000130 RDI: ffff911b87c20400 [ 338.619874] RBP: 0000000000000000 R08: ffff911b87c20498 R09: 000000000000000a [ 338.627610] R10: 0000000000000001 R11: 0000000000000004 R12: 0000000000000000 [ 338.635402] R13: ffff911c89590000 R14: ffff911c91730000 R15: 0000000000000000 [ 338.643234] FS: 0000000000000000(0000) GS:ffff911c97800000(0000) knlGS:0000000000000000 [ 338.652047] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 338.658299] CR2: 0000000000000004 CR3: 00000001ec20a000 CR4: 00000000000006f0 [ 338.666382] Call Trace: [ 338.669051] [ 338.671254] esp_input_done+0x12/0x20 [esp4] [ 338.675922] chcr_handle_resp+0x3b5/0x790 [chcr] [ 338.680949] cpl_fw6_pld_handler+0x37/0x60 [chcr] [ 338.686080] chcr_uld_rx_handler+0x22/0x50 [chcr] [ 338.691233] uldrx_handler+0x8c/0xc0 [cxgb4] [ 338.695923] process_responses+0x2f0/0x5d0 [cxgb4] [ 338.701177] ? bitmap_find_next_zero_area_off+0x3a/0x90 [ 338.706882] ? matrix_alloc_area.constprop.7+0x60/0x90 [ 338.712517] ? apic_update_irq_cfg+0x82/0xf0 [ 338.717177] napi_rx_handler+0x14/0xe0 [cxgb4] [ 338.722015] net_rx_action+0x2aa/0x3e0 [ 338.726136] __do_softirq+0xcb/0x280 [ 338.730054] irq_exit+0xde/0xf0 [ 338.733504] do_IRQ+0x54/0xd0 [ 338.736745] common_interrupt+0xf/0xf Fixes: 104880a6b470 ("crypto: authencesn - Convert to new AEAD...") Signed-off-by: Harsh Jain Cc: stable@vger.kernel.org Signed-off-by: Herbert Xu commit 2dd3fde41bf3dc68e38de23da87e72a07719b708 Author: Horia Geantă Date: Fri Dec 21 14:47:46 2018 +0200 crypto: caam - fix SHA support detection The addition of Chacha20 + Poly1305 authenc support inadvertently broke detection of algorithms supported by MDHA (Message Digest Hardware Accelerator), fix it. Fixes: d6bbd4eea243 ("crypto: caam/jr - add support for Chacha20 + Poly1305") Signed-off-by: Horia Geantă Signed-off-by: Herbert Xu commit 04e6d25c5bb244c1a37eb9fe0b604cc11a04e8c5 Author: Aymen Sghaier Date: Wed Dec 19 16:36:44 2018 +0200 crypto: caam - fix zero-length buffer DMA mapping Recent changes - probably DMA API related (generic and/or arm64-specific) - exposed a case where driver maps a zero-length buffer: ahash_init()->ahash_update()->ahash_final() with a zero-length string to hash kernel BUG at kernel/dma/swiotlb.c:475! Internal error: Oops - BUG: 0 [#1] PREEMPT SMP Modules linked in: CPU: 2 PID: 1823 Comm: cryptomgr_test Not tainted 4.20.0-rc1-00108-g00c9fe37a7f2 #1 Hardware name: LS1046A RDB Board (DT) pstate: 80000005 (Nzcv daif -PAN -UAO) pc : swiotlb_tbl_map_single+0x170/0x2b8 lr : swiotlb_map_page+0x134/0x1f8 sp : ffff00000f79b8f0 x29: ffff00000f79b8f0 x28: 0000000000000000 x27: ffff0000093d0000 x26: 0000000000000000 x25: 00000000001f3ffe x24: 0000000000200000 x23: 0000000000000000 x22: 00000009f2c538c0 x21: ffff800970aeb410 x20: 0000000000000001 x19: ffff800970aeb410 x18: 0000000000000007 x17: 000000000000000e x16: 0000000000000001 x15: 0000000000000019 x14: c32cb8218a167fe8 x13: ffffffff00000000 x12: ffff80097fdae348 x11: 0000800976bca000 x10: 0000000000000010 x9 : 0000000000000000 x8 : ffff0000091fd6c8 x7 : 0000000000000000 x6 : 00000009f2c538bf x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 x2 : 00000009f2c538c0 x1 : 00000000f9fff000 x0 : 0000000000000000 Process cryptomgr_test (pid: 1823, stack limit = 0x(____ptrval____)) Call trace: swiotlb_tbl_map_single+0x170/0x2b8 swiotlb_map_page+0x134/0x1f8 ahash_final_no_ctx+0xc4/0x6cc ahash_final+0x10/0x18 crypto_ahash_op+0x30/0x84 crypto_ahash_final+0x14/0x1c __test_hash+0x574/0xe0c test_hash+0x28/0x80 __alg_test_hash+0x84/0xd0 alg_test_hash+0x78/0x144 alg_test.part.30+0x12c/0x2b4 alg_test+0x3c/0x68 cryptomgr_test+0x44/0x4c kthread+0xfc/0x128 ret_from_fork+0x10/0x18 Code: d34bfc18 2a1a03f7 1a9f8694 35fff89a (d4210000) Cc: Signed-off-by: Aymen Sghaier Signed-off-by: Horia Geantă Reviewed-by: Christoph Hellwig Signed-off-by: Herbert Xu commit dc95b5350a8f07d73d6bde3a79ef87289698451d Author: Eric Biggers Date: Sun Dec 16 23:23:24 2018 -0800 crypto: ccree - convert to use crypto_authenc_extractkeys() Convert the ccree crypto driver to use crypto_authenc_extractkeys() so that it picks up the fix for broken validation of rtattr::rta_len. Fixes: ff27e85a85bb ("crypto: ccree - add AEAD support") Cc: # v4.17+ Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit ab57b33525c3221afaebd391458fa0cbcd56903d Author: Eric Biggers Date: Sun Dec 16 23:23:23 2018 -0800 crypto: bcm - convert to use crypto_authenc_extractkeys() Convert the bcm crypto driver to use crypto_authenc_extractkeys() so that it picks up the fix for broken validation of rtattr::rta_len. This also fixes the DES weak key check to actually be done on the right key. (It was checking the authentication key, not the encryption key...) Fixes: 9d12ba86f818 ("crypto: brcm - Add Broadcom SPU driver") Cc: # v4.11+ Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 8f9c469348487844328e162db57112f7d347c49f Author: Eric Biggers Date: Sun Dec 16 23:23:22 2018 -0800 crypto: authenc - fix parsing key with misaligned rta_len Keys for "authenc" AEADs are formatted as an rtattr containing a 4-byte 'enckeylen', followed by an authentication key and an encryption key. crypto_authenc_extractkeys() parses the key to find the inner keys. However, it fails to consider the case where the rtattr's payload is longer than 4 bytes but not 4-byte aligned, and where the key ends before the next 4-byte aligned boundary. In this case, 'keylen -= RTA_ALIGN(rta->rta_len);' underflows to a value near UINT_MAX. This causes a buffer overread and crash during crypto_ahash_setkey(). Fix it by restricting the rtattr payload to the expected size. Reproducer using AF_ALG: #include #include #include int main() { int fd; struct sockaddr_alg addr = { .salg_type = "aead", .salg_name = "authenc(hmac(sha256),cbc(aes))", }; struct { struct rtattr attr; __be32 enckeylen; char keys[1]; } __attribute__((packed)) key = { .attr.rta_len = sizeof(key), .attr.rta_type = 1 /* CRYPTO_AUTHENC_KEYA_PARAM */, }; fd = socket(AF_ALG, SOCK_SEQPACKET, 0); bind(fd, (void *)&addr, sizeof(addr)); setsockopt(fd, SOL_ALG, ALG_SET_KEY, &key, sizeof(key)); } It caused: BUG: unable to handle kernel paging request at ffff88007ffdc000 PGD 2e01067 P4D 2e01067 PUD 2e04067 PMD 2e05067 PTE 0 Oops: 0000 [#1] SMP CPU: 0 PID: 883 Comm: authenc Not tainted 4.20.0-rc1-00108-g00c9fe37a7f27 #13 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-20181126_142135-anatol 04/01/2014 RIP: 0010:sha256_ni_transform+0xb3/0x330 arch/x86/crypto/sha256_ni_asm.S:155 [...] Call Trace: sha256_ni_finup+0x10/0x20 arch/x86/crypto/sha256_ssse3_glue.c:321 crypto_shash_finup+0x1a/0x30 crypto/shash.c:178 shash_digest_unaligned+0x45/0x60 crypto/shash.c:186 crypto_shash_digest+0x24/0x40 crypto/shash.c:202 hmac_setkey+0x135/0x1e0 crypto/hmac.c:66 crypto_shash_setkey+0x2b/0xb0 crypto/shash.c:66 shash_async_setkey+0x10/0x20 crypto/shash.c:223 crypto_ahash_setkey+0x2d/0xa0 crypto/ahash.c:202 crypto_authenc_setkey+0x68/0x100 crypto/authenc.c:96 crypto_aead_setkey+0x2a/0xc0 crypto/aead.c:62 aead_setkey+0xc/0x10 crypto/algif_aead.c:526 alg_setkey crypto/af_alg.c:223 [inline] alg_setsockopt+0xfe/0x130 crypto/af_alg.c:256 __sys_setsockopt+0x6d/0xd0 net/socket.c:1902 __do_sys_setsockopt net/socket.c:1913 [inline] __se_sys_setsockopt net/socket.c:1910 [inline] __x64_sys_setsockopt+0x1f/0x30 net/socket.c:1910 do_syscall_64+0x4a/0x180 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Fixes: e236d4a89a2f ("[CRYPTO] authenc: Move enckeylen into key itself") Cc: # v2.6.25+ Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 0206131811fa6e4b3ed64b5f1c107e2815dcab42 Author: Ravi Bangoria Date: Thu Jan 10 15:19:35 2019 +0530 perf powerpc: Rework syscall table generation Commit aff850393200 ("powerpc: add system call table generation support") changed how systemcall table is generated for powerpc. Incorporate these changes into perf as well. Committer testing: $ podman run --entrypoint=/bin/sh --privileged -v /home/acme/git:/git --rm -ti docker.io/acmel/linux-perf-tools-build-ubuntu:18.04-x-powerpc64 perfbuilder@d7a7af166a80:/git/perf$ head -2 /etc/os-release NAME="Ubuntu" VERSION="18.04.1 LTS (Bionic Beaver)" perfbuilder@d7a7af166a80:/git/perf$ perfbuilder@d7a7af166a80:/git/perf$ make ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu- EXTRA_CFLAGS= -C /git/linux/tools/perf O=/tmp/build/perf make: Entering directory '/git/linux/tools/perf' BUILD: Doing 'make -j8' 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/include/uapi/linux/mman.h' differs from latest version at 'include/uapi/linux/mman.h' diff -u tools/include/uapi/linux/mman.h include/uapi/linux/mman.h sh: 1: command: Illegal option -c Auto-detecting system features: ... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... gtk2: [ OFF ] ... libaudit: [ OFF ] ... libbfd: [ OFF ] ... libelf: [ on ] ... libnuma: [ OFF ] ... numa_num_possible_cpus: [ OFF ] ... libperl: [ OFF ] ... libpython: [ OFF ] ... libslang: [ OFF ] ... libcrypto: [ OFF ] ... libunwind: [ OFF ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ OFF ] ... get_cpuid: [ OFF ] ... bpf: [ on ] Makefile.config:445: No sys/sdt.h found, no SDT events are defined, please install systemtap-sdt-devel or systemtap-sdt-dev Makefile.config:491: No libunwind found. Please install libunwind-dev[el] >= 1.1 and/or set LIBUNWIND_DIR Makefile.config:583: No libcrypto.h found, disables jitted code injection, please install libssl-devel or libssl-dev Makefile.config:598: slang not found, disables TUI support. Please install slang-devel, libslang-dev or libslang2-dev Makefile.config:612: GTK2 not found, disables GTK2 support. Please install gtk2-devel or libgtk2.0-dev Makefile.config:639: Missing perl devel files. Disabling perl scripting support, please install perl-ExtUtils-Embed/libperl-dev Makefile.config:666: No python interpreter was found: disables Python support - please install python-devel/python-dev Makefile.config:721: No bfd.h/libbfd found, please install binutils-dev[el]/zlib-static/libiberty-dev to gain symbol demangling Makefile.config:750: No liblzma found, disables xz kernel module decompression, please install xz-devel/liblzma-dev Makefile.config:763: No numa.h found, disables 'perf bench numa mem' benchmark, please install numactl-devel/libnuma-devel/libnuma-dev Makefile.config:814: No libbabeltrace found, disables 'perf data' CTF format support, please install libbabeltrace-dev[el]/libbabeltrace-ctf-dev Makefile.config:840: No alternatives command found, you need to set JDIR= to point to the root of your Java directory GEN /tmp/build/perf/common-cmds.h CC /tmp/build/perf/util/syscalltbl.o LD /tmp/build/perf/libperf-in.o AR /tmp/build/perf/libperf.a LINK /tmp/build/perf/perf make: Leaving directory '/git/linux/tools/perf' perfbuilder@d7a7af166a80:/git/perf$ head /tmp/build/perf/arch/powerpc/include/generated/asm/syscalls_64.c static const char *syscalltbl_powerpc_64[] = { [0] = "restart_syscall", [1] = "exit", [2] = "fork", [3] = "read", [4] = "write", [5] = "open", [6] = "close", [7] = "waitpid", [8] = "creat", perfbuilder@d7a7af166a80:/git/perf$ tail /tmp/build/perf/arch/powerpc/include/generated/asm/syscalls_64.c [381] = "pwritev2", [382] = "kexec_file_load", [383] = "statx", [384] = "pkey_alloc", [385] = "pkey_free", [386] = "pkey_mprotect", [387] = "rseq", [388] = "io_pgetevents", }; #define SYSCALLTBL_POWERPC_64_MAX_ID 388 perfbuilder@d7a7af166a80:/git/perf$ head /tmp/build/perf/arch/powerpc/include/generated/asm/syscalls_32.c static const char *syscalltbl_powerpc_32[] = { [0] = "restart_syscall", [1] = "exit", [2] = "fork", [3] = "read", [4] = "write", [5] = "open", [6] = "close", [7] = "waitpid", [8] = "creat", perfbuilder@d7a7af166a80:/git/perf$ tail /tmp/build/perf/arch/powerpc/include/generated/asm/syscalls_32.c [381] = "pwritev2", [382] = "kexec_file_load", [383] = "statx", [384] = "pkey_alloc", [385] = "pkey_free", [386] = "pkey_mprotect", [387] = "rseq", [388] = "io_pgetevents", }; #define SYSCALLTBL_POWERPC_32_MAX_ID 388 perfbuilder@d7a7af166a80:/git/perf$ Signed-off-by: Ravi Bangoria Reported-by: Arnaldo Carvalho de Melo Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Michael Ellerman Cc: Namhyung Kim Cc: linuxppc-dev@lists.ozlabs.org Link: http://lkml.kernel.org/r/20190110094936.3132-1-ravi.bangoria@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit f299e0bdbaeb60fd8829f42e53a7457cc5a6f4a2 Author: José Roberto de Souza Date: Wed Dec 5 10:48:50 2018 -0800 drm: Fix documentation generation for DP_DPCD_QUIRK_NO_PSR The DP_DPCD_QUIRK_NO_PSR comment is missing colon causing this warning when generating kernel documentation. ./include/drm/drm_dp_helper.h:1374: warning: Incorrect use of kernel-doc format: * @DP_DPCD_QUIRK_NO_PSR Fixes: 1035f4a65f58 ("drm/i915: Disable PSR in Apple panels") Cc: Dhinakaran Pandiyan Signed-off-by: José Roberto de Souza Reviewed-by: Dhinakaran Pandiyan Link: https://patchwork.freedesktop.org/patch/msgid/20181205184850.13218-1-jose.souza@intel.com (cherry picked from commit ed17b555303c74a35f226268523b1695dbd4617d) Signed-off-by: Jani Nikula commit 70e31424eabe4923a2140eb86f704c75db6a5c87 Author: Daniele Ceraolo Spurio Date: Wed Jan 9 17:32:32 2019 -0800 drm/i915: init per-engine WAs for all engines commit 4a15c75c4246 ("drm/i915: Introduce per-engine workarounds") refactored the workaround code to have functions per-engine, but didn't call any of them from logical_xcs_ring_init. Since we do have a non-RCS workaround for KBL (WaKBLVECSSemaphoreWaitPoll) we do need to call intel_engine_init_workarounds for non-RCS engines. Note that whitelist is still RCS-only. v2: move the call to logical_ring_init (Chris) Fixes: 4a15c75c4246 ("drm/i915: Introduce per-engine workarounds") Cc: Tvrtko Ursulin Cc: Chris Wilson Signed-off-by: Daniele Ceraolo Spurio Reviewed-by: Chris Wilson Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20190110013232.8972-2-daniele.ceraolospurio@intel.com (cherry picked from commit a60acb223fecc77531540196008ac2de89e2a162) Signed-off-by: Jani Nikula commit 280d479b310298dfeb1d6f9a1617eca37beb6ce4 Author: Chris Wilson Date: Sat Dec 22 03:06:23 2018 +0000 drm/i915: Unwind failure on pinning the gen7 ppgtt If we fail to pin the ggtt vma slot for the ppgtt page tables, we need to unwind the locals before reporting the error. Or else on subsequent attempts to bind the page tables into the ggtt, we will already believe that the vma has been pinned and continue on blithely. If something else should happen to be at that location, choas ensues. Fixes: a2bbf7148342 ("drm/i915/gtt: Only keep gen6 page directories pinned while active") Signed-off-by: Chris Wilson Cc: Joonas Lahtinen Cc: Mika Kuoppala Cc: Matthew Auld Cc: # v4.19+ Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20181222030623.21710-1-chris@chris-wilson.co.uk (cherry picked from commit d4de753526f4d99f541f1b6ed1d963005c09700c) Signed-off-by: Jani Nikula commit 107c595c2a277be65b28762f12e1dad243e05623 Author: Chris Wilson Date: Fri Dec 7 11:05:54 2018 +0000 drm/i915: Skip the ERR_PTR error state Although commit fb6f0b64e455 ("drm/i915: Prevent machine hang from Broxton's vtd w/a and error capture") applied cleanly after a 24 month hiatus, the code had moved on with new methods for peeking and fetching the captured gpu info. Make sure we catch all uses of the stashed error state and avoid dereferencing the error pointer. v2: Move error pointer determination into i915_gpu_capture_state v3: Restore early check to avoid capturing and then throwing away subsequent GPU error states. Fixes: fb6f0b64e455 ("drm/i915: Prevent machine hang from Broxton's vtd w/a and error capture") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: Joonas Lahtinen Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20181207110554.19897-1-chris@chris-wilson.co.uk (cherry picked from commit e6154e4cb8b0d3692f84ca0d66b4e1ba0389b134) Signed-off-by: Jani Nikula commit 1035f4a65f58407951d8d2f54c289c2b252e499c Author: José Roberto de Souza Date: Mon Dec 3 16:33:55 2018 -0800 drm/i915: Disable PSR in Apple panels i915 yet don't support PSR in Apple panels, so lets keep it disabled while we work on that. v2: Renamed DP_DPCD_QUIRK_PSR_NOT_CURRENTLY_SUPPORTED to DP_DPCD_QUIRK_NO_PSR (Ville) v3: Adding documentation to DP_DPCD_QUIRK_NO_PSR(Dhinakaran and Jani) Fixed typo in comment of the new quirk entry(Jani) Fixes: 598c6cfe0690 (drm/i915/psr: Enable PSR1 on gen-9+ HW) Cc: Jani Nikula Cc: Ville Syrjälä Cc: Rodrigo Vivi Cc: Dhinakaran Pandiyan Reviewed-by: Dhinakaran Pandiyan Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20181204003403.23361-1-jose.souza@intel.com (cherry picked from commit 7c5c641a930ed06ca317ee39faee7d5824266348) Signed-off-by: Jani Nikula commit 038a0a8d2972962aa8d5adc250ce28cd0b2a3448 Merge: bfeffd1552837 f0e9943725186 Author: Jani Nikula Date: Thu Jan 10 15:02:03 2019 +0200 Merge tag 'gvt-fixes-2019-01-09' of https://github.com/intel/gvt-linux into drm-intel-fixes gvt-fixes-2019-01-09 - Fix one race issue between pre-scan of guest workload with submission Signed-off-by: Jani Nikula From: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20190109050151.GL11631@zhen-hp.sh.intel.com commit 70c25259537c073584eb906865307687275b527f Author: Guo Ren Date: Thu Jan 10 20:28:39 2019 +0800 csky: fixup compile error with CPU 810. This bug is from commit f553aa1c13cb ("csky: fixup relocation error with 807 & 860"). I forgot to compile with 810 for that patch. Signed-off-by: Guo Ren Cc: Arnd Bergmann Signed-off-by: Linus Torvalds commit b5f034845e70916fd33e172fad5ad530a29c10ab Author: Linus Walleij Date: Tue Jan 8 00:08:18 2019 +0100 ARM: dts: kirkwood: Fix polarity of GPIO fan lines These two lines are active high, not active low. The bug was found when we changed the kernel to respect the polarity defined in the device tree. Fixes: 1b90e06b1429 ("ARM: kirkwood: Use devicetree to define DNS-32[05] fan") Cc: Jamie Lentin Cc: Guenter Roeck Cc: Jason Cooper Cc: Andrew Lunn Cc: Gregory Clement Cc: Sebastian Hesselbarth Cc: Julien D'Ascenzio Reviewed-by: Andrew Lunn Tested-by: Jamie Lentin Reported-by: Julien D'Ascenzio Tested-by: Julien D'Ascenzio Signed-off-by: Linus Walleij Signed-off-by: Gregory CLEMENT commit 59c4dccbc3676144091783c8b46bd51daa4f80bc Author: Baruch Siach Date: Wed Dec 12 08:43:26 2018 +0200 arm64: dts: marvell: mcbin: fix PCIe reset signal The MPP52 signal is on the seconds GPIO instance of CP0, which corresponds to the &cp0_gpio2 handle. Rename the property name to the standard '-gpios' suffix while at it. Fixes: b83e1669adce6 ("arm64: dts: marvell: mcbin: add support for PCIe") Signed-off-by: Baruch Siach Signed-off-by: Gregory CLEMENT commit 132ac39cffbcfed80ada38ef0fc6d34d95da7be6 Author: Heinrich Schuchardt Date: Fri Dec 21 17:45:03 2018 +0100 arm64: dts: marvell: armada-ap806: reserve PSCI area The memory area [0x4000000-0x4200000[ is occupied by the PSCI firmware. Any attempt to access it from Linux leads to an immediate crash. So let's make the same memory reservation as the vendor kernel. [gregory: added as comment that this region matches the mainline U-boot] Signed-off-by: Heinrich Schuchardt Signed-off-by: Gregory CLEMENT commit d9ed41962ee202f653a5fa8d2ea0f52924abe629 Author: Will Deacon Date: Wed Jan 9 10:34:49 2019 +0000 arm64: asm-prototypes: Fix fat-fingered typo in comment Some of the right letters, not necessarily in the right order: CONFIG_MODEVERIONS -> CONFIG_MODVERSIONS Signed-off-by: Will Deacon commit ba422731316dde1e22dcc84b83c7349dc0ce1c3c Author: Sean Christopherson Date: Wed Jan 9 16:51:17 2019 -0800 mm/mmu_notifier: mm/rmap.c: Fix a mmu_notifier range bug in try_to_unmap_one The conversion to use a structure for mmu_notifier_invalidate_range_*() unintentionally changed the usage in try_to_unmap_one() to init the 'struct mmu_notifier_range' with vma->vm_start instead of @address, i.e. it invalidates the wrong address range. Revert to the correct address range. Manifests as KVM use-after-free WARNINGs and subsequent "BUG: Bad page state in process X" errors when reclaiming from a KVM guest due to KVM removing the wrong pages from its own mappings. Reported-by: leozinho29_eu@hotmail.com Reported-by: Mike Galbraith Reported-and-tested-by: Adam Borowski Reviewed-by: Jérôme Glisse Reviewed-by: Pankaj gupta Cc: Christian König Cc: Jan Kara Cc: Matthew Wilcox Cc: Ross Zwisler Cc: Dan Williams Cc: Paolo Bonzini Cc: Radim Krčmář Cc: Michal Hocko Cc: Felix Kuehling Cc: Ralph Campbell Cc: John Hubbard Cc: Andrew Morton Fixes: ac46d4f3c432 ("mm/mmu_notifier: use structure for invalidate_range_start/end calls v2") Signed-off-by: Sean Christopherson Signed-off-by: Linus Torvalds commit 4089e272ac61603931beb024d4d640de2cb390e0 Author: Tetsuo Handa Date: Thu Jan 10 19:19:31 2019 +0900 gpu/drm: Fix lock held when returning to user space. We need to call drm_modeset_acquire_fini() when drm_atomic_state_alloc() failed or call drm_modeset_acquire_init() after drm_atomic_state_alloc() succeeded. Signed-off-by: Tetsuo Handa Reported-by: syzbot Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/1547115571-21219-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp commit ca27e4cd0bdd87e33fda38e6e3d18d36d54356d4 Author: Vincent Guittot Date: Thu Jan 10 10:00:40 2019 +0100 PM-runtime: Fix autosuspend_delay on 32bits arch Cast autosuspend_delay to u64 to make sure that the full computation of 'expires' or slack will be done in u64, even on 32bits arch. Otherwise, any delay greater than 2^31 nsec can overflow if signed 32bits is used when converting delay from msec to nsec. Fixes: 8234f6734c5d (PM-runtime: Switch autosuspend over to using hrtimers) Reported-by: Tony Lindgren Tested-by: Tony Lindgren Signed-off-by: Vincent Guittot Signed-off-by: Rafael J. Wysocki commit 1f7b7081568bca281f4ef42096206180cfaced00 Author: Ladislav Michl Date: Thu Jan 10 00:19:44 2019 +0100 PM-runtime: Fix 'jiffies' in comments after switch to hrtimers PM-runtime now uses the hrtimers infrastructure for autosuspend, however comments still reference 'jiffies'. Fixes: 8234f6734c5d (PM-runtime: Switch autosuspend over to using hrtimers) Signed-off-by: Ladislav Michl Signed-off-by: Rafael J. Wysocki commit 85f5a4d666fd9be73856ed16bb36c5af5b406b29 Author: Ilya Dryomov Date: Tue Jan 8 19:47:38 2019 +0100 rbd: don't return 0 on unmap if RBD_DEV_FLAG_REMOVING is set There is a window between when RBD_DEV_FLAG_REMOVING is set and when the device is removed from rbd_dev_list. During this window, we set "already" and return 0. Returning 0 from write(2) can confuse userspace tools because 0 indicates that nothing was written. In particular, "rbd unmap" will retry the write multiple times a second: 10:28:05.463299 write(4, "0", 1) = 0 10:28:05.463509 write(4, "0", 1) = 0 10:28:05.463720 write(4, "0", 1) = 0 10:28:05.463942 write(4, "0", 1) = 0 10:28:05.464155 write(4, "0", 1) = 0 Cc: stable@vger.kernel.org Signed-off-by: Ilya Dryomov Tested-by: Dongsheng Yang commit c25748acc5c20786ecb7518bfeae8fcef93472d6 Author: Peter Ujfalusi Date: Wed Dec 19 13:47:26 2018 +0200 ARM: dts: da850-lcdk: Correct the sound card name To avoid the following error: asoc-simple-card sound: ASoC: Failed to create card debugfs directory Which is because the card name contains '/' character, which can not be used in file or directory names. Signed-off-by: Peter Ujfalusi Signed-off-by: Sekhar Nori commit bd540ebe68c3017194a1caa38e075bbbc0832749 Author: Peter Ujfalusi Date: Wed Dec 19 13:47:25 2018 +0200 ARM: dts: da850-lcdk: Correct the audio codec regulators Add the board level fixed regulators for 3.3V and 1.8V which is used to power - among other things - the tlv320aic3106 codec. Apart from removing the following warning during boot: tlv320aic3x-codec 0-0018: Invalid supply voltage(s) AVDD: -22, DVDD: -22 With the correct voltages the driver can select correct OCMV value to reduce pop noise. Signed-off-by: Peter Ujfalusi Signed-off-by: Sekhar Nori commit 7fca69d4e43fa1ae9cb4f652772c132dc5a659c6 Author: Peter Ujfalusi Date: Wed Dec 19 13:47:24 2018 +0200 ARM: dts: da850-evm: Correct the sound card name To avoid the following error: asoc-simple-card sound: ASoC: Failed to create card debugfs directory Which is because the card name contains '/' character, which can not be used in file or directory names. Signed-off-by: Peter Ujfalusi Signed-off-by: Sekhar Nori commit 706edaa88835e3d8de8920584ad5da76dd3d6666 Author: Peter Ujfalusi Date: Wed Dec 19 13:47:23 2018 +0200 ARM: dts: da850-evm: Correct the audio codec regulators Add the board level fixed regulators for 3.3V and 1.8V which is used to power - among other things - the tlv320aic3106 codec. Apart from removing the following warning during boot: tlv320aic3x-codec 0-0018: Too high supply voltage(s) AVDD: 5000000, DVDD: 5000000 With the correct voltages the driver can select correct OCMV value to reduce pop noise. Signed-off-by: Peter Ujfalusi Signed-off-by: Sekhar Nori commit 054b8dc381b1c784852ad3e109270d236a58b71d Author: Bartosz Golaszewski Date: Thu Jan 3 16:11:04 2019 +0100 ARM: davinci: omapl138-hawk: fix label names in GPIO lookup entries Since commit 587f7a694f01 ("gpio: davinci: Use dev name for label and automatic base selection") the gpiochip label no longer has an ID suffix. Update the GPIO lookup entries. Fixes: 587f7a694f01 ("gpio: davinci: Use dev name for label and automatic base selection") Cc: stable@vger.kernel.org Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori commit 7f1015b29d9b9eb1cd3c038d6c30d698c6d7782e Author: Bartosz Golaszewski Date: Thu Jan 3 16:11:03 2019 +0100 ARM: davinci: dm644x-evm: fix label names in GPIO lookup entries Since commit 587f7a694f01 ("gpio: davinci: Use dev name for label and automatic base selection") the gpiochip label no longer has an ID suffix. Update the GPIO lookup entries. Fixes: 587f7a694f01 ("gpio: davinci: Use dev name for label and automatic base selection") Cc: stable@vger.kernel.org Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori commit 94777ed3b644a1af09843f729b2a3f25794bed0f Author: Bartosz Golaszewski Date: Thu Jan 3 16:11:02 2019 +0100 ARM: davinci: dm355-evm: fix label names in GPIO lookup entries Since commit 587f7a694f01 ("gpio: davinci: Use dev name for label and automatic base selection") the gpiochip label no longer has an ID suffix. Update the GPIO lookup entries. Fixes: 587f7a694f01 ("gpio: davinci: Use dev name for label and automatic base selection") Cc: stable@vger.kernel.org Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori commit c3f08cceb6a59f328f1c847b002729d1584c7a32 Author: Bartosz Golaszewski Date: Thu Jan 3 16:11:01 2019 +0100 ARM: davinci: da850-evm: fix label names in GPIO lookup entries Since commit 587f7a694f01 ("gpio: davinci: Use dev name for label and automatic base selection") the gpiochip label no longer has an ID suffix. Update the GPIO lookup entries. Fixes: 587f7a694f01 ("gpio: davinci: Use dev name for label and automatic base selection") Cc: stable@vger.kernel.org Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori commit cc557afb4d10cba175fd08d51c557004a229eded Author: Bartosz Golaszewski Date: Thu Jan 3 16:11:00 2019 +0100 ARM: davinci: da830-evm: fix label names in GPIO lookup entries Since commit 587f7a694f01 ("gpio: davinci: Use dev name for label and automatic base selection") the gpiochip label no longer has an ID suffix. Update the GPIO lookup entries. Fixes: 587f7a694f01 ("gpio: davinci: Use dev name for label and automatic base selection") Cc: stable@vger.kernel.org Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori commit 66a8d5bfb518f9f12d47e1d2dce1732279f9451e Author: Ivan Mironov Date: Tue Jan 8 12:23:53 2019 +0500 drm/fb-helper: Ignore the value of fb_var_screeninfo.pixclock Strict requirement of pixclock to be zero breaks support of SDL 1.2 which contains hardcoded table of supported video modes with non-zero pixclock values[1]. To better understand which pixclock values are considered valid and how driver should handle these values, I briefly examined few existing fbdev drivers and documentation in Documentation/fb/. And it looks like there are no strict rules on that and actual behaviour varies: * some drivers treat (pixclock == 0) as "use defaults" (uvesafb.c); * some treat (pixclock == 0) as invalid value which leads to -EINVAL (clps711x-fb.c); * some pass converted pixclock value to hardware (uvesafb.c); * some are trying to find nearest value from predefined table (vga16fb.c, video_gx.c). Given this, I believe that it should be safe to just ignore this value if changing is not supported. It seems that any portable fbdev application which was not written only for one specific device working under one specific kernel version should not rely on any particular behaviour of pixclock anyway. However, while enabling SDL1 applications to work out of the box when there is no /etc/fb.modes with valid settings, this change affects the video mode choosing logic in SDL. Depending on current screen resolution, contents of /etc/fb.modes and resolution requested by application, this may lead to user-visible difference (not always): image will be displayed in a right way, but it will be aligned to the left instead of center. There is no "right behaviour" here as well, as emulated fbdev, opposing to old fbdev drivers, simply ignores any requsts of video mode changes with resolutions smaller than current. The easiest way to reproduce this problem is to install sdl-sopwith[2], remove /etc/fb.modes file if it exists, and then try to run sopwith from console without X. At least in Fedora 29, sopwith may be simply installed from standard repositories. [1] SDL 1.2.15 source code, src/video/fbcon/SDL_fbvideo.c, vesa_timings [2] http://sdl-sopwith.sourceforge.net/ Signed-off-by: Ivan Mironov Cc: stable@vger.kernel.org Fixes: 79e539453b34e ("DRM: i915: add mode setting support") Fixes: 771fe6b912fca ("drm/radeon: introduce kernel modesetting for radeon hardware") Fixes: 785b93ef8c309 ("drm/kms: move driver specific fb common code to helper functions (v2)") Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20190108072353.28078-3-mironov.ivan@gmail.com commit 62d85b3bf9d978ed4b6b2aeef5cf0ccf1423906e Author: Ivan Mironov Date: Tue Jan 8 12:23:52 2019 +0500 drm/fb-helper: Partially bring back workaround for bugs of SDL 1.2 SDL 1.2 sets all fields related to the pixel format to zero in some cases[1]. Prior to commit db05c48197759 ("drm: fb-helper: Reject all pixel format changing requests"), there was an unintentional workaround for this that existed for more than a decade. First in device-specific DRM drivers, then here in drm_fb_helper.c. Previous code containing this workaround just ignores pixel format fields from userspace code. Not a good thing either, as this way, driver may silently use pixel format different from what client actually requested, and this in turn will lead to displaying garbage on the screen. I think that returning EINVAL to userspace in this particular case is the right option, so I decided to left code from problematic commit untouched instead of just reverting it entirely. Here is the steps required to reproduce this problem exactly: 1) Compile fceux[2] with SDL 1.2.15 and without GTK or OpenGL support. SDL should be compiled with fbdev support (which is on by default). 2) Create /etc/fb.modes with following contents (values seems not used, and just required to trigger problematic code in SDL): mode "test" geometry 1 1 1 1 1 timings 1 1 1 1 1 1 1 endmode 3) Create ~/.fceux/fceux.cfg with following contents: SDL.Hotkeys.Quit = 27 SDL.DoubleBuffering = 1 4) Ensure that screen resolution is at least 1280x960 (e.g. append "video=Virtual-1:1280x960-32" to the kernel cmdline for qemu/QXL). 5) Try to run fceux on VT with some ROM file[3]: # ./fceux color_test.nes [1] SDL 1.2.15 source code, src/video/fbcon/SDL_fbvideo.c, FB_SetVideoMode() [2] http://www.fceux.com [3] Example ROM: https://github.com/bokuweb/rustynes/blob/master/roms/color_test.nes Reported-by: saahriktu Suggested-by: saahriktu Cc: stable@vger.kernel.org Fixes: db05c48197759 ("drm: fb-helper: Reject all pixel format changing requests") Signed-off-by: Ivan Mironov [danvet: Delete misleading comment.] Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20190108072353.28078-2-mironov.ivan@gmail.com Link: https://patchwork.freedesktop.org/patch/msgid/20190108072353.28078-2-mironov.ivan@gmail.com commit 5db470e229e22b7eda6e23b5566e532c96fb5bc3 Author: Jaegeuk Kim Date: Wed Jan 9 19:17:14 2019 -0800 loop: drop caches if offset or block_size are changed If we don't drop caches used in old offset or block_size, we can get old data from new offset/block_size, which gives unexpected data to user. For example, Martijn found a loopback bug in the below scenario. 1) LOOP_SET_FD loads first two pages on loop file 2) LOOP_SET_STATUS64 changes the offset on the loop file 3) mount is failed due to the cached pages having wrong superblock Cc: Jens Axboe Cc: linux-block@vger.kernel.org Reported-by: Martijn Coenen Reviewed-by: Bart Van Assche Signed-off-by: Jaegeuk Kim Signed-off-by: Jens Axboe commit 31aa6503a15ba00182ea6dbbf51afb63bf9e851d Author: Yuchung Cheng Date: Tue Jan 8 18:12:24 2019 -0800 bpf: correctly set initial window on active Fast Open sender The existing BPF TCP initial congestion window (TCP_BPF_IW) does not to work on (active) Fast Open sender. This is because it changes the (initial) window only if data_segs_out is zero -- but data_segs_out is also incremented on SYN-data. This patch fixes the issue by proerly accounting for SYN-data additionally. Fixes: fc7478103c84 ("bpf: Adds support for setting initial cwnd") Signed-off-by: Yuchung Cheng Reviewed-by: Neal Cardwell Acked-by: Lawrence Brakmo Signed-off-by: Alexei Starovoitov commit 27de1f541f1f911bc2242ae68ef7375247b36c7d Author: Anup Patel Date: Tue Dec 4 19:25:05 2018 +0530 tty/serial: Add RISC-V SBI earlycon support In RISC-V, the M-mode runtime firmware provide SBI calls for debug prints. This patch adds earlycon support using RISC-V SBI console calls. To enable it, just pass "earlycon=sbi" in kernel parameters. Signed-off-by: Anup Patel Acked-by: Greg Kroah-Hartman Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt commit 649d4968860ba708636ad643bd52b28027367042 Author: Jonathan Corbet Date: Wed Jan 9 13:59:32 2019 -0700 block: fix kerneldoc comment for blk_attempt_plug_merge() Commit 5f0ed774ed29 ("block: sum requests in the plug structure") removed the request_count parameter from block_attempt_plug_merge(), but did not remove the associated kerneldoc comment, introducing this warning to the docs build: ./block/blk-core.c:685: warning: Excess function parameter 'request_count' description in 'blk_attempt_plug_merge' Remove the obsolete description and make things a little quieter. Signed-off-by: Jonathan Corbet Signed-off-by: Jens Axboe commit a799aea0988ea0d1b1f263e996fdad2f6133c680 Author: wenxu Date: Wed Jan 9 10:40:11 2019 +0800 netfilter: nft_flow_offload: Fix reverse route lookup Using the following example: client 1.1.1.7 ---> 2.2.2.7 which dnat to 10.0.0.7 server The first reply packet (ie. syn+ack) uses an incorrect destination address for the reverse route lookup since it uses: daddr = ct->tuplehash[!dir].tuple.dst.u3.ip; which is 2.2.2.7 in the scenario that is described above, while this should be: daddr = ct->tuplehash[dir].tuple.src.u3.ip; that is 10.0.0.7. Signed-off-by: wenxu Signed-off-by: Pablo Neira Ayuso commit e7f45099442a380f8e087b6a8aadc36e887df1cc Author: Santosh kumar pradhan Date: Wed Jan 9 22:08:26 2019 +0530 sunrpc: kernel BUG at kernel/cred.c:825! Init missing debug member magic with CRED_MAGIC. Signed-off-by: Santosh kumar pradhan Reported-by: Dave Jones Signed-off-by: Anna Schumaker commit 321c46b91550adc03054125fa7a1639390608e1a Author: Rafał Miłecki Date: Thu Jan 3 08:34:17 2019 +0100 MIPS: BCM47XX: Setup struct device for the SoC So far we never had any device registered for the SoC. This resulted in some small issues that we kept ignoring like: 1) Not working GPIOLIB_IRQCHIP (gpiochip_irqchip_add_key() failing) 2) Lack of proper tree in the /sys/devices/ 3) mips_dma_alloc_coherent() silently handling empty coherent_dma_mask Kernel 4.19 came with a lot of DMA changes and caused a regression on bcm47xx. Starting with the commit f8c55dc6e828 ("MIPS: use generic dma noncoherent ops for simple noncoherent platforms") DMA coherent allocations just fail. Example: [ 1.114914] bgmac_bcma bcma0:2: Allocation of TX ring 0x200 failed [ 1.121215] bgmac_bcma bcma0:2: Unable to alloc memory for DMA [ 1.127626] bgmac_bcma: probe of bcma0:2 failed with error -12 [ 1.133838] bgmac_bcma: Broadcom 47xx GBit MAC driver loaded The bgmac driver also triggers a WARNING: [ 0.959486] ------------[ cut here ]------------ [ 0.964387] WARNING: CPU: 0 PID: 1 at ./include/linux/dma-mapping.h:516 bgmac_enet_probe+0x1b4/0x5c4 [ 0.973751] Modules linked in: [ 0.976913] CPU: 0 PID: 1 Comm: swapper Not tainted 4.19.9 #0 [ 0.982750] Stack : 804a0000 804597c4 00000000 00000000 80458fd8 8381bc2c 838282d4 80481a47 [ 0.991367] 8042e3ec 00000001 804d38f0 00000204 83980000 00000065 8381bbe0 6f55b24f [ 0.999975] 00000000 00000000 80520000 00002018 00000000 00000075 00000007 00000000 [ 1.008583] 00000000 80480000 000ee811 00000000 00000000 00000000 80432c00 80248db8 [ 1.017196] 00000009 00000204 83980000 803ad7b0 00000000 801feeec 00000000 804d0000 [ 1.025804] ... [ 1.028325] Call Trace: [ 1.030875] [<8000aef8>] show_stack+0x58/0x100 [ 1.035513] [<8001f8b4>] __warn+0xe4/0x118 [ 1.039708] [<8001f9a4>] warn_slowpath_null+0x48/0x64 [ 1.044935] [<80248db8>] bgmac_enet_probe+0x1b4/0x5c4 [ 1.050101] [<802498e0>] bgmac_probe+0x558/0x590 [ 1.054906] [<80252fd0>] bcma_device_probe+0x38/0x70 [ 1.060017] [<8020e1e8>] really_probe+0x170/0x2e8 [ 1.064891] [<8020e714>] __driver_attach+0xa4/0xec [ 1.069784] [<8020c1e0>] bus_for_each_dev+0x58/0xb0 [ 1.074833] [<8020d590>] bus_add_driver+0xf8/0x218 [ 1.079731] [<8020ef24>] driver_register+0xcc/0x11c [ 1.084804] [<804b54cc>] bgmac_init+0x1c/0x44 [ 1.089258] [<8000121c>] do_one_initcall+0x7c/0x1a0 [ 1.094343] [<804a1d34>] kernel_init_freeable+0x150/0x218 [ 1.099886] [<803a082c>] kernel_init+0x10/0x104 [ 1.104583] [<80005878>] ret_from_kernel_thread+0x14/0x1c [ 1.110107] ---[ end trace f441c0d873d1fb5b ]--- This patch setups a "struct device" (and passes it to the bcma) which allows fixing all the mentioned problems. It'll also require a tiny bcma patch which will follow through the wireless tree & its maintainer. Fixes: f8c55dc6e828 ("MIPS: use generic dma noncoherent ops for simple noncoherent platforms") Signed-off-by: Rafał Miłecki Signed-off-by: Paul Burton Acked-by: Hauke Mehrtens Cc: Christoph Hellwig Cc: Linus Walleij Cc: linux-wireless@vger.kernel.org Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org # v4.19+ commit 41af167fbc0032f9d7562854f58114eaa9270336 Author: Thomas Bogendoerfer Date: Wed Jan 9 18:12:16 2019 +0100 MIPS: jazz: fix 64bit build 64bit JAZZ builds failed with linux-next/arch/mips/jazz/jazzdma.c: In function `vdma_init`: /linux-next/arch/mips/jazz/jazzdma.c:77:30: error: implicit declaration of function `KSEG1ADDR`; did you mean `CKSEG1ADDR`? [-Werror=implicit-function-declaration] pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl); ^~~~~~~~~ CKSEG1ADDR /linux-next/arch/mips/jazz/jazzdma.c:77:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl); ^ In file included from /linux-next/arch/mips/include/asm/barrier.h:11:0, from /linux-next/include/linux/compiler.h:248, from /linux-next/include/linux/kernel.h:10, from /linux-next/arch/mips/jazz/jazzdma.c:11: /linux-next/arch/mips/include/asm/addrspace.h:41:29: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] #define _ACAST32_ (_ATYPE_)(_ATYPE32_) /* widen if necessary */ ^ /linux-next/arch/mips/include/asm/addrspace.h:53:25: note: in expansion of macro `_ACAST32_` #define CPHYSADDR(a) ((_ACAST32_(a)) & 0x1fffffff) ^~~~~~~~~ /linux-next/arch/mips/jazz/jazzdma.c:84:44: note: in expansion of macro `CPHYSADDR` r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE, CPHYSADDR(pgtbl)); Using correct casts and CKSEG1ADDR when dealing with the pgtbl setup fixes this. Signed-off-by: Thomas Bogendoerfer Signed-off-by: Paul Burton Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org commit 1c1eba86339c8517814863bc7dd21e2661a84e77 Author: Christian König Date: Mon Jan 7 14:43:55 2019 +0100 drm/amdgpu: disable system memory page tables for now We hit a problem with IOMMU with that. Disable until we have time to debug further. Signed-off-by: Christian König Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher commit 0c6c8125582714e1fd3544983eba3d750db0f5b8 Author: Jim Qu Date: Mon Dec 17 17:00:50 2018 +0800 drm/amdgpu: set WRITE_BURST_LENGTH to 64B to workaround SDMA1 hang effect asics: VEGA10 and VEGA12 Signed-off-by: Jim Qu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 3e958fe67720b37d04ab8ef81b9d507a56a09bbc Author: Tao Zhou Date: Tue Jan 8 15:08:44 2019 +0800 drm/amdgpu: fix CPDMA hang in PRT mode for VEGA20 Fix CPDMA hang in PRT mode for both VEGA10 and VEGA20 Signed-off-by: Tao Zhou Tested-by: Yukun.Li Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 549aff770ccfec368aa8f0652dbce8b1e8e6715a Author: Arnaldo Carvalho de Melo Date: Wed Jan 9 16:19:24 2019 -0300 perf symbols: Add 'arch_cpu_idle' to the list of kernel idle symbols When testing 'perf top' on a armhf system (32-bit, Orange Pi Zero), I noticed that 'arch_cpu_idle' dominated, add it to the list of idle symbols, so that we can see what is that being done when not idle. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-4q2b5g4p2hrstrhp9t2mrlho@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit b8a38ea64dc714a64f8fb76e311a4f15a3f67861 Author: Andrey Smirnov Date: Mon Jan 7 19:08:49 2019 -0800 nvme: don't initlialize ctrl->cntlid twice ctrl->cntlid will already be initialized from id->cntlid for non-NVME_F_FABRICS controllers few lines below. For NVME_F_FABRICS controllers this field should already be initialized, otherwise the check if (ctrl->cntlid != le16_to_cpu(id->cntlid)) below will always be a no-op. Signed-off-by: Andrey Smirnov Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 6299358d198a0635da2dd3c4b3ec37789e811e44 Author: James Dingwall Date: Tue Jan 8 10:20:51 2019 -0700 nvme: introduce NVME_QUIRK_IGNORE_DEV_SUBNQN If a device provides an NQN it is expected to be globally unique. Unfortunately some firmware revisions for Intel 760p/Pro 7600p devices did not satisfy this requirement. In these circumstances if a system has >1 affected device then only one device is enabled. If this quirk is enabled then the device supplied subnqn is ignored and we fallback to generating one as if the field was empty. In this case we also suppress the version check so we don't print a warning when the quirk is enabled. Reviewed-by: Keith Busch Signed-off-by: James Dingwall Signed-off-by: Christoph Hellwig commit 3da584f57133e51aeb84aaefae5e3d69531a1e4f Author: Keith Busch Date: Tue Jan 8 09:37:43 2019 -0700 nvme: pad fake subsys NQN vid and ssvid with zeros We need to preserve the leading zeros in the vid and ssvid when generating a unique NQN. Truncating these may lead to naming collisions. Signed-off-by: Keith Busch Signed-off-by: Christoph Hellwig commit c7055fd15ff46d92eb0dd1c16a4fe010d58224c8 Author: Hannes Reinecke Date: Tue Jan 8 12:46:58 2019 +0100 nvme-multipath: zero out ANA log buffer When nvme_init_identify() fails the ANA log buffer is deallocated but _not_ set to NULL. This can cause double free oops when this controller is deleted without ever being reconnected. Signed-off-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit 9846ac0143fe9872e92fe2a1ddff868ad05bdbb6 Author: Sagi Grimberg Date: Mon Jan 7 23:54:23 2019 -0800 nvme-fabrics: unset write/poll queues for discovery controllers Even if user-space sent it to us, it got it wrong so lets help by disallowing it. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit e85037a2e90ac9aa448a08927d7a7436206c6000 Author: Sagi Grimberg Date: Mon Dec 31 23:58:30 2018 -0800 nvme-tcp: don't ask if controller is fabrics For sure we are a fabric driver. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit e9c2edc098921173920df370c69b5c38fe52df56 Author: Sagi Grimberg Date: Mon Dec 31 23:58:29 2018 -0800 nvme-tcp: remove dead code We should never touch the opal device from the transport driver. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit dcca1662727220d18fa351097ddff33f95f516c5 Author: Hongbo Yao Date: Mon Jan 7 10:22:07 2019 +0800 nvme-pci: fix out of bounds access in nvme_cqe_pending There is an out of bounds array access in nvme_cqe_peding(). When enable irq_thread for nvme interrupt, there is racing between the nvmeq->cq_head updating and reading. nvmeq->cq_head is updated in nvme_update_cq_head(), if nvmeq->cq_head equals nvmeq->q_depth and before its value set to zero, nvme_cqe_pending() uses its value as an array index, the index will be out of bounds. Signed-off-by: Hongbo Yao [hch: slight coding style update] Signed-off-by: Christoph Hellwig commit 8fae268b40f5191227ae7050a99cb2cf1b914ddd Author: Keith Busch Date: Fri Jan 4 15:04:33 2019 -0700 nvme-pci: rerun irq setup on IO queue init errors If the driver is unable to create a subset of IO queues for any reason, the read/write and polled queue sets will not match the actual allocated hardware contexts. This leaves gaps in the CPU affinity mappings and causes the following kernel panic after blk_mq_map_queue_type() returns a NULL hctx. BUG: unable to handle kernel NULL pointer dereference at 0000000000000198 #PF error: [normal kernel read fault] PGD 0 P4D 0 Oops: 0000 [#1] SMP CPU: 64 PID: 1171 Comm: kworker/u259:1 Not tainted 4.20.0+ #241 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-2.fc27 04/01/2014 Workqueue: nvme-wq nvme_scan_work [nvme_core] RIP: 0010:blk_mq_init_allocated_queue+0x2d9/0x440 RSP: 0018:ffffb1bf0abc3cd0 EFLAGS: 00010286 RAX: 000000000000001f RBX: ffff8ea744cf0718 RCX: 0000000000000000 RDX: 0000000000000002 RSI: 000000000000007c RDI: ffffffff9109a820 RBP: ffff8ea7565f7008 R08: 000000000000001f R09: 000000000000003f R10: ffffb1bf0abc3c00 R11: 0000000000000000 R12: 000000000001d008 R13: ffff8ea7565f7008 R14: 000000000000003f R15: 0000000000000001 FS: 0000000000000000(0000) GS:ffff8ea757200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000198 CR3: 0000000013058000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: blk_mq_init_queue+0x35/0x60 nvme_validate_ns+0xc6/0x7c0 [nvme_core] ? nvme_identify_ctrl.isra.56+0x7e/0xc0 [nvme_core] nvme_scan_work+0xc8/0x340 [nvme_core] ? __wake_up_common+0x6d/0x120 ? try_to_wake_up+0x55/0x410 process_one_work+0x1e9/0x3d0 worker_thread+0x2d/0x3d0 ? process_one_work+0x3d0/0x3d0 kthread+0x111/0x130 ? kthread_park+0x90/0x90 ret_from_fork+0x1f/0x30 Modules linked in: nvme nvme_core serio_raw CR2: 0000000000000198 Fix by re-running the interrupt vector setup from scratch using a reduced count that may be successful until the created queues matches the irq affinity plus polling queue sets. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Ming Lei Signed-off-by: Christoph Hellwig commit cc667f6d5de023ee131e96bb88e5cddca23272bd Author: Liviu Dudau Date: Sat Dec 29 17:23:43 2018 +0000 nvme-pci: use the same attributes when freeing host_mem_desc_bufs. When using HMB the PCIe host driver allocates host_mem_desc_bufs using dma_alloc_attrs() but frees them using dma_free_coherent(). Use the correct dma_free_attrs() function to free the buffers. Signed-off-by: Liviu Dudau Signed-off-by: Christoph Hellwig commit c61e678f30da733a1b7fdd5983d0770de2e6009c Author: Jianchao Wang Date: Mon Dec 24 11:15:53 2018 +0800 nvme-pci: fix the wrong setting of nr_maps We only set the nr_maps to 3 if poll queues are supported. Signed-off-by: Jianchao Wang Signed-off-by: Christoph Hellwig commit 4064e47c82810586975b4304b105056389beaa06 Merge: a88cc8da0279f 56752b21755ae Author: Linus Torvalds Date: Wed Jan 9 10:00:11 2019 -0800 Merge tag 'csky-for-linus-5.0-rc1' of git://github.com/c-sky/csky-linux Pull arch/csky bug fixes from Guo Ren: "Here are some fixup patches for 5.0-rc1: - fix compile error with pte_alloc - fix handle_irq_perbit break irq flow - fix CACHEV1 store instruction fast retire - fix module relocation error with 807 & 860 - add csky kernel features to documentation" * tag 'csky-for-linus-5.0-rc1' of git://github.com/c-sky/csky-linux: irqchip/csky: fixup handle_irq_perbit break irq csky: fixup compile error with pte_alloc csky: fixup CACHEV1 store instruction fast retire csky: fixup relocation error with 807 & 860 Documentation/features: Add csky kernel features commit 47cb393ee4815e10ab66f981fed581afdcc7caac Author: John Pittman Date: Tue Jan 8 16:56:13 2019 -0500 block: doc: add slice_idle_us to bfq documentation Of the tunables available for the bfq I/O scheduler, the only one missing from the documentation in 'Documentation/block/bfq-iosched.txt' is slice_idle_us. Add this tunable to the documentation and a short explanation of its purpose. Acked-by: Paolo Valente Signed-off-by: John Pittman Signed-off-by: Jens Axboe commit a6d8654d885d7d79a3fb82da64eaa489ca332a82 Author: Filipe Manana Date: Tue Jan 8 11:44:41 2019 +0000 Btrfs: fix deadlock when using free space tree due to block group creation When modifying the free space tree we can end up COWing one of its extent buffers which in turn might result in allocating a new chunk, which in turn can result in flushing (finish creation) of pending block groups. If that happens we can deadlock because creating a pending block group needs to update the free space tree, and if any of the updates tries to modify the same extent buffer that we are COWing, we end up in a deadlock since we try to write lock twice the same extent buffer. So fix this by skipping pending block group creation if we are COWing an extent buffer from the free space tree. This is a case missed by commit 5ce555578e091 ("Btrfs: fix deadlock when writing out free space caches"). Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=202173 Fixes: 5ce555578e091 ("Btrfs: fix deadlock when writing out free space caches") CC: stable@vger.kernel.org # 4.18+ Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit d8b5524242108cb7d28c9b8b9aded7c1edd0e8a8 Author: Filipe Manana Date: Tue Jan 8 11:43:07 2019 +0000 Btrfs: fix race between reflink/dedupe and relocation The recent rework that makes btrfs' remap_file_range operation use the generic helper generic_remap_file_range_prep() introduced a race between relocation and reflinking (for both cloning and deduplication) the file extents between the source and destination inodes. This happens because we no longer lock the source range anymore, and we do not lock it anymore because we wait for direct IO writes and writeback to complete early on the code path right after locking the inodes, which guarantees no other file operations interfere with the reflinking. However there is one exception which is relocation, since it replaces the byte number of file extents items in the fs tree after locking the range the file extent items represent. This is a problem because after finding each file extent to clone in the fs tree, the reflink process copies the file extent item into a local buffer, releases the search path, inserts new file extent items in the destination range and then increments the reference count for the extent mentioned in the file extent item that it previously copied to the buffer. If right after copying the file extent item into the buffer and releasing the path the relocation process updates the file extent item to point to the new extent, the reflink process ends up creating a delayed reference to increment the reference count of the old extent, for which the relocation process already created a delayed reference to drop it. This results in failure to run delayed references because we will attempt to increment the count of a reference that was already dropped. This is illustrated by the following diagram: CPU 1 CPU 2 relocation is running btrfs_clone_files() btrfs_clone() --> finds extent item in source range point to extent at bytenr X --> copies it into a local buffer --> releases path replace_file_extents() --> successfully locks the range represented by the file extent item --> replaces disk_bytenr field in the file extent item with some other value Y --> creates delayed reference to increment reference count for extent at bytenr Y --> creates delayed reference to drop the extent at bytenr X --> starts transaction --> creates delayed reference to increment extent at bytenr X When this race is hit the running transaction ends up getting aborted with an -EIO error and a trace like the following is produced: [ 4382.553858] WARNING: CPU: 2 PID: 3648 at fs/btrfs/extent-tree.c:1552 lookup_inline_extent_backref+0x4f4/0x650 [btrfs] (...) [ 4382.556293] CPU: 2 PID: 3648 Comm: btrfs Tainted: G W 4.20.0-rc6-btrfs-next-41 #1 [ 4382.556294] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.2-0-gf9626ccb91-prebuilt.qemu-project.org 04/01/2014 [ 4382.556308] RIP: 0010:lookup_inline_extent_backref+0x4f4/0x650 [btrfs] (...) [ 4382.556310] RSP: 0018:ffffac784408f738 EFLAGS: 00010202 [ 4382.556311] RAX: 0000000000000001 RBX: ffff8980673c3a48 RCX: 0000000000000001 [ 4382.556312] RDX: 0000000000000008 RSI: 0000000000000000 RDI: 0000000000000000 [ 4382.556312] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000001 [ 4382.556313] R10: 0000000000000001 R11: ffff897f40000000 R12: 0000000000001000 [ 4382.556313] R13: 00000000c224f000 R14: ffff89805de9bd40 R15: ffff8980453f4548 [ 4382.556315] FS: 00007f5e759178c0(0000) GS:ffff89807b300000(0000) knlGS:0000000000000000 [ 4382.563130] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 4382.563562] CR2: 00007f2e9789fcbc CR3: 0000000120512001 CR4: 00000000003606e0 [ 4382.564005] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 4382.564451] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 4382.564887] Call Trace: [ 4382.565343] insert_inline_extent_backref+0x55/0xe0 [btrfs] [ 4382.565796] __btrfs_inc_extent_ref.isra.60+0x88/0x260 [btrfs] [ 4382.566249] ? __btrfs_run_delayed_refs+0x93/0x1650 [btrfs] [ 4382.566702] __btrfs_run_delayed_refs+0xa22/0x1650 [btrfs] [ 4382.567162] btrfs_run_delayed_refs+0x7e/0x1d0 [btrfs] [ 4382.567623] btrfs_commit_transaction+0x50/0x9c0 [btrfs] [ 4382.568112] ? _raw_spin_unlock+0x24/0x30 [ 4382.568557] ? block_rsv_release_bytes+0x14e/0x410 [btrfs] [ 4382.569006] create_subvol+0x3c8/0x830 [btrfs] [ 4382.569461] ? btrfs_mksubvol+0x317/0x600 [btrfs] [ 4382.569906] btrfs_mksubvol+0x317/0x600 [btrfs] [ 4382.570383] ? rcu_sync_lockdep_assert+0xe/0x60 [ 4382.570822] ? __sb_start_write+0xd4/0x1c0 [ 4382.571262] ? mnt_want_write_file+0x24/0x50 [ 4382.571712] btrfs_ioctl_snap_create_transid+0x117/0x1a0 [btrfs] [ 4382.572155] ? _copy_from_user+0x66/0x90 [ 4382.572602] btrfs_ioctl_snap_create+0x66/0x80 [btrfs] [ 4382.573052] btrfs_ioctl+0x7c1/0x30e0 [btrfs] [ 4382.573502] ? mem_cgroup_commit_charge+0x8b/0x570 [ 4382.573946] ? do_raw_spin_unlock+0x49/0xc0 [ 4382.574379] ? _raw_spin_unlock+0x24/0x30 [ 4382.574803] ? __handle_mm_fault+0xf29/0x12d0 [ 4382.575215] ? do_vfs_ioctl+0xa2/0x6f0 [ 4382.575622] ? btrfs_ioctl_get_supported_features+0x30/0x30 [btrfs] [ 4382.576020] do_vfs_ioctl+0xa2/0x6f0 [ 4382.576405] ksys_ioctl+0x70/0x80 [ 4382.576776] __x64_sys_ioctl+0x16/0x20 [ 4382.577137] do_syscall_64+0x60/0x1b0 [ 4382.577488] entry_SYSCALL_64_after_hwframe+0x49/0xbe (...) [ 4382.578837] RSP: 002b:00007ffe04bf64c8 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [ 4382.579174] RAX: ffffffffffffffda RBX: 00005564136f3050 RCX: 00007f5e74724dd7 [ 4382.579505] RDX: 00007ffe04bf64d0 RSI: 000000005000940e RDI: 0000000000000003 [ 4382.579848] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000044 [ 4382.580164] R10: 0000000000000541 R11: 0000000000000202 R12: 00005564136f3010 [ 4382.580477] R13: 0000000000000003 R14: 00005564136f3035 R15: 00005564136f3050 [ 4382.580792] irq event stamp: 0 [ 4382.581106] hardirqs last enabled at (0): [<0000000000000000>] (null) [ 4382.581441] hardirqs last disabled at (0): [] copy_process.part.32+0x6e2/0x2320 [ 4382.581772] softirqs last enabled at (0): [] copy_process.part.32+0x6e2/0x2320 [ 4382.582095] softirqs last disabled at (0): [<0000000000000000>] (null) [ 4382.582413] ---[ end trace d3c188e3e9367382 ]--- [ 4382.623855] BTRFS: error (device sdc) in btrfs_run_delayed_refs:2981: errno=-5 IO failure [ 4382.624295] BTRFS info (device sdc): forced readonly Fix this by locking the source range before searching for the file extent items in the fs tree, since the relocation process will try to lock the range a file extent item represents before updating it with the new extent location. Fixes: 34a28e3d7753 ("Btrfs: use generic_remap_file_range_prep() for cloning and deduplication") Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit f7fa1107f30e13255fb9a5359d357e07d3721b0b Author: Filipe Manana Date: Tue Jan 8 11:42:54 2019 +0000 Btrfs: fix race between cloning range ending at eof and writeback The recent rework that makes btrfs' remap_file_range operation use the generic helper generic_remap_file_range_prep() introduced a race between writeback and cloning a range that covers the eof extent of the source file into a destination offset that is greater then the same file's size. This happens because we now wait for writeback to complete before doing the truncation of the eof block, while previously we did the truncation and then waited for writeback to complete. This leads to a race between writeback of the truncated block and cloning the file extents in the source range, because we copy each file extent item we find in the fs root into a buffer, then release the path and then increment the reference count for the extent referred in that file extent item we copied, which can no longer exist if writeback of the truncated eof block completes after we copied the file extent item into the buffer and before we incremented the reference count. This is illustrated by the following diagram: CPU 1 CPU 2 btrfs_clone_files() btrfs_cont_expand() btrfs_truncate_block() --> zeroes part of the page containg eof, marking it for delalloc btrfs_clone() --> finds extent item covering eof, points to extent at bytenr X --> copies it into a local buffer --> releases path writeback starts btrfs_finish_ordered_io() insert_reserved_file_extent() __btrfs_drop_extents() --> creates delayed reference to drop the extent at bytenr X --> starts transaction --> creates delayed reference to increment extent at bytenr X When this race is hit the running transaction ends up getting aborted with an -EIO error and a trace like the following is produced: [ 4382.553858] WARNING: CPU: 2 PID: 3648 at fs/btrfs/extent-tree.c:1552 lookup_inline_extent_backref+0x4f4/0x650 [btrfs] (...) [ 4382.556293] CPU: 2 PID: 3648 Comm: btrfs Tainted: G W 4.20.0-rc6-btrfs-next-41 #1 [ 4382.556294] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.11.2-0-gf9626ccb91-prebuilt.qemu-project.org 04/01/2014 [ 4382.556308] RIP: 0010:lookup_inline_extent_backref+0x4f4/0x650 [btrfs] (...) [ 4382.556310] RSP: 0018:ffffac784408f738 EFLAGS: 00010202 [ 4382.556311] RAX: 0000000000000001 RBX: ffff8980673c3a48 RCX: 0000000000000001 [ 4382.556312] RDX: 0000000000000008 RSI: 0000000000000000 RDI: 0000000000000000 [ 4382.556312] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000001 [ 4382.556313] R10: 0000000000000001 R11: ffff897f40000000 R12: 0000000000001000 [ 4382.556313] R13: 00000000c224f000 R14: ffff89805de9bd40 R15: ffff8980453f4548 [ 4382.556315] FS: 00007f5e759178c0(0000) GS:ffff89807b300000(0000) knlGS:0000000000000000 [ 4382.563130] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 4382.563562] CR2: 00007f2e9789fcbc CR3: 0000000120512001 CR4: 00000000003606e0 [ 4382.564005] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 4382.564451] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 4382.564887] Call Trace: [ 4382.565343] insert_inline_extent_backref+0x55/0xe0 [btrfs] [ 4382.565796] __btrfs_inc_extent_ref.isra.60+0x88/0x260 [btrfs] [ 4382.566249] ? __btrfs_run_delayed_refs+0x93/0x1650 [btrfs] [ 4382.566702] __btrfs_run_delayed_refs+0xa22/0x1650 [btrfs] [ 4382.567162] btrfs_run_delayed_refs+0x7e/0x1d0 [btrfs] [ 4382.567623] btrfs_commit_transaction+0x50/0x9c0 [btrfs] [ 4382.568112] ? _raw_spin_unlock+0x24/0x30 [ 4382.568557] ? block_rsv_release_bytes+0x14e/0x410 [btrfs] [ 4382.569006] create_subvol+0x3c8/0x830 [btrfs] [ 4382.569461] ? btrfs_mksubvol+0x317/0x600 [btrfs] [ 4382.569906] btrfs_mksubvol+0x317/0x600 [btrfs] [ 4382.570383] ? rcu_sync_lockdep_assert+0xe/0x60 [ 4382.570822] ? __sb_start_write+0xd4/0x1c0 [ 4382.571262] ? mnt_want_write_file+0x24/0x50 [ 4382.571712] btrfs_ioctl_snap_create_transid+0x117/0x1a0 [btrfs] [ 4382.572155] ? _copy_from_user+0x66/0x90 [ 4382.572602] btrfs_ioctl_snap_create+0x66/0x80 [btrfs] [ 4382.573052] btrfs_ioctl+0x7c1/0x30e0 [btrfs] [ 4382.573502] ? mem_cgroup_commit_charge+0x8b/0x570 [ 4382.573946] ? do_raw_spin_unlock+0x49/0xc0 [ 4382.574379] ? _raw_spin_unlock+0x24/0x30 [ 4382.574803] ? __handle_mm_fault+0xf29/0x12d0 [ 4382.575215] ? do_vfs_ioctl+0xa2/0x6f0 [ 4382.575622] ? btrfs_ioctl_get_supported_features+0x30/0x30 [btrfs] [ 4382.576020] do_vfs_ioctl+0xa2/0x6f0 [ 4382.576405] ksys_ioctl+0x70/0x80 [ 4382.576776] __x64_sys_ioctl+0x16/0x20 [ 4382.577137] do_syscall_64+0x60/0x1b0 [ 4382.577488] entry_SYSCALL_64_after_hwframe+0x49/0xbe (...) [ 4382.578837] RSP: 002b:00007ffe04bf64c8 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [ 4382.579174] RAX: ffffffffffffffda RBX: 00005564136f3050 RCX: 00007f5e74724dd7 [ 4382.579505] RDX: 00007ffe04bf64d0 RSI: 000000005000940e RDI: 0000000000000003 [ 4382.579848] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000044 [ 4382.580164] R10: 0000000000000541 R11: 0000000000000202 R12: 00005564136f3010 [ 4382.580477] R13: 0000000000000003 R14: 00005564136f3035 R15: 00005564136f3050 [ 4382.580792] irq event stamp: 0 [ 4382.581106] hardirqs last enabled at (0): [<0000000000000000>] (null) [ 4382.581441] hardirqs last disabled at (0): [] copy_process.part.32+0x6e2/0x2320 [ 4382.581772] softirqs last enabled at (0): [] copy_process.part.32+0x6e2/0x2320 [ 4382.582095] softirqs last disabled at (0): [<0000000000000000>] (null) [ 4382.582413] ---[ end trace d3c188e3e9367382 ]--- [ 4382.623855] BTRFS: error (device sdc) in btrfs_run_delayed_refs:2981: errno=-5 IO failure [ 4382.624295] BTRFS info (device sdc): forced readonly Fix this by waiting for writeback to complete after truncating the eof block. Fixes: 34a28e3d7753 ("Btrfs: use generic_remap_file_range_prep() for cloning and deduplication") Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 498c203d855eaf6571b63ea860a53862c4fe91b7 Author: Arnaldo Carvalho de Melo Date: Wed Jan 9 10:02:12 2019 -0300 tools include uapi: Sync linux/if_link.h copy with the kernel sources To pick the changes from: a428afe82f98 ("net: bridge: add support for user-controlled bool options") a025fb5f49ad ("geneve: Allow configuration of DF behaviour") b4d3069783bc ("vxlan: Allow configuration of DF behaviour") Silencing this tools/ build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h' Cc: Adrian Hunter Cc: David S. Miller Cc: Jiri Olsa Cc: Namhyung Kim Cc: Nikolay Aleksandrov Cc: Stefano Brivio Link: https://lkml.kernel.org/n/tip-wq410s2wuqv5k980bidw0ju8@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 0e141d1c65c1dd31c914eb2e11651adcc1a15912 Author: Quentin Perret Date: Wed Jan 9 10:42:36 2019 +0000 cpufreq: scmi: Fix frequency invariance in slow path The scmi-cpufreq driver calls the arch_set_freq_scale() callback on frequency changes to provide scale-invariant load-tracking signals to the scheduler. However, in the slow path, it does so while specifying the current and max frequencies in different units, hence resulting in a broken freq_scale factor. Fix this by passing all frequencies in KHz, as stored in the CPUFreq frequency table. Fixes: 99d6bdf33877 (cpufreq: add support for CPU DVFS based on SCMI message protocol) Signed-off-by: Quentin Perret Acked-by: Viresh Kumar Acked-by: Sudeep Holla Cc: 4.17+ # v4.17+ Signed-off-by: Rafael J. Wysocki commit 7604bf0920985c9280c8b24e2f0c3e4ed47f502f Author: Otto Sabart Date: Wed Jan 9 00:56:51 2019 +0100 doc: trace: fix reference to cpuidle documentation file Old cpuidle/sysfs.txt file was replaced in aa5eee355b46. So, refer to an updated file. Fixes: aa5eee355b46 (Documentation: admin-guide: PM: Add cpuidle document) Signed-off-by: Otto Sabart Signed-off-by: Rafael J. Wysocki commit 3e2ffd655cc6a694608d997738989ff5572a8266 Author: Michael S. Tsirkin Date: Wed Jan 2 15:57:49 2019 -0500 include/linux/compiler*.h: fix OPTIMIZER_HIDE_VAR Since commit 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive") clang no longer reuses the OPTIMIZER_HIDE_VAR macro from compiler-gcc - instead it gets the version in include/linux/compiler.h. Unfortunately that version doesn't actually prevent compiler from optimizing out the variable. Fix up by moving the macro out from compiler-gcc.h to compiler.h. Compilers without incline asm support will keep working since it's protected by an ifdef. Also fix up comments to match reality since we are no longer overriding any macros. Build-tested with gcc and clang. Fixes: 815f0ddb346c ("include/linux/compiler*.h: make compiler-*.h mutually exclusive") Cc: Eli Friedman Cc: Joe Perches Cc: Linus Torvalds Reviewed-by: Nick Desaulniers Signed-off-by: Michael S. Tsirkin Signed-off-by: Miguel Ojeda commit f8c15790e4d8bdf2d21a5e9d43b5f97983af1222 Author: Tomi Valkeinen Date: Thu Jan 3 13:59:54 2019 +0200 drm/bridge: tc358767: use DP connector if no panel set tc358767 driver sets the connector type always to eDP. This patch sets the type to DP if there is no panel defined, which implies that there's a DP connector on the board. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20190103115954.12785-8-tomi.valkeinen@ti.com commit 7923e09c7a766e2d58de7fc395bb84c18e5bc625 Author: Tomi Valkeinen Date: Thu Jan 3 13:59:53 2019 +0200 drm/bridge: tc358767: fix output H/V syncs The H and V syncs of the DP output are always set to active high. This patch fixes the syncs by configuring them according to the videomode. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20190103115954.12785-7-tomi.valkeinen@ti.com commit 51b9e62eb6950c762162ab7eb8390990179be067 Author: Tomi Valkeinen Date: Thu Jan 3 13:59:52 2019 +0200 drm/bridge: tc358767: reject modes which require too much BW The current driver accepts any videomode with pclk < 154MHz. This is not correct, as with 1 lane and/or 1.62Mbps speed not all videomodes can be supported. Add code to reject modes that require more bandwidth that is available. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20190103115954.12785-6-tomi.valkeinen@ti.com commit 9a63bd6fe1b5590ffa42ae2ed22ee21363293e31 Author: Tomi Valkeinen Date: Thu Jan 3 13:59:51 2019 +0200 drm/bridge: tc358767: fix initial DP0/1_SRCCTRL value Initially DP0_SRCCTRL is set to a static value which includes DP0_SRCCTRL_LANES_2 and DP0_SRCCTRL_BW27, even when only 1 lane of 1.62Gbps speed is used. DP1_SRCCTRL is configured to a magic number. This patch changes the configuration as follows: Configure DP0_SRCCTRL by using tc_srcctrl() which provides the correct value. DP1_SRCCTRL needs two bits to be set to the same value as DP0_SRCCTRL: SSCG and BW27. All other bits can be zero. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20190103115954.12785-5-tomi.valkeinen@ti.com commit 4d9d54a730434cc068dd3515ba6116697196f77b Author: Tomi Valkeinen Date: Thu Jan 3 13:59:50 2019 +0200 drm/bridge: tc358767: fix single lane configuration PHY_2LANE bit is always set in DP_PHY_CTRL, breaking 1 lane use. Set PHY_2LANE only when 2 lanes are used. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20190103115954.12785-4-tomi.valkeinen@ti.com commit adf4109896bbee27fd2ac3b48d22d6a0062fe517 Author: Tomi Valkeinen Date: Thu Jan 3 13:59:49 2019 +0200 drm/bridge: tc358767: add defines for DP1_SRCCTRL & PHY_2LANE DP1_SRCCTRL register and PHY_2LANE field did not have matching defines. Add these. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20190103115954.12785-3-tomi.valkeinen@ti.com commit 4842379cbe6e851de914a7132f76f4e200b9a98b Author: Tomi Valkeinen Date: Thu Jan 3 13:59:48 2019 +0200 drm/bridge: tc358767: add bus flags tc358767 driver does not set DRM bus_flags, even if it does configures the polarity settings into its registers. This means that the DPI source can't configure the polarities correctly. Add sync flags accordingly. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20190103115954.12785-2-tomi.valkeinen@ti.com commit e4f358916d528d479c3c12bd2fd03f2d5a576380 Author: WANG Chao Date: Tue Dec 11 00:37:25 2018 +0800 x86, modpost: Replace last remnants of RETPOLINE with CONFIG_RETPOLINE Commit 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") replaced the RETPOLINE define with CONFIG_RETPOLINE checks. Remove the remaining pieces. [ bp: Massage commit message. ] Fixes: 4cd24de3a098 ("x86/retpoline: Make CONFIG_RETPOLINE depend on compiler support") Signed-off-by: WANG Chao Signed-off-by: Borislav Petkov Reviewed-by: Zhenzhong Duan Reviewed-by: Masahiro Yamada Cc: "H. Peter Anvin" Cc: Andi Kleen Cc: Andrew Morton Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Daniel Borkmann Cc: David Woodhouse Cc: Geert Uytterhoeven Cc: Jessica Yu Cc: Jiri Kosina Cc: Kees Cook Cc: Konrad Rzeszutek Wilk Cc: Luc Van Oostenryck Cc: Michal Marek Cc: Miguel Ojeda Cc: Peter Zijlstra Cc: Tim Chen Cc: Vasily Gorbik Cc: linux-kbuild@vger.kernel.org Cc: srinivas.eeda@oracle.com Cc: stable Cc: x86-ml Link: https://lkml.kernel.org/r/20181210163725.95977-1-chao.wang@ucloud.cn commit 90802938f7e88045ace123e105e22e8c3e7f9c7e Author: Borislav Petkov Date: Tue Jan 8 17:38:29 2019 +0100 x86/cache: Rename config option to CONFIG_X86_RESCTRL CONFIG_RESCTRL is too generic. The final goal is to have a generic option called like this which is selected by the arch-specific ones CONFIG_X86_RESCTRL and CONFIG_ARM64_RESCTRL. The generic one will cover the resctrl filesystem and other generic and shared bits of functionality. Signed-off-by: Borislav Petkov Suggested-by: Ingo Molnar Requested-by: Linus Torvalds Cc: Babu Moger Cc: Fenghua Yu Cc: James Morse Cc: Reinette Chatre Cc: Tony Luck Cc: x86@kernel.org Link: http://lkml.kernel.org/r/20190108171401.GC12235@zn.tnic commit d1dd42110d2727e81b9265841a62bc84c454c3a2 Author: Kailang Yang Date: Wed Jan 9 17:05:24 2019 +0800 ALSA: hda/realtek - Disable headset Mic VREF for headset mode of ALC225 Disable Headset Mic VREF for headset mode of ALC225. This will be controlled by coef bits of headset mode functions. [ Fixed a compile warning and code simplification -- tiwai ] Signed-off-by: Kailang Yang Cc: Signed-off-by: Takashi Iwai commit 4d4b0c52bde470c379f5d168d5c139ad866cb808 Author: Kailang Yang Date: Wed Jan 9 16:23:37 2019 +0800 ALSA: hda/realtek - Add unplug function into unplug state of Headset Mode for ALC225 Forgot to add unplug function to unplug state of headset mode for ALC225. Signed-off-by: Kailang Yang Cc: Signed-off-by: Takashi Iwai commit 576b50ea235699d83758c0c514c65b8d486a159d Merge: 64598e8b6fdaf ee412f14693a3 Author: Ingo Molnar Date: Wed Jan 9 07:59:40 2019 +0100 Merge tag 'perf-core-for-mingo-5.0-20190108' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent Pull perf/core fixes and improvements from Arnaldo Carvalho de Melo: perf top: Arnaldo Carvalho de Melo: - Lift restriction on using callchains without "sym" in --sort perf trace: Arnaldo Carvalho de Melo: - Fix ')' placement in "interrupted" syscall lines. - Fix alignment for [continued] lines. perf tests: Florian Fainelli: - Add a test for the ARM 32-bit [vectors] page. tools lib traceevent: Tzvetomir Stoyanov: - Introduce new libtracevent API: tep_override_comm(). - Initialize host_bigendian at tep_handle allocation. - More namespacing changes. - Remove superfluous APIs. tools headers uapi: Arnaldo Carvalho de Melo: . Update linux/{fs,vhost}.h, grab a copy o linux/mount.h, where the MS_ mount flags were moved. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar commit 1cb95e072ede5e3d6a54eefd520db21b45985896 Author: Dan Williams Date: Tue Jan 8 15:34:52 2019 -0800 libnvdimm/dimm: Fix security capability detection for non-Intel NVDIMMs Kees reports a crash with the following signature... RIP: 0010:nvdimm_visible+0x79/0x80 [..] Call Trace: internal_create_group+0xf4/0x380 sysfs_create_groups+0x46/0xb0 device_add+0x331/0x680 nd_async_device_register+0x15/0x60 async_run_entry_fn+0x38/0x100 ...when starting a QEMU environment with "label-less" DIMM. Without labels QEMU does not publish any DSM methods. Without defined methods the NVDIMM_FAMILY type is not established and the nfit driver will skip registering security operations. In that case the security state should be initialized to a negative value in __nvdimm_create() and nvdimm_visible() should skip interrogating the specific ops. However, since 'enum nvdimm_security_state' was only defined to contain positive values the "if (nvdimm->sec.state < 0)" check always fails. Define a negative error state to allow negative state values to be handled as expected. Fixes: f2989396553a ("acpi/nfit, libnvdimm: Introduce nvdimm_security_ops") Reviewed-by: Dave Jiang Reported-by: Kees Cook Tested-by: Kees Cook Signed-off-by: Dan Williams commit ccb7f15a8a3c0c7a35389e4c8e083c424b4df79d Author: Nathan Chancellor Date: Tue Jan 8 22:00:37 2019 -0700 nfit: Mark some functions as __maybe_unused On arm64 little endian allyesconfig: drivers/acpi/nfit/intel.c:149:12: warning: unused function 'intel_security_unlock' [-Wunused-function] static int intel_security_unlock(struct nvdimm *nvdimm, ^ drivers/acpi/nfit/intel.c:230:12: warning: unused function 'intel_security_erase' [-Wunused-function] static int intel_security_erase(struct nvdimm *nvdimm, ^ drivers/acpi/nfit/intel.c:279:12: warning: unused function 'intel_security_query_overwrite' [-Wunused-function] static int intel_security_query_overwrite(struct nvdimm *nvdimm) ^ drivers/acpi/nfit/intel.c:316:12: warning: unused function 'intel_security_overwrite' [-Wunused-function] static int intel_security_overwrite(struct nvdimm *nvdimm, ^ 4 warnings generated. Mark these functions as __maybe_unused because they are only used when CONFIG_X86 is set. Fixes: 4c6926a23b76 ("acpi/nfit, libnvdimm: Add unlock of nvdimm support for Intel DIMMs") Suggested-by: Dan Williams Signed-off-by: Nathan Chancellor Signed-off-by: Dan Williams commit f0e9943725186ddbdc9718a559c26c5f507262f2 Author: Zhenyu Wang Date: Sat Dec 29 11:13:10 2018 +0800 drm/i915/gvt: Fix workload request allocation before request add In commit 6bb2a2af8b1b ("drm/i915/gvt: Fix crash after request->hw_context change"), forgot to handle workload scan path in ELSP handler case which was to optimize scanning earlier instead of in gvt submission thread, so request alloc and add was splitting then which is against right process. This trys to do a partial revert of that commit which still has workload request alloc helper and make sure shadow state population is handled after request alloc for target state buffer. v3: Fix missed workload status setting in request alloc error path v2: Fix dispatch workload err path that should add request after alloc anyway. Fixes: 6bb2a2af8b1b ("drm/i915/gvt: Fix crash after request->hw_context change") Cc: Bin Yang Cc: Chris Wilson Tested-by: Bin Yang Reviewed-by: Xiaolin Zhang Signed-off-by: Zhenyu Wang commit 40405851af73c59678ffd8f490e6b288c7fbaf29 Author: Jeff Moyer Date: Tue Jan 8 16:57:34 2019 -0500 block: clarify documentation for blk_{start|finish}_plug There was some confusion about what these functions did. Make it clear that this is a hint for upper layers to pass to the block layer, and that it does not guarantee that I/O will not be submitted between a start and finish plug. Reported-by: "Darrick J. Wong" Reviewed-by: Darrick J. Wong Reviewed-by: Ming Lei Signed-off-by: Jeff Moyer Signed-off-by: Jens Axboe commit cc29a1b0a3f2597ce887d339222fa85b9307706d Author: Logan Gunthorpe Date: Tue Jan 8 13:50:43 2019 -0700 scsi: isci: initialize shost fully before calling scsi_add_host() scsi_mq_setup_tags(), which is called by scsi_add_host(), calculates the command size to allocate based on the prot_capabilities. In the isci driver, scsi_host_set_prot() is called after scsi_add_host() so the command size gets calculated to be smaller than it needs to be. Eventually, scsi_mq_init_request() locates the 'prot_sdb' after the command assuming it was sized correctly and a buffer overrun may occur. However, seeing blk_mq_alloc_rqs() rounds up to the nearest cache line size, the mistake can go unnoticed. The bug was noticed after the struct request size was reduced by commit 9d037ad707ed ("block: remove req->timeout_list") Which likely reduced the allocated space for the request by an entire cache line, enough that the overflow could be hit and it caused a panic, on boot, at: RIP: 0010:t10_pi_complete+0x77/0x1c0 Call Trace: sd_done+0xf5/0x340 scsi_finish_command+0xc3/0x120 blk_done_softirq+0x83/0xb0 __do_softirq+0xa1/0x2e6 irq_exit+0xbc/0xd0 call_function_single_interrupt+0xf/0x20 sd_done() would call scsi_prot_sg_count() which reads the number of entities in 'prot_sdb', but seeing 'prot_sdb' is located after the end of the allocated space it reads a garbage number and erroneously calls t10_pi_complete(). To prevent this, the calls to scsi_host_set_prot() are moved into isci_host_alloc() before the call to scsi_add_host(). Out of caution, also move the similar call to scsi_host_set_guard(). Fixes: 3d2d75254915 ("[SCSI] isci: T10 DIF support") Link: http://lkml.kernel.org/r/da851333-eadd-163a-8c78-e1f4ec5ec857@deltatee.com Signed-off-by: Logan Gunthorpe Cc: Intel SCU Linux support Cc: Artur Paszkiewicz Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: Christoph Hellwig Cc: Jens Axboe Cc: Jeff Moyer Reviewed-by: Jeff Moyer Reviewed-by: Jens Axboe Signed-off-by: Martin K. Petersen commit a88cc8da0279f8e481b0d90e51a0a1cffac55906 Merge: 9cb2feb4d21d9 73444bc4d8f92 Author: Linus Torvalds Date: Tue Jan 8 18:58:29 2019 -0800 Merge branch 'akpm' (patches from Andrew) Merge misc fixes from Andrew Morton: "14 fixes" * emailed patches from Andrew Morton : mm, page_alloc: do not wake kswapd with zone lock held hugetlbfs: revert "use i_mmap_rwsem for more pmd sharing synchronization" hugetlbfs: revert "Use i_mmap_rwsem to fix page fault/truncate race" mm: page_mapped: don't assume compound page is huge or THP mm/memory.c: initialise mmu_notifier_range correctly tools/vm/page_owner: use page_owner_sort in the use example kasan: fix krealloc handling for tag-based mode kasan: make tag based mode work with CONFIG_HARDENED_USERCOPY kasan, arm64: use ARCH_SLAB_MINALIGN instead of manual aligning mm, memcg: fix reclaim deadlock with writeback mm/usercopy.c: no check page span for stack objects slab: alien caches must not be initialized if the allocation of the alien cache failed fork, memcg: fix cached_stacks case zram: idle writeback fixes and cleanup commit 5bd5f66cf142703e163459e1b36b73e265f0a0da Author: Gustavo A. R. Silva Date: Tue Nov 27 22:32:18 2018 -0600 scsi: lpfc: lpfc_sli: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that, in this particular case, I replaced "Drop thru" and "Fall Thru" with "fall through" annotations, which is what GCC is expecting to find. Also, in some cases a dash is added as a token in order to separate the "fall through" annotation from the rest of the comment on the same line, which is what GCC is expecting to find. Addresses-Coverity-ID: 114979 ("Missing break in switch") Addresses-Coverity-ID: 114980 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Acked-by: Dick Kennedy Signed-off-by: Martin K. Petersen commit 12de280b36f0e0599c7f170aa7f1058f3aeb6d9d Author: Gustavo A. R. Silva Date: Thu Jan 3 10:47:44 2019 -0600 scsi: smartpqi_init: fix boolean expression in pqi_device_remove_start Fix boolean expression by using logical AND operator '&&' instead of bitwise operator '&'. This issue was detected with the help of Coccinelle. Fixes: 1e46731efd9c ("scsi: smartpqi: check for null device pointers") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Gustavo A. R. Silva Acked-by: Don Brace Signed-off-by: Martin K. Petersen commit 3f7e62bba0003f9c68f599f5997c4647ef5b4f4e Author: Stanley Chu Date: Thu Jan 3 22:08:05 2019 +0800 scsi: core: Synchronize request queue PM status only on successful resume The commit 356fd2663cff ("scsi: Set request queue runtime PM status back to active on resume") fixed up the inconsistent RPM status between request queue and device. However changing request queue RPM status shall be done only on successful resume, otherwise status may be still inconsistent as below, Request queue: RPM_ACTIVE Device: RPM_SUSPENDED This ends up soft lockup because requests can be submitted to underlying devices but those devices and their required resource are not resumed. For example, After above inconsistent status happens, IO request can be submitted to UFS device driver but required resource (like clock) is not resumed yet thus lead to warning as below call stack, WARN_ON(hba->clk_gating.state != CLKS_ON); ufshcd_queuecommand scsi_dispatch_cmd scsi_request_fn __blk_run_queue cfq_insert_request __elv_add_request blk_flush_plug_list blk_finish_plug jbd2_journal_commit_transaction kjournald2 We may see all behind IO requests hang because of no response from storage host or device and then soft lockup happens in system. In the end, system may crash in many ways. Fixes: 356fd2663cff (scsi: Set request queue runtime PM status back to active on resume) Cc: stable@vger.kernel.org Signed-off-by: Stanley Chu Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 251f24e63fc291f288f765663e62cd575f048fd5 Author: Julia Lawall Date: Sun Dec 30 16:53:13 2018 +0100 scsi: pm80xx: reduce indentation Delete tab aligning a statement with the right hand side of a preceding assignment rather than the left hand side. Found with the help of Coccinelle. [mkp: added space] Signed-off-by: Julia Lawall Acked-by: Jack Wang Signed-off-by: Martin K. Petersen commit 72b4a0465f995175a2e22cf4a636bf781f1f28a7 Author: YueHaibing Date: Thu Dec 20 11:16:07 2018 +0800 scsi: qla4xxx: check return code of qla4xxx_copy_from_fwddb_param The return code should be check while qla4xxx_copy_from_fwddb_param fails. Signed-off-by: YueHaibing Acked-by: Manish Rangankar Signed-off-by: Martin K. Petersen commit d1f38d995e984db36449661fcbad1649c21883e7 Author: Tomas Henzl Date: Wed Jan 2 16:07:25 2019 +0100 scsi: megaraid_sas: correct an info message This was apparently forgotten in 894169db1 ("scsi: megaraid_sas: Use 63-bit DMA addressing"). Signed-off-by: Tomas Henzl Signed-off-by: Martin K. Petersen commit 621a4367d69509f35abb4559a2dd7179ea5acada Author: Leo Zhang Date: Mon Dec 24 00:18:27 2018 +0800 scsi: target/iscsi: fix error msg typo when create lio_qr_cache failed Signed-off-by: Leo Zhang Signed-off-by: Martin K. Petersen commit 44759979a49bfd2d20d789add7fa81a21eb1a4ab Author: Ivan Mironov Date: Sun Dec 23 12:41:58 2018 +0500 scsi: sd: Fix cache_type_store() Changing of caching mode via /sys/devices/.../scsi_disk/.../cache_type may fail if device responds to MODE SENSE command with DPOFUA flag set, and then checks this flag to be not set on MODE SELECT command. In this scenario, when trying to change cache_type, write always fails: # echo "none" >cache_type bash: echo: write error: Invalid argument And following appears in dmesg: [13007.865745] sd 1:0:1:0: [sda] Sense Key : Illegal Request [current] [13007.865753] sd 1:0:1:0: [sda] Add. Sense: Invalid field in parameter list From SBC-4 r15, 6.5.1 "Mode pages overview", description of DEVICE-SPECIFIC PARAMETER field in the mode parameter header: ... The write protect (WP) bit for mode data sent with a MODE SELECT command shall be ignored by the device server. ... The DPOFUA bit is reserved for mode data sent with a MODE SELECT command. ... The remaining bits in the DEVICE-SPECIFIC PARAMETER byte are also reserved and shall be set to zero. [mkp: shuffled commentary to commit description] Cc: stable@vger.kernel.org Signed-off-by: Ivan Mironov Signed-off-by: Martin K. Petersen commit d972f3dce8d161e2142da0ab1ef25df00e2f21a9 Author: Jason Gunthorpe Date: Tue Jan 8 23:27:06 2019 +0000 packet: Do not leak dev refcounts on error exit 'dev' is non NULL when the addr_len check triggers so it must goto a label that does the dev_put otherwise dev will have a leaked refcount. This bug causes the ib_ipoib module to become unloadable when using systemd-network as it triggers this check on InfiniBand links. Fixes: 99137b7888f4 ("packet: validate address length") Reported-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe Acked-by: Willem de Bruijn Signed-off-by: David S. Miller commit 9cb2feb4d21d97386eb25c7b67e2793efcc1e70a Author: Stafford Horne Date: Tue Jan 8 22:15:15 2019 +0900 arch/openrisc: Fix issues with access_ok() The commit 594cc251fdd0 ("make 'user_access_begin()' do 'access_ok()'") exposed incorrect implementations of access_ok() macro in several architectures. This change fixes 2 issues found in OpenRISC. OpenRISC was not properly using parenthesis for arguments and also using arguments twice. This patch fixes those 2 issues. I test booted this patch with v5.0-rc1 on qemu and it's working fine. Cc: Guenter Roeck Cc: Linus Torvalds Reported-by: Linus Torvalds Signed-off-by: Stafford Horne Signed-off-by: Linus Torvalds commit 8a7f02f67c395949c768ae1cf4f12905a81e3cde Author: Xiaochun Lee Date: Sat Jan 5 16:08:38 2019 +0800 ACPI/nfit: delete the function to_acpi_nfit_desc The function to_acpi_nfit_desc and function to_acpi_desc do the same things,delete the function to_acpi_nfit_desc, and keep the inline function to_acpi_desc. Signed-off-by: Xiaochun Lee Signed-off-by: Dan Williams commit dadbcb450cb22acbc06bb53edf2bcc9261cb78f3 Author: Xiaochun Lee Date: Mon Jan 7 10:33:36 2019 +0800 ACPI/nfit: delete the redundant header file The header file "intel.h" is repeated here, So delete one. Signed-off-by: Xiaochun Lee Signed-off-by: Dan Williams commit 73444bc4d8f92e46a20cb6bd3342fc2ea75c6787 Author: Mel Gorman Date: Tue Jan 8 15:23:39 2019 -0800 mm, page_alloc: do not wake kswapd with zone lock held syzbot reported the following regression in the latest merge window and it was confirmed by Qian Cai that a similar bug was visible from a different context. ====================================================== WARNING: possible circular locking dependency detected 4.20.0+ #297 Not tainted ------------------------------------------------------ syz-executor0/8529 is trying to acquire lock: 000000005e7fb829 (&pgdat->kswapd_wait){....}, at: __wake_up_common_lock+0x19e/0x330 kernel/sched/wait.c:120 but task is already holding lock: 000000009bb7bae0 (&(&zone->lock)->rlock){-.-.}, at: spin_lock include/linux/spinlock.h:329 [inline] 000000009bb7bae0 (&(&zone->lock)->rlock){-.-.}, at: rmqueue_bulk mm/page_alloc.c:2548 [inline] 000000009bb7bae0 (&(&zone->lock)->rlock){-.-.}, at: __rmqueue_pcplist mm/page_alloc.c:3021 [inline] 000000009bb7bae0 (&(&zone->lock)->rlock){-.-.}, at: rmqueue_pcplist mm/page_alloc.c:3050 [inline] 000000009bb7bae0 (&(&zone->lock)->rlock){-.-.}, at: rmqueue mm/page_alloc.c:3072 [inline] 000000009bb7bae0 (&(&zone->lock)->rlock){-.-.}, at: get_page_from_freelist+0x1bae/0x52a0 mm/page_alloc.c:3491 It appears to be a false positive in that the only way the lock ordering should be inverted is if kswapd is waking itself and the wakeup allocates debugging objects which should already be allocated if it's kswapd doing the waking. Nevertheless, the possibility exists and so it's best to avoid the problem. This patch flags a zone as needing a kswapd using the, surprisingly, unused zone flag field. The flag is read without the lock held to do the wakeup. It's possible that the flag setting context is not the same as the flag clearing context or for small races to occur. However, each race possibility is harmless and there is no visible degredation in fragmentation treatment. While zone->flag could have continued to be unused, there is potential for moving some existing fields into the flags field instead. Particularly read-mostly ones like zone->initialized and zone->contiguous. Link: http://lkml.kernel.org/r/20190103225712.GJ31517@techsingularity.net Fixes: 1c30844d2dfe ("mm: reclaim small amounts of memory when an external fragmentation event occurs") Reported-by: syzbot+93d94a001cfbce9e60e1@syzkaller.appspotmail.com Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka Tested-by: Qian Cai Cc: Dmitry Vyukov Cc: Vlastimil Babka Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ddeaab32a89f04b7e2a2df8771583a719c4ac6b7 Author: Mike Kravetz Date: Tue Jan 8 15:23:36 2019 -0800 hugetlbfs: revert "use i_mmap_rwsem for more pmd sharing synchronization" This reverts b43a9990055958e70347c56f90ea2ae32c67334c The reverted commit caused issues with migration and poisoning of anon huge pages. The LTP move_pages12 test will cause an "unable to handle kernel NULL pointer" BUG would occur with stack similar to: RIP: 0010:down_write+0x1b/0x40 Call Trace: migrate_pages+0x81f/0xb90 __ia32_compat_sys_migrate_pages+0x190/0x190 do_move_pages_to_node.isra.53.part.54+0x2a/0x50 kernel_move_pages+0x566/0x7b0 __x64_sys_move_pages+0x24/0x30 do_syscall_64+0x5b/0x180 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The purpose of the reverted patch was to fix some long existing races with huge pmd sharing. It used i_mmap_rwsem for this purpose with the idea that this could also be used to address truncate/page fault races with another patch. Further analysis has determined that i_mmap_rwsem can not be used to address all these hugetlbfs synchronization issues. Therefore, revert this patch while working an another approach to the underlying issues. Link: http://lkml.kernel.org/r/20190103235452.29335-2-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reported-by: Jan Stancek Cc: Michal Hocko Cc: Hugh Dickins Cc: Naoya Horiguchi Cc: "Aneesh Kumar K . V" Cc: Andrea Arcangeli Cc: "Kirill A . Shutemov" Cc: Davidlohr Bueso Cc: Prakash Sangappa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e7c58097793ef15d58fadf190ee58738fbf447cd Author: Mike Kravetz Date: Tue Jan 8 15:23:32 2019 -0800 hugetlbfs: revert "Use i_mmap_rwsem to fix page fault/truncate race" This reverts c86aa7bbfd5568ba8a82d3635d8f7b8a8e06fe54 The reverted commit caused ABBA deadlocks when file migration raced with file eviction for specific hugetlbfs files. This was discovered with a modified version of the LTP move_pages12 test. The purpose of the reverted patch was to close a long existing race between hugetlbfs file truncation and page faults. After more analysis of the patch and impacted code, it was determined that i_mmap_rwsem can not be used for all required synchronization. Therefore, revert this patch while working an another approach to the underlying issue. Link: http://lkml.kernel.org/r/20190103235452.29335-1-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reported-by: Jan Stancek Cc: Michal Hocko Cc: Hugh Dickins Cc: Naoya Horiguchi Cc: "Aneesh Kumar K . V" Cc: Andrea Arcangeli Cc: "Kirill A . Shutemov" Cc: Davidlohr Bueso Cc: Prakash Sangappa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8ab88c7169b7fba98812ead6524b9d05bc76cf00 Author: Jan Stancek Date: Tue Jan 8 15:23:28 2019 -0800 mm: page_mapped: don't assume compound page is huge or THP LTP proc01 testcase has been observed to rarely trigger crashes on arm64: page_mapped+0x78/0xb4 stable_page_flags+0x27c/0x338 kpageflags_read+0xfc/0x164 proc_reg_read+0x7c/0xb8 __vfs_read+0x58/0x178 vfs_read+0x90/0x14c SyS_read+0x60/0xc0 The issue is that page_mapped() assumes that if compound page is not huge, then it must be THP. But if this is 'normal' compound page (COMPOUND_PAGE_DTOR), then following loop can keep running (for HPAGE_PMD_NR iterations) until it tries to read from memory that isn't mapped and triggers a panic: for (i = 0; i < hpage_nr_pages(page); i++) { if (atomic_read(&page[i]._mapcount) >= 0) return true; } I could replicate this on x86 (v4.20-rc4-98-g60b548237fed) only with a custom kernel module [1] which: - allocates compound page (PAGEC) of order 1 - allocates 2 normal pages (COPY), which are initialized to 0xff (to satisfy _mapcount >= 0) - 2 PAGEC page structs are copied to address of first COPY page - second page of COPY is marked as not present - call to page_mapped(COPY) now triggers fault on access to 2nd COPY page at offset 0x30 (_mapcount) [1] https://github.com/jstancek/reproducers/blob/master/kernel/page_mapped_crash/repro.c Fix the loop to iterate for "1 << compound_order" pages. Kirrill said "IIRC, sound subsystem can producuce custom mapped compound pages". Link: http://lkml.kernel.org/r/c440d69879e34209feba21e12d236d06bc0a25db.1543577156.git.jstancek@redhat.com Fixes: e1534ae95004 ("mm: differentiate page_mapped() from page_mapcount() for compound pages") Signed-off-by: Jan Stancek Debugged-by: Laszlo Ersek Suggested-by: "Kirill A. Shutemov" Acked-by: Michal Hocko Acked-by: Kirill A. Shutemov Reviewed-by: David Hildenbrand Reviewed-by: Andrea Arcangeli Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1ed7293ac40c5b1950b8ab21b6bc1838578ae2ad Author: Matthew Wilcox Date: Tue Jan 8 15:23:25 2019 -0800 mm/memory.c: initialise mmu_notifier_range correctly One of the paths in follow_pte_pmd() initialised the mmu_notifier_range incorrectly. Link: http://lkml.kernel.org/r/20190103002126.GM6310@bombadil.infradead.org Fixes: ac46d4f3c432 ("mm/mmu_notifier: use structure for invalidate_range_start/end calls v2") Signed-off-by: Matthew Wilcox Tested-by: Dave Chinner Reviewed-by: Jérôme Glisse Cc: John Hubbard Cc: Jan Kara Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit aff876dcf4461f311adbdf39ce48c134b3f99c49 Author: Miles Chen Date: Tue Jan 8 15:23:22 2019 -0800 tools/vm/page_owner: use page_owner_sort in the use example The example in comment does not useable because the output binary is named "page_owner_sort", not "sort". Also add a reference to Documentation/vm/page_owner.rst Link: http://lkml.kernel.org/r/1546515361-8317-1-git-send-email-miles.chen@mediatek.com Signed-off-by: Miles Chen Reviewed-by: Andrew Morton Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a3fe7cdf02e318870fb71218726cc2321ff41f30 Author: Andrey Konovalov Date: Tue Jan 8 15:23:18 2019 -0800 kasan: fix krealloc handling for tag-based mode Right now tag-based KASAN can retag the memory that is reallocated via krealloc and return a differently tagged pointer even if the same slab object gets used and no reallocated technically happens. There are a few issues with this approach. One is that krealloc callers can't rely on comparing the return value with the passed argument to check whether reallocation happened. Another is that if a caller knows that no reallocation happened, that it can access object memory through the old pointer, which leads to false positives. Look at nf_ct_ext_add() to see an example. Fix this by keeping the same tag if the memory don't actually gets reallocated during krealloc. Link: http://lkml.kernel.org/r/bb2a71d17ed072bcc528cbee46fcbd71a6da3be4.1546540962.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Andrey Ryabinin Cc: Christoph Lameter Cc: Dmitry Vyukov Cc: Mark Rutland Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 96fedce27e1356a2fff1c270710d9405848db562 Author: Andrey Konovalov Date: Tue Jan 8 15:23:15 2019 -0800 kasan: make tag based mode work with CONFIG_HARDENED_USERCOPY With CONFIG_HARDENED_USERCOPY enabled __check_heap_object() compares and then subtracts a potentially tagged pointer with a non-tagged address of the page that this pointer belongs to, which leads to unexpected behavior. Untag the pointer in __check_heap_object() before doing any of these operations. Link: http://lkml.kernel.org/r/7e756a298d514c4482f52aea6151db34818d395d.1546540962.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Andrey Ryabinin Cc: Christoph Lameter Cc: Dmitry Vyukov Cc: Mark Rutland Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit eb214f2dda31ffa989033b1e0f848ba0d3cb6188 Author: Andrey Konovalov Date: Tue Jan 8 15:23:11 2019 -0800 kasan, arm64: use ARCH_SLAB_MINALIGN instead of manual aligning Instead of changing cache->align to be aligned to KASAN_SHADOW_SCALE_SIZE in kasan_cache_create() we can reuse the ARCH_SLAB_MINALIGN macro. Link: http://lkml.kernel.org/r/52ddd881916bcc153a9924c154daacde78522227.1546540962.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Suggested-by: Vincenzo Frascino Cc: Andrey Ryabinin Cc: Christoph Lameter Cc: Dmitry Vyukov Cc: Mark Rutland Cc: Vincenzo Frascino Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 63f3655f950186752236bb88a22f8252c11ce394 Author: Michal Hocko Date: Tue Jan 8 15:23:07 2019 -0800 mm, memcg: fix reclaim deadlock with writeback Liu Bo has experienced a deadlock between memcg (legacy) reclaim and the ext4 writeback task1: wait_on_page_bit+0x82/0xa0 shrink_page_list+0x907/0x960 shrink_inactive_list+0x2c7/0x680 shrink_node_memcg+0x404/0x830 shrink_node+0xd8/0x300 do_try_to_free_pages+0x10d/0x330 try_to_free_mem_cgroup_pages+0xd5/0x1b0 try_charge+0x14d/0x720 memcg_kmem_charge_memcg+0x3c/0xa0 memcg_kmem_charge+0x7e/0xd0 __alloc_pages_nodemask+0x178/0x260 alloc_pages_current+0x95/0x140 pte_alloc_one+0x17/0x40 __pte_alloc+0x1e/0x110 alloc_set_pte+0x5fe/0xc20 do_fault+0x103/0x970 handle_mm_fault+0x61e/0xd10 __do_page_fault+0x252/0x4d0 do_page_fault+0x30/0x80 page_fault+0x28/0x30 task2: __lock_page+0x86/0xa0 mpage_prepare_extent_to_map+0x2e7/0x310 [ext4] ext4_writepages+0x479/0xd60 do_writepages+0x1e/0x30 __writeback_single_inode+0x45/0x320 writeback_sb_inodes+0x272/0x600 __writeback_inodes_wb+0x92/0xc0 wb_writeback+0x268/0x300 wb_workfn+0xb4/0x390 process_one_work+0x189/0x420 worker_thread+0x4e/0x4b0 kthread+0xe6/0x100 ret_from_fork+0x41/0x50 He adds "task1 is waiting for the PageWriteback bit of the page that task2 has collected in mpd->io_submit->io_bio, and tasks2 is waiting for the LOCKED bit the page which tasks1 has locked" More precisely task1 is handling a page fault and it has a page locked while it charges a new page table to a memcg. That in turn hits a memory limit reclaim and the memcg reclaim for legacy controller is waiting on the writeback but that is never going to finish because the writeback itself is waiting for the page locked in the #PF path. So this is essentially ABBA deadlock: lock_page(A) SetPageWriteback(A) unlock_page(A) lock_page(B) lock_page(B) pte_alloc_pne shrink_page_list wait_on_page_writeback(A) SetPageWriteback(B) unlock_page(B) # flush A, B to clear the writeback This accumulating of more pages to flush is used by several filesystems to generate a more optimal IO patterns. Waiting for the writeback in legacy memcg controller is a workaround for pre-mature OOM killer invocations because there is no dirty IO throttling available for the controller. There is no easy way around that unfortunately. Therefore fix this specific issue by pre-allocating the page table outside of the page lock. We have that handy infrastructure for that already so simply reuse the fault-around pattern which already does this. There are probably other hidden __GFP_ACCOUNT | GFP_KERNEL allocations from under a fs page locked but they should be really rare. I am not aware of a better solution unfortunately. [akpm@linux-foundation.org: fix mm/memory.c:__do_fault()] [akpm@linux-foundation.org: coding-style fixes] [mhocko@kernel.org: enhance comment, per Johannes] Link: http://lkml.kernel.org/r/20181214084948.GA5624@dhcp22.suse.cz Link: http://lkml.kernel.org/r/20181213092221.27270-1-mhocko@kernel.org Fixes: c3b94f44fcb0 ("memcg: further prevent OOM with too many dirty pages") Signed-off-by: Michal Hocko Reported-by: Liu Bo Debugged-by: Liu Bo Acked-by: Kirill A. Shutemov Acked-by: Johannes Weiner Reviewed-by: Liu Bo Cc: Jan Kara Cc: Dave Chinner Cc: Theodore Ts'o Cc: Vladimir Davydov Cc: Shakeel Butt Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7bff3c06997374fb9b9991536a547b840549a813 Author: Qian Cai Date: Tue Jan 8 15:23:04 2019 -0800 mm/usercopy.c: no check page span for stack objects It is easy to trigger this with CONFIG_HARDENED_USERCOPY_PAGESPAN=y, usercopy: Kernel memory overwrite attempt detected to spans multiple pages (offset 0, size 23)! kernel BUG at mm/usercopy.c:102! For example, print_worker_info char name[WQ_NAME_LEN] = { }; char desc[WORKER_DESC_LEN] = { }; probe_kernel_read(name, wq->name, sizeof(name) - 1); probe_kernel_read(desc, worker->desc, sizeof(desc) - 1); __copy_from_user_inatomic check_object_size check_heap_object check_page_span This is because on-stack variables could cross PAGE_SIZE boundary, and failed this check, if (likely(((unsigned long)ptr & (unsigned long)PAGE_MASK) == ((unsigned long)end & (unsigned long)PAGE_MASK))) ptr = FFFF889007D7EFF8 end = FFFF889007D7F00E Hence, fix it by checking if it is a stack object first. [keescook@chromium.org: improve comments after reorder] Link: http://lkml.kernel.org/r/20190103165151.GA32845@beast Link: http://lkml.kernel.org/r/20181231030254.99441-1-cai@lca.pw Signed-off-by: Qian Cai Signed-off-by: Kees Cook Acked-by: Kees Cook Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 09c2e76ed734a1d36470d257a778aaba28e86531 Author: Christoph Lameter Date: Tue Jan 8 15:23:00 2019 -0800 slab: alien caches must not be initialized if the allocation of the alien cache failed Callers of __alloc_alien() check for NULL. We must do the same check in __alloc_alien_cache to avoid NULL pointer dereferences on allocation failures. Link: http://lkml.kernel.org/r/010001680f42f192-82b4e12e-1565-4ee0-ae1f-1e98974906aa-000000@email.amazonses.com Fixes: 49dfc304ba241 ("slab: use the lock on alien_cache, instead of the lock on array_cache") Fixes: c8522a3a5832b ("Slab: introduce alloc_alien") Signed-off-by: Christoph Lameter Reported-by: syzbot+d6ed4ec679652b4fd4e4@syzkaller.appspotmail.com Reviewed-by: Andrew Morton Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ba4a45746c362b665e245c50b870615f02f34781 Author: Shakeel Butt Date: Tue Jan 8 15:22:57 2019 -0800 fork, memcg: fix cached_stacks case Commit 5eed6f1dff87 ("fork,memcg: fix crash in free_thread_stack on memcg charge fail") fixes a crash caused due to failed memcg charge of the kernel stack. However the fix misses the cached_stacks case which this patch fixes. So, the same crash can happen if the memcg charge of a cached stack is failed. Link: http://lkml.kernel.org/r/20190102180145.57406-1-shakeelb@google.com Fixes: 5eed6f1dff87 ("fork,memcg: fix crash in free_thread_stack on memcg charge fail") Signed-off-by: Shakeel Butt Acked-by: Michal Hocko Acked-by: Rik van Riel Cc: Rik van Riel Cc: Roman Gushchin Cc: Johannes Weiner Cc: Tejun Heo Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1d69a3f8ae77e3dbfdc1356225cce5ea9c366aec Author: Minchan Kim Date: Tue Jan 8 15:22:53 2019 -0800 zram: idle writeback fixes and cleanup This patch includes some fixes and cleanup for idle-page writeback. 1. writeback_limit interface Now writeback_limit interface is rather conusing. For example, once writeback limit budget is exausted, admin can see 0 from /sys/block/zramX/writeback_limit which is same semantic with disable writeback_limit at this moment. IOW, admin cannot tell that zero came from disable writeback limit or exausted writeback limit. To make the interface clear, let's sepatate enable of writeback limit to another knob - /sys/block/zram0/writeback_limit_enable * before: while true : # to re-enable writeback limit once previous one is used up echo 0 > /sys/block/zram0/writeback_limit echo $((200<<20)) > /sys/block/zram0/writeback_limit .. .. # used up the writeback limit budget * new # To enable writeback limit, from the beginning, admin should # enable it. echo $((200<<20)) > /sys/block/zram0/writeback_limit echo 1 > /sys/block/zram/0/writeback_limit_enable while true : echo $((200<<20)) > /sys/block/zram0/writeback_limit .. .. # used up the writeback limit budget It's much strightforward. 2. fix condition check idle/huge writeback mode check The mode in writeback_store is not bit opeartion any more so no need to use bit operations. Furthermore, current condition check is broken in that it does writeback every pages regardless of huge/idle. 3. clean up idle_store No need to use goto. [minchan@kernel.org: missed spin_lock_init] Link: http://lkml.kernel.org/r/20190103001601.GA255139@google.com Link: http://lkml.kernel.org/r/20181224033529.19450-1-minchan@kernel.org Signed-off-by: Minchan Kim Suggested-by: John Dias Cc: Sergey Senozhatsky Cc: John Dias Cc: Srinivas Paladugu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 917cb8a72a94d198073ad1e087685f801292042d Author: Steve Wise Date: Mon Jan 7 11:01:13 2019 -0800 RDMA/cma: Add cm_id restrack resource based on kernel or user cm_id type A recent regression causes a null ptr crash when dumping cm_id resources. The cma is incorrectly adding all cm_id restrack resources as kernel mode. Fixes: af8d70375d56 ("RDMA/restrack: Resource-tracker should not use uobject pointers") Signed-off-by: Steve Wise Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 19a220dd1e8a1b1d8e5e2f8f4a25313c4b02d527 Author: Jerome Brunet Date: Tue Aug 28 14:27:35 2018 +0200 arm64: defconfig: enable modules for amlogic s400 sound card Compile the necessary drivers as modules, including codecs, for the s400 sound card. Signed-off-by: Jerome Brunet Signed-off-by: Kevin Hilman commit c235316d935a19deedc2fc48076798c9a56e1a7c Author: Lyude Paul Date: Tue Jan 8 16:11:29 2019 -0500 drm/dp_mst: Add __must_check to drm_dp_mst_topology_mgr_resume() Since I've had to fix two cases of drivers not checking the return code from this function, let's make the compiler complain so this doesn't come up again in the future. Changes since v1: * Remove unneeded __must_check in function declaration - danvet Signed-off-by: Lyude Paul Cc: Jerry Zuo Reviewed-by: Daniel Vetter Reviewed-by: Harry Wentland Link: https://patchwork.freedesktop.org/patch/msgid/20190108211133.32564-4-lyude@redhat.com commit 2d1af6a11cb9d88e0e3dd10258904c437fe1b315 Author: Lyude Paul Date: Tue Jan 8 16:11:28 2019 -0500 drm/amdgpu: Don't fail resume process if resuming atomic state fails This is an ugly one unfortunately. Currently, all DRM drivers supporting atomic modesetting will save the state that userspace had set before suspending, then attempt to restore that state on resume. This probably worked very well at one point, like many other things, until DP MST came into the picture. While it's easy to restore state on normal display connectors that were disconnected during suspend regardless of their state post-resume, this can't really be done with MST because of the fact that setting up a downstream sink requires performing sideband transactions between the source and the MST hub, sending out the ACT packets, etc. Because of this, there isn't really a guarantee that we can restore the atomic state we had before suspend once we've resumed. This sucks pretty bad, but so far I haven't run into any compositors that this actually causes serious issues with. Most compositors will notice the hotplug we send afterwards, and then reprobe state. Since nouveau and i915 also don't fail the suspend/resume process due to failing to restore the atomic state, let's make amdgpu match this behavior. Better to resume the GPU properly, then to stop the process half way because of a potentially unavoidable atomic commit failure. Eventually, we'll have a real fix for this problem on the DRM level. But we've got some more important low-hanging fruit to deal with first. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Cc: Jerry Zuo Cc: # v4.15+ Link: https://patchwork.freedesktop.org/patch/msgid/20190108211133.32564-3-lyude@redhat.com commit fe7553bef8d676d1d8b40666868b33ec39b9df5d Author: Lyude Paul Date: Tue Jan 8 16:11:27 2019 -0500 drm/amdgpu: Don't ignore rc from drm_dp_mst_topology_mgr_resume() drm_dp_mst_topology_mgr_resume() returns whether or not it managed to find the topology in question after a suspend resume cycle, and the driver is supposed to check this value and disable MST accordingly if it's gone-in addition to sending a hotplug in order to notify userspace that something changed during suspend. Currently, amdgpu just makes the mistake of ignoring the return code from drm_dp_mst_topology_mgr_resume() which means that if a topology was removed in suspend, amdgpu never notices and assumes it's still connected which leads to all sorts of problems. So, fix this by actually checking the rc from drm_dp_mst_topology_mgr_resume(). Also, reformat the rest of the function while we're at it to fix the over-indenting. Signed-off-by: Lyude Paul Reviewed-by: Harry Wentland Cc: Jerry Zuo Cc: # v4.15+ Link: https://patchwork.freedesktop.org/patch/msgid/20190108211133.32564-2-lyude@redhat.com commit 715849ab31f8e57bbad84cc6c38912aeba6beb21 Author: Pablo Neira Ayuso Date: Tue Jan 8 23:18:58 2019 +0100 netfilter: nf_tables: selective rule dump needs table to be specified Table needs to be specified for selective rule dumps per chain. Fixes: 241faeceb849c ("netfilter: nf_tables: Speed up selective rule dumps") Reported-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit b91d9036883793122cf6575ca4dfbfbdd201a83d Author: Taehee Yoo Date: Fri Jan 4 17:56:16 2019 +0900 netfilter: nf_tables: fix leaking object reference count There is no code that decreases the reference count of stateful objects in error path of the nft_add_set_elem(). this causes a leak of reference count of stateful objects. Test commands: $nft add table ip filter $nft add counter ip filter c1 $nft add map ip filter m1 { type ipv4_addr : counter \;} $nft add element ip filter m1 { 1 : c1 } $nft add element ip filter m1 { 1 : c1 } $nft delete element ip filter m1 { 1 } $nft delete counter ip filter c1 Result: Error: Could not process rule: Device or resource busy delete counter ip filter c1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ At the second 'nft add element ip filter m1 { 1 : c1 }', the reference count of the 'c1' is increased then it tries to insert into the 'm1'. but the 'm1' already has same element so it returns -EEXIST. But it doesn't decrease the reference count of the 'c1' in the error path. Due to a leak of the reference count of the 'c1', the 'c1' can't be removed by 'nft delete counter ip filter c1'. Fixes: 8aeff920dcc9 ("netfilter: nf_tables: add stateful object reference to set elements") Signed-off-by: Taehee Yoo Signed-off-by: Pablo Neira Ayuso commit 310529e663ed975d564cf029f878583e70c3b8a3 Author: Phil Sutter Date: Sun Dec 30 17:27:43 2018 +0100 netfilter: nf_tables: Fix for endless loop when dumping ruleset __nf_tables_dump_rules() stores the current idx value into cb->args[0] before returning to caller. With multiple chains present, cb->args[0] is therefore updated after each chain's rules have been traversed. This though causes the final nf_tables_dump_rules() run (which should return an skb->len of zero since no rules are left to dump) to continue dumping rules for each but the first chain. Fix this by moving the cb->args[0] update to nf_tables_dump_rules(). With no final action to be performed anymore in __nf_tables_dump_rules(), drop 'out_unfinished' jump label and 'rc' variable - instead return the appropriate value directly. Fixes: 241faeceb849c ("netfilter: nf_tables: Speed up selective rule dumps") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit 4314b1f68a3f655f75010ab04bb57419eab34ec3 Merge: 11287b693d038 4fabf3bf93a19 Author: David S. Miller Date: Tue Jan 8 16:53:54 2019 -0500 Merge branch 'mlxsw-fixes' Daniel Borkmann says: ==================== pull-request: bpf 2019-01-08 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Fix BSD'ism in sendmsg(2) to rewrite unspecified IPv6 dst for unconnected UDP sockets with [::1] _after_ cgroup BPF invocation, from Andrey. 2) Follow-up fix to the speculation fix where we need to reject a corner case for sanitation when ptr and scalars are mixed in the same alu op. Also, some unrelated minor doc fixes, from Daniel. 3) Fix BPF kselftest's incorrect uses of create_and_get_cgroup() by not assuming fd of zero value to be the result of an error case, from Stanislav. ==================== Signed-off-by: David S. Miller commit 4fabf3bf93a194c7fa5288da3e0af37e4b943cf3 Author: Ido Schimmel Date: Tue Jan 8 16:48:14 2019 +0000 selftests: forwarding: Add a test for VLAN deletion Add a VLAN on a bridge port, delete it and make sure the PVID VLAN is not affected. Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 674bed5df4cab8f96d04f7b99608883a48f9226b Author: Ido Schimmel Date: Tue Jan 8 16:48:13 2019 +0000 mlxsw: spectrum_switchdev: Set PVID correctly during VLAN deletion When a VLAN is deleted from a bridge port we should not change the PVID unless the deleted VLAN is the PVID. Fixes: fe9ccc785de5 ("mlxsw: spectrum_switchdev: Don't batch VLAN operations") Signed-off-by: Ido Schimmel Acked-by: Jiri Pirko Signed-off-by: David S. Miller commit 289fb44df4e4c3fe977ee4b451e1d11e10227654 Author: Ido Schimmel Date: Tue Jan 8 16:48:12 2019 +0000 selftests: forwarding: Fix test for different devices When running the test on the Spectrum ASIC the generated packets are counted on the ingress filter and injected back to the pipeline because of the 'pass' action. The router block then drops the packets due to checksum error, as the test generates packets with zero checksum. When running the test on an emulator that is not as strict about checksum errors the test fails since packets are counted twice. Once by the emulated ASIC on its ingress filter and again by the kernel as the emulator does not perform checksum validation and allows the packets to be trapped by a matching host route. Fix this by changing the action to 'drop', which will prevent the packet from continuing further in the pipeline to the router block. For veth pairs this change is essentially a NOP given packets are only processed once (by the kernel). Fixes: a0b61f3d8ebf ("selftests: forwarding: vxlan_bridge_1d: Add an ECN decap test") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 279737939a8194f02fa352ab4476a1b241f44ef4 Author: Ido Schimmel Date: Tue Jan 8 16:48:11 2019 +0000 net: bridge: Fix VLANs memory leak When adding / deleting VLANs to / from a bridge port, the bridge driver first tries to propagate the information via switchdev and falls back to the 8021q driver in case the underlying driver does not support switchdev. This can result in a memory leak [1] when VXLAN and mlxsw ports are enslaved to the bridge: $ ip link set dev vxlan0 master br0 # No mlxsw ports are enslaved to 'br0', so mlxsw ignores the switchdev # notification and the bridge driver adds the VLAN on 'vxlan0' via the # 8021q driver $ bridge vlan add vid 10 dev vxlan0 pvid untagged # mlxsw port is enslaved to the bridge $ ip link set dev swp1 master br0 # mlxsw processes the switchdev notification and the 8021q driver is # skipped $ bridge vlan del vid 10 dev vxlan0 This results in 'struct vlan_info' and 'struct vlan_vid_info' being leaked, as they were allocated by the 8021q driver during VLAN addition, but never freed as the 8021q driver was skipped during deletion. Fix this by introducing a new VLAN private flag that indicates whether the VLAN was added on the port by switchdev or the 8021q driver. If the VLAN was added by the 8021q driver, then we make sure to delete it via the 8021q driver as well. [1] unreferenced object 0xffff88822d20b1e8 (size 256): comm "bridge", pid 2532, jiffies 4295216998 (age 1188.830s) hex dump (first 32 bytes): e0 42 97 ce 81 88 ff ff 00 00 00 00 00 00 00 00 .B.............. 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000f82d851d>] kmem_cache_alloc_trace+0x1be/0x330 [<00000000e0178b02>] vlan_vid_add+0x661/0x920 [<00000000218ebd5f>] __vlan_add+0x1be9/0x3a00 [<000000006eafa1ca>] nbp_vlan_add+0x8b3/0xd90 [<000000003535392c>] br_vlan_info+0x132/0x410 [<00000000aedaa9dc>] br_afspec+0x75c/0x870 [<00000000f5716133>] br_setlink+0x3dc/0x6d0 [<00000000aceca5e2>] rtnl_bridge_setlink+0x615/0xb30 [<00000000a2f2d23e>] rtnetlink_rcv_msg+0x3a3/0xa80 [<0000000064097e69>] netlink_rcv_skb+0x152/0x3c0 [<000000008be8d614>] rtnetlink_rcv+0x21/0x30 [<000000009ab2ca25>] netlink_unicast+0x52f/0x740 [<00000000e7d9ac96>] netlink_sendmsg+0x9c7/0xf50 [<000000005d1e2050>] sock_sendmsg+0xbe/0x120 [<00000000d51426bc>] ___sys_sendmsg+0x778/0x8f0 [<00000000b9d7b2cc>] __sys_sendmsg+0x112/0x270 unreferenced object 0xffff888227454308 (size 32): comm "bridge", pid 2532, jiffies 4295216998 (age 1188.882s) hex dump (first 32 bytes): 88 b2 20 2d 82 88 ff ff 88 b2 20 2d 82 88 ff ff .. -...... -.... 81 00 0a 00 01 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000f82d851d>] kmem_cache_alloc_trace+0x1be/0x330 [<0000000018050631>] vlan_vid_add+0x3e6/0x920 [<00000000218ebd5f>] __vlan_add+0x1be9/0x3a00 [<000000006eafa1ca>] nbp_vlan_add+0x8b3/0xd90 [<000000003535392c>] br_vlan_info+0x132/0x410 [<00000000aedaa9dc>] br_afspec+0x75c/0x870 [<00000000f5716133>] br_setlink+0x3dc/0x6d0 [<00000000aceca5e2>] rtnl_bridge_setlink+0x615/0xb30 [<00000000a2f2d23e>] rtnetlink_rcv_msg+0x3a3/0xa80 [<0000000064097e69>] netlink_rcv_skb+0x152/0x3c0 [<000000008be8d614>] rtnetlink_rcv+0x21/0x30 [<000000009ab2ca25>] netlink_unicast+0x52f/0x740 [<00000000e7d9ac96>] netlink_sendmsg+0x9c7/0xf50 [<000000005d1e2050>] sock_sendmsg+0xbe/0x120 [<00000000d51426bc>] ___sys_sendmsg+0x778/0x8f0 [<00000000b9d7b2cc>] __sys_sendmsg+0x112/0x270 Fixes: d70e42b22dd4 ("mlxsw: spectrum: Enable VxLAN enslavement to VLAN-aware bridges") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Cc: Roopa Prabhu Cc: Nikolay Aleksandrov Cc: bridge@lists.linux-foundation.org Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 16dc42e4511172aa3a4d49931597582c9ff78843 Author: Ido Schimmel Date: Tue Jan 8 16:48:10 2019 +0000 selftests: mlxsw: Add a test case for VLAN addition error flow Add a test case for the issue fixed by previous commit. In case the offloading of an unsupported VxLAN tunnel was triggered by adding the mapped VLAN to a local port, then error should be returned to the user. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 412283eedc138381e24d8c1304a3c5b298c503c4 Author: Ido Schimmel Date: Tue Jan 8 16:48:08 2019 +0000 mlxsw: spectrum_nve: Replace error code with EINVAL Adding a VLAN on a port can trigger the offload of a VXLAN tunnel which is already a member in the VLAN. In case the configuration of the VXLAN is not supported, the driver would return -EOPNOTSUPP. This is problematic since bridge code does not interpret this as error, but rather that it should try to setup the VLAN using the 8021q driver instead of switchdev. Fixes: d70e42b22dd4 ("mlxsw: spectrum: Enable VxLAN enslavement to VLAN-aware bridges") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 457e20d659247a09524e276aed46f19d853701d0 Author: Ido Schimmel Date: Tue Jan 8 16:48:07 2019 +0000 mlxsw: spectrum_switchdev: Avoid returning errors in commit phase Drivers are not supposed to return errors in switchdev commit phase if they returned OK in prepare phase. Otherwise, a WARNING is emitted. However, when the offloading of a VXLAN tunnel is triggered by the addition of a VLAN on a local port, it is not possible to guarantee that the commit phase will succeed without doing a lot of work. In these cases, the artificial division between prepare and commit phase does not make sense, so simply do the work in the prepare phase. Fixes: d70e42b22dd4 ("mlxsw: spectrum: Enable VxLAN enslavement to VLAN-aware bridges") Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 143a8e038ac599ca73c6354c8af6a8fdeee9fa7d Author: Ido Schimmel Date: Tue Jan 8 16:48:06 2019 +0000 mlxsw: spectrum: Add VXLAN dependency for spectrum When VXLAN is a loadable module, MLXSW_SPECTRUM must not be built-in: drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c:2547: undefined reference to `vxlan_fdb_find_uc' Add Kconfig dependency to enforce usable configurations. Fixes: 1231e04f5bba ("mlxsw: spectrum_switchdev: Add support for VxLAN encapsulation") Signed-off-by: Ido Schimmel Reported-by: kbuild test robot Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 8adbe212a159d9c78a90fca1d854f6e63452426b Author: Jiri Pirko Date: Tue Jan 8 16:48:05 2019 +0000 mlxsw: spectrum: Disable lag port TX before removing it Make sure that lag port TX is disabled before mlxsw_sp_port_lag_leave() is called and prevent from possible EMAD error. Fixes: 0d65fc13042f ("mlxsw: spectrum: Implement LAG port join/leave") Signed-off-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 04d075b7aa8433dc3c98e14c571705effc318cd8 Author: Nir Dotan Date: Tue Jan 8 16:48:04 2019 +0000 mlxsw: spectrum_acl: Remove ASSERT_RTNL()s in module removal flow Removal of the mlxsw driver on Spectrum-2 platforms hits an ASSERT_RTNL() in Spectrum-2 ACL Bloom filter and in ERP removal paths. This happens because the multicast router implementation in Spectrum-2 relies on ACLs. Taking the RTNL lock upon driver removal is useless since the driver first removes its ports and unregisters from notifiers so concurrent writes cannot happen at that time. The assertions were originally put as a reminder for future work involving ERP background optimization, but having these assertions only during addition serves this purpose as well. Therefore remove the ASSERT_RTNL() in both places related to ERP and Bloom filter removal. Fixes: cf7221a4f5a5 ("mlxsw: spectrum_router: Add Multicast routing support for Spectrum-2") Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit ff0db43cd6c530ff944773ccf48ece55d32d0c22 Author: Nir Dotan Date: Tue Jan 8 16:48:03 2019 +0000 mlxsw: spectrum_acl: Add cleanup after C-TCAM update error condition When writing to C-TCAM, mlxsw driver uses cregion->ops->entry_insert(). In case of C-TCAM HW insertion error, the opposite action should take place. Add error handling case in which the C-TCAM region entry is removed, by calling cregion->ops->entry_remove(). Fixes: a0a777b9409f ("mlxsw: spectrum_acl: Start using A-TCAM") Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit f5c9571e2265b3cbfad2ed41ba60c3da474daa61 Author: Amadeusz Sławiński Date: Tue Jan 8 21:03:11 2019 +0100 ALSA: usb-audio: fix CM6206 register definitions fix typo after a recent commit causing headphones to have no sound Fixes: ad43d528a7ac (ALSA: usb-audio: Define registers for CM6206) Signed-off-by: Amadeusz Sławiński Signed-off-by: Takashi Iwai commit 11287b693d03830010356339e4ceddf47dee34fa Author: Heiner Kallweit Date: Mon Jan 7 21:49:09 2019 +0100 r8169: load Realtek PHY driver module before r8169 This soft dependency works around an issue where sometimes the genphy driver is used instead of the dedicated PHY driver. The root cause of the issue isn't clear yet. People reported the unloading/re-loading module r8169 helps, and also configuring this soft dependency in the modprobe config files. Important just seems to be that the realtek module is loaded before r8169. Once this has been applied preliminary fix 38af4b903210 ("net: phy: add workaround for issue where PHY driver doesn't bind to the device") will be removed. Fixes: f1e911d5d0df ("r8169: add basic phylib support") Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit c4a32b266da7bb702e60381ca0c35eaddbc89a6c Author: Yu Zhao Date: Mon Jan 7 15:51:15 2019 -0700 drm/amdgpu: validate user GEM object size When creating frame buffer, userspace may request to attach to a previously allocated GEM object that is smaller than what GPU requires. Validation must be done to prevent out-of-bound DMA, otherwise it could be exploited to reveal sensitive data. This fix is not done in a common code path because individual driver might have different requirement. Cc: stable@vger.kernel.org # v4.2+ Reviewed-by: Michel Dänzer Signed-off-by: Yu Zhao Signed-off-by: Alex Deucher commit 89f23b6efef554766177bf51aa754bce14c3e7da Author: Yu Zhao Date: Mon Jan 7 15:51:14 2019 -0700 drm/amdgpu: validate user pitch alignment Userspace may request pitch alignment that is not supported by GPU. Some requests 32, but GPU ignores it and uses default 64 when cpp is 4. If GEM object is allocated based on the smaller alignment, GPU DMA will go out of bound. Cc: stable@vger.kernel.org # v4.2+ Reviewed-by: Michel Dänzer Signed-off-by: Yu Zhao Signed-off-by: Alex Deucher commit fadcb8f9fc89f7b517ce48f30e0b607b16d99d63 Author: Evan Quan Date: Tue Jan 8 12:22:24 2019 +0800 drm/amd/powerplay: drop the unnecessary uclk hard min setting Since soft min setting is enough. Hard min setting is redundant. Reported-by: Likun Gao Signed-off-by: Evan Quan Acked-by: Alex Deucher Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit fff0d3f7686942bd544b53a48d1b76bd62c46946 Author: Evan Quan Date: Tue Jan 8 10:33:35 2019 +0800 drm/amd/powerplay: avoid possible buffer overflow Make sure the clock level enforced is within the allowed ranges. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Reviewed-by: Likun Gao Signed-off-by: Alex Deucher commit 0624e145fb2ba87c752bec355af12f43cb52cd68 Author: Evan Quan Date: Mon Jan 7 18:56:14 2019 +0800 drm/amd/powerplay: create pp_od_clk_voltage device file under OD support Since pp_od_clk_voltage device file is for OD related sysfs operations. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit a0071840d2040ea1b27e5a008182b09b88defc15 Author: Bryan Whitehead Date: Mon Jan 7 14:00:09 2019 -0500 lan743x: Remove phy_read from link status change function It has been noticed that some phys do not have the registers required by the previous implementation. To fix this, instead of using phy_read, the required information is extracted from the phy_device structure. fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver") Signed-off-by: Bryan Whitehead Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 8139d493daf1ef19d34192f95e92e19dc19b648a Author: Evan Quan Date: Mon Jan 7 18:38:30 2019 +0800 drm/amd/powerplay: update OD support flag for SKU with no OD capabilities For those ASICs with no overdrive capabilities, the OD support flag will be reset. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit b7ea4894aa867aaf1c31bfb4b00a3c3e38eedf95 Author: Eugene Syromiatnikov Date: Mon Jan 7 16:22:38 2019 +0100 ptp: uapi: change _IOW to IOWR in PTP_SYS_OFFSET_EXTENDED definition The ioctl command is read/write (or just read, if the fact that user space writes n_samples field is ignored). Signed-off-by: Eugene Syromiatnikov Signed-off-by: David S. Miller commit 895ac1376d5abcb94ca1b70a595579f253237790 Author: Eugene Syromiatnikov Date: Mon Jan 7 16:22:29 2019 +0100 ptp: check that rsv field is zero in struct ptp_sys_offset_extended Otherwise it is impossible to use it for something else, as it will break userspace that puts garbage there. The same check should be done in other structures, but the fact that data in reserved fields is ignored is already part of the kernel ABI. Signed-off-by: Eugene Syromiatnikov Signed-off-by: David S. Miller commit 6a829eb8619fbdde6d7d627ad582fe119805f39d Author: Trond Myklebust Date: Thu Jan 3 09:04:45 2019 -0500 SUNRPC: Fix TCP receive code on archs with flush_dcache_page() After receiving data into the page cache, we need to call flush_dcache_page() for the architectures that define it. Fixes: 277e4ab7d530b ("SUNRPC: Simplify TCP receive code by switching...") Reported-by: Geert Uytterhoeven Signed-off-by: Trond Myklebust Cc: stable@vger.kernel.org # v4.20 Tested-by: Geert Uytterhoeven Signed-off-by: Anna Schumaker commit 7b55851367136b1efd84d98fea81ba57a98304cf Author: David Herrmann Date: Tue Jan 8 13:58:52 2019 +0100 fork: record start_time late This changes the fork(2) syscall to record the process start_time after initializing the basic task structure but still before making the new process visible to user-space. Technically, we could record the start_time anytime during fork(2). But this might lead to scenarios where a start_time is recorded long before a process becomes visible to user-space. For instance, with userfaultfd(2) and TLS, user-space can delay the execution of fork(2) for an indefinite amount of time (and will, if this causes network access, or similar). By recording the start_time late, it much closer reflects the point in time where the process becomes live and can be observed by other processes. Lastly, this makes it much harder for user-space to predict and control the start_time they get assigned. Previously, user-space could fork a process and stall it in copy_thread_tls() before its pid is allocated, but after its start_time is recorded. This can be misused to later-on cycle through PIDs and resume the stalled fork(2) yielding a process that has the same pid and start_time as a process that existed before. This can be used to circumvent security systems that identify processes by their pid+start_time combination. Even though user-space was always aware that start_time recording is flaky (but several projects are known to still rely on start_time-based identification), changing the start_time to be recorded late will help mitigate existing attacks and make it much harder for user-space to control the start_time a process gets assigned. Reported-by: Jann Horn Signed-off-by: Tom Gundersen Signed-off-by: David Herrmann Signed-off-by: Linus Torvalds commit ee412f14693a3fe2645b3528603dfd37dd05118a Author: Arnaldo Carvalho de Melo Date: Tue Jan 8 13:53:23 2019 -0300 tools include uapi: Sync linux/vhost.h with the kernel sources To get the changes in: 4b86713236e4 ("vhost: split structs into a separate header file") 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 Those didn't touch things used in tools, i.e. the following continues working: $ tools/perf/trace/beauty/vhost_virtio_ioctl.sh static const char *vhost_virtio_ioctl_cmds[] = { [0x00] = "SET_FEATURES", [0x01] = "SET_OWNER", [0x02] = "RESET_OWNER", [0x03] = "SET_MEM_TABLE", [0x04] = "SET_LOG_BASE", [0x07] = "SET_LOG_FD", [0x10] = "SET_VRING_NUM", [0x11] = "SET_VRING_ADDR", [0x12] = "SET_VRING_BASE", [0x13] = "SET_VRING_ENDIAN", [0x14] = "GET_VRING_ENDIAN", [0x20] = "SET_VRING_KICK", [0x21] = "SET_VRING_CALL", [0x22] = "SET_VRING_ERR", [0x23] = "SET_VRING_BUSYLOOP_TIMEOUT", [0x24] = "GET_VRING_BUSYLOOP_TIMEOUT", [0x25] = "SET_BACKEND_FEATURES", [0x30] = "NET_SET_BACKEND", [0x40] = "SCSI_SET_ENDPOINT", [0x41] = "SCSI_CLEAR_ENDPOINT", [0x42] = "SCSI_GET_ABI_VERSION", [0x43] = "SCSI_SET_EVENTS_MISSED", [0x44] = "SCSI_GET_EVENTS_MISSED", [0x60] = "VSOCK_SET_GUEST_CID", [0x61] = "VSOCK_SET_RUNNING", }; static const char *vhost_virtio_ioctl_read_cmds[] = { [0x00] = "GET_FEATURES", [0x12] = "GET_VRING_BASE", [0x26] = "GET_BACKEND_FEATURES", }; $ At some point in the eBPFication of perf, using something like: # perf trace -e ioctl(cmd=VHOST_VRING*) Will setup a BPF filter right at the raw_syscalls:sys_enter tracepoint, i.e. filtering at the origin. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Michael S. Tsirkin Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-g28usrt7l59lwq3wuh8vzbig@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit fdc42ca190c7d8976f4f9240752f0bd008270b72 Author: Arnaldo Carvalho de Melo Date: Tue Jan 8 13:48:14 2019 -0300 tools include uapi: Sync linux/fs.h copy with the kernel sources To get the changes in: e262e32d6bde ("vfs: Suppress MS_* flag defs within the kernel unless explicitly enabled") That made the mount flags string table generator to switch to using mount.h instead. This silences the following 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 Cc: Adrian Hunter Cc: David Howells Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-mosz81pa6iwxko4p2owbm3ss@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 1c23397d2a6a077ab32f01c01406c2fe61b7b3a4 Author: Arnaldo Carvalho de Melo Date: Tue Jan 8 13:46:43 2019 -0300 perf beauty: Switch from using uapi/linux/fs.h to uapi/linux/mount.h As now we'll update our fs.h copy and what tools/perf/trace/beauty/mount_flags.sh needs just got moved to mount.h, use that instead. Cc: Adrian Hunter Cc: David Howells Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-ls19h376xukeouxrw9dswkcn@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 250bfc87ddc427fa001bbc8bc1468ce5fc06645b Author: Arnaldo Carvalho de Melo Date: Tue Jan 8 13:42:37 2019 -0300 tools include uapi: Grab a copy of linux/mount.h We were using a copy of uapi/linux/fs.h to create the mount syscall 'flags' string table to use in 'perf trace', to convert from the number obtained via the raw_syscalls:sys_enter into a string, using tools/perf/trace/beauty/mount_flags.sh, but in e262e32d6bde ("vfs: Suppress MS_* flag defs within the kernel unless explicitly enabled") those defines got moved to linux/mount.h, so grab a copy of mount.h too. Keep the uapi/linux/fs.h as we'll use it for the SEEK_ constants. Cc: Adrian Hunter Cc: David Howells Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-i2ricmpwpdrpukfq3298jr1z@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 6e17f58c486d9554341f70aa5b63b8fbed07b3fa Author: Dan Carpenter Date: Sat Jan 5 16:06:48 2019 +0300 xprtrdma: Double free in rpcrdma_sendctxs_create() The clean up is handled by the caller, rpcrdma_buffer_create(), so this call to rpcrdma_sendctxs_destroy() leads to a double free. Fixes: ae72950abf99 ("xprtrdma: Add data structure to manage RDMA Send arguments") Signed-off-by: Dan Carpenter Reviewed-by: Chuck Lever Signed-off-by: Anna Schumaker commit 4429b668e0375206408617d6440e3bb76c56c7d2 Author: Dan Carpenter Date: Sat Jan 5 16:06:07 2019 +0300 xprtrdma: Fix error code in rpcrdma_buffer_create() This should return -ENOMEM if __alloc_workqueue_key() fails, but it returns success. Fixes: 6d2d0ee27c7a ("xprtrdma: Replace rpcrdma_receive_wq with a per-xprt workqueue") Signed-off-by: Dan Carpenter Reviewed-by: Chuck Lever Signed-off-by: Anna Schumaker commit 58fec830fc19208354895d9832785505046d6c01 Author: Alex Williamson Date: Mon Jan 7 22:13:22 2019 -0700 vfio/type1: Fix unmap overflow off-by-one The below referenced commit adds a test for integer overflow, but in doing so prevents the unmap ioctl from ever including the last page of the address space. Subtract one to compare to the last address of the unmap to avoid the overflow and wrap-around. Fixes: 71a7d3d78e3c ("vfio/type1: silence integer overflow warning") Link: https://bugzilla.redhat.com/show_bug.cgi?id=1662291 Cc: stable@vger.kernel.org # v4.15+ Reported-by: Pei Zhang Debugged-by: Peter Xu Reviewed-by: Dan Carpenter Reviewed-by: Peter Xu Tested-by: Peter Xu Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson commit f2e14cd2c93699aa0aeaa8240457ab359f1258ff Author: Arnaldo Carvalho de Melo Date: Tue Jan 8 10:56:59 2019 -0300 perf top: Lift restriction on using callchains without "sym" in --sort This restriction is not present in 'perf report' and since 'perf top' uses the same hists browser, remove it from it as well. With this we create per event buckets with callchain trees, so that # perf top --sort dso -g --no-children Bucketizes samples by DSO and below it shows the callchains leading to functions in this DSO. Try also: # perf top -e sched:*switch -g --no-children To see the callchains leading to sched switches, pressing 'E' to expand all one can quickly see the most common scheduler switches and what leads to them, for instance, calls to IO, futexes, etc. Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Jiri Olsa Link: https://lkml.kernel.org/r/20190107140854.GA28965@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 9231967e2f515fce9e19687c0c40dfda416b3512 Author: Tzvetomir Stoyanov Date: Fri Nov 30 23:08:13 2018 -0500 tools lib traceevent: Remove tep_data_event_from_type() API In order to make libtraceevent into a proper library, its API should be straightforward. After discussion with Steven Rostedt, we decided to remove the tep_data_event_from_type() API and to replace it with tep_find_event(), as it does the same. Signed-off-by: Tzvetomir Stoyanov Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20181201040852.913841066@goodmis.org Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit 4104e604277016b3e6a7d120368054f9d2716953 Author: Tzvetomir Stoyanov Date: Fri Nov 30 23:08:12 2018 -0500 tools lib traceevent: Rename tep_is_file_bigendian() to tep_file_bigendian() In order to make libtraceevent into a proper library, its API should be straightforward. After a discussion with Steven Rostedt, we decided to rename a few APIs, to have more intuitive names. This patch renames tep_is_file_bigendian() to tep_file_bigendian(). Signed-off-by: Tzvetomir Stoyanov Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20181201040852.767549746@goodmis.org Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit f87ce7c43f36d4abff91b19edadd23939f99ff98 Author: Tzvetomir Stoyanov Date: Fri Nov 30 23:08:11 2018 -0500 tools lib traceevent: Changed return logic of tep_register_event_handler() API In order to make libtraceevent into a proper library, its API should be straightforward. The tep_register_event_handler() functions returns -1 in case it successfully registers the new event handler. Such return code is used by the other library APIs in case of an error. To unify the return logic of tep_register_event_handler() with the other APIs, this patch introduces enum tep_reg_handler, which is used by this function as return value, to handle all possible successful return cases. Signed-off-by: Tzvetomir Stoyanov Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20181201040852.628034497@goodmis.org Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit 6d2d6fd7e3ee0daf0d8308741792b3ec41aafd0c Author: Tzvetomir Stoyanov Date: Fri Nov 30 23:08:10 2018 -0500 tools lib traceevent: Changed return logic of trace_seq_printf() and trace_seq_vprintf() APIs In order to make libtraceevent into a proper library, its API should be straightforward. The trace_seq_printf() and trace_seq_vprintf() APIs have inconsistent returned values with the other trace_seq_* APIs. This path changes the return logic of trace_seq_printf() and trace_seq_vprintf() to return the number of printed characters, as the other trace_seq_* related APIs. Signed-off-by: Tzvetomir Stoyanov Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20181201040852.485792891@goodmis.org Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit 2e4318a287bdf815140462257ab8697f5289a12f Author: Tzvetomir Stoyanov Date: Fri Nov 30 23:08:09 2018 -0500 tools lib traceevent: Rename struct cmdline to struct tep_cmdline In order to make libtraceevent a proper library, variables, data structures and functions should have a unique prefix to prevent name space conflicts. That prefix will be "tep_". This patch renames 'struct cmdline' to 'struct tep_cmdline'. Signed-off-by: Tzvetomir Stoyanov Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20181201040852.358871851@goodmis.org Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit eed14f4b075ec594ac09921b998bf3dd61f5886b Author: Tzvetomir Stoyanov Date: Fri Nov 30 23:08:08 2018 -0500 tools lib traceevent: Initialize host_bigendian at tep_handle allocation This patch initializes the host_bigendian member of the tep_handle structure with the byte order of the current host, when this handler is created - in tep_alloc() API. We need this in order to remove the tep_set_host_bigendian() API. Signed-off-by: Tzvetomir Stoyanov Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20181201040852.216292134@goodmis.org Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit ca3958b1c0968a6f3105e211355f128ce871e796 Author: Tzvetomir Stoyanov Date: Fri Nov 30 10:44:11 2018 -0500 tools lib traceevent: Introduce new libtracevent API: tep_override_comm() This patch adds a new API of tracevent library: tep_override_comm() It registers a pid / command mapping. If a mapping with the same pid already exists, the entry is updated with the new command. Signed-off-by: Tzvetomir Stoyanov Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20181130154648.038915912@goodmis.org Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit 21327c7843e9169d5e2e527713e60e6c9842a56c Author: Florian Fainelli Date: Thu Dec 20 19:43:37 2018 -0800 perf tests: Add a test for the ARM 32-bit [vectors] page perf on ARM requires CONFIG_KUSER_HELPERS to be turned on to allow some independance with respect to the ARM CPU being used. Add a test which tries to locate the [vectors] page, created when CONFIG_KUSER_HELPERS is turned on to help asses the system's health. Signed-off-by: Florian Fainelli Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Chris Healy Cc: Greg Kroah-Hartman Cc: Kim Phillips Cc: Lucas Stach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Russell King Cc: Thomas Gleixner Cc: Thomas Richter Link: http://lkml.kernel.org/r/20181221034337.26663-3-f.fainelli@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 011532379b7c2de6757e129037bdfc8d704bce23 Author: Florian Fainelli Date: Thu Dec 20 19:43:36 2018 -0800 perf tools: Make find_vdso_map() more modular In preparation for checking that the vectors page on the ARM architecture, refactor the find_vdso_map() function to accept finding an arbitrary string and create a dedicated helper function for that under util/find-map.c and update the filename to find-map.c and all references to it: perf-read-vdso.c and util/vdso.c. Signed-off-by: Florian Fainelli Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Chris Healy Cc: Greg Kroah-Hartman Cc: Kim Phillips Cc: Lucas Stach Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Russell King Cc: Thomas Gleixner Cc: Thomas Richter Link: http://lkml.kernel.org/r/20181221034337.26663-2-f.fainelli@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit ac6e022cbfdce215ad545e91d9827060855da3d7 Author: Arnaldo Carvalho de Melo Date: Mon Jan 7 16:54:38 2019 -0300 perf trace: Fix alignment for [continued] lines We were not taking into account the "... [continued]" printed characters, fix it. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-qt20y0acmf8k0bzisce8kw95@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 172bf02d564bdb6df8410f64720fa2c68e755d1a Author: Arnaldo Carvalho de Melo Date: Mon Jan 7 16:24:27 2019 -0300 perf trace: Fix ')' placement in "interrupted" syscall lines When we get the sys_enter for a syscall we check if the last one is still waiting for its matching sys_exit, if so we print this: 468.753 ( ): firefox/32382 poll(ufds: 0x7f3988d3dd00, nfds: 7, timeout_msecs: 4294967295) ... 449.575 ( 0.004 ms): Softwar~cThrea/32434 futex(uaddr: 0x7f39a18a9b70, op: WAKE|PRIVATE_FLAG, val: 1) = 0 At some point we'll get that poll sys_exit event and will print a "[continued]" line. While making the sizing of the alignment after the syscall arg list and its result configurable, so that we can mimic strace, which uses a smaller alingment by default, a bug was introduced where the closing parens appeared before the syscall name and its arg list, fix it. Fixes: 4b8a240ed5e0 ("perf trace: Add alignment spaces after the closing parens") Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-oi45i54s59h1w1kmgpzrfuum@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 56752b21755aef598709d143684cb363db98a7d2 Author: Guo Ren Date: Tue Jan 8 20:49:24 2019 +0800 irqchip/csky: fixup handle_irq_perbit break irq The handle_irq_perbit function loop every bit in hwirq local variable. handle_irq_perbit(hwirq) { for_everyt_bit_in(hwirq) { handle_domain_irq() ->irq_exit() ->invoke_softirq() ->__do_softirq() ->local_irq_enable() // Here will cause new interrupt. } } When new interrupt coming at local_irq_enable, it will finish another interrupt handler and pull down the interrupt source. But hwirq is the local variable for handle_irq_perbit(), it can't get new interrupt controller pending reg status. So we need update hwirq with pending reg in every loop. Also change write_relax to writel could prevent stw from fast retire. When local_irq is enabled, intc regs is really set-in. Signed-off-by: Guo Ren Cc: Lu Baoquan commit 2a60aa14a9a0333b3eef58150bc1ef654f7321ef Author: Guo Ren Date: Tue Jan 8 20:31:43 2019 +0800 csky: fixup compile error with pte_alloc Commit: 4cf58924951e remove the address argument of pte_alloc without modify csky related code. linux-5.0-rc1 compile failed with csky. Remove the unnecessary address testing in pte_alloc(). Signed-off-by: Guo Ren Cc: Joel Fernandes (Google) Cc: Guenter Roeck Cc: Arnd Bergmann Cc: Linus Torvalds commit d1fc1176c055c9ec9c6ec4d113a284e0bad9d09a Author: Masahiro Yamada Date: Tue Jan 8 12:08:03 2019 +0900 vfio/pci: set TRACE_INCLUDE_PATH to fix the build error drivers/vfio/pci/vfio_pci_nvlink2.c cannot be compiled for in-tree building. CC drivers/vfio/pci/vfio_pci_nvlink2.o In file included from drivers/vfio/pci/trace.h:102, from drivers/vfio/pci/vfio_pci_nvlink2.c:29: ./include/trace/define_trace.h:89:42: fatal error: ./trace.h: No such file or directory #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) ^ compilation terminated. make[1]: *** [scripts/Makefile.build;277: drivers/vfio/pci/vfio_pci_nvlink2.o] Error 1 To fix the build error, let's tell include/trace/define_trace.h the location of drivers/vfio/pci/trace.h Fixes: 7f92891778df ("vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] subdriver") Reported-by: Laura Abbott Signed-off-by: Masahiro Yamada Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson commit d3a28a53630e1ca10f59562ef560e3f70785cb09 Author: Hauke Mehrtens Date: Sun Jan 6 19:50:37 2019 +0100 serial: lantiq: Do not swap register read/writes The ltq_r32() and ltq_w32() macros use the __raw_readl() and __raw_writel() functions which do not swap the value to little endian. On the big endian vrx200 SoC the UART is operated in big endian IO mode, the readl() and write() functions convert the value to little endian first and then the driver does not work any more on this SoC. Currently the vrx200 SoC selects the CONFIG_SWAP_IO_SPACE option, without this option the serial driver would work, but PCI devices do not work any more. This patch makes the driver use the __raw_readl() and __raw_writel() functions which do not swap the endianness. On big endian system it is assumed that the device should be access in big endian IO mode and on a little endian system it would be access in little endian mode. Fixes: 89b8bd2082bb ("serial: lantiq: Use readl/writel instead of ltq_r32/ltq_w32") Signed-off-by: Hauke Mehrtens Acked-by: John Crispin Signed-off-by: Greg Kroah-Hartman commit b9fcb0e6b7052b7e2d18fed1d673f8247060c32c Author: David Brown Date: Mon Jan 7 12:15:03 2019 -0700 usb: storage: Remove outdated URL from MAINTAINERS This website hasn't worked for quite some time. Signed-off-by: David Brown Cc: Matt Dharm Signed-off-by: Greg Kroah-Hartman commit 96354ad79e2e59f9d620669c8e1ac2452440c260 Author: Guo Ren Date: Tue Jan 8 20:17:49 2019 +0800 csky: fixup CACHEV1 store instruction fast retire For I/O access, 810/807 store instruction fast retire will cause wrong primitive. For example: stw (clear interrupt source) stw (unmask interrupt controller) enable interrupt stw is fast retire instruction. When PC is run at enable interrupt stage, the clear interrupt source hasn't finished. It will cause another wrong irq-enter. So use mb() to prevent above. Signed-off-by: Guo Ren Cc: Lu Baoquan commit 64598e8b6fdaf28e37c3530f8b95a9f8ef6af131 Merge: 3bd6e94bec122 03fa483821c0b Author: Ingo Molnar Date: Tue Jan 8 16:31:19 2019 +0100 Merge tag 'perf-core-for-mingo-4.21-20190104' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: perf annotate: Ivan Krylov: - Pass filename to objdump via execl, fixing usage with filenames with special characters. perf report: Jin Yao: Fix wrong iteration count in --branch-history perf stat: Jin Yao: - Fix endless wait for child process perf test: Arnaldo Carvalho de Melo: - Use a fallback to get the pathname in vfs_getname in tools build: Jiri Olsa: - Allow overriding CFLAGS assignments. Misc: Arnaldo Carvalho de Melo: - Syncronize UAPI headers Mattias Jacobsson: - Remove redundant va_end() in strbuf_addv() Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar commit a3869d43c9800cf39496615361c83635fa3e7c82 Author: Corentin Labbe Date: Mon Jan 7 17:22:23 2019 +0000 PCI: amlogic: Fix build failure due to missing gpio header Building the driver when GPIOLIB=n is not selected is causing the following compilation failure: drivers/pci/controller/dwc/pci-meson.c: In function 'meson_pcie_assert_reset': drivers/pci/controller/dwc/pci-meson.c:290:2: error: implicit declaration of function 'gpiod_set_value_cansleep'; did you mean 'gpio_set_value_cansleep'? [-Werror=implicit-function-declaration] gpiod_set_value_cansleep(mp->reset_gpio, 0); ^~~~~~~~~~~~~~~~~~~~~~~~ gpio_set_value_cansleep drivers/pci/controller/dwc/pci-meson.c: In function 'meson_pcie_probe': drivers/pci/controller/dwc/pci-meson.c:540:19: error: implicit declaration of function 'devm_gpiod_get'; did you mean 'devm_gpio_free'? [-Werror=implicit-function-declaration] mp->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); ^~~~~~~~~~~~~~ devm_gpio_free drivers/pci/controller/dwc/pci-meson.c:540:48: error: 'GPIOD_OUT_LOW' undeclared (first use in this function); did you mean 'GPIOF_INIT_LOW'? mp->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); ^~~~~~~~~~~~~ GPIOF_INIT_LOW Add the missing linux/gpio/consumer.h header to fix it. Fixes: 9c0ef6d34fdb ("PCI: amlogic: Add the Amlogic Meson PCIe controller driver") Signed-off-by: Corentin Labbe [lorenzo.pieralisi@arm.com: commit log] Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas commit 735df0ff6ece7b8759a744158f5d246fae4739f4 Author: Greg Kroah-Hartman Date: Fri Dec 21 08:54:40 2018 +0100 Documentation: driver core: remove use of BUS_ATTR We are getting rid of the "raw" BUS_ATTR() macro, so fix up the documentation to not refer to it anymore. Cc: "Rafael J. Wysocki" Signed-off-by: Greg Kroah-Hartman commit dfd32cad146e3624970eee9329e99d2c6ef751b3 Author: Luis Chamberlain Date: Wed Dec 19 12:30:34 2018 -0800 dma-mapping: remove dma_zalloc_coherent() dma_zalloc_coherent() is no longer needed as it has no users because dma_alloc_coherent() already zeroes out memory for us. The Coccinelle grammar rule that used to check for dma_alloc_coherent() + memset() is modified so that it just tells the user that the memset is not needed anymore. Suggested-by: Christoph Hellwig Signed-off-by: Luis Chamberlain Signed-off-by: Christoph Hellwig commit 07a85fe14254e01bcf37f4d2e0a13f093378620b Author: Luis Chamberlain Date: Wed Dec 19 12:24:08 2018 -0800 cross-tree: phase out dma_zalloc_coherent() on headers The last few stragglers coccinelle doesn't pick up are on driver specific header files. Phase those out as well as dma_alloc_coherent() zeroes out the memory as well now too. Suggested-by: Christoph Hellwig Signed-off-by: Luis Chamberlain Signed-off-by: Christoph Hellwig commit 750afb08ca71310fcf0c4e2cb1565c63b8235b60 Author: Luis Chamberlain Date: Fri Jan 4 09:23:09 2019 +0100 cross-tree: phase out dma_zalloc_coherent() We already need to zero out memory for dma_alloc_coherent(), as such using dma_zalloc_coherent() is superflous. Phase it out. This change was generated with the following Coccinelle SmPL patch: @ replace_dma_zalloc_coherent @ expression dev, size, data, handle, flags; @@ -dma_zalloc_coherent(dev, size, handle, flags) +dma_alloc_coherent(dev, size, handle, flags) Suggested-by: Christoph Hellwig Signed-off-by: Luis Chamberlain [hch: re-ran the script on the latest tree] Signed-off-by: Christoph Hellwig commit f553aa1c13cbc29aaf420349a28fc33ca98440e5 Author: Guo Ren Date: Tue Jan 8 19:52:22 2019 +0800 csky: fixup relocation error with 807 & 860 810 doesn't support jsri instruction and csky-as will leave jsri + nop for relocation. Module-probe need replace them with lrw + jsr. Signed-off-by: Guo Ren Cc: Hui Kai commit 81d9bdf59092e4755fc4307c93c4589ef0fe2e0f Author: Christian Lamparter Date: Sun Dec 23 01:31:26 2018 +0100 mtd: rawnand: qcom: fix memory corruption that causes panic This patch fixes a memory corruption that occurred in the qcom-nandc driver since it was converted to nand_scan(). On boot, an affected device will panic from a NPE at a weird place: | Unable to handle kernel NULL pointer dereference at virtual address 0 | pgd = (ptrval) | [00000000] *pgd=00000000 | Internal error: Oops: 80000005 [#1] SMP ARM | CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.9 #0 | Hardware name: Generic DT based system | PC is at (null) | LR is at nand_block_isbad+0x90/0xa4 | pc : [<00000000>] lr : [] psr: 80000013 | sp : cf839d40 ip : 00000000 fp : cfae9e20 | r10: cf815810 r9 : 00000000 r8 : 00000000 | r7 : 00000000 r6 : 00000000 r5 : 00000001 r4 : cf815810 | r3 : 00000000 r2 : cfae9810 r1 : ffffffff r0 : cf815810 | Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none | Control: 10c5387d Table: 8020406a DAC: 00000051 | Process swapper/0 (pid: 1, stack limit = 0x(ptrval)) | [] (nand_block_isbad) from [] | [] (allocate_partition) from [] | [] (add_mtd_partitions) from [] | [] (parse_mtd_partitions) from [] | [] (mtd_device_parse_register) from [] | [] (qcom_nandc_probe) from [] The problem is that the nand_scan()'s qcom_nand_attach_chip callback is updating the nandc->max_cwperpage from 1 to 4. This causes the sg_init_table of clear_bam_transaction() in the driver's qcom_nandc_block_bad() to memset much more than what was initially allocated by alloc_bam_transaction(). This patch restores the old behavior by reallocating the shared bam transaction alloc_bam_transaction() after the chip was identified, but before mtd_device_parse_register() (which is an alias for mtd_device_register() - see panic) gets called. This fixes the corruption and the driver is working again. Cc: stable@vger.kernel.org Fixes: 6a3cec64f18c ("mtd: rawnand: qcom: convert driver to nand_scan()") Signed-off-by: Christian Lamparter Acked-by: Miquel Raynal Signed-off-by: Boris Brezillon commit 2f66196208c98b3d1b4294edffb2c5a8197be899 Author: Sudeep Holla Date: Mon Jan 7 18:51:53 2019 +0000 cpufreq: check if policy is inactive early in __cpufreq_get() cpuinfo_cur_freq gets current CPU frequency as detected by hardware while scaling_cur_freq last known CPU frequency. Some platforms may not allow checking the CPU frequency of an offline CPU or the associated resources may have been released via cpufreq_exit when the CPU gets offlined, in which case the policy would have been invalidated already. If we attempt to get current frequency from the hardware, it may result in hang or crash. For example on Juno, I see: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000188 [0000000000000188] pgd=0000000000000000 Internal error: Oops: 96000004 [#1] PREEMPT SMP Modules linked in: CPU: 5 PID: 4202 Comm: cat Not tainted 4.20.0-08251-ga0f2c0318a15-dirty #87 Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform pstate: 40000005 (nZcv daif -PAN -UAO) pc : scmi_cpufreq_get_rate+0x34/0xb0 lr : scmi_cpufreq_get_rate+0x34/0xb0 Call trace: scmi_cpufreq_get_rate+0x34/0xb0 __cpufreq_get+0x34/0xc0 show_cpuinfo_cur_freq+0x24/0x78 show+0x40/0x60 sysfs_kf_seq_show+0xc0/0x148 kernfs_seq_show+0x44/0x50 seq_read+0xd4/0x480 kernfs_fop_read+0x15c/0x208 __vfs_read+0x60/0x188 vfs_read+0x94/0x150 ksys_read+0x6c/0xd8 __arm64_sys_read+0x24/0x30 el0_svc_common+0x78/0x100 el0_svc_handler+0x38/0x78 el0_svc+0x8/0xc ---[ end trace 3d1024e58f77f6b2 ]--- So fix the issue by checking if the policy is invalid early in __cpufreq_get before attempting to get the current frequency. Signed-off-by: Sudeep Holla Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 6529870cb0323823f49b3e95d1760383910f96cd Author: Madhavan Srinivasan Date: Sun Dec 9 14:55:36 2018 +0530 powerpc/perf: Update perf_regs structure to include MMCRA On each sample, Monitor Mode Control Register A (MMCRA) content is saved in pt_regs. MMCRA does not have a entry as-is in the pt_regs but instead, MMCRA content is saved in the "dsisr" register of pt_regs. Patch adds another entry to the perf_regs structure to include the "MMCRA" printing which internally maps to the "dsisr" of pt_regs. It also check for the MMCRA availability in the platform and present value accordingly mpe: This was the 2nd patch in a series with commit 333804dc3b7a ("powerpc/perf: Update perf_regs structure to include SIER") but I accidentally only merged the 1st patch, so merge this one now. Signed-off-by: Madhavan Srinivasan Signed-off-by: Michael Ellerman commit 1524f4e47f90b27a3ac84efbdd94c63172246a6f Author: Dan Carpenter Date: Tue Jan 8 10:43:30 2019 +0300 ALSA: cs46xx: Potential NULL dereference in probe The "chip->dsp_spos_instance" can be NULL on some of the ealier error paths in snd_cs46xx_create(). Reported-by: "Yavuz, Tuba" Signed-off-by: Dan Carpenter Cc: Signed-off-by: Takashi Iwai commit a77d1d196bc63b37d9b4d1b614884669e8e79d32 Author: Tycho Andersen Date: Mon Jan 7 16:16:31 2019 -0700 samples/seccomp: Fix 32-bit build Both the .o and the actual executable need to be built with -m32 in order to link correctly. Reported-by: Ingo Molnar Signed-off-by: Tycho Andersen Reviewed-by: Kees Cook Cc: Borislav Petkov Cc: James Morris Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: fec7b6690541 ("samples: add an example of seccomp user trap") Link: http://lkml.kernel.org/r/20190107231631.1849-1-tycho@tycho.ws Signed-off-by: Ingo Molnar commit b0407d820b65272fcaa77e0dd1347dc7678d23b8 Author: Gustavo A. R. Silva Date: Mon Jan 7 12:34:31 2019 -0600 hwmon: (occ) Fix potential integer overflow Cast get_unaligned_be32(...) to u64 in order to give the compiler complete information about the proper arithmetic to use and avoid a potential integer overflow. Notice that such function call is used in contexts that expect expressions of type u64 (64 bits, unsigned); and the following expressions are currently being evaluated using 32-bit arithmetic: val = get_unaligned_be32(&power->update_tag) * occ->powr_sample_time_us; val = get_unaligned_be32(&power->vdn.update_tag) * occ->powr_sample_time_us; Addresses-Coverity-ID: 1442357 ("Unintentional integer overflow") Addresses-Coverity-ID: 1442476 ("Unintentional integer overflow") Addresses-Coverity-ID: 1442508 ("Unintentional integer overflow") Fixes: ff692d80b2e2 ("hwmon (occ): Add sensor types and versions") Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Reviewed-by: Eddie James Signed-off-by: Guenter Roeck commit 977e4899c9b4bea787531b0837af5ed442e3118f Merge: 26d92e951fe0a 2dc0f02da14e1 Author: David S. Miller Date: Mon Jan 7 22:49:35 2019 -0500 Merge ra.kernel.org:/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2019-01-08 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) Fix BSD'ism in sendmsg(2) to rewrite unspecified IPv6 dst for unconnected UDP sockets with [::1] _after_ cgroup BPF invocation, from Andrey. 2) Follow-up fix to the speculation fix where we need to reject a corner case for sanitation when ptr and scalars are mixed in the same alu op. Also, some unrelated minor doc fixes, from Daniel. 3) Fix BPF kselftest's incorrect uses of create_and_get_cgroup() by not assuming fd of zero value to be the result of an error case, from Stanislav. ==================== Signed-off-by: David S. Miller commit 2dc0f02da14e19f510694f8d8bbcb0f2f63e0646 Merge: a8911d6d58785 80f21ff987eb3 Author: Alexei Starovoitov Date: Mon Jan 7 15:52:00 2019 -0800 Merge branch 'bpf-doc-updates' Daniel Borkmann says: ==================== Two trivial doc follow-ups to i) remove deprecated kern_version mentioning in the design qa and ii) to mention stand-alone build and license of libbpf. Thanks! ==================== Signed-off-by: Alexei Starovoitov commit 80f21ff987eb377140d27102285f8dd1167b335c Author: Daniel Borkmann Date: Mon Jan 7 22:57:18 2019 +0100 bpf, doc: add note for libbpf's stand-alone build Given this came up couple of times, add a note to libbpf's readme about the semi-automated mirror for a stand-alone build which is officially managed by BPF folks. While at it, also explicitly state the libbpf license in the readme file. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Signed-off-by: Alexei Starovoitov commit a769fa7208b94f37b6240215dc6970f9d76fc58c Author: Daniel Borkmann Date: Mon Jan 7 22:57:17 2019 +0100 bpf, doc: update design qa to reflect kern_version requirement Update the bpf_design_QA.rst to also reflect recent changes in 6c4fc209fcf9 ("bpf: remove useless version check for prog load"). Suggested-by: Quentin Monnet Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Signed-off-by: Alexei Starovoitov commit c64a2b0516a02361d8deb1f038647c29020d0852 Author: Souptick Joarder Date: Sat Jan 5 01:00:29 2019 +0530 ceph: use vmf_error() in ceph_filemap_fault() This code is converted to use vmf_error(). Signed-off-by: Souptick Joarder Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 02b2f549d502b46e68b97ea1452fb8853b3327dd Author: Dongsheng Yang Date: Tue Dec 18 04:31:48 2018 -0500 libceph: allow setting abort_on_full for rbd Introduce a new option abort_on_full, default to false. Then we can get -ENOSPC when the pool is full, or reaches quota. [ Don't show abort_on_full in /proc/mounts. ] Signed-off-by: Dongsheng Yang Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 565dc8a4f55e491935bfb04866068d21784ea9a4 Author: Alban Bedel Date: Mon Jan 7 20:45:15 2019 +0100 MIPS: ath79: Enable OF serial ports in the default config CONFIG_SERIAL_OF_PLATFORM is needed to get a working console on the OF boards, enable it in the default config to get a working setup out of the box. Signed-off-by: Alban Bedel Signed-off-by: Paul Burton Cc: linux-mips@vger.kernel.org Cc: Ralf Baechle Cc: James Hogan Cc: linux-kernel@vger.kernel.org commit 390d1b461eec4b15aed78df0ce72a5c4bc40d619 Author: Hauke Mehrtens Date: Sun Jan 6 19:44:12 2019 +0100 MIPS: lantiq: Use CP0_LEGACY_COMPARE_IRQ Instead of using the lantiq specific MIPS_CPU_TIMER_IRQ use the generic CP0_LEGACY_COMPARE_IRQ constant for the timer interrupt number. MIPS_CPU_TIMER_IRQ was already defined to 7 for both supported SoC families. Signed-off-by: Hauke Mehrtens Signed-off-by: Paul Burton Cc: jhogan@kernel.org Cc: ralf@linux-mips.org Cc: john@phrozen.org Cc: linux-mips@linux-mips.org Cc: linux-mips@vger.kernel.org commit 2b4dba55b04b212a7fd1f0395b41d79ee3a9801b Author: Hauke Mehrtens Date: Sun Jan 6 19:44:11 2019 +0100 MIPS: lantiq: Fix IPI interrupt handling This makes SMP on the vrx200 work again, by removing all the MIPS CPU interrupt specific code and making it fully use the generic MIPS CPU interrupt controller. The mti,cpu-interrupt-controller from irq-mips-cpu.c now handles the CPU interrupts and also the IPI interrupts which are used to communication between the CPUs in a SMP system. The generic interrupt code was already used before but the interrupt vectors were overwritten again when we called set_vi_handler() in the lantiq interrupt driver and we also provided our own plat_irq_dispatch() function which overwrote the weak generic implementation. Now the code uses the generic handler for the MIPS CPU interrupts including the IPI interrupts and registers a handler for the CPU interrupts which are handled by the lantiq ICU with irq_set_chained_handler() which was already called before. Calling the set_c0_status() function is also not needed any more because the generic MIPS CPU interrupt already activates the needed bits. Fixes: 1eed40043579 ("MIPS: smp-mt: Use CPU interrupt controller IPI IRQ domain support") Cc: stable@kernel.org # v4.12 Signed-off-by: Hauke Mehrtens Signed-off-by: Paul Burton Cc: jhogan@kernel.org Cc: ralf@linux-mips.org Cc: john@phrozen.org Cc: linux-mips@linux-mips.org Cc: linux-mips@vger.kernel.org commit a8911d6d5878587767a78c6bde371298ca2a3be3 Author: Stanislav Fomichev Date: Mon Jan 7 09:46:46 2019 -0800 selftests/bpf: fix incorrect users of create_and_get_cgroup We have some tests that assume create_and_get_cgroup returns -1 on error which is incorrect (it returns 0 on error). Since fd might be zero in general case, change create_and_get_cgroup to return -1 on error and fix the users that assume 0 on error. Fixes: f269099a7e7a ("tools/bpf: add a selftest for bpf_get_current_cgroup_id() helper") Fixes: 7d2c6cfc5411 ("bpf: use --cgroup in test_suite if supplied") v2: - instead of fixing the uses that assume -1 on error, convert the users that assume 0 on error (fd might be zero in general case) Signed-off-by: Stanislav Fomichev Signed-off-by: Alexei Starovoitov commit a9666c1cae8dbcd1a9aacd08a778bf2a28eea300 Author: Leon Romanovsky Date: Mon Dec 24 11:05:16 2018 +0200 RDMA/nldev: Don't expose unsafe global rkey to regular user Unsafe global rkey is considered dangerous because it exposes memory registered for all memory in the system. Only users with a QP on the same PD can use the rkey, and generally those QPs will already know the value. However, out of caution, do not expose the value to unprivleged users on the local system. Require CAP_NET_ADMIN instead. Cc: # 4.16 Fixes: 29cf1351d450 ("RDMA/nldev: provide detailed PD information") Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 26d92e951fe0a44ee4aec157cabb65a818cc8151 Author: Cong Wang Date: Sat Jan 5 23:45:26 2019 -0800 smc: move unhash as early as possible in smc_release() In smc_release() we release smc->clcsock before unhash the smc sock, but a parallel smc_diag_dump() may be still reading smc->clcsock, therefore this could cause a use-after-free as reported by syzbot. Reported-and-tested-by: syzbot+fbd1e5476e4c94c7b34e@syzkaller.appspotmail.com Fixes: 51f1de79ad8e ("net/smc: replace sock_put worker by socket refcounting") Cc: Ursula Braun Signed-off-by: Cong Wang Reported-by: syzbot+0bf2e01269f1274b4b03@syzkaller.appspotmail.com Reported-by: syzbot+e3132895630f957306bc@syzkaller.appspotmail.com Signed-off-by: David S. Miller commit 7acf8b36a2ac6eb4fdc53c4d862570089e56c69e Author: Jason Gunthorpe Date: Mon Jan 7 17:54:14 2019 +0000 phy: ti: Fix compilation failures without REGMAP This driver requires regmap or the compile fails: drivers/phy/ti/phy-gmii-sel.c:43:27: error: array type has incomplete element type ‘struct reg_field’ const struct reg_field (*regfields)[PHY_GMII_SEL_LAST]; Add it to kconfig. Signed-off-by: Jason Gunthorpe Signed-off-by: David S. Miller commit f687ccea10d23a9b0faed67ceac535b76604669a Author: Gal Pressman Date: Mon Jan 7 13:36:56 2019 +0200 RDMA/uverbs: Fix post send success return value in case of error If get QP object fails 'ret' must be assigned with a proper error code. Fixes: 9a0738575f26 ("RDMA/uverbs: Use uverbs_response() for remaining response copying") Signed-off-by: Gal Pressman Signed-off-by: Jason Gunthorpe commit 6b68835b5af4feb2a3f31592a52a1a68d7c1b1f3 Author: Qian Cai Date: Mon Jan 7 16:42:07 2019 +0000 ACPI/IORT: Fix build when CONFIG_IOMMU_API=n Commit 8097e53eaba2 ("ACPI/IORT: Use helper functions to access dev->iommu_fwspec") changed by mistake the iort_fwspec_iommu_ops() stub definition (compiled in when CONFIG_IOMMU_API=n), that caused the following compilation failure: drivers/acpi/arm64/iort.c:880:1: error: expected identifier or '(' before '{' token { return NULL; } ^ drivers/acpi/arm64/iort.c:879:39: warning: 'iort_fwspec_iommu_ops' used but never defined static inline const struct iommu_ops *iort_fwspec_iommu_ops(struct device *dev); ^~~~~~~~~~~~~~~~~~~~~ Fix it. Fixes: 8097e53eaba2 ("ACPI/IORT: Use helper functions to access dev->iommu_fwspec") Signed-off-by: Qian Cai [lorenzo.pieralisi@arm.com: updated tags and log] Signed-off-by: Lorenzo Pieralisi Acked-by: Hanjun Guo Cc: Will Deacon Cc: Sudeep Holla Cc: Catalin Marinas Cc: Joerg Roedel Signed-off-by: Will Deacon commit 4c84edc11b76590859b1e45dd676074c59602dc4 Author: JianJhen Chen Date: Sun Jan 6 11:28:13 2019 +0800 net: bridge: fix a bug on using a neighbour cache entry without checking its state When handling DNAT'ed packets on a bridge device, the neighbour cache entry from lookup was used without checking its state. It means that a cache entry in the NUD_STALE state will be used directly instead of entering the NUD_DELAY state to confirm the reachability of the neighbor. This problem becomes worse after commit 2724680bceee ("neigh: Keep neighbour cache entries if number of them is small enough."), since all neighbour cache entries in the NUD_STALE state will be kept in the neighbour table as long as the number of cache entries does not exceed the value specified in gc_thresh1. This commit validates the state of a neighbour cache entry before using the entry. Signed-off-by: JianJhen Chen Reviewed-by: JinLin Chen Signed-off-by: David S. Miller commit 801009424e05cf110f016d7fac7fcf20ef94941a Merge: 2cffc9569050a 5aeb1b36cedd3 Author: Palmer Dabbelt Date: Mon Jan 7 08:45:47 2019 -0800 Fix a handful of audit-related issue This is sort of a mix between a new feature and a bug fix. I've managed to screw up merging this patch set a handful of times but I think it's OK this time around. The main new feature here is audit support for RISC-V, with some fixes to audit-related bugs that cropped up along the way: * The addition of NR_syscalls into unistd.h, which is necessary for CONFIG_FTRACE_SYSCALLS. * The definition of CREATE_TRACE_POINTS so __tracepoint_sys_{enter,exit} get defined. * A fix for trace_sys_exit() so we can enable CONFIG_HAVE_SYSCALL_TRACEPOINTS. commit f87d8ad9233f115db92c6c087d58403b0009ed36 Author: Gustavo A. R. Silva Date: Sat Jan 5 10:52:23 2019 -0600 tipc: fix memory leak in tipc_nl_compat_publ_dump There is a memory leak in case genlmsg_put fails. Fix this by freeing *args* before return. Addresses-Coverity-ID: 1476406 ("Resource leak") Fixes: 46273cf7e009 ("tipc: fix a missing check of genlmsg_put") Signed-off-by: Gustavo A. R. Silva Acked-by: Ying Xue Signed-off-by: David S. Miller commit a29c3c09bad18ac2c91dfdbcc892a7a37e407227 Author: Bjørn Mork Date: Sat Jan 5 14:32:39 2019 +0100 cdc_ether: trivial whitespace readability fix This function is unreadable enough without indenting mismatches and unnecessary line breaks. Signed-off-by: Bjørn Mork Signed-off-by: David S. Miller commit 3483254b89438e60f719937376c5e0ce2bc46761 Author: Jack Stocker Date: Thu Jan 3 21:56:53 2019 +0000 USB: Add USB_QUIRK_DELAY_CTRL_MSG quirk for Corsair K70 RGB To match the Corsair Strafe RGB, the Corsair K70 RGB also requires USB_QUIRK_DELAY_CTRL_MSG to completely resolve boot connection issues discussed here: https://github.com/ckb-next/ckb-next/issues/42. Otherwise roughly 1 in 10 boots the keyboard will fail to be detected. Patch that applied delay control quirk for Corsair Strafe RGB: cb88a0588717 ("usb: quirks: add control message delay for 1b1c:1b20") Previous K70 RGB patch to add delay-init quirk: 7a1646d92257 ("Add delay-init quirk for Corsair K70 RGB keyboards") Signed-off-by: Jack Stocker Cc: stable Signed-off-by: Greg Kroah-Hartman commit ff2a8c532c14fd22fb26a36574d9ff199afbbe54 Author: Saranya Gopal Date: Sun Jan 6 08:14:02 2019 +0530 usbcore: Select only first configuration for non-UAC3 compliant devices In most of the UAC1 and UAC2 audio devices, the first configuration is most often the best configuration. However, with recent patch to support UAC3 configuration, second configuration was unintentionally chosen for some of the UAC1/2 devices that had more than one configuration. This was because of the existing check after the audio config check which selected any config which had a non-vendor class. This patch fixes this issue. Fixes: f13912d3f014 ("usbcore: Select UAC3 configuration for audio if present") Reported-by: Con Kolivas Signed-off-by: Saranya Gopal Tested-by: Con Kolivas Cc: stable Signed-off-by: Greg Kroah-Hartman commit 0a99cc4b8ee83885ab9f097a3737d1ab28455ac0 Author: Icenowy Zheng Date: Thu Jan 3 11:26:18 2019 +0800 USB: storage: add quirk for SMI SM3350 The SMI SM3350 USB-UFS bridge controller cannot handle long sense request correctly and will make the chip refuse to do read/write when requested long sense. Add a bad sense quirk for it. Signed-off-by: Icenowy Zheng Cc: stable Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman commit c5603d2fdb424849360fe7e3f8c1befc97571b8c Author: Icenowy Zheng Date: Thu Jan 3 11:26:17 2019 +0800 USB: storage: don't insert sane sense for SPC3+ when bad sense specified Currently the code will set US_FL_SANE_SENSE flag unconditionally if device claims SPC3+, however we should allow US_FL_BAD_SENSE flag to prevent this behavior, because SMI SM3350 UFS-USB bridge controller, which claims SPC4, will show strange behavior with 96-byte sense (put the chip into a wrong state that cannot read/write anything). Check the presence of US_FL_BAD_SENSE when assuming US_FL_SANE_SENSE on SPC4+ devices. Signed-off-by: Icenowy Zheng Cc: stable Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman commit 34aabf918717dd14e05051896aaecd3b16b53d95 Author: Daniele Palmas Date: Fri Dec 28 16:15:41 2018 +0100 usb: cdc-acm: send ZLP for Telit 3G Intel based modems Telit 3G Intel based modems require zero packet to be sent if out data size is equal to the endpoint max packet size. Signed-off-by: Daniele Palmas Cc: stable Signed-off-by: Greg Kroah-Hartman commit 5aeb1b36cedd3a1dfdbfe368629fed52dee34103 Author: David Abdurachmanov Date: Thu Dec 6 16:26:35 2018 +0100 riscv: add HAVE_SYSCALL_TRACEPOINTS to Kconfig I looked into Documentation/trace/ftrace-design.rst and, I think, we check all the boxes needed for HAVE_SYSCALL_TRACEPOINTS. Signed-off-by: David Abdurachmanov Signed-off-by: Palmer Dabbelt commit 775800b0f1d7303d4fd8ce0e0d9eca4ff2f338f2 Author: David Abdurachmanov Date: Thu Dec 6 16:26:34 2018 +0100 riscv: fix trace_sys_exit hook Fix compilation error. Signed-off-by: David Abdurachmanov Signed-off-by: Palmer Dabbelt commit 008e901b70282183b52ee80d838d2994b2610231 Author: David Abdurachmanov Date: Mon Dec 10 21:43:55 2018 +0100 riscv: define CREATE_TRACE_POINTS in ptrace.c Define CREATE_TRACE_POINTS in order to create functions and structures for the trace events. This is needed if HAVE_SYSCALL_TRACEPOINTS and CONFIG_FTRACE_SYSCALLS are enabled, otherwise we get linking errors: [..] MODPOST vmlinux.o kernel/trace/trace_syscalls.o: In function `.L0 ': trace_syscalls.c:(.text+0x1152): undefined reference to `__tracepoint_sys_enter' trace_syscalls.c:(.text+0x126c): undefined reference to `__tracepoint_sys_enter' trace_syscalls.c:(.text+0x1328): undefined reference to `__tracepoint_sys_enter' trace_syscalls.c:(.text+0x14aa): undefined reference to `__tracepoint_sys_enter' trace_syscalls.c:(.text+0x1684): undefined reference to `__tracepoint_sys_exit' trace_syscalls.c:(.text+0x17a0): undefined reference to `__tracepoint_sys_exit' trace_syscalls.c:(.text+0x185c): undefined reference to `__tracepoint_sys_exit' trace_syscalls.c:(.text+0x19de): undefined reference to `__tracepoint_sys_exit' arch/riscv/kernel/ptrace.o: In function `.L0 ': ptrace.c:(.text+0x4dc): undefined reference to `__tracepoint_sys_enter' ptrace.c:(.text+0x632): undefined reference to `__tracepoint_sys_exit' make: *** [Makefile:1036: vmlinux] Error 1 Signed-off-by: David Abdurachmanov Fixes: b78002b395b4 ("riscv: add HAVE_SYSCALL_TRACEPOINTS to Kconfig") Signed-off-by: Palmer Dabbelt commit 45ef1aa8a0e3b0da449c619035b0841f28abca63 Author: David Abdurachmanov Date: Mon Dec 10 21:43:54 2018 +0100 riscv: define NR_syscalls in unistd.h This macro is used by kernel/trace/{trace.h,trace_syscalls.c} if we have CONFIG_FTRACE_SYSCALLS enabled. Signed-off-by: David Abdurachmanov Fixes: b78002b395b4 ("riscv: add HAVE_SYSCALL_TRACEPOINTS to Kconfig") Signed-off-by: Palmer Dabbelt commit 0aea89430a4c79c65c541c947497007d33fbe002 Author: David Abdurachmanov Date: Mon Oct 29 11:48:54 2018 +0100 riscv: audit: add audit hook in do_syscall_trace_enter/exit() This patch adds auditing functions on entry to and exit from every system call invocation. Signed-off-by: David Abdurachmanov Signed-off-by: Palmer Dabbelt commit efe75c494f57890900caf6c8a0667db35bfaf56a Author: David Abdurachmanov Date: Mon Oct 29 11:48:53 2018 +0100 riscv: add audit support On RISC-V (riscv) audit is supported through generic lib/audit.c. The patch adds required arch specific definitions. Signed-off-by: David Abdurachmanov Signed-off-by: Palmer Dabbelt commit 2cffc9569050a8dbc0c4a6ee7186c0919487c3ec Author: Zong Li Date: Fri Dec 7 17:02:16 2018 +0800 RISC-V: Support MODULE_SECTIONS mechanism on RV32 This patch supports dynamic generate got and plt sections mechanism on rv32. It contains the modification as follows: - Always enable MODULE_SECTIONS (both rv64 and rv32) - Change the fixed size type. This patch had been tested by following modules: btrfs 6795991 0 - Live 0xa544b000 test_static_keys 17304 0 - Live 0xa28be000 zstd_compress 1198986 1 btrfs, Live 0xa2a25000 zstd_decompress 608112 1 btrfs, Live 0xa24e7000 lzo 8787 0 - Live 0xa2049000 xor 27461 1 btrfs, Live 0xa2041000 zram 78849 0 - Live 0xa2276000 netdevsim 55909 0 - Live 0xa202d000 tun 211534 0 - Live 0xa21b5000 fuse 566049 0 - Live 0xa25fb000 nfs_layout_flexfiles 192597 0 - Live 0xa229b000 ramoops 74895 0 - Live 0xa2019000 xfs 3973221 0 - Live 0xa507f000 libcrc32c 3053 2 btrfs,xfs, Live 0xa34af000 lzo_compress 17302 2 btrfs,lzo, Live 0xa347d000 lzo_decompress 7178 2 btrfs,lzo, Live 0xa3451000 raid6_pq 142086 1 btrfs, Live 0xa33a4000 reed_solomon 31022 1 ramoops, Live 0xa31eb000 test_bitmap 3734 0 - Live 0xa31af000 test_bpf 1588736 0 - Live 0xa2c11000 test_kmod 41161 0 - Live 0xa29f8000 test_module 1356 0 - Live 0xa299e000 test_printf 6024 0 [permanent], Live 0xa2971000 test_static_key_base 5797 1 test_static_keys, Live 0xa2931000 test_user_copy 4382 0 - Live 0xa28c9000 xxhash 70501 2 zstd_compress,zstd_decompress, Live 0xa2055000 Signed-off-by: Zong Li Signed-off-by: Palmer Dabbelt commit 3b56adcf94d03533666e87e41d23ac91756cec9b Author: Paul Walmsley Date: Mon Dec 17 16:09:59 2018 -0800 MAINTAINERS: SiFive drivers: add myself as a SiFive driver maintainer I'll be helping Palmer review drivers for SiFive-specific IP blocks, so add myself to the MAINTAINERS file. Cc: Albert Ou Cc: Palmer Dabbelt Cc: linux-kernel@vger.kernel.org Cc: linux-riscv@lists.infradead.org Signed-off-by: Paul Walmsley Signed-off-by: Paul Walmsley Signed-off-by: Palmer Dabbelt commit af5f462c2d9ed227ffca4c8d02eb38679c9b8846 Author: Paul Walmsley Date: Mon Dec 17 16:09:58 2018 -0800 MAINTAINERS: SiFive drivers: change the git tree to a SiFive git tree Update the git tree URL for drivers for SiFive-related IP blocks to point to a SiFive-managed URL. Cc: Albert Ou Cc: Palmer Dabbelt Cc: linux-kernel@vger.kernel.org Cc: linux-riscv@lists.infradead.org Signed-off-by: Paul Walmsley Signed-off-by: Paul Walmsley Signed-off-by: Palmer Dabbelt commit 37a107ff6dcd773da4dc75b62b9bf4349dd7300f Author: Andreas Schwab Date: Tue Dec 11 11:20:40 2018 +0100 riscv: don't stop itself in smp_send_stop Add IPI_CPU_STOP message and use it in smp_send_stop to stop other cpus, but not itself. Mark cpu offline on reception of IPI_CPU_STOP. Signed-off-by: Andreas Schwab Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 8fd6e05c7463b635e51ec7df0a1858c1b5a6e350 Author: Paul Walmsley Date: Mon Dec 17 19:15:12 2018 -0800 arch: riscv: support kernel command line forcing when no DTB passed CONFIG_CMDLINE_FORCE doesn't work on RISC-V when no DTB is passed into the kernel. This is because the code that forces the kernel command line only runs if a valid DTB is present at boot. During debugging, it's useful to have the ability to force kernel command lines even when no DTB is present. This patch adds support for doing so. Cc: Palmer Dabbelt Cc: Albert Ou Cc: linux-riscv@lists.infradead.org Cc: linux-kernel@vger.kernel.org (open list) Signed-off-by: Paul Walmsley Signed-off-by: Paul Walmsley Signed-off-by: Palmer Dabbelt commit d0df00e30e4bf9bc27ddbd092ad683ff6121b360 Author: Aurelien Jarno Date: Tue Dec 25 15:46:24 2018 +0100 tools uapi: fix RISC-V 64-bit support The BPF library is not built on 64-bit RISC-V, as the BPF feature is not detected. Looking more in details, feature/test-bpf.c fails to build with the following error: | In file included from /tmp/linux-4.19.12/tools/include/uapi/asm/bitsperlong.h:17, | from /tmp/linux-4.19.12/tools/include/uapi/asm-generic/unistd.h:2, | from /usr/include/riscv64-linux-gnu/asm/unistd.h:1, | from test-bpf.c:2: | /tmp/linux-4.19.12/tools/include/asm-generic/bitsperlong.h:14:2: error: #error Inconsistent word size. Check asm/bitsperlong.h | #error Inconsistent word size. Check asm/bitsperlong.h | ^~~~~ The UAPI from the tools directory is missing RISC-V support, therefore bitsperlong.h from asm-generic is used, defaulting to 32 bits. Fix that by adding tools/arch/riscv/include/uapi/asm/bitsperlong.h as a copy of arch/riscv/include/uapi/asm/bitsperlong.h and by updating tools/include/uapi/asm/bitsperlong.h. Signed-off-by: Aurelien Jarno Signed-off-by: Palmer Dabbelt commit 22e6a2e14cb8ebcae059488cf24e778e4058c2bf Author: Anup Patel Date: Wed Dec 19 18:06:57 2018 +0530 RISC-V: Make BSS section as the last section in vmlinux.lds.S The objcopy only emits loadable sections when creating flat kernel Image. To have minimal possible size of flat kernel Image, we should have all non-loadable sections after loadable sections. Currently, execption table section (loadable section) is after BSS section (non-loadable section) in the RISC-V vmlinux.lds.S. This is not optimal for having minimal flat kernel Image size hence this patch makes BSS section as the last section in RISC-V vmlinux.lds.S. In addition, we make BSS section aligned to 16byte instead of PAGE aligned which further reduces flat kernel Image size by few KBs. The flat kernel Image size of Linux-4.20-rc4 using GCC 8.2.0 is 8819980 bytes with current RISC-V vmlinux.lds.S and it reduces to 7991740 bytes with this patch applied. In summary, this patch reduces Linux-4.20-rc4 flat kernel Image size by 809 KB. Signed-off-by: Anup Patel Reviewed-by: Bin Meng Signed-off-by: Palmer Dabbelt commit d0c2d2101b4c1a41e6ebeca6a28c70df43d2a6a3 Author: Kunihiko Hayashi Date: Fri Nov 9 10:42:07 2018 +0900 reset: uniphier-glue: Add AHCI reset control support in glue layer Add a reset line included in AHCI glue layer to enable AHCI core implemented in UniPhier SoCs. Signed-off-by: Kunihiko Hayashi Signed-off-by: Philipp Zabel commit 69af3d1b8a91cf9b426c4238964df847036bf214 Author: Kunihiko Hayashi Date: Fri Nov 9 10:42:06 2018 +0900 dt-bindings: reset: uniphier: Add AHCI core reset description Add compatible strings for reset control of AHCI core implemented in UniPhier SoCs. The reset control belongs to AHCI glue layer. Signed-off-by: Kunihiko Hayashi Reviewed-by: Rob Herring Signed-off-by: Philipp Zabel commit 3eb8f765f5aeca6e4195246f41e534025f69eee8 Author: Kunihiko Hayashi Date: Fri Nov 9 10:42:05 2018 +0900 reset: uniphier-usb3: Rename to reset-uniphier-glue This driver works for controlling the reset lines including USB3 glue layer, however, this can be applied to other glue layers. Now this patch renames the driver from "reset-uniphier-usb3" to "reset-uniphier-glue". At the same time, this changes CONFIG_RESET_UNIPHIER_USB3 to CONFIG_RESET_UNIPHIER_GLUE. Signed-off-by: Kunihiko Hayashi Signed-off-by: Philipp Zabel commit 21b22136b4330abd1467e59fbe651ae4d18f0357 Author: Kunihiko Hayashi Date: Fri Nov 9 10:42:04 2018 +0900 dt-bindings: reset: uniphier: Replace the expression of USB3 with generic peripherals Replace the expression of "USB3 glue layer" with the glue layer of the generic peripherals to allow other devices to use it. The reset control belongs to this glue layer. Signed-off-by: Kunihiko Hayashi Reviewed-by: Rob Herring Signed-off-by: Philipp Zabel commit a277105b239bdcb6490ec51366413643dbc8ed4a Author: Dinh Nguyen Date: Mon Nov 5 14:05:49 2018 -0600 ARM: socfpga: dts: document "altr,stratix10-rst-mgr" binding "altr,stratix10-rst-mgr" is used for the Stratix10 reset manager. Signed-off-by: Dinh Nguyen Signed-off-by: Philipp Zabel commit b3ca9888f35fa6919569cf27c929dc0ac49e9716 Author: Dinh Nguyen Date: Tue Nov 13 12:50:48 2018 -0600 reset: socfpga: add an early reset driver for SoCFPGA Create a separate reset driver that uses the reset operations in reset-simple. The reset driver for the SoCFPGA platform needs to register early in order to be able bring online timers that needed early in the kernel bootup. We do not need this early reset driver for Stratix10, because on arm64, Linux does not need the timers are that in reset. Linux is able to run just fine with the internal armv8 timer. Thus, we use a new binding "altr,stratix10-rst-mgr" for the Stratix10 platform. The Stratix10 platform will continue to use the reset-simple platform driver, while the 32-bit platforms(Cyclone5/Arria5/Arria10) will use the early reset driver. Signed-off-by: Dinh Nguyen [p.zabel@pengutronix.de: fixed socfpga of_device_id in reset-simple] Signed-off-by: Philipp Zabel commit 151f72f493f2605ebbed0198362eed05918ed839 Author: Colin Ian King Date: Wed Nov 14 21:49:35 2018 +0000 reset: fix null pointer dereference on dev by dev_name The call to dev_name will dereference dev, however, dev is later being null checked, so there is a possibility of a null pointer dereference on dev by the call to dev_name. Fix this by null checking dev first before the call to dev_name Detected by CoverityScan, CID#1475475 ("Dereference before null check") Fixes: 2a6cb2b1d83b ("reset: Add reset_control_get_count()") Signed-off-by: Colin Ian King Signed-off-by: Philipp Zabel commit eaf91db0ab22dc2c664a9782f2f31dcbc410f3b5 Author: Geert Uytterhoeven Date: Tue Nov 13 13:47:44 2018 +0100 reset: Add reset_control_get_count() Currently the reset core has internal support for counting the number of resets for a device described in DT. Generalize this to devices using lookup resets, and export it for public use. This will be used by generic drivers that need to be sure a device is controlled by a single, dedicated reset line (e.g. vfio-platform). Signed-off-by: Geert Uytterhoeven [p.zabel@pengutronix.de: fixed a typo in reset_control_get_count comment] Signed-off-by: Philipp Zabel commit 12c62b9d6ce57d37f3c03cc902c30498909fbc42 Author: Geert Uytterhoeven Date: Mon Oct 8 13:15:43 2018 +0200 reset: Improve reset controller kernel docs Grammar and indentation fixes. Signed-off-by: Geert Uytterhoeven [p.zabel@pengutronix.de: dropped "shared among" -> "shared between"] Signed-off-by: Philipp Zabel commit 42f03ab3c75197e8fec2dbd6b50bc699619aab9b Author: Eugeniy Paltsev Date: Wed Oct 17 17:05:52 2018 +0300 ARC: HSDK: improve reset driver As for today HSDK reset driver implements only .reset() callback. In case of driver which implements one of standard reset controller usage pattern (call *_deassert() in probe(), call *_assert() in remove()) that leads to inoperability of this reset driver. Improve HSDK reset driver by calling .reset() callback inside of .deassert() callback to avoid each reset controller user adaptation for work with both reset methods (reset() and {.assert() & .deassert()} pair) Signed-off-by: Eugeniy Paltsev Signed-off-by: Philipp Zabel commit eeb2c4fb6a3d0ebed35fbc13a255f691c8b8d7e5 Author: Jacob Wen Date: Mon Jan 7 09:59:59 2019 +0800 rds: use DIV_ROUND_UP instead of ceil Yes indeed, DIV_ROUND_UP is in kernel.h. Signed-off-by: Jacob Wen Signed-off-by: David S. Miller commit 10262b0b53666cbc506989b17a3ead1e9c3b43b4 Author: Heiner Kallweit Date: Sun Jan 6 20:44:00 2019 +0100 r8169: don't try to read counters if chip is in a PCI power-save state Avoid log spam caused by trying to read counters from the chip whilst it is in a PCI power-save state. Reference: https://bugzilla.kernel.org/show_bug.cgi?id=107421 Fixes: 1ef7286e7f36 ("r8169: Dereference MMIO address immediately before use") Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 7775665aadc48a562051834a73519129bf717d73 Author: Larry Finger Date: Wed Jan 2 20:12:47 2019 -0600 staging: rtl8188eu: Fix module loading from tasklet for WEP encryption Commit 2b2ea09e74a5 ("staging:r8188eu: Use lib80211 to decrypt WEP-frames") causes scheduling while atomic bugs followed by a hard freeze whenever the driver tries to connect to a WEP-encrypted network. Experimentation showed that the freezes were eliminated when module lib80211 was preloaded, which can be forced by calling lib80211_get_crypto_ops() directly rather than indirectly through try_then_request_module(). With this change, no BUG messages are logged. Fixes: 2b2ea09e74a5 ("staging:r8188eu: Use lib80211 to decrypt WEP-frames") Cc: Stable # v4.17+ Cc: Michael Straube Cc: Ivan Safonov Signed-off-by: Larry Finger Signed-off-by: Greg Kroah-Hartman commit 84cad97a717f5749a0236abd5ce68da582ea074f Author: Larry Finger Date: Wed Jan 2 20:12:46 2019 -0600 staging: rtl8188eu: Fix module loading from tasklet for CCMP encryption Commit 6bd082af7e36 ("staging:r8188eu: use lib80211 CCMP decrypt") causes scheduling while atomic bugs followed by a hard freeze whenever the driver tries to connect to a CCMP-encrypted network. Experimentation showed that the freezes were eliminated when module lib80211 was preloaded, which can be forced by calling lib80211_get_crypto_ops() directly rather than indirectly through try_then_request_module(). With this change, no BUG messages are logged. Fixes: 6bd082af7e36 ("staging:r8188eu: use lib80211 CCMP decrypt") Cc: Stable # v4.17+ Reported-and-tested-by: Michael Straube Cc: Ivan Safonov Signed-off-by: Larry Finger Signed-off-by: Greg Kroah-Hartman commit 8a5aaf97cc4876a9b61cb3b7c07128d4569ac536 Author: Guo Ren Date: Fri Jan 4 11:17:33 2019 +0800 Documentation/features: Add csky kernel features core/ cBPF-JIT : TODO | core/ eBPF-JIT : TODO | core/ generic-idle-thread : ok | core/ jump-labels : TODO | core/ tracehook : ok | debug/ KASAN : TODO | debug/ gcov-profile-all : TODO | debug/ kgdb : TODO | debug/ kprobes-on-ftrace : TODO | debug/ kprobes : TODO | debug/ kretprobes : TODO | debug/ optprobes : TODO | debug/ stackprotector : TODO | debug/ uprobes : TODO | debug/ user-ret-profiler : TODO | io/ dma-contiguous : ok | locking/ cmpxchg-local : TODO | locking/ lockdep : TODO | locking/ queued-rwlocks : ok | locking/ queued-spinlocks : TODO | locking/ rwsem-optimized : TODO | perf/ kprobes-event : TODO | perf/ perf-regs : TODO | perf/ perf-stackdump : TODO | sched/ membarrier-sync-core : TODO | sched/ numa-balancing : .. | seccomp/ seccomp-filter : TODO | time/ arch-tick-broadcast : TODO | time/ clockevents : ok | time/ context-tracking : TODO | time/ irq-time-acct : TODO | time/ modern-timekeeping : ok | time/ virt-cpuacct : TODO | vm/ ELF-ASLR : TODO | vm/ PG_uncached : TODO | vm/ THP : .. | vm/ batch-unmap-tlb-flush: TODO | vm/ huge-vmap : TODO | vm/ ioremap_prot : TODO | vm/ numa-memblock : .. | vm/ pte_special : TODO | Signed-off-by: Guo Ren Cc: Arnd Bergmann commit a64597227d0de5610407fcc95dc835745a53f5d0 Author: Biju Das Date: Wed Dec 12 12:17:11 2018 +0000 soc: renesas: r8a774c0-sysc: Fix initialization order of 3DG-{A,B} The workaround for the wrong hierarchy of the 3DG-{A,B} power domains on RZ/G2E ES1.0 corrected the parent domains. However, the 3DG-{A,B} power domains were still initialized and powered in the wrong order, causing 3DG operation to fail. Fix this by changing the order in the table at runtime, when running on an affected SoC. This work is based on the work done by Geert for R-Car E3. Fixes: f37d211c687588328 ("soc: renesas: rcar-sysc: Add r8a774c0 support") Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 0fac32f24ceadad801ef1f4de468f1d5186c808d Author: Christophe JAILLET Date: Sat Dec 29 01:05:40 2018 +0100 i3c: master: Fix an error checking typo in 'cdns_i3c_master_probe()' Fix a cut'n'paste typo. Checking 'master->sysclk' is expected here. Fixes: 603f2bee2c54 ("i3c: master: Add driver for Cadence IP") Signed-off-by: Christophe JAILLET Signed-off-by: Boris Brezillon commit 0aaa81377c5a01f686bcdb8c7a6929a7bf330c68 Author: Oliver Hartkopp Date: Fri Jan 4 15:55:26 2019 +0100 can: gw: ensure DLC boundaries after CAN frame modification Muyu Yu provided a POC where user root with CAP_NET_ADMIN can create a CAN frame modification rule that makes the data length code a higher value than the available CAN frame data size. In combination with a configured checksum calculation where the result is stored relatively to the end of the data (e.g. cgw_csum_xor_rel) the tail of the skb (e.g. frag_list pointer in skb_shared_info) can be rewritten which finally can cause a system crash. Michael Kubecek suggested to drop frames that have a DLC exceeding the available space after the modification process and provided a patch that can handle CAN FD frames too. Within this patch we also limit the length for the checksum calculations to the maximum of Classic CAN data length (8). CAN frames that are dropped by these additional checks are counted with the CGW_DELETED counter which indicates misconfigurations in can-gw rules. This fixes CVE-2019-3701. Reported-by: Muyu Yu Reported-by: Marcus Meissner Suggested-by: Michal Kubecek Tested-by: Muyu Yu Tested-by: Oliver Hartkopp Signed-off-by: Oliver Hartkopp Cc: linux-stable # >= v3.2 Signed-off-by: Marc Kleine-Budde Signed-off-by: David S. Miller commit 01cd364a15f42575ef4aac8f82ff05516ea5da9a Author: Stephen Warren Date: Thu Jan 3 10:23:24 2019 -0700 net/mlx4: replace pci_{,un}map_sg with dma_{,un}map_sg pci_{,un}map_sg are deprecated and replaced by dma_{,un}map_sg. This is especially relevant since the rest of the driver uses the DMA API. Fix the driver to use the replacement APIs. Signed-off-by: Stephen Warren Reviewed-by: Tariq Toukan Signed-off-by: David S. Miller commit f65e192af35058e5c82da9e90871b472d24912bc Author: Stephen Warren Date: Thu Jan 3 10:23:23 2019 -0700 net/mlx4: Get rid of page operation after dma_alloc_coherent This patch solves a crash at the time of mlx4 driver unload or system shutdown. The crash occurs because dma_alloc_coherent() returns one value in mlx4_alloc_icm_coherent(), but a different value is passed to dma_free_coherent() in mlx4_free_icm_coherent(). In turn this is because when allocated, that pointer is passed to sg_set_buf() to record it, then when freed it is re-calculated by calling lowmem_page_address(sg_page()) which returns a different value. Solve this by recording the value that dma_alloc_coherent() returns, and passing this to dma_free_coherent(). This patch is roughly equivalent to commit 378efe798ecf ("RDMA/hns: Get rid of page operation after dma_alloc_coherent"). Based-on-code-from: Christoph Hellwig Signed-off-by: Stephen Warren Reviewed-by: Tariq Toukan Signed-off-by: David S. Miller commit 2b6f0090a3335b7bdd03ca520c35591159463041 Author: Boris Brezillon Date: Wed Jan 2 15:36:54 2019 +0100 mtd: Check add_mtd_device() ret code add_mtd_device() can fail. We should always check its return value and gracefully handle the failure case. Fix the call sites where this not done (in mtdpart.c) and add a __must_check attribute to the prototype to avoid this kind of mistakes. Signed-off-by: Boris Brezillon commit 19e16fb4f319b84b3220e98abf726218beba8c34 Author: Boris Brezillon Date: Wed Jan 2 15:36:53 2019 +0100 mtd: Fix the check on nvmem_register() ret code Commit 20167b70c894 ("nvmem: use EOPNOTSUPP instead of ENOSYS") changed the nvmem_register() ret code from ENOSYS to EOPNOTSUPP when CONFIG_NVMEM is not enabled, but the check in mtd_nvmem_add() was not adjusted accordingly. Cc: Bartosz Golaszewski Cc: Alban Bedel Fixes: c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem API") Reported-by: kernel test robot Signed-off-by: Boris Brezillon Reviewed-by: Bartosz Golaszewski Signed-off-by: Boris Brezillon commit 1cd824361eed0f3621e32df1be15159c91f137d9 Merge: bfeffd1552837 74d4b4e0f43e5 Author: Mark Brown Date: Mon Jan 7 12:42:14 2019 +0000 Merge branch 'regmap-4.21' into regmap-5.0 commit 8070ba6348608aa1da15eb83dbaa9ece596aaa67 Author: Arnd Bergmann Date: Mon Dec 10 22:00:23 2018 +0100 ARM: shmobile: fix build regressions A number of Kconfig options have become available now to random ARM platforms outside of ARCH_MULTIPLATFORM, which now causes Kconfig warnings, and other build errors when those select options that lack additional dependencies, e.g.: WARNING: unmet direct dependencies detected for HAVE_ARM_ARCH_TIMER Depends on [n]: CPU_V7 [=n] Selected by [y]: - ARCH_RCAR_GEN2 [=y] && SOC_RENESAS [=y] - ARCH_R8A73A4 [=y] && SOC_RENESAS [=y] && ARM [=y] WARNING: unmet direct dependencies detected for SYS_SUPPORTS_EM_STI Depends on [n]: GENERIC_CLOCKEVENTS [=n] Selected by [y]: - ARCH_EMEV2 [=y] && SOC_RENESAS [=y] && ARM [=y] Put the old dependency on ARCH_RENESAS back for the moment to restore the previous behavior. Fixes: 062887bf5ef7 ("ARM: shmobile: Move SoC Kconfig symbols to drivers/soc/renesas/") Signed-off-by: Arnd Bergmann Acked-by: Geert Uytterhoeven Signed-off-by: Simon Horman commit 2b531d71595d2b5b12782a49b23c335869e2621e Author: Hans de Goede Date: Fri Jan 4 23:10:54 2019 +0100 ACPI / PMIC: xpower: Fix TS-pin current-source handling The current-source used for the battery temp-sensor (TS) is shared with the GPADC. For proper fuel-gauge and charger operation the TS current-source needs to be permanently on. But to read the GPADC we need to temporary switch the TS current-source to ondemand, so that the GPADC can use it, otherwise we will always read an all 0 value. The switching from on to on-ondemand is not necessary when the TS current-source is off (this happens on devices which do not have a TS). Prior to this commit there were 2 issues with our handling of the TS current-source switching: 1) We were writing hardcoded values to the ADC TS pin-ctrl register, overwriting various other unrelated bits. Specifically we were overwriting the current-source setting for the TS and GPIO0 pins, forcing it to 80ųA independent of its original setting. On a Chuwi Vi10 tablet this was causing us to get a too high adc value (due to a too high current-source) resulting in acpi_lpat_raw_to_temp() returning -ENOENT, resulting in: ACPI Error: AE_ERROR, Returned by Handler for [UserDefinedRegion] ACPI Error: Method parse/execution failed \_SB.SXP1._TMP, AE_ERROR This commit fixes this by using regmap_update_bits to change only the relevant bits. 2) At the end of intel_xpower_pmic_get_raw_temp() we were unconditionally enabling the TS current-source even on devices where the TS-pin is not used and the current-source thus was off on entry of the function. This commit fixes this by checking if the TS current-source is off when entering intel_xpower_pmic_get_raw_temp() and if so it is left as is. Fixes: 58eefe2f3f53 (ACPI / PMIC: xpower: Do pinswitch ... reading GPADC) Signed-off-by: Hans de Goede Acked-by: Andy Shevchenko Cc: 4.14+ # 4.14+ Signed-off-by: Rafael J. Wysocki commit c2a7c55a04065c3b0c32d23b099db7ea1dbf6250 Author: Kailang Yang Date: Thu Jan 3 15:53:39 2019 +0800 ALSA: hda/realtek - Support Dell headset mode for New AIO platform Dell has new platform for ALC274. This will support to enable headset mode. Signed-off-by: Kailang Yang Cc: Signed-off-by: Takashi Iwai commit 605c0351fa36e857e29d34ebab2719d9c04e95f6 Author: Larry Finger Date: Wed Jan 2 14:02:08 2019 -0600 MAINTAINERS: Add entry for staging driver r8188eu This entry was missed when the driver was added. Signed-off-by: Larry Finger Signed-off-by: Greg Kroah-Hartman commit cbb2ebf70daf7f7d97d3811a2ff8e39655b8c184 Author: Hui Peng Date: Tue Dec 25 18:11:52 2018 -0500 ALSA: usb-audio: Fix an out-of-bound read in create_composite_quirks In `create_composite_quirk`, the terminating condition of for loops is `quirk->ifnum < 0`. So any composite quirks should end with `struct snd_usb_audio_quirk` object with ifnum < 0. for (quirk = quirk_comp->data; quirk->ifnum >= 0; ++quirk) { ..... } the data field of Bower's & Wilkins PX headphones usb device device quirks do not end with {.ifnum = -1}, wihch may result in out-of-bound read. This Patch fix the bug by adding an ending quirk object. Fixes: 240a8af929c7 ("ALSA: usb-audio: Add a quirck for B&W PX headphones") Signed-off-by: Hui Peng Cc: Signed-off-by: Takashi Iwai commit 3e96d7280f16e2f787307f695a31296b9e4a1cd7 Author: Takashi Iwai Date: Wed Jan 2 17:12:21 2019 +0100 ALSA: usb-audio: Always check descriptor sizes in parser code There are a few places where we access the data without checking the actual object size from the USB audio descriptor. This may result in OOB access, as recently reported. This patch addresses these missing checks. Most of added codes are simple bLength checks in the caller side. For the input and output terminal parsers, we put the length check in the parser functions. For the input terminal, a new argument is added to distinguish between UAC1 and the rest, as they treat different objects. Reported-by: Mathias Payer Reported-by: Hui Peng Tested-by: Hui Peng Cc: Signed-off-by: Takashi Iwai commit 0bfe5e434e6665b3590575ec3c5e4f86a1ce51c9 Author: Takashi Iwai Date: Wed Dec 19 14:04:47 2018 +0100 ALSA: usb-audio: Check mixer unit descriptors more strictly We've had some sanity checks of the mixer unit descriptors but they are too loose and some corner cases are overlooked. Add more strict checks in uac_mixer_unit_get_channels() for avoiding possible OOB accesses by malformed descriptors. This also changes the semantics of uac_mixer_unit_get_channels() slightly. Now it returns zero for the cases where the descriptor lacks of bmControls instead of -EINVAL. Then the caller side skips the mixer creation for such unit while it keeps parsing it. This corresponds to the case like Maya44. Cc: Signed-off-by: Takashi Iwai commit f4351a199cc120ff9d59e06d02e8657d08e6cc46 Author: Takashi Iwai Date: Wed Dec 19 12:36:27 2018 +0100 ALSA: usb-audio: Avoid access before bLength check in build_audio_procunit() The parser for the processing unit reads bNrInPins field before the bLength sanity check, which may lead to an out-of-bound access when a malformed descriptor is given. Fix it by assignment after the bLength check. Cc: Signed-off-by: Takashi Iwai commit 4a22fc534f2f55808c41197cf17d829099032acb Author: Dan Carpenter Date: Fri Jan 4 09:47:25 2019 +0300 watchdog: tqmx86: Fix a couple IS_ERR() vs NULL bugs These functions return NULL on error but we accidentally check for IS_ERR() instead. Fixes: e3c21e088f89 ("watchdog: tqmx86: Add watchdog driver for the IO controller") Signed-off-by: Dan Carpenter Reviewed-by: Andrew Lunn Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 3aa8b8bbc142eeaac89891de584535ceb7fce405 Author: NeilBrown Date: Sun Dec 30 14:21:52 2018 +1100 watchdog: mt7621_wdt/rt2880_wdt: Fix compilation problem These files need #include to compile correctly. Fixes: ac3167257b9f ("headers: separate linux/mod_devicetable.h from linux/platform_device.h") Signed-off-by: NeilBrown Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 862523297778775a0543110dcbf2ca832782f675 Author: Hans de Goede Date: Wed Nov 28 17:57:56 2018 +0100 gpiolib-acpi: Remove unnecessary WARN_ON from acpi_gpiochip_free_interrupts acpi_gpiochip_alloc_event only continues allocating an event and adding it to the list if gpiochip_request_own_desc does not return an error. So events with an error desc are never placed on the events list and this check is really not necessary. Suggested-by: Andy Shevchenko Signed-off-by: Hans de Goede Acked-by: Mika Westerberg Signed-off-by: Linus Walleij commit de96e9fea7ba56042f105b6fe163447b280eb800 Author: Greg Kroah-Hartman Date: Thu Jan 3 10:23:47 2019 +0100 sysfs: convert BUG_ON to WARN_ON It's rude to crash the system just because the developer did something wrong, as it prevents them from usually even seeing what went wrong. So convert the few BUG_ON() calls that have snuck into the sysfs code over the years to WARN_ON() to make it more "friendly". All of these are able to be recovered from, so it makes no sense to crash. Reported-by: Linus Torvalds Reviewed-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit 07bd14ccc3049f9c0147a91a4227a571f981601a Author: Wei Yongjun Date: Wed Dec 26 11:28:24 2018 +0000 hwmon: (lm80) Fix missing unlock on error in set_fan_div() Add the missing unlock before return from function set_fan_div() in the error handling case. Fixes: c9c63915519b ("hwmon: (lm80) fix a missing check of the status of SMBus read") Signed-off-by: Wei Yongjun Signed-off-by: Guenter Roeck commit 9de15c95a63f527c8f7a968cd95e6ec71fc6891d Author: Guenter Roeck Date: Wed Dec 26 13:56:15 2018 -0800 hwmon: (nct6775) Enable IO mapping for NCT6797D and NCT6798D Similar to other recent chips from Nuvoton, IO mapping may be disabled by default. Enable it when instantiating the driver and after resume. Fixes: 0599682b826f ("hwmon: (nct6775) Add support for NCT6798D") Fixes: e41da286a2fd ("hwmon: (nct6775) Add support for NCT6797D") Reported-by: Michael Cook Cc: Michael Cook Signed-off-by: Guenter Roeck commit 264142bc70ec039e26d8f3b46a717e8037f59ca0 Author: Guenter Roeck Date: Wed Dec 26 07:34:31 2018 -0800 hwmon: (nct6775) Fix chip ID for NCT6798D The chip ID is 0xd42[8-f], not 0xd45[8-f]. Fixes: 0599682b826f ("hwmon: (nct6775) Add support for NCT6798D") Reported-by: Michael Cook Cc: Michael Cook Signed-off-by: Guenter Roeck commit 3bd6e94bec122a951d462c239b47954cf5f36e33 Author: Masahiro Yamada Date: Mon Jan 7 11:08:08 2019 +0900 arch: restore generic-y += shmparam.h for some architectures For some reasons, I accidentally got rid of "generic-y += shmparam.h" from some architectures. Restore them to fix building c6x, h8300, hexagon, m68k, microblaze, openrisc, and unicore32. Fixes: d6e4b3e326d8 ("arch: remove redundant UAPI generic-y defines") Signed-off-by: Masahiro Yamada Signed-off-by: Linus Torvalds commit bfeffd155283772bbe78c6a05dec7c0128ee500c Author: Linus Torvalds Date: Sun Jan 6 17:08:20 2019 -0800 Linux 5.0-rc1 commit 85e1ffbd42f664965dc05f6e9851c06379f27fb2 Merge: ac5eed2b41776 d86271af64602 Author: Linus Torvalds Date: Sun Jan 6 16:33:10 2019 -0800 Merge tag 'kbuild-v4.21-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull more Kbuild updates from Masahiro Yamada: - improve boolinit.cocci and use_after_iter.cocci semantic patches - fix alignment for kallsyms - move 'asm goto' compiler test to Kconfig and clean up jump_label CONFIG option - generate asm-generic wrappers automatically if arch does not implement mandatory UAPI headers - remove redundant generic-y defines - misc cleanups * tag 'kbuild-v4.21-3' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kconfig: rename generated .*conf-cfg to *conf-cfg kbuild: remove unnecessary stubs for archheader and archscripts kbuild: use assignment instead of define ... endef for filechk_* rules arch: remove redundant UAPI generic-y defines kbuild: generate asm-generic wrappers if mandatory headers are missing arch: remove stale comments "UAPI Header export list" riscv: remove redundant kernel-space generic-y kbuild: change filechk to surround the given command with { } kbuild: remove redundant target cleaning on failure kbuild: clean up rule_dtc_dt_yaml kbuild: remove UIMAGE_IN and UIMAGE_OUT jump_label: move 'asm goto' support test to Kconfig kallsyms: lower alignment on ARM scripts: coccinelle: boolinit: drop warnings on named constants scripts: coccinelle: check for redeclaration kconfig: remove unused "file" field of yylval union nds32: remove redundant kernel-space generic-y nios2: remove unneeded HAS_DMA define commit ac5eed2b41776b05cf03aac761d3bb5e64eea24c Merge: 574823bfab82d 2573be22e5b6f Author: Linus Torvalds Date: Sun Jan 6 16:30:14 2019 -0800 Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf tooling updates form Ingo Molnar: "A final batch of perf tooling changes: mostly fixes and small improvements" * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (29 commits) perf session: Add comment for perf_session__register_idle_thread() perf thread-stack: Fix thread stack processing for the idle task perf thread-stack: Allocate an array of thread stacks perf thread-stack: Factor out thread_stack__init() perf thread-stack: Allow for a thread stack array perf thread-stack: Avoid direct reference to the thread's stack perf thread-stack: Tidy thread_stack__bottom() usage perf thread-stack: Simplify some code in thread_stack__process() tools gpio: Allow overriding CFLAGS tools power turbostat: Override CFLAGS assignments and add LDFLAGS to build command tools thermal tmon: Allow overriding CFLAGS assignments tools power x86_energy_perf_policy: Override CFLAGS assignments and add LDFLAGS to build command perf c2c: Increase the HITM ratio limit for displayed cachelines perf c2c: Change the default coalesce setup perf trace beauty ioctl: Beautify USBDEVFS_ commands perf trace beauty: Export function to get the files for a thread perf trace: Wire up ioctl's USBDEBFS_ cmd table generator perf beauty ioctl: Add generator for USBDEVFS_ ioctl commands tools headers uapi: Grab a copy of usbdevice_fs.h perf trace: Store the major number for a file when storing its pathname ... commit 574823bfab82d9d8fa47f422778043fbb4b4f50e Author: Linus Torvalds Date: Sat Jan 5 17:50:59 2019 -0800 Change mincore() to count "mapped" pages rather than "cached" pages The semantics of what "in core" means for the mincore() system call are somewhat unclear, but Linux has always (since 2.3.52, which is when mincore() was initially done) treated it as "page is available in page cache" rather than "page is mapped in the mapping". The problem with that traditional semantic is that it exposes a lot of system cache state that it really probably shouldn't, and that users shouldn't really even care about. So let's try to avoid that information leak by simply changing the semantics to be that mincore() counts actual mapped pages, not pages that might be cheaply mapped if they were faulted (note the "might be" part of the old semantics: being in the cache doesn't actually guarantee that you can access them without IO anyway, since things like network filesystems may have to revalidate the cache before use). In many ways the old semantics were somewhat insane even aside from the information leak issue. From the very beginning (and that beginning is a long time ago: 2.3.52 was released in March 2000, I think), the code had a comment saying Later we can get more picky about what "in core" means precisely. and this is that "later". Admittedly it is much later than is really comfortable. NOTE! This is a real semantic change, and it is for example known to change the output of "fincore", since that program literally does a mmmap without populating it, and then doing "mincore()" on that mapping that doesn't actually have any pages in it. I'm hoping that nobody actually has any workflow that cares, and the info leak is real. We may have to do something different if it turns out that people have valid reasons to want the old semantics, and if we can limit the information leak sanely. Cc: Kevin Easton Cc: Jiri Kosina Cc: Masatake YAMATO Cc: Andrew Morton Cc: Greg KH Cc: Peter Zijlstra Cc: Michal Hocko Signed-off-by: Linus Torvalds commit 94bd8a05cd4de344a9a57e52ef7d99550251984f Author: Linus Torvalds Date: Sun Jan 6 11:15:04 2019 -0800 Fix 'acccess_ok()' on alpha and SH Commit 594cc251fdd0 ("make 'user_access_begin()' do 'access_ok()'") broke both alpha and SH booting in qemu, as noticed by Guenter Roeck. It turns out that the bug wasn't actually in that commit itself (which would have been surprising: it was mostly a no-op), but in how the addition of access_ok() to the strncpy_from_user() and strnlen_user() functions now triggered the case where those functions would test the access of the very last byte of the user address space. The string functions actually did that user range test before too, but they did it manually by just comparing against user_addr_max(). But with user_access_begin() doing the check (using "access_ok()"), it now exposed problems in the architecture implementations of that function. For example, on alpha, the access_ok() helper macro looked like this: #define __access_ok(addr, size) \ ((get_fs().seg & (addr | size | (addr+size))) == 0) and what it basically tests is of any of the high bits get set (the USER_DS masking value is 0xfffffc0000000000). And that's completely wrong for the "addr+size" check. Because it's off-by-one for the case where we check to the very end of the user address space, which is exactly what the strn*_user() functions do. Why? Because "addr+size" will be exactly the size of the address space, so trying to access the last byte of the user address space will fail the __access_ok() check, even though it shouldn't. As a result, the user string accessor functions failed consistently - because they literally don't know how long the string is going to be, and the max access is going to be that last byte of the user address space. Side note: that alpha macro is buggy for another reason too - it re-uses the arguments twice. And SH has another version of almost the exact same bug: #define __addr_ok(addr) \ ((unsigned long __force)(addr) < current_thread_info()->addr_limit.seg) so far so good: yes, a user address must be below the limit. But then: #define __access_ok(addr, size) \ (__addr_ok((addr) + (size))) is wrong with the exact same off-by-one case: the case when "addr+size" is exactly _equal_ to the limit is actually perfectly fine (think "one byte access at the last address of the user address space") The SH version is actually seriously buggy in another way: it doesn't actually check for overflow, even though it did copy the _comment_ that talks about overflow. So it turns out that both SH and alpha actually have completely buggy implementations of access_ok(), but they happened to work in practice (although the SH overflow one is a serious serious security bug, not that anybody likely cares about SH security). This fixes the problems by using a similar macro on both alpha and SH. It isn't trying to be clever, the end address is based on this logic: unsigned long __ao_end = __ao_a + __ao_b - !!__ao_b; which basically says "add start and length, and then subtract one unless the length was zero". We can't subtract one for a zero length, or we'd just hit an underflow instead. For a lot of access_ok() users the length is a constant, so this isn't actually as expensive as it initially looks. Reported-and-tested-by: Guenter Roeck Cc: Matt Turner Cc: Yoshinori Sato Signed-off-by: Linus Torvalds commit baa6707381285e68cc472efba58e7e736057aacc Merge: 215240462a967 8094c3ceb21ad Author: Linus Torvalds Date: Sun Jan 6 12:21:11 2019 -0800 Merge tag 'fscrypt_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/fscrypt Pull fscrypt updates from Ted Ts'o: "Add Adiantum support for fscrypt" * tag 'fscrypt_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/fscrypt: fscrypt: add Adiantum support commit 215240462a9672db771bb60adcc1c4fdf40e8ec4 Merge: e2b745f469ec0 191ce17876c93 Author: Linus Torvalds Date: Sun Jan 6 12:19:23 2019 -0800 Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 bug fixes from Ted Ts'o: "Fix a number of ext4 bugs" * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: fix special inode number checks in __ext4_iget() ext4: track writeback errors using the generic tracking infrastructure ext4: use ext4_write_inode() when fsyncing w/o a journal ext4: avoid kernel warning when writing the superblock to a dead device ext4: fix a potential fiemap/page fault deadlock w/ inline_data ext4: make sure enough credits are reserved for dioread_nolock writes commit e2b745f469ec0f3165ba5ffaee3ce40f98d77878 Merge: 12133258d7fe3 8270f3a11ceef Author: Linus Torvalds Date: Sun Jan 6 11:47:26 2019 -0800 Merge tag 'dma-mapping-4.21-1' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping fixes from Christoph Hellwig: "Fix various regressions introduced in this cycles: - fix dma-debug tracking for the map_page / map_single consolidatation - properly stub out DMA mapping symbols for !HAS_DMA builds to avoid link failures - fix AMD Gart direct mappings - setup the dma address for no kernel mappings using the remap allocator" * tag 'dma-mapping-4.21-1' of git://git.infradead.org/users/hch/dma-mapping: dma-direct: fix DMA_ATTR_NO_KERNEL_MAPPING for remapped allocations x86/amd_gart: fix unmapping of non-GART mappings dma-mapping: remove a few unused exports dma-mapping: properly stub out the DMA API for !CONFIG_HAS_DMA dma-mapping: remove dmam_{declare,release}_coherent_memory dma-mapping: implement dmam_alloc_coherent using dmam_alloc_attrs dma-mapping: implement dma_map_single_attrs using dma_map_page_attrs commit 12133258d7fe309b42a35677549c606b15a0822d Merge: 66e012f6188fb cdd6a4a0e2ec5 Author: Linus Torvalds Date: Sun Jan 6 11:40:06 2019 -0800 Merge tag 'tag-chrome-platform-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/bleung/chrome-platform Pull chrome platform updates from Benson Leung: - Changes for EC_MKBP_EVENT_SENSOR_FIFO handling. - Also, maintainership changes. Olofj out, Enric balletbo in. * tag 'tag-chrome-platform-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/bleung/chrome-platform: MAINTAINERS: add maintainers for ChromeOS EC sub-drivers MAINTAINERS: platform/chrome: Add Enric as a maintainer MAINTAINERS: platform/chrome: remove myself as maintainer platform/chrome: don't report EC_MKBP_EVENT_SENSOR_FIFO as wakeup platform/chrome: straighten out cros_ec_get_{next,host}_event() error codes commit 66e012f6188fb37b18c774277f34fb52278059c3 Merge: b5aef86e089a2 4d5a91fd1f42a Author: Linus Torvalds Date: Sun Jan 6 11:37:44 2019 -0800 Merge tag 'hwlock-v4.21' of git://github.com/andersson/remoteproc Pull hwspinlock updates from Bjorn Andersson: "This adds support for the hardware semaphores found in STM32MP1" * tag 'hwlock-v4.21' of git://github.com/andersson/remoteproc: hwspinlock: fix return value check in stm32_hwspinlock_probe() hwspinlock: add STM32 hwspinlock device dt-bindings: hwlock: Document STM32 hwspinlock bindings commit 373282e7ab6840cd583a223fa90628f2d8293c26 Author: John Pittman Date: Fri Jan 4 12:06:37 2019 -0500 null_blk: add zoned config support information If the kernel is built without CONFIG_BLK_DEV_ZONED, a modprobe of the null_blk driver with zoned=1 fails with 'Invalid argument'. This can be confusing to users, prompting a search as to why the parameter is invalid. To assist in that search, add a bit more information to the failure, additionally adding to the documentation that CONFIG_BLK_DEV_ZONED is needed for zoned=1. Reviewed-by: Bart Van Assche Signed-off-by: John Pittman Added null_blk prefix to error message. Signed-off-by: Jens Axboe commit 8094c3ceb21ad93896fd4d238e8ba41911932eaf Author: Eric Biggers Date: Sun Jan 6 08:36:21 2019 -0500 fscrypt: add Adiantum support Add support for the Adiantum encryption mode to fscrypt. Adiantum is a tweakable, length-preserving encryption mode with security provably reducible to that of XChaCha12 and AES-256, subject to a security bound. It's also a true wide-block mode, unlike XTS. See the paper "Adiantum: length-preserving encryption for entry-level processors" (https://eprint.iacr.org/2018/720.pdf) for more details. Also see commit 059c2a4d8e16 ("crypto: adiantum - add Adiantum support"). On sufficiently long messages, Adiantum's bottlenecks are XChaCha12 and the NH hash function. These algorithms are fast even on processors without dedicated crypto instructions. Adiantum makes it feasible to enable storage encryption on low-end mobile devices that lack AES instructions; currently such devices are unencrypted. On ARM Cortex-A7, on 4096-byte messages Adiantum encryption is about 4 times faster than AES-256-XTS encryption; decryption is about 5 times faster. In fscrypt, Adiantum is suitable for encrypting both file contents and names. With filenames, it fixes a known weakness: when two filenames in a directory share a common prefix of >= 16 bytes, with CTS-CBC their encrypted filenames share a common prefix too, leaking information. Adiantum does not have this problem. Since Adiantum also accepts long tweaks (IVs), it's also safe to use the master key directly for Adiantum encryption rather than deriving per-file keys, provided that the per-file nonce is included in the IVs and the master key isn't used for any other encryption mode. This configuration saves memory and improves performance. A new fscrypt policy flag is added to allow users to opt-in to this configuration. Signed-off-by: Eric Biggers Signed-off-by: Theodore Ts'o commit 97274b6126193cca2b820579f5d758589a2badc2 Merge: 466f89e9ec8c6 1cbbcfbbd56ef Author: Alexei Starovoitov Date: Sat Jan 5 21:32:39 2019 -0800 Merge branch 'reject-ptr-scalar-mix' Daniel Borkmann says: ==================== Follow-up fix to 979d63d50c0c ("bpf: prevent out of bounds speculation on pointer arithmetic") in order to reject a corner case for sanitation when ptr / scalars are mixed in the same alu op. ==================== Signed-off-by: Alexei Starovoitov commit 1cbbcfbbd56efd994d643428c69467fe3c8ab672 Author: Daniel Borkmann Date: Sun Jan 6 00:54:38 2019 +0100 bpf: add various test cases for alu op on mixed dst register types Add couple of test_verifier tests to check sanitation of alu op insn with pointer and scalar type coming from different paths. This also includes BPF insns of the test reproducer provided by Jann Horn. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Signed-off-by: Alexei Starovoitov commit d3bd7413e0ca40b60cf60d4003246d067cafdeda Author: Daniel Borkmann Date: Sun Jan 6 00:54:37 2019 +0100 bpf: fix sanitation of alu op with pointer / scalar type from different paths While 979d63d50c0c ("bpf: prevent out of bounds speculation on pointer arithmetic") took care of rejecting alu op on pointer when e.g. pointer came from two different map values with different map properties such as value size, Jann reported that a case was not covered yet when a given alu op is used in both "ptr_reg += reg" and "numeric_reg += reg" from different branches where we would incorrectly try to sanitize based on the pointer's limit. Catch this corner case and reject the program instead. Fixes: 979d63d50c0c ("bpf: prevent out of bounds speculation on pointer arithmetic") Reported-by: Jann Horn Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Signed-off-by: Alexei Starovoitov commit b5aef86e089a2d85a6d627372287785d08938cbe Merge: 15b215e5aa299 93fb7f19985a0 Author: Linus Torvalds Date: Sat Jan 5 18:35:02 2019 -0800 Merge tag 'docs-5.0-fixes' of git://git.lwn.net/linux Pull documentation fixes from Jonathan Corbet: "A handful of late-arriving documentation fixes" * tag 'docs-5.0-fixes' of git://git.lwn.net/linux: doc: filesystems: fix bad references to nonexistent ext4.rst file Documentation/admin-guide: update URL of LKML information link Docs/kernel-api.rst: Remove blk-tag.c reference commit 15b215e5aa29993c1b0f46693a1b482296bcf08e Merge: d7252d0d36375 c820518f6ca15 Author: Linus Torvalds Date: Sat Jan 5 18:33:21 2019 -0800 Merge tag 'firewire-update' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394 Pull firewire fixlet from Stefan Richter: "Remove an explicit dependency in Kconfig which is implied by another dependency" * tag 'firewire-update' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: firewire: Remove depends on HAS_DMA in case of platform dependency commit d7252d0d36375fe8c544098469a21d03fa267a55 Merge: 0fe4e2d5cd931 59f75fd0e3153 Author: Linus Torvalds Date: Sat Jan 5 18:29:13 2019 -0800 Merge tag 'for-linus-20190104' of git://git.kernel.dk/linux-block Pull block updates and fixes from Jens Axboe: - Pulled in MD changes that Shaohua had queued up for 4.21. Unfortunately we lost Shaohua late 2018, I'm sending these in on his behalf. - In conjunction with the above, I added a CREDITS entry for Shaoua. - sunvdc queue restart fix (Ming) * tag 'for-linus-20190104' of git://git.kernel.dk/linux-block: Add CREDITS entry for Shaohua Li block: sunvdc: don't run hw queue synchronously from irq context md: fix raid10 hang issue caused by barrier raid10: refactor common wait code from regular read/write request md: remvoe redundant condition check lib/raid6: add option to skip algo benchmarking lib/raid6: sort algos in rough performance order lib/raid6: check for assembler SSSE3 support lib/raid6: avoid __attribute_const__ redefinition lib/raid6: add missing include for raid6test md: remove set but not used variable 'bi_rdev' commit 0fe4e2d5cd931ad2ff99d61cfdd5c6dc0c3ec60b Merge: 3954e1d0310e3 9ddf32a8df9e3 Author: Linus Torvalds Date: Sat Jan 5 18:25:19 2019 -0800 Merge tag 'drm-next-2019-01-05' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Happy New Year, just decloaking from leave to get some stuff from the last week in before rc1: core: - two regression fixes for damage blob and atomic i915 gvt: - Some missed GVT fixes from the original pull amdgpu: - new PCI IDs - SR-IOV fixes - DC fixes - Vega20 fixes" * tag 'drm-next-2019-01-05' of git://anongit.freedesktop.org/drm/drm: (53 commits) drm: Put damage blob when destroy plane state drm: fix null pointer dereference on null state pointer drm/amdgpu: Add new VegaM pci id drm/ttm: Use drm_debug_printer for all ttm_bo_mem_space_debug output drm/amdgpu: add Vega20 PSP ASD firmware loading drm/amd/display: Fix MST dp_blank REG_WAIT timeout drm/amd/display: validate extended dongle caps drm/amd/display: Use div_u64 for flip timestamp ns to ms drm/amdgpu/uvd:Change uvd ring name convention drm/amd/powerplay: add Vega20 LCLK DPM level setting support drm/amdgpu: print process info when job timeout drm/amdgpu/nbio7.4: add hw bug workaround for vega20 drm/amdgpu/nbio6.1: add hw bug workaround for vega10/12 drm/amd/display: Optimize passive update planes. drm/amd/display: verify lane status before exiting verify link cap drm/amd/display: Fix bug with not updating VSP infoframe drm/amd/display: Add retry to read ddc_clock pin drm/amd/display: Don't skip link training for empty dongle drm/amd/display: Wait edp HPD to high in detect_sink drm/amd/display: fix surface update sequence ... commit 3954e1d0310e30e743431b58918825c4d4fe8812 Merge: a8a6b1186b1a2 9c6260de505b6 Author: Linus Torvalds Date: Sat Jan 5 18:20:51 2019 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "Over the break a few defects were found, so this is a -rc style pull request of various small things that have been posted. - An attempt to shorten RCU grace period driven delays showed crashes during heavier testing, and has been entirely reverted - A missed merge/rebase error between the advise_mr and ib_device_ops series - Some small static analysis driven fixes from Julia and Aditya - Missed ability to create a XRC_INI in the devx verbs interop series" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: infiniband/qedr: Potential null ptr dereference of qp infiniband: bnxt_re: qplib: Check the return value of send_message IB/ipoib: drop useless LIST_HEAD IB/core: Add advise_mr to the list of known ops Revert "IB/mlx5: Fix long EEH recover time with NVMe offloads" IB/mlx5: Allow XRC INI usage via verbs in DEVX context commit a8a6b1186b1a209647483c2ff81e0d59c43dbdd3 Merge: 7671c14e6aca7 399382f801820 Author: Linus Torvalds Date: Sat Jan 5 18:15:37 2019 -0800 Merge tag 'fbdev-v4.21' of git://github.com/bzolnier/linux Pull fbdev updates from Bartlomiej Zolnierkiewicz: "This time the pull request is really small. The most notable changes are fixing fbcon to not cause crash on unregister_framebuffer() operation when there is more than one framebuffer, adding config option to center the bootup logo and making FB_BACKLIGHT config option tristate (which in turn uncovered incorrect FB_BACKLIGHT usage by DRM's nouveau driver). Summary: - fix fbcon to not cause crash on unregister_framebuffer() when there is more than one framebuffer (Noralf Trønnes) - improve support for small rotated displays (Peter Rosin) - fix probe failure handling in udlfb driver (Dan Carpenter) - add config option to center the bootup logo (Peter Rosin) - make FB_BACKLIGHT config option tristate (Rob Clark) - remove superfluous HAS_DMA dependency for goldfishfb driver (Geert Uytterhoeven) - misc fixes (Alexey Khoroshilov, YueHaibing, Colin Ian King, Lubomir Rintel) - misc cleanups (Yangtao Li, Wen Yang) also there is DRM's nouveau driver fix for wrong FB_BACKLIGHT config option usage (FB_BACKLIGHT is for internal fbdev subsystem use only)" * tag 'fbdev-v4.21' of git://github.com/bzolnier/linux: drm/nouveau: fix incorrect FB_BACKLIGHT usage in Kconfig fbdev: fbcon: Fix unregister crash when more than one framebuffer fbdev: Remove depends on HAS_DMA in case of platform dependency pxa168fb: trivial typo fix fbdev: fsl-diu: remove redundant null check on cmap fbdev: omap2: omapfb: convert to DEFINE_SHOW_ATTRIBUTE fbdev: uvesafb: fix spelling mistake "memoery" -> "memory" fbdev: fbmem: add config option to center the bootup logo fbdev: fbmem: make fb_show_logo_line return the end instead of the height video: fbdev: pxafb: Fix "WARNING: invalid free of devm_ allocated data" fbdev: fbmem: behave better with small rotated displays and many CPUs video: clps711x-fb: release disp device node in probe() fbdev: make FB_BACKLIGHT a tristate udlfb: fix some inconsistent NULL checking commit 7671c14e6aca7a816a29a85eba47d9bccb7d23ae Merge: 926b02d3eb547 81482d13f37b1 Author: Linus Torvalds Date: Sat Jan 5 18:13:35 2019 -0800 Merge branch 'i2c/for-5.0' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: "I2C has only driver updates for you this time. Mostly new IDs/DT compatibles, also SPDX conversions, small cleanups. STM32F7 got FastMode+ and PM support, Axxia some reliabilty improvements" * 'i2c/for-5.0' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (26 commits) i2c: Add Actions Semiconductor Owl family S700 I2C support dt-bindings: i2c: Add S700 support for Actions Semi Soc's i2c: ismt: Add support for Intel Cedar Fork i2c: tegra: Switch to SPDX identifier i2c: tegra: Add missing kerneldoc for some fields i2c: tegra: Cleanup kerneldoc comments i2c: axxia: support sequence command mode dt-bindings: i2c: rcar: Add r8a774c0 support dt-bindings: i2c: sh_mobile: Add r8a774c0 support i2c: sh_mobile: Add support for r8a774c0 (RZ/G2E) i2c: i2c-cros-ec-tunnel: Switch to SPDX identifier. i2c: powermac: Use of_node_name_eq for node name comparisons i2c-axxia: check for error conditions first i2c-axxia: dedicated function to set client addr dt-bindings: i2c: Use correct vendor prefix for Atmel i2c: tegra: replace spin_lock_irqsave with spin_lock in ISR eeprom: at24: add support for 24c2048 dt-bindings: eeprom: at24: add "atmel,24c2048" compatible string i2c: i2c-stm32f7: add PM Runtime support i2c: sh_mobile: add support for r8a77990 (R-Car E3) ... commit 926b02d3eb547daa1d56cf9b586f31b270488b77 Merge: cf26057a94411 72199051af620 Author: Linus Torvalds Date: Sat Jan 5 17:57:34 2019 -0800 Merge tag 'pci-v4.21-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI updates from Bjorn Helgaas: - Remove unused lists from ASPM pcie_link_state (Frederick Lawler) - Fix Broadcom CNB20LE host bridge unintended sign extension (Colin Ian King) - Expand Kconfig "PF" acronyms (Randy Dunlap) - Update MAINTAINERS for arch/x86/kernel/early-quirks.c (Bjorn Helgaas) - Add missing include to drivers/pci.h (Alexandru Gagniuc) - Override Synopsys USB 3.x HAPS device class so dwc3-haps can claim it instead of xhci (Thinh Nguyen) - Clean up P2PDMA documentation (Randy Dunlap) - Allow runtime PM even if driver doesn't supply callbacks (Jarkko Nikula) - Remove status check after submitting Switchtec MRPC Firmware Download commands to avoid Completion Timeouts (Kelvin Cao) - Set Switchtec coherent DMA mask to allow 64-bit DMA (Boris Glimcher) - Fix Switchtec SWITCHTEC_IOCTL_EVENT_IDX_ALL flag overwrite issue (Joey Zhang) - Enable write combining for Switchtec MRPC Input buffers (Kelvin Cao) - Add Switchtec MRPC DMA mode support (Wesley Sheng) - Skip VF scanning on powerpc, which does this in firmware (Sebastian Ott) - Add Amlogic Meson PCIe controller driver and DT bindings (Yue Wang) - Constify histb dw_pcie_host_ops structure (Julia Lawall) - Support multiple power domains for imx6 (Leonard Crestez) - Constify layerscape driver data (Stefan Agner) - Update imx6 Kconfig to allow imx6 PCIe in imx7 kernel (Trent Piepho) - Support armada8k GPIO reset (Baruch Siach) - Support suspend/resume support on imx6 (Leonard Crestez) - Don't hard-code DesignWare DBI/ATU offst (Stephen Warren) - Skip i.MX6 PHY setup on i.MX7D (Andrey Smirnov) - Remove Jianguo Sun from HiSilicon STB maintainers (Lorenzo Pieralisi) - Mask DesignWare interrupts instead of disabling them to avoid lost interrupts (Marc Zyngier) - Add locking when acking DesignWare interrupts (Marc Zyngier) - Ack DesignWare interrupts in the proper callbacks (Marc Zyngier) - Use devm resource parser in mediatek (Honghui Zhang) - Remove unused mediatek "num-lanes" DT property (Honghui Zhang) - Add UniPhier PCIe controller driver and DT bindings (Kunihiko Hayashi) - Enable MSI for imx6 downstream components (Richard Zhu) * tag 'pci-v4.21-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (40 commits) PCI: imx: Enable MSI from downstream components s390/pci: skip VF scanning PCI/IOV: Add flag so platforms can skip VF scanning PCI/IOV: Factor out sriov_add_vfs() PCI: uniphier: Add UniPhier PCIe host controller support dt-bindings: PCI: Add UniPhier PCIe host controller description PCI: amlogic: Add the Amlogic Meson PCIe controller driver dt-bindings: PCI: meson: add DT bindings for Amlogic Meson PCIe controller arm64: dts: mt7622: Remove un-used property for PCIe arm: dts: mt7623: Remove un-used property for PCIe dt-bindings: PCI: MediaTek: Remove un-used property PCI: mediatek: Remove un-used variant in struct mtk_pcie_port MAINTAINERS: Remove Jianguo Sun from HiSilicon STB DWC entry PCI: dwc: Don't hard-code DBI/ATU offset PCI: imx: Add imx6sx suspend/resume support PCI: armada8k: Add support for gpio controlled reset signal PCI: dwc: Adjust Kconfig to allow IMX6 PCIe host on IMX7 PCI: dwc: layerscape: Constify driver data PCI: imx: Add multi-pd support PCI: Override Synopsys USB 3.x HAPS device class ... commit cf26057a9441173ad552e90cea3344607075c9ad Merge: 1686cc1a31f45 bd8879faafe6d Author: Linus Torvalds Date: Sat Jan 5 17:53:40 2019 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID updates from Jiri Kosina: - high-resolution scrolling support that gracefully handles differences between MS and Logitech implementations in HW, from Peter Hutterer and Harry Cutts - MSI IRQ support for intel-ish driver, from Song Hongyan - support for new hardware (Cougar 700K, Odys Winbook 13, ASUS FX503VD, ASUS T101HA) from Daniel M. Lambea, Hans de Goede and Aleix Roca Nonell - other small assorted fixups * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (22 commits) HID: i2c-hid: Add Odys Winbook 13 to descriptor override HID: lenovo: Add checks to fix of_led_classdev_register HID: intel-ish-hid: add MSI interrupt support HID: debug: Change to use DEFINE_SHOW_ATTRIBUTE macro HID: doc: fix wrong data structure reference for UHID_OUTPUT HID: intel-ish-hid: fixes incorrect error handling HID: asus: Add support for the ASUS T101HA keyboard dock HID: logitech: Use LDJ_DEVICE macro for existing Logitech mice HID: logitech: Enable high-resolution scrolling on Logitech mice HID: logitech: Add function to enable HID++ 1.0 "scrolling acceleration" HID: logitech-hidpp: fix typo, hiddpp to hidpp HID: input: use the Resolution Multiplier for high-resolution scrolling HID: core: process the Resolution Multiplier HID: core: store the collections as a basic tree Input: add `REL_WHEEL_HI_RES` and `REL_HWHEEL_HI_RES` HID: input: support Microsoft wireless radio control hotkey HID: use macros in IS_INPUT_APPLICATION HID: asus: Add support for the ASUS FX503VD laptop HID: asus: Add event handler to catch unmapped Asus Vendor UsagePage codes HID: cougar: Add support for Cougar 700K Gaming Keyboard ... commit 1686cc1a31f45a3fd090e5d0c6fce777422e13fa Merge: 5c4a60831aa6d 5f30b2e823484 Author: Linus Torvalds Date: Sat Jan 5 17:51:36 2019 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching Pull livepatch update from Jiri Kosina: "Return value checking fixup in livepatching samples, from Nicholas Mc Guire" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching: livepatch: check kzalloc return values commit d86271af64602e7c86c003b27f27c7216706ff96 Author: Masahiro Yamada Date: Sat Jan 5 12:01:51 2019 +0900 kconfig: rename generated .*conf-cfg to *conf-cfg Remove the dot-prefixing since it is just a matter of the .gitignore file. Signed-off-by: Masahiro Yamada commit f7de64b73172e0c4cc900c14a432b76f0347ee9e Author: Masahiro Yamada Date: Thu Jan 3 10:47:05 2019 +0900 kbuild: remove unnecessary stubs for archheader and archscripts Make simply skips a missing rule when it is marked as .PHONY. Remove the dummy targets. Signed-off-by: Masahiro Yamada commit ba97df45581f09a987ffa38444c33ed6a0a9479e Author: Masahiro Yamada Date: Thu Jan 3 10:16:54 2019 +0900 kbuild: use assignment instead of define ... endef for filechk_* rules You do not have to use define ... endef for filechk_* rules. For simple cases, the use of assignment looks cleaner, IMHO. I updated the usage for scripts/Kbuild.include in case somebody misunderstands the 'define ... endif' is the requirement. Signed-off-by: Masahiro Yamada Acked-by: Heiko Carstens commit d6e4b3e326d8b44675b9e19534347d97073826aa Author: Masahiro Yamada Date: Thu Jan 3 10:10:39 2019 +0900 arch: remove redundant UAPI generic-y defines Now that Kbuild automatically creates asm-generic wrappers for missing mandatory headers, it is redundant to list the same headers in generic-y and mandatory-y. Suggested-by: Sam Ravnborg Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit 919987318a129b4d0c2203a3c6fd2d804be77100 Author: Masahiro Yamada Date: Thu Jan 3 10:10:38 2019 +0900 kbuild: generate asm-generic wrappers if mandatory headers are missing Some time ago, Sam pointed out a certain degree of overwrap between generic-y and mandatory-y. (https://lkml.org/lkml/2017/7/10/121) I tweaked the meaning of mandatory-y a little bit; now it defines the minimum set of ASM headers that all architectures must have. If arch does not have specific implementation of a mandatory header, Kbuild will let it fallback to the asm-generic one by automatically generating a wrapper. This will allow to drop lots of redundant generic-y defines. Previously, "mandatory" was used in the context of UAPI, but I guess this can be extended to kernel space ASM headers. Suggested-by: Sam Ravnborg Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit d4ce5458ea1b7d8ca49c436d602095c4912777d3 Author: Masahiro Yamada Date: Thu Jan 3 10:10:37 2019 +0900 arch: remove stale comments "UAPI Header export list" These comments are leftovers of commit fcc8487d477a ("uapi: export all headers under uapi directories"). Prior to that commit, exported headers must be explicitly added to header-y. Now, all headers under the uapi/ directories are exported. Signed-off-by: Masahiro Yamada commit 8c4fa8b8d48326353afaf6934edd5f1cc49ee90b Author: Masahiro Yamada Date: Thu Jan 3 10:10:36 2019 +0900 riscv: remove redundant kernel-space generic-y This commit removes redundant generic-y defines in arch/riscv/include/asm/Kbuild. [1] It is redundant to define the same generic-y in both arch/$(ARCH)/include/asm/Kbuild and arch/$(ARCH)/include/uapi/asm/Kbuild. Remove the following generic-y: errno.h fcntl.h ioctl.h ioctls.h ipcbuf.h mman.h msgbuf.h param.h poll.h posix_types.h resource.h sembuf.h setup.h shmbuf.h signal.h socket.h sockios.h stat.h statfs.h swab.h termbits.h termios.h types.h [2] It is redundant to define generic-y when arch-specific implementation exists in arch/$(ARCH)/include/asm/*.h Remove the following generic-y: cacheflush.h module.h Signed-off-by: Masahiro Yamada commit ad774086356da92a477a87916613d96f4b36005c Author: Masahiro Yamada Date: Mon Dec 31 17:24:09 2018 +0900 kbuild: change filechk to surround the given command with { } filechk_* rules often consist of multiple 'echo' lines. They must be surrounded with { } or ( ) to work correctly. Otherwise, only the string from the last 'echo' would be written into the target. Let's take care of that in the 'filechk' in scripts/Kbuild.include to clean up filechk_* rules. Signed-off-by: Masahiro Yamada commit 172caf1993b7a6503a9f7faf589e2cf26eb1f219 Author: Masahiro Yamada Date: Mon Dec 31 17:24:08 2018 +0900 kbuild: remove redundant target cleaning on failure Since commit 9c2af1c7377a ("kbuild: add .DELETE_ON_ERROR special target"), the target file is automatically deleted on failure. The boilerplate code ... || { rm -f $@; false; } is unneeded. Signed-off-by: Masahiro Yamada commit f5688663db9b207d7d31f30f388417504b16b76c Author: Masahiro Yamada Date: Mon Dec 31 13:09:00 2018 +0900 kbuild: clean up rule_dtc_dt_yaml Commit 3a2429e1faf4 ("kbuild: change if_changed_rule for multi-line recipe") and commit 4f0e3a57d6eb ("kbuild: Add support for DT binding schema checks") came in via different sub-systems. This is a follow-up cleanup. Signed-off-by: Masahiro Yamada commit 786ac51a48465da56f333652ec1d8b215bb272fe Author: Masahiro Yamada Date: Mon Dec 31 10:05:01 2018 +0900 kbuild: remove UIMAGE_IN and UIMAGE_OUT The only/last user of UIMAGE_IN/OUT was removed by commit 4722a3e6b716 ("microblaze: fix multiple bugs in arch/microblaze/boot/Makefile"). The input and output should always be $< and $@. Signed-off-by: Masahiro Yamada commit e9666d10a5677a494260d60d1fa0b73cc7646eb3 Author: Masahiro Yamada Date: Mon Dec 31 00:14:15 2018 +0900 jump_label: move 'asm goto' support test to Kconfig Currently, CONFIG_JUMP_LABEL just means "I _want_ to use jump label". The jump label is controlled by HAVE_JUMP_LABEL, which is defined like this: #if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) # define HAVE_JUMP_LABEL #endif We can improve this by testing 'asm goto' support in Kconfig, then make JUMP_LABEL depend on CC_HAS_ASM_GOTO. Ugly #ifdef HAVE_JUMP_LABEL will go away, and CONFIG_JUMP_LABEL will match to the real kernel capability. Signed-off-by: Masahiro Yamada Acked-by: Michael Ellerman (powerpc) Tested-by: Sedat Dilek commit 72d3ebb929de339f991fc49b58942d2d5ecdb753 Author: Mathias Krause Date: Sun Dec 30 13:36:00 2018 +0100 kallsyms: lower alignment on ARM As mentioned in the info pages of gas, the '.align' pseudo op's interpretation of the alignment value is architecture specific. It might either be a byte value or taken to the power of two. On ARM it's actually the latter which leads to unnecessary large alignments of 16 bytes for 32 bit builds or 256 bytes for 64 bit builds. Fix this by switching to '.balign' instead which is consistent across all architectures. Signed-off-by: Mathias Krause Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Masahiro Yamada commit c3003315fbf442d99a73a3fc5288dbf89a735e38 Author: Julia Lawall Date: Sat Dec 29 07:14:16 2018 +0100 scripts: coccinelle: boolinit: drop warnings on named constants Coccinelle doesn't always have access to the values of named (#define) constants, and they may likely often be bound to true and false values anyway, resulting in false positives. So stop warning about them. Signed-off-by: Julia Lawall Signed-off-by: Masahiro Yamada commit dc7884f34a5da79c61a9443c465a99512dc7bb15 Author: Julia Lawall Date: Fri Dec 28 15:49:01 2018 +0100 scripts: coccinelle: check for redeclaration Avoid reporting on the use of an iterator index variable when the variable is redeclared. Signed-off-by: Julia Lawall Signed-off-by: Masahiro Yamada commit a5003571e627789d8104ebdbe3ae24be41ea071a Author: Masahiro Yamada Date: Fri Dec 21 15:23:02 2018 +0900 kconfig: remove unused "file" field of yylval union This has never been used. Signed-off-by: Masahiro Yamada commit 5c0ab286aeb1b7feeb50c138f2d9d80b3b04c276 Author: Masahiro Yamada Date: Sun Dec 16 23:14:11 2018 +0900 nds32: remove redundant kernel-space generic-y This commit removes redundant generic-y defines in arch/nds32/include/asm/Kbuild. [1] It is redundant to define the same generic-y in both arch/$(ARCH)/include/asm/Kbuild and arch/$(ARCH)/include/uapi/asm/Kbuild. Remove the following generic-y: bitsperlong.h bpf_perf_event.h errno.h fcntl.h ioctl.h ioctls.h mman.h shmbuf.h stat.h [2] It is redundant to define generic-y when arch-specific implementation exists in arch/$(ARCH)/include/asm/*.h Remove the following generic-y: ftrace.h Signed-off-by: Masahiro Yamada commit fd8658b58030b1815ba8bccfc02692c9fa718996 Author: Masahiro Yamada Date: Mon Nov 26 16:42:10 2018 +0900 nios2: remove unneeded HAS_DMA define kernel/dma/Kconfig globally defines HAS_DMA as follows: config HAS_DMA bool depends on !NO_DMA default y Signed-off-by: Masahiro Yamada Reviewed-by: Christoph Hellwig commit 5c4a60831aa6d937cec9cf17aef8eb6c1851bfcd Merge: c280230254635 24ef9ec891c76 Author: Linus Torvalds Date: Sat Jan 5 16:07:28 2019 -0800 Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux Pull thermal management updates from Zhang Rui: - Add locking for cooling device sysfs attribute in case the cooling device state is changed by userspace and thermal framework simultaneously. (Thara Gopinath) - Fix a problem that passive cooling is reset improperly after system suspend/resume. (Wei Wang) - Cleanup the driver/thermal/ directory by moving intel and qcom platform specific drivers to platform specific sub-directories. (Amit Kucheria) - Some trivial cleanups. (Lukasz Luba, Wolfram Sang) * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: thermal/intel: fixup for Kconfig string parsing tightening up drivers: thermal: Move QCOM_SPMI_TEMP_ALARM into the qcom subdir drivers: thermal: Move various drivers for intel platforms into a subdir thermal: Fix locking in cooling device sysfs update cur_state Thermal: do not clear passive state during system sleep thermal: zx2967_thermal: simplify getting .driver_data thermal: st: st_thermal: simplify getting .driver_data thermal: spear_thermal: simplify getting .driver_data thermal: rockchip_thermal: simplify getting .driver_data thermal: int340x_thermal: int3400_thermal: simplify getting .driver_data thermal: remove unused function parameter commit c280230254635da33703dd8f4a10cad23f640fb0 Merge: a67012412e5a8 9d216211fded2 Author: Linus Torvalds Date: Sat Jan 5 16:01:16 2019 -0800 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal Pull thermal SoC updates from Eduardo Valentin: - Tegra DT binding documentation for Tegra194 - Armada now supports ap806 and cp110 - RCAR thermal now supports R8A774C0 and R8A77990 - Fixes on thermal_hwmon, IMX, generic-ADC, ST, RCAR, Broadcom, Uniphier, QCOM, Tegra, PowerClamp, and Armada thermal drivers. * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal: (22 commits) thermal: generic-adc: Fix adc to temp interpolation thermal: rcar_thermal: add R8A77990 support dt-bindings: thermal: rcar-thermal: add R8A77990 support thermal: rcar_thermal: add R8A774C0 support dt-bindings: thermal: rcar-thermal: add R8A774C0 support dt-bindings: cp110: document the thermal interrupt capabilities dt-bindings: ap806: document the thermal interrupt capabilities MAINTAINERS: thermal: add entry for Marvell MVEBU thermal driver thermal: armada: add overheat interrupt support thermal: st: fix Makefile typo thermal: uniphier: Convert to SPDX identifier thermal/intel_powerclamp: Change to use DEFINE_SHOW_ATTRIBUTE macro thermal: tegra: soctherm: Change to use DEFINE_SHOW_ATTRIBUTE macro dt-bindings: thermal: tegra-bpmp: Add Tegra194 support thermal: imx: save one condition block for normal case of nvmem initialization thermal: imx: fix for dependency on cpu-freq thermal: tsens: qcom: do not create duplicate regmap debugfs entries thermal: armada: Use PTR_ERR_OR_ZERO in armada_thermal_probe_legacy() dt-bindings: thermal: rcar-gen3-thermal: All variants use 3 interrupts thermal: broadcom: use devm_thermal_zone_of_sensor_register ... commit d4a7e9bb74b5aaf07b89f6531c080b1130bdf019 Author: David Ahern Date: Sat Jan 5 07:35:04 2019 -0800 ipv6: Take rcu_read_lock in __inet6_bind for mapped addresses I realized the last patch calls dev_get_by_index_rcu in a branch not holding the rcu lock. Add the calls to rcu_read_lock and rcu_read_unlock. Fixes: ec90ad334986 ("ipv6: Consider sk_bound_dev_if when binding a socket to a v4 mapped address") Signed-off-by: David Ahern Signed-off-by: David S. Miller commit a67012412e5a820c44239af9712a1a6037b33fd4 Merge: 7e928df80d30b dc56367cb5dbf Author: Linus Torvalds Date: Sat Jan 5 14:08:00 2019 -0800 Merge tag 'trace-v4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull ftrace sh build fix from Steven Rostedt: "It appears that the zero-day bot did find a bug in my sh build. And that I didn't have the bad code in my config file when I cross compiled it, although there are a few other errors in sh that makes it not build for me, I missed that I added one more" * tag 'trace-v4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: sh: ftrace: Fix missing parenthesis in WARN_ON() commit 7e928df80d30b7664b5822784c95b4a54dc7cfbf Merge: 3cd6d495db2a0 d5c7076b772ad Author: Linus Torvalds Date: Sat Jan 5 14:05:06 2019 -0800 Merge tag '4.21-smb3-small-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull smb3 fixes from Steve French: "Three fixes, one for stable, one adds the (most secure) SMB3.1.1 dialect to default list requested" * tag '4.21-smb3-small-fixes' of git://git.samba.org/sfrench/cifs-2.6: smb3: add smb3.1.1 to default dialect list cifs: fix confusing warning message on reconnect smb3: fix large reads on encrypted connections commit 3cd6d495db2a0acfd2854f43aac8bfc5914bc89c Merge: acda9efa8c62d 31af12efd0a25 Author: Linus Torvalds Date: Sat Jan 5 14:02:22 2019 -0800 Merge tag 'iomap-4.21-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull iomap maintainer update from Darrick Wong: "Christoph Hellwig and I have decided to take responsibility for the fs iomap code rather than let it languish further" * tag 'iomap-4.21-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: iomap: take responsibility for the filesystem iomap code commit acda9efa8c62d4baa0395c83bda43f252137e302 Merge: c7eaf342ecb16 90be9b86da903 Author: Linus Torvalds Date: Sat Jan 5 14:00:56 2019 -0800 Merge tag 'xfs-4.21-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fixlets from Darrick Wong: "Remove a couple of unnecessary local variables" * tag 'xfs-4.21-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: xfs_fsops: drop useless LIST_HEAD xfs: xfs_buf: drop useless LIST_HEAD commit c7eaf342ecb164d79275a6c1c93aef19293a4aaf Merge: 35004f2e55807 5ccedf1ccd710 Author: Linus Torvalds Date: Sat Jan 5 13:58:08 2019 -0800 Merge tag 'ceph-for-4.21-rc1' of git://github.com/ceph/ceph-client Pull ceph updates from Ilya Dryomov: "A fairly quiet round: a couple of messenger performance improvements from myself and a few cap handling fixes from Zheng" * tag 'ceph-for-4.21-rc1' of git://github.com/ceph/ceph-client: ceph: don't encode inode pathes into reconnect message ceph: update wanted caps after resuming stale session ceph: skip updating 'wanted' caps if caps are already issued ceph: don't request excl caps when mount is readonly ceph: don't update importing cap's mseq when handing cap export libceph: switch more to bool in ceph_tcp_sendmsg() libceph: use MSG_SENDPAGE_NOTLAST with ceph_tcp_sendpage() libceph: use sock_no_sendpage() as a fallback in ceph_tcp_sendpage() libceph: drop last_piece logic from write_partial_message_data() ceph: remove redundant assignment ceph: cleanup splice_dentry() commit 35004f2e55807a1a1491db24ab512dd2f770a130 Author: Olof Johansson Date: Sat Jan 5 13:21:18 2019 -0800 lib/genalloc.c: include vmalloc.h Fixes build break on most ARM/ARM64 defconfigs: lib/genalloc.c: In function 'gen_pool_add_virt': lib/genalloc.c:190:10: error: implicit declaration of function 'vzalloc_node'; did you mean 'kzalloc_node'? lib/genalloc.c:190:8: warning: assignment to 'struct gen_pool_chunk *' from 'int' makes pointer from integer without a cast [-Wint-conversion] lib/genalloc.c: In function 'gen_pool_destroy': lib/genalloc.c:254:3: error: implicit declaration of function 'vfree'; did you mean 'kfree'? Fixes: 6862d2fc8185 ('lib/genalloc.c: use vzalloc_node() to allocate the bitmap') Cc: Huang Shijie Cc: Andrew Morton Cc: Alexey Skidanov Signed-off-by: Olof Johansson Signed-off-by: Linus Torvalds commit 505b050fdf42097883b2d37b8e796e1f11dbef50 Merge: 9b286efeb5eb5 718c43038f287 Author: Linus Torvalds Date: Sat Jan 5 13:25:58 2019 -0800 Merge branch 'mount.part1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs mount API prep from Al Viro: "Mount API prereqs. Mostly that's LSM mount options cleanups. There are several minor fixes in there, but nothing earth-shattering (leaks on failure exits, mostly)" * 'mount.part1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (27 commits) mount_fs: suppress MAC on MS_SUBMOUNT as well as MS_KERNMOUNT smack: rewrite smack_sb_eat_lsm_opts() smack: get rid of match_token() smack: take the guts of smack_parse_opts_str() into a new helper LSM: new method: ->sb_add_mnt_opt() selinux: rewrite selinux_sb_eat_lsm_opts() selinux: regularize Opt_... names a bit selinux: switch away from match_token() selinux: new helper - selinux_add_opt() LSM: bury struct security_mnt_opts smack: switch to private smack_mnt_opts selinux: switch to private struct selinux_mnt_opts LSM: hide struct security_mnt_opts from any generic code selinux: kill selinux_sb_get_mnt_opts() LSM: turn sb_eat_lsm_opts() into a method nfs_remount(): don't leak, don't ignore LSM options quietly btrfs: sanitize security_mnt_opts use selinux; don't open-code a loop in sb_finish_set_opts() LSM: split ->sb_set_mnt_opts() out of ->sb_kern_mount() new helper: security_sb_eat_lsm_opts() ... commit 9b286efeb5eb5aaa2712873fc1f928b2f879dbde Merge: 47f3f4eb7834e e4f2283cc6ffe Author: Linus Torvalds Date: Sat Jan 5 13:18:59 2019 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull trivial vfs updates from Al Viro: "A few cleanups + Neil's namespace_unlock() optimization" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: exec: make prepare_bprm_creds static genheaders: %-s had been there since v6; %-*s - since v7 VFS: use synchronize_rcu_expedited() in namespace_unlock() iov_iter: reduce code duplication commit 47f3f4eb7834ea424b0704bffd0d3e3c8ffbc3a1 Merge: f1c2f8857c5aa edefae94b7b9f Author: Linus Torvalds Date: Sat Jan 5 12:48:25 2019 -0800 Merge tag 'mips_fixes_4.21_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fixes from Paul Burton: "A few early MIPS fixes for 4.21: - The Broadcom BCM63xx platform sees a fix for resetting the BCM6368 ethernet switch, and the removal of a platform device we've never had a driver for. - The Alchemy platform sees a few fixes for bitrot that occurred within the past few cycles. - We now enable vectored interrupt support for the MediaTek MT7620 SoC, which makes sense since they're supported by the SoC but in this case also works around a bug relating to the location of exception vectors when using a recent version of U-Boot. - The atomic64_fetch_*_relaxed() family of functions see a fix for a regression in MIPS64 kernels since v4.19. - Cavium Octeon III CN7xxx systems will now disable their RGMII interfaces rather than attempt to enable them & warn about the lack of support for doing so, as they did since initial CN7xxx ethernet support was added in v4.7. - The Microsemi/Microchip MSCC SoCs gain a MAINTAINERS entry. - .mailmap now provides consistency for Dengcheng Zhu's name & current email address" * tag 'mips_fixes_4.21_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: OCTEON: mark RGMII interface disabled on OCTEON III MIPS: Fix a R10000_LLSC_WAR logic in atomic.h MIPS: BCM63XX: drop unused and broken DSP platform device mailmap: Update name spelling and email for Dengcheng Zhu MIPS: ralink: Select CONFIG_CPU_MIPSR2_IRQ_VI on MT7620/8 MAINTAINERS: Add a maintainer for MSCC MIPS SoCs MIPS: Alchemy: update dma masks for devboard devices MIPS: Alchemy: update cpu-feature-overrides MIPS: Alchemy: drop DB1000 IrDA support bits MIPS: alchemy: cpu_all_mask is forbidden for clock event devices MIPS: BCM63XX: fix switch core reset on BCM6368 commit f1c2f8857c5aa6c92aa903bc06437503422e5925 Merge: cd08f68c659f4 074400a7be612 Author: Linus Torvalds Date: Sat Jan 5 11:48:44 2019 -0800 Merge tag 'powerpc-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: "A fix for the recent access_ok() change, which broke the build. We recently added a use of type in order to squash a warning elsewhere about type being unused. A handful of other minor build fixes, and one defconfig update. Thanks to: Christian Lamparter, Christophe Leroy, Diana Craciun, Mathieu Malaterre" * tag 'powerpc-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc: Drop use of 'type' from access_ok() KVM: PPC: Book3S HV: radix: Fix uninitialized var build error powerpc/configs: Add PPC4xx_OCM to ppc40x_defconfig powerpc/4xx/ocm: Fix phys_addr_t printf warnings powerpc/4xx/ocm: Fix compilation error due to PAGE_KERNEL usage powerpc/fsl: Fixed warning: orphan section `__btb_flush_fixup' commit cd08f68c659f42f9ec23b25b9cefd1ef49dc78b5 Merge: 670b321f4150b dfbaecb2b707c Author: Linus Torvalds Date: Sat Jan 5 11:44:20 2019 -0800 Merge branch 'parisc-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc fix from Helge Deller: "Fix boot issues with a series of parisc servers since kernel 4.20. Remapping kernel text with set_kernel_text_rw() missed to remap from lowest up until the highest huge-page aligned kernel text addresss" * 'parisc-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Remap hugepage-aligned pages in set_kernel_text_rw() commit 670b321f4150bfc8a2261f4db3fcdab21738506b Merge: b23b0ea3708c3 21c7acc439b55 Author: Linus Torvalds Date: Sat Jan 5 11:35:55 2019 -0800 Merge tag 'for-4.21' of git://git.sourceforge.jp/gitroot/uclinux-h8/linux Pull h8300 fix from Yoshinori Sato: "Build problem fix" * tag 'for-4.21' of git://git.sourceforge.jp/gitroot/uclinux-h8/linux: h8300: pci: Remove local declaration of pcibios_penalize_isa_irq commit b23b0ea3708c3dec599966fc856836aca48835b9 Merge: 078a5a4faf64f 00f8ccd0c95f4 Author: Linus Torvalds Date: Sat Jan 5 11:30:37 2019 -0800 Merge tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull more ARM SoC updates from Olof Johansson: "A few updates that we merged late but are low risk for regressions for other platforms (and a few other straggling patches): - I mis-tagged the 'drivers' branch, and missed 3 patches. Merged in here. They're for a driver for the PL353 SRAM controller and a build fix for the qualcomm scm driver. - A new platform, RDA Micro RDA8810PL (Cortex-A5 w/ integrated Vivante GPU, 256MB RAM, Wifi). This includes some acked platform-specific drivers (serial, etc). This also include DTs for two boards with this SoC, OrangePi 2G and OrangePi i86. - i.MX8 is another new platform (NXP, 4x Cortex-A53 + Cortex-M4, 4K video playback offload). This is the first i.MX 64-bit SoC. - Some minor updates to Samsung boards (adding a few peripherals in DTs). - Small rework for SMP bootup on STi platforms. - A couple of TEE driver fixes. - A couple of new config options (bcm2835 thermal, Uniphier MDMAC) enabled in defconfigs" * tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (27 commits) ARM: multi_v7_defconfig: enable CONFIG_UNIPHIER_MDMAC arm64: defconfig: Re-enable bcm2835-thermal driver MAINTAINERS: Add entry for RDA Micro SoC architecture tty: serial: Add RDA8810PL UART driver ARM: dts: rda8810pl: Add interrupt support for UART dt-bindings: serial: Document RDA Micro UART ARM: dts: rda8810pl: Add timer support ARM: dts: Add devicetree for OrangePi i96 board ARM: dts: Add devicetree for OrangePi 2G IoT board ARM: dts: Add devicetree for RDA8810PL SoC ARM: Prepare RDA8810PL SoC dt-bindings: arm: Document RDA8810PL and reference boards dt-bindings: Add RDA Micro vendor prefix ARM: sti: remove pen_release and boot_lock arm64: dts: exynos: Add Bluetooth chip to TM2(e) boards arm64: dts: imx8mq-evk: enable watchdog arm64: dts: imx8mq: add watchdog devices MAINTAINERS: add i.MX8 DT path to i.MX architecture arm64: add support for i.MX8M EVK board arm64: add basic DTS for i.MX8MQ ... commit 078a5a4faf64fefaf13478a9091782432cad33fa Merge: 1205b62390eed 7e0b44e870cf2 Author: Linus Torvalds Date: Sat Jan 5 11:28:39 2019 -0800 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "I'm safely chained back up to my desk, so please pull these arm64 fixes for -rc1 that address some issues that cropped up during the merge window: - Prevent KASLR from mapping the top page of the virtual address space - Fix device-tree probing of SDEI driver - Fix incorrect register offset definition in Hisilicon DDRC PMU driver - Fix compilation issue with older binutils not liking unsigned immediates - Fix uapi headers so that libc can provide its own sigcontext definition - Fix handling of private compat syscalls - Hook up compat io_pgetevents() syscall for 32-bit tasks - Cleanup to arm64 Makefile (including now to avoid silly conflicts)" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: compat: Hook up io_pgetevents() for 32-bit tasks arm64: compat: Don't pull syscall number from regs in arm_compat_syscall arm64: compat: Avoid sending SIGILL for unallocated syscall numbers arm64/sve: Disentangle from arm64/sve: ptrace: Fix SVE_PT_REGS_OFFSET definition drivers/perf: hisi: Fixup one DDRC PMU register offset arm64: replace arm64-obj-* in Makefile with obj-* arm64: kaslr: Reserve size of ARM64_MEMSTART_ALIGN in linear region firmware: arm_sdei: Fix DT platform device creation firmware: arm_sdei: fix wrong of_node_put() in init function arm64: entry: remove unused register aliases arm64: smp: Fix compilation error commit 1205b62390eed4e747232d183fbf412a5aecacd9 Merge: 9ee3b3f4a5eb5 6de92920a717e Author: Linus Torvalds Date: Sat Jan 5 11:23:17 2019 -0800 Merge tag 'for-4.21' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM updates from Russell King: "Included in this update: - Florian Fainelli noticed that userspace segfaults caused by the lack of kernel-userspace helpers was hard to diagnose; we now issue a warning when userspace tries to use the helpers but the kernel has them disabled. - Ben Dooks wants compatibility for the old ATAG serial number with DT systems. - Some cleanup of assembly by Nicolas Pitre. - User accessors optimisation from Vincent Whitchurch. - More robust kdump on SMP systems from Yufen Wang. - Sebastian Andrzej Siewior noticed problems with the SMP "boot_lock" on RT kernels, and so we convert the Versatile series of platforms to use a raw spinlock instead, consolidating the Versatile implementation. We entirely remove the boot_lock on OMAP systems, where it's unnecessary. Further patches for other systems will be submitted for the following merge window. - Start switching old StrongARM-11x0 systems to use gpiolib rather than their private GPIO implementation - mostly PCMCIA bits. - ARM Kconfig cleanups. - Cleanup a mostly harmless mistake in the recent Spectre patch in 4.20 (which had the effect that data that can be placed into the init sections was incorrectly always placed in the rodata section)" * tag 'for-4.21' of git://git.armlinux.org.uk/~rmk/linux-arm: (25 commits) ARM: omap2: remove unnecessary boot_lock ARM: versatile: rename and comment SMP implementation ARM: versatile: convert boot_lock to raw ARM: vexpress/realview: consolidate immitation CPU hotplug ARM: fix the cockup in the previous patch ARM: sa1100/cerf: switch to using gpio_led_register_device() ARM: sa1100/assabet: switch to using gpio leds ARM: sa1100/assabet: add gpio keys support for right-hand two buttons ARM: sa1111: remove legacy GPIO interfaces pcmcia: sa1100*: remove redundant bvd1/bvd2 setting ARM: pxa/lubbock: switch PCMCIA to MAX1600 library ARM: pxa/mainstone: switch PCMCIA to MAX1600 library and gpiod APIs ARM: sa1100/neponset: switch PCMCIA to MAX1600 library and gpiod APIs ARM: sa1100/jornada720: switch PCMCIA to gpiod APIs pcmcia: add MAX1600 library ARM: sa1100: explicitly register sa11x0-pcmcia devices ARM: 8813/1: Make aligned 2-byte getuser()/putuser() atomic on ARMv6+ ARM: 8812/1: Optimise copy_{from/to}_user for !CPU_USE_DOMAINS ARM: 8811/1: always list both ldrd/strd registers explicitly ARM: 8808/1: kexec:offline panic_smp_self_stop CPU ... commit 9ee3b3f4a5eb523ef27675ac2fcd2269b9d68767 Merge: a65981109f294 f50fd2d8524c1 Author: Linus Torvalds Date: Sat Jan 5 09:50:07 2019 -0800 Merge tag 'csky-for-linus-4.21' of git://github.com/c-sky/csky-linux Pull arch/csky updates from Guo Ren: "Here are three main features (cpu_hotplug, basic ftrace, basic perf) and some bugfixes: Features: - Add CPU-hotplug support for SMP - Add ftrace with function trace and function graph trace - Add Perf support - Add EM_CSKY_OLD 39 - optimize kernel panic print. - remove syscall_exit_work Bugfixes: - fix abiv2 mmap(... O_SYNC) failure - fix gdb coredump error - remove vdsp implement for kernel - fix qemu failure to bootup sometimes - fix ftrace call-graph panic - fix device tree node reference leak - remove meaningless header-y - fix save hi,lo,dspcr regs in switch_stack - remove unused members in processor.h" * tag 'csky-for-linus-4.21' of git://github.com/c-sky/csky-linux: csky: Add perf support for C-SKY csky: Add EM_CSKY_OLD 39 clocksource/drivers/c-sky: fixup ftrace call-graph panic csky: ftrace call graph supported. csky: basic ftrace supported csky: remove unused members in processor.h csky: optimize kernel panic print. csky: stacktrace supported. csky: CPU-hotplug supported for SMP clocksource/drivers/c-sky: fixup qemu fail to bootup sometimes. csky: fixup save hi,lo,dspcr regs in switch_stack. csky: remove syscall_exit_work csky: fixup remove vdsp implement for kernel. csky: bugfix gdb coredump error. csky: fixup abiv2 mmap(... O_SYNC) failed. csky: define syscall_get_arch() elf-em.h: add EM_CSKY csky: remove meaningless header-y csky: Don't leak device tree node reference commit a65981109f294ba7e64b33ad3b4575a4636fce66 Merge: 3fed6ae4b027f b685a7350ae76 Author: Linus Torvalds Date: Sat Jan 5 09:16:18 2019 -0800 Merge branch 'akpm' (patches from Andrew) Merge more updates from Andrew Morton: - procfs updates - various misc bits - lib/ updates - epoll updates - autofs - fatfs - a few more MM bits * emailed patches from Andrew Morton : (58 commits) mm/page_io.c: fix polled swap page in checkpatch: add Co-developed-by to signature tags docs: fix Co-Developed-by docs drivers/base/platform.c: kmemleak ignore a known leak fs: don't open code lru_to_page() fs/: remove caller signal_pending branch predictions mm/: remove caller signal_pending branch predictions arch/arc/mm/fault.c: remove caller signal_pending_branch predictions kernel/sched/: remove caller signal_pending branch predictions kernel/locking/mutex.c: remove caller signal_pending branch predictions mm: select HAVE_MOVE_PMD on x86 for faster mremap mm: speed up mremap by 20x on large regions mm: treewide: remove unused address argument from pte_alloc functions initramfs: cleanup incomplete rootfs scripts/gdb: fix lx-version string output kernel/kcov.c: mark write_comp_data() as notrace kernel/sysctl: add panic_print into sysctl panic: add options to print system info when panic happens bfs: extra sanity checking and static inode bitmap exec: separate MM_ANONPAGES and RLIMIT_STACK accounting ... commit 8270f3a11ceef64bdb0ab141180e8d2f17c619ec Author: Christoph Hellwig Date: Fri Jan 4 18:31:48 2019 +0100 dma-direct: fix DMA_ATTR_NO_KERNEL_MAPPING for remapped allocations We need to return a dma_addr_t even if we don't have a kernel mapping. Do so by consolidating the phys_to_dma call in a single place and jump to it from all the branches that return successfully. Fixes: bfd56cd60521 ("dma-mapping: support highmem in the generic remap allocator") Reported-by: Liviu Dudau Tested-by: Liviu Dudau commit 06f55fd2d22742ed7e725124dfea68936d12ce40 Author: Christoph Hellwig Date: Fri Jan 4 09:50:33 2019 +0100 x86/amd_gart: fix unmapping of non-GART mappings In many cases we don't have to create a GART mapping at all, which also means there is nothing to unmap. Fix the range check that was incorrectly modified when removing the mapping_error method. Fixes: 9e8aa6b546 ("x86/amd_gart: remove the mapping_error dma_map_ops method") Reported-by: Michal Kubecek Signed-off-by: Christoph Hellwig Tested-by: Michal Kubecek commit 466f89e9ec8c6868131c2d2ba9cd5f536879c42a Merge: ec90ad334986f 976b4f3a4646f Author: Alexei Starovoitov Date: Fri Jan 4 20:23:33 2019 -0800 Merge branch 'udpv6_sendmsg-addr_any-fix' Andrey Ignatov says: ==================== The patch set fixes BSD'ism in sys_sendmsg to rewrite unspecified destination IPv6 for unconnected UDP sockets in sys_sendmsg with [::1] in case when either CONFIG_CGROUP_BPF is enabled or when sys_sendmsg BPF hook sets destination IPv6 to [::]. Patch 1 is the fix and provides more details. Patch 2 adds two test cases to verify the fix. v1->v2: * Fix compile error in patch 1. ==================== Signed-off-by: Alexei Starovoitov commit 976b4f3a4646fbf0d189caca25f91f82e4be4b5a Author: Andrey Ignatov Date: Fri Jan 4 01:07:08 2019 -0800 selftests/bpf: Test [::] -> [::1] rewrite in sys_sendmsg in test_sock_addr Test that sys_sendmsg BPF hook doesn't break sys_sendmsg behaviour to rewrite destination IPv6 = [::] with [::1] (BSD'ism). Two test cases are added: 1) User passes dst IPv6 = [::] and BPF_CGROUP_UDP6_SENDMSG program doesn't touch it. 2) User passes dst IPv6 != [::], but BPF_CGROUP_UDP6_SENDMSG program rewrites it with [::]. In both cases [::1] is used by sys_sendmsg code eventually and datagram is sent successfully for unconnected UDP socket. Example of relevant output: Test case: sendmsg6: set dst IP = [::] (BSD'ism) .. [PASS] Test case: sendmsg6: preserve dst IP = [::] (BSD'ism) .. [PASS] Signed-off-by: Andrey Ignatov Signed-off-by: Alexei Starovoitov commit e8e36984080b55ac5e57bdb09a5b570f2fc8e963 Author: Andrey Ignatov Date: Fri Jan 4 01:07:07 2019 -0800 bpf: Fix [::] -> [::1] rewrite in sys_sendmsg sys_sendmsg has supported unspecified destination IPv6 (wildcard) for unconnected UDP sockets since 876c7f41. When [::] is passed by user as destination, sys_sendmsg rewrites it with [::1] to be consistent with BSD (see "BSD'ism" comment in the code). This didn't work when cgroup-bpf was enabled though since the rewrite [::] -> [::1] happened before passing control to cgroup-bpf block where fl6.daddr was updated with passed by user sockaddr_in6.sin6_addr (that might or might not be changed by BPF program). That way if user passed [::] as dst IPv6 it was first rewritten with [::1] by original code from 876c7f41, but then rewritten back with [::] by cgroup-bpf block. It happened even when BPF_CGROUP_UDP6_SENDMSG program was not present (CONFIG_CGROUP_BPF=y was enough). The fix is to apply BSD'ism after cgroup-bpf block so that [::] is replaced with [::1] no matter where it came from: passed by user to sys_sendmsg or set by BPF_CGROUP_UDP6_SENDMSG program. Fixes: 1cedee13d25a ("bpf: Hooks for sys_sendmsg") Reported-by: Nitin Rawat Signed-off-by: Andrey Ignatov Signed-off-by: Alexei Starovoitov commit bb351abaf5cd4f9237e1b3094d9cc04853de6d95 Author: Weiping Zhang Date: Wed Dec 26 11:56:33 2018 +0800 block: add documentation for io_timeout Add documentation for /sys/block//queue/io_timeout. Reviewed-by: Bart Van Assche Signed-off-by: Weiping Zhang Signed-off-by: Jens Axboe commit 3fed6ae4b027f9c93be18520f87bd06bdffd196b Author: Christoph Hellwig Date: Fri Jan 4 13:03:08 2019 -0800 ia64: fix compile without swiotlb Some non-generic ia64 configs don't build swiotlb, and thus should not pull in the generic non-coherent DMA infrastructure. Fixes: 68c608345c ("swiotlb: remove dma_mark_clean") Reported-by: Tony Luck Signed-off-by: Christoph Hellwig Signed-off-by: Tony Luck Signed-off-by: Linus Torvalds commit 170d13ca3a2fdaaa0283399247631b76b441cca2 Author: Linus Torvalds Date: Fri Jan 4 17:52:49 2019 -0800 x86: re-introduce non-generic memcpy_{to,from}io This has been broken forever, and nobody ever really noticed because it's purely a performance issue. Long long ago, in commit 6175ddf06b61 ("x86: Clean up mem*io functions") Brian Gerst simplified the memory copies to and from iomem, since on x86, the instructions to access iomem are exactly the same as the regular instructions. That is technically true, and things worked, and nobody said anything. Besides, back then the regular memcpy was pretty simple and worked fine. Nobody noticed except for David Laight, that is. David has a testing a TLP monitor he was writing for an FPGA, and has been occasionally complaining about how memcpy_toio() writes things one byte at a time. Which is completely unacceptable from a performance standpoint, even if it happens to technically work. The reason it's writing one byte at a time is because while it's technically true that accesses to iomem are the same as accesses to regular memory on x86, the _granularity_ (and ordering) of accesses matter to iomem in ways that they don't matter to regular cached memory. In particular, when ERMS is set, we default to using "rep movsb" for larger memory copies. That is indeed perfectly fine for real memory, since the whole point is that the CPU is going to do cacheline optimizations and executes the memory copy efficiently for cached memory. With iomem? Not so much. With iomem, "rep movsb" will indeed work, but it will copy things one byte at a time. Slowly and ponderously. Now, originally, back in 2010 when commit 6175ddf06b61 was done, we didn't use ERMS, and this was much less noticeable. Our normal memcpy() was simpler in other ways too. Because in fact, it's not just about using the string instructions. Our memcpy() these days does things like "read and write overlapping values" to handle the last bytes of the copy. Again, for normal memory, overlapping accesses isn't an issue. For iomem? It can be. So this re-introduces the specialized memcpy_toio(), memcpy_fromio() and memset_io() functions. It doesn't particularly optimize them, but it tries to at least not be horrid, or do overlapping accesses. In fact, this uses the existing __inline_memcpy() function that we still had lying around that uses our very traditional "rep movsl" loop followed by movsw/movsb for the final bytes. Somebody may decide to try to improve on it, but if we've gone almost a decade with only one person really ever noticing and complaining, maybe it's not worth worrying about further, once it's not _completely_ broken? Reported-by: David Laight Signed-off-by: Linus Torvalds commit a959dc88f9c8900296ccf13e2f3e1cbc555a8917 Author: Linus Torvalds Date: Sat May 21 21:55:19 2016 -0700 Use __put_user_goto in __put_user_size() and unsafe_put_user() This actually enables the __put_user_goto() functionality in unsafe_put_user(). For an example of the effect of this, this is the code generated for the unsafe_put_user(signo, &infop->si_signo, Efault); in the waitid() system call: movl %ecx,(%rbx) # signo, MEM[(struct __large_struct *)_2] It's just one single store instruction, along with generating an exception table entry pointing to the Efault label case in case that instruction faults. Before, we would generate this: xorl %edx, %edx movl %ecx,(%rbx) # signo, MEM[(struct __large_struct *)_3] testl %edx, %edx jne .L309 with the exception table generated for that 'mov' instruction causing us to jump to a stub that set %edx to -EFAULT and then jumped back to the 'testl' instruction. So not only do we now get rid of the extra code in the normal sequence, we also avoid unnecessarily keeping that extra error register live across it all. Signed-off-by: Linus Torvalds commit 4a789213c9a54c8b618924d3421e56e98df8a447 Author: Linus Torvalds Date: Sat May 21 21:44:51 2016 -0700 x86 uaccess: Introduce __put_user_goto This is finally the actual reason for the odd error handling in the "unsafe_get/put_user()" functions, introduced over three years ago. Using a "jump to error label" interface is somewhat odd, but very convenient as a programming interface, and more importantly, it fits very well with simply making the target be the exception handler address directly from the inline asm. The reason it took over three years to actually do this? We need "asm goto" support for it, which only became the default on x86 last year. It's now been a year that we've forced asm goto support (see commit e501ce957a78 "x86: Force asm-goto"), and so let's just do it here too. [ Side note: this commit was originally done back in 2016. The above commentary about timing is obviously about it only now getting merged into my real upstream tree - Linus ] Sadly, gcc still only supports "asm goto" with asms that do not have any outputs, so we are limited to only the put_user case for this. Maybe in several more years we can do the get_user case too. Signed-off-by: Linus Torvalds commit ec90ad334986fa5856d11dd272f7f22fa86c55c4 Author: David Ahern Date: Fri Jan 4 16:58:15 2019 -0800 ipv6: Consider sk_bound_dev_if when binding a socket to a v4 mapped address Similar to c5ee066333eb ("ipv6: Consider sk_bound_dev_if when binding a socket to an address"), binding a socket to v4 mapped addresses needs to consider if the socket is bound to a device. This problem also exists from the beginning of git history. Signed-off-by: David Ahern Signed-off-by: David S. Miller commit dfbaecb2b707cfdc5276b548d52b437384bd6483 Author: Helge Deller Date: Fri Jan 4 23:32:53 2019 +0100 parisc: Remap hugepage-aligned pages in set_kernel_text_rw() The alternative coding patch for parisc in kernel 4.20 broke booting machines with PA8500-PA8700 CPUs. The problem is, that for such machines the parisc kernel automatically utilizes huge pages to access kernel text code, but the set_kernel_text_rw() function, which is used shortly before applying any alternative patches, didn't used the correctly hugepage-aligned addresses to remap the kernel text read-writeable. Fixes: 3847dab77421 ("parisc: Add alternative coding infrastructure") Cc: [4.20] Signed-off-by: Helge Deller commit 00f8ccd0c95f4e604297057a5bccec86c0903d14 Merge: 8e564895c30ca 3e730e858139c Author: Olof Johansson Date: Fri Jan 4 14:30:36 2019 -0800 Merge branch 'next/drivers' into next/late Merge in a few missing patches from the pull request (my copy of the branch was behind the staged version in linux-next). * next/drivers: memory: pl353: Add driver for arm pl353 static memory controller dt-bindings: memory: Add pl353 smc controller devicetree binding information firmware: qcom: scm: fix compilation error when disabled Signed-off-by: Olof Johansson commit 8e564895c30ca73cd9788aecb845879ddee987c3 Author: Masahiro Yamada Date: Fri Dec 21 17:51:24 2018 +0900 ARM: multi_v7_defconfig: enable CONFIG_UNIPHIER_MDMAC Enable the UniPhier MIO DMAC driver. This is used as the DMA engine for accelerating the SD/eMMC controller drivers. Signed-off-by: Masahiro Yamada Signed-off-by: Olof Johansson commit ae84e4a8eb6f0d7f3b902ce238f285e98cf2ac12 Author: Jeff Kirsher Date: Fri Jan 4 10:48:02 2019 -0800 ixgbe: fix Kconfig when driver is not a module The new ability added to the driver to use mii_bus to handle MII related ioctls is causing compile issues when the driver is compiled into the kernel (i.e. not a module). The problem was in selecting MDIO_DEVICE instead of the preferred PHYLIB Kconfig option. The reason being that MDIO_DEVICE had a dependency on PHYLIB and would be compiled as a module when PHYLIB was a module, no matter whether ixgbe was compiled into the kernel. CC: Dave Jones CC: Steve Douthit CC: Florian Fainelli Signed-off-by: Jeff Kirsher Reviewed-by: Stephen Douthit Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 8d933670452107e41165bea70a30dffbd281bef1 Author: Eric Dumazet Date: Fri Jan 4 11:00:00 2019 -0800 ipv6: make icmp6_send() robust against null skb->dev syzbot was able to crash one host with the following stack trace : kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 8625 Comm: syz-executor4 Not tainted 4.20.0+ #8 RIP: 0010:dev_net include/linux/netdevice.h:2169 [inline] RIP: 0010:icmp6_send+0x116/0x2d30 net/ipv6/icmp.c:426 icmpv6_send smack_socket_sock_rcv_skb security_sock_rcv_skb sk_filter_trim_cap __sk_receive_skb dccp_v6_do_rcv release_sock This is because a RX packet found socket owned by user and was stored into socket backlog. Before leaving RCU protected section, skb->dev was cleared in __sk_receive_skb(). When socket backlog was finally handled at release_sock() time, skb was fed to smack_socket_sock_rcv_skb() then icmp6_send() We could fix the bug in smack_socket_sock_rcv_skb(), or simply make icmp6_send() more robust against such possibility. In the future we might provide to icmp6_send() the net pointer instead of infering it. Fixes: d66a8acbda92 ("Smack: Inform peer that IPv6 traffic has been blocked") Signed-off-by: Eric Dumazet Cc: Piotr Sawicki Cc: Casey Schaufler Reported-by: syzbot Acked-by: Casey Schaufler Signed-off-by: David S. Miller commit 3271a4821882a64214acc1bd7b173900ec70c9bf Author: Peter Oskolkov Date: Fri Jan 4 09:43:08 2019 -0800 selftests: net: fix/improve ip_defrag selftest Commit ade446403bfb ("net: ipv4: do not handle duplicate fragments as overlapping") changed IPv4 defragmentation so that duplicate fragments, as well as _some_ fragments completely covered by previously delivered fragments, do not lead to the whole frag queue being discarded. This makes the existing ip_defrag selftest flaky. This patch * makes sure that negative IPv4 defrag tests generate truly overlapping fragments that trigger defrag queue drops; * tests that duplicate IPv4 fragments do not trigger defrag queue drops; * makes a couple of minor tweaks to the test aimed at increasing its code coverage and reduce flakiness. Signed-off-by: Peter Oskolkov Signed-off-by: David S. Miller commit f87118d5760f00af7228033fbe783c7f380d2866 Author: Daniele Palmas Date: Fri Jan 4 13:26:10 2019 +0100 qmi_wwan: add MTU default to qmap network interface This patch adds MTU default value to qmap network interface in order to avoid "RTNETLINK answers: No buffer space available" error when setting an ipv6 address. Signed-off-by: Daniele Palmas Acked-by: Bjørn Mork Signed-off-by: David S. Miller commit 75e7fb0a87a11c085a58ce583be3f4b1369584e7 Merge: cff1e01f16f84 bb989501abcaf Author: David S. Miller Date: Fri Jan 4 13:33:57 2019 -0800 Merge branch 'hns-fixes' Huazhong Tan says: ==================== net: hns: Bugfixes for HNS driver This patchset includes bugfixes for the HNS ethernet controller driver. Every patch is independent. ==================== Signed-off-by: David S. Miller commit bb989501abcafa0de5f18b0ec0ec459b5b817908 Author: Yonglong Liu Date: Fri Jan 4 20:18:11 2019 +0800 net: hns: Fix use after free identified by SLUB debug When enable SLUB debug, than remove hns_enet_drv module, SLUB debug will identify a use after free bug: [134.189505] Unable to handle kernel paging request at virtual address 006b6b6b6b6b6b6b [134.197553] Mem abort info: [134.200381] ESR = 0x96000004 [134.203487] Exception class = DABT (current EL), IL = 32 bits [134.209497] SET = 0, FnV = 0 [134.212596] EA = 0, S1PTW = 0 [134.215777] Data abort info: [134.218701] ISV = 0, ISS = 0x00000004 [134.222596] CM = 0, WnR = 0 [134.225606] [006b6b6b6b6b6b6b] address between user and kernel address ranges [134.232851] Internal error: Oops: 96000004 [#1] SMP [134.237798] CPU: 21 PID: 27834 Comm: rmmod Kdump: loaded Tainted: G OE 4.19.5-1.2.34.aarch64 #1 [134.247856] Hardware name: Huawei TaiShan 2280 /BC11SPCD, BIOS 1.58 10/24/2018 [134.255181] pstate: 20000005 (nzCv daif -PAN -UAO) [134.260044] pc : hns_ae_put_handle+0x38/0x60 [134.264372] lr : hns_ae_put_handle+0x24/0x60 [134.268700] sp : ffff00001be93c50 [134.272054] x29: ffff00001be93c50 x28: ffff802faaec8040 [134.277442] x27: 0000000000000000 x26: 0000000000000000 [134.282830] x25: 0000000056000000 x24: 0000000000000015 [134.288284] x23: ffff0000096fe098 x22: ffff000001050070 [134.293671] x21: ffff801fb3c044a0 x20: ffff80afb75ec098 [134.303287] x19: ffff80afb75ec098 x18: 0000000000000000 [134.312945] x17: 0000000000000000 x16: 0000000000000000 [134.322517] x15: 0000000000000002 x14: 0000000000000000 [134.332030] x13: dead000000000100 x12: ffff7e02bea3c988 [134.341487] x11: ffff80affbee9e68 x10: 0000000000000000 [134.351033] x9 : 6fffff8000008101 x8 : 0000000000000000 [134.360569] x7 : dead000000000100 x6 : ffff000009579748 [134.370059] x5 : 0000000000210d00 x4 : 0000000000000000 [134.379550] x3 : 0000000000000001 x2 : 0000000000000000 [134.388813] x1 : 6b6b6b6b6b6b6b6b x0 : 0000000000000000 [134.397993] Process rmmod (pid: 27834, stack limit = 0x00000000d474b7fd) [134.408498] Call trace: [134.414611] hns_ae_put_handle+0x38/0x60 [134.422208] hnae_put_handle+0xd4/0x108 [134.429563] hns_nic_dev_remove+0x60/0xc0 [hns_enet_drv] [134.438342] platform_drv_remove+0x2c/0x70 [134.445958] device_release_driver_internal+0x174/0x208 [134.454810] driver_detach+0x70/0xd8 [134.461913] bus_remove_driver+0x64/0xe8 [134.469396] driver_unregister+0x34/0x60 [134.476822] platform_driver_unregister+0x20/0x30 [134.485130] hns_nic_dev_driver_exit+0x14/0x6e4 [hns_enet_drv] [134.494634] __arm64_sys_delete_module+0x238/0x290 struct hnae_handle is a member of struct hnae_vf_cb, so when vf_cb is freed, than use hnae_handle will cause use after free panic. This patch frees vf_cb after hnae_handle used. Signed-off-by: Yonglong Liu Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit c77804be53369dd4c15bfc376cf9b45948194cab Author: Yonglong Liu Date: Fri Jan 4 20:18:10 2019 +0800 net: hns: Fix WARNING when hns modules installed Commit 308c6cafde01 ("net: hns: All ports can not work when insmod hns ko after rmmod.") add phy_stop in hns_nic_init_phy(), In the branch of "net", this method is effective, but in the branch of "net-next", it will cause a WARNING when hns modules loaded, reference to commit 2b3e88ea6528 ("net: phy: improve phy state checking"): [10.092168] ------------[ cut here ]------------ [10.092171] called from state READY [10.092189] WARNING: CPU: 4 PID: 1 at ../drivers/net/phy/phy.c:854 phy_stop+0x90/0xb0 [10.092192] Modules linked in: [10.092197] CPU: 4 PID:1 Comm:swapper/0 Not tainted 4.20.0-rc7-next-20181220 #1 [10.092200] Hardware name: Huawei TaiShan 2280 /D05, BIOS Hisilicon D05 UEFI 16.12 Release 05/15/2017 [10.092202] pstate: 60000005 (nZCv daif -PAN -UAO) [10.092205] pc : phy_stop+0x90/0xb0 [10.092208] lr : phy_stop+0x90/0xb0 [10.092209] sp : ffff00001159ba90 [10.092212] x29: ffff00001159ba90 x28: 0000000000000007 [10.092215] x27: ffff000011180068 x26: ffff0000110a5620 [10.092218] x25: ffff0000113b6000 x24: ffff842f96dac000 [10.092221] x23: 0000000000000000 x22: 0000000000000000 [10.092223] x21: ffff841fb8425e18 x20: ffff801fb3a56438 [10.092226] x19: ffff801fb3a56000 x18: ffffffffffffffff [10.092228] x17: 0000000000000000 x16: 0000000000000000 [10.092231] x15: ffff00001122d6c8 x14: ffff00009159b7b7 [10.092234] x13: ffff00001159b7c5 x12: ffff000011245000 [10.092236] x11: 0000000005f5e0ff x10: ffff00001159b750 [10.092239] x9 : 00000000ffffffd0 x8 : 0000000000000465 [10.092242] x7 : ffff0000112457f8 x6 : ffff0000113bd7ce [10.092245] x5 : 0000000000000000 x4 : 0000000000000000 [10.092247] x3 : 00000000ffffffff x2 : ffff000011245828 [10.092250] x1 : 4b5860bd05871300 x0 : 0000000000000000 [10.092253] Call trace: [10.092255] phy_stop+0x90/0xb0 [10.092260] hns_nic_init_phy+0xf8/0x110 [10.092262] hns_nic_try_get_ae+0x4c/0x3b0 [10.092264] hns_nic_dev_probe+0x1fc/0x480 [10.092268] platform_drv_probe+0x50/0xa0 [10.092271] really_probe+0x1f4/0x298 [10.092273] driver_probe_device+0x58/0x108 [10.092275] __driver_attach+0xdc/0xe0 [10.092278] bus_for_each_dev+0x74/0xc8 [10.092280] driver_attach+0x20/0x28 [10.092283] bus_add_driver+0x1b8/0x228 [10.092285] driver_register+0x60/0x110 [10.092288] __platform_driver_register+0x40/0x48 [10.092292] hns_nic_dev_driver_init+0x18/0x20 [10.092296] do_one_initcall+0x5c/0x180 [10.092299] kernel_init_freeable+0x198/0x240 [10.092303] kernel_init+0x10/0x108 [10.092306] ret_from_fork+0x10/0x18 [10.092308] ---[ end trace 1396dd0278e397eb ]--- This WARNING occurred because of calling phy_stop before phy_start. The root cause of the problem in commit '308c6cafde01' is: Reference to hns_nic_init_phy, the flag phydev->supported is changed after phy_connect_direct. The flag phydev->supported is 0x6ff when hns modules is loaded, so will not change Fiber Port power(Reference to marvell.c), which is power on at default. Then the flag phydev->supported is changed to 0x6f, so Fiber Port power is off when removing hns modules. When hns modules installed again, the flag phydev->supported is default value 0x6ff, so will not change Fiber Port power(now is off), causing mac link not up problem. So the solution is change phy flags before phy_connect_direct. Fixes: 308c6cafde01 ("net: hns: All ports can not work when insmod hns ko after rmmod.") Signed-off-by: Yonglong Liu Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller commit 59f75fd0e31532bdcf65f754516cac2954d5ddc7 Author: Jens Axboe Date: Fri Jan 4 14:27:09 2019 -0700 Add CREDITS entry for Shaohua Li Signed-off-by: Jens Axboe commit b685a7350ae76bc0f388e24b36d06a63776c68ee Author: Jens Axboe Date: Thu Jan 3 15:29:15 2019 -0800 mm/page_io.c: fix polled swap page in swap_readpage() wants to do polling to bring in pages if asked to, but it doesn't mark the bio as being polled. Additionally, the looping around the blk_poll() check isn't correct - if we get a zero return, we should call io_schedule(), we can't just assume that the bio has completed. The regular bio->bi_private check should be used for that. Link: http://lkml.kernel.org/r/e15243a8-2cdf-c32c-ecee-f289377c8ef9@kernel.dk Signed-off-by: Jens Axboe Reviewed-by: Andrew Morton Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d499480cc435ff153bf7e2e7ee6ab6ac44306c28 Author: Jorge Ramirez-Ortiz Date: Thu Jan 3 15:29:12 2019 -0800 checkpatch: add Co-developed-by to signature tags As per Documentation/process/submitting-patches, Co-developed-by is a valid signature. This commit removes the warning. Link: http://lkml.kernel.org/r/1544808928-20002-3-git-send-email-jorge.ramirez-ortiz@linaro.org Signed-off-by: Jorge Ramirez-Ortiz Cc: Greg Kroah-Hartman Cc: Himanshu Jha Cc: Joe Perches Cc: Jonathan Cameron Cc: Jonathan Corbet Cc: Niklas Cassel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ae67ee6c5e1d5b6acdb0d51fddde651834096d75 Author: Jorge Ramirez-Ortiz Date: Thu Jan 3 15:29:09 2019 -0800 docs: fix Co-Developed-by docs The accepted terminology will be Co-developed-by therefore lose the capital letter from now on. Link: http://lkml.kernel.org/r/1544808928-20002-2-git-send-email-jorge.ramirez-ortiz@linaro.org Signed-off-by: Jorge Ramirez-Ortiz Acked-by: Himanshu Jha Cc: Jonathan Cameron Cc: Joe Perches Cc: Greg Kroah-Hartman Cc: Niklas Cassel Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 967d3010df8b6f6f9aa95c198edc5fe3646ebf36 Author: Qian Cai Date: Thu Jan 3 15:29:05 2019 -0800 drivers/base/platform.c: kmemleak ignore a known leak unreferenced object 0xffff808ec6dc5a80 (size 128): comm "swapper/0", pid 1, jiffies 4294938063 (age 2560.530s) hex dump (first 32 bytes): ff ff ff ff 00 00 00 00 6b 6b 6b 6b 6b 6b 6b 6b ........kkkkkkkk 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk backtrace: [<00000000476dcf8c>] kmem_cache_alloc_trace+0x430/0x500 [<000000004f708d37>] platform_device_register_full+0xbc/0x1e8 [<000000006c2a7ec7>] acpi_create_platform_device+0x370/0x450 [<00000000ef135642>] acpi_default_enumeration+0x34/0x78 [<000000003bd9a052>] acpi_bus_attach+0x2dc/0x3e0 [<000000003cf4f7f2>] acpi_bus_attach+0x108/0x3e0 [<000000003cf4f7f2>] acpi_bus_attach+0x108/0x3e0 [<000000002968643e>] acpi_bus_scan+0xb0/0x110 [<0000000010dd0bd7>] acpi_scan_init+0x1a8/0x410 [<00000000965b3c5a>] acpi_init+0x408/0x49c [<00000000ed4b9fe2>] do_one_initcall+0x178/0x7f4 [<00000000a5ac5a74>] kernel_init_freeable+0x9d4/0xa9c [<0000000070ea6c15>] kernel_init+0x18/0x138 [<00000000fb8fff06>] ret_from_fork+0x10/0x1c [<0000000041273a0d>] 0xffffffffffffffff Then, faddr2line pointed out this line, /* * This memory isn't freed when the device is put, * I don't have a nice idea for that though. Conceptually * dma_mask in struct device should not be a pointer. * See http://thread.gmane.org/gmane.linux.kernel.pci/9081 */ pdev->dev.dma_mask = kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL); Since this leak has existed for more than 8 years and it does not reference other parts of the memory, let kmemleak ignore it, so users don't need to waste time reporting this in the future. Link: http://lkml.kernel.org/r/20181206160751.36211-1-cai@gmx.us Signed-off-by: Qian Cai Reviewed-by: Andrew Morton Cc: Greg Kroah-Hartman Cc: "Rafael J . Wysocki" Cc: Catalin Marinas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f86196ea8737c98ea96e5f95c99d0367be39a5d2 Author: Nikolay Borisov Date: Thu Jan 3 15:29:02 2019 -0800 fs: don't open code lru_to_page() Multiple filesystems open code lru_to_page(). Rectify this by moving the macro from mm_inline (which is specific to lru stuff) to the more generic mm.h header and start using the macro where appropriate. No functional changes. Link: http://lkml.kernel.org/r/20181129104810.23361-1-nborisov@suse.com Link: https://lkml.kernel.org/r/20181129075301.29087-1-nborisov@suse.com Signed-off-by: Nikolay Borisov Acked-by: Michal Hocko Reviewed-by: David Hildenbrand Reviewed-by: Mike Rapoport Acked-by: Pankaj gupta Acked-by: "Yan, Zheng" [ceph] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 08d405c8b845a4b871fa3606c9ebe0d0f3b74614 Author: Davidlohr Bueso Date: Thu Jan 3 15:28:58 2019 -0800 fs/: remove caller signal_pending branch predictions This is already done for us internally by the signal machinery. [akpm@linux-foundation.org: fix fs/buffer.c] Link: http://lkml.kernel.org/r/20181116002713.8474-7-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fa45f1162f28cbba6c38180647b7b300f317ecb4 Author: Davidlohr Bueso Date: Thu Jan 3 15:28:55 2019 -0800 mm/: remove caller signal_pending branch predictions This is already done for us internally by the signal machinery. Link: http://lkml.kernel.org/r/20181116002713.8474-5-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d8d7d842e8286a98fb56df9caf5d19b46e01ba4b Author: Davidlohr Bueso Date: Thu Jan 3 15:28:51 2019 -0800 arch/arc/mm/fault.c: remove caller signal_pending_branch predictions This is already done for us internally by the signal machinery. Link: http://lkml.kernel.org/r/20181116002713.8474-4-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Reviewed-by: Andrew Morton Cc: Vineet Gupta Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 34ec35ad8f5f4624e8391dbb83afb4c791f027e3 Author: Davidlohr Bueso Date: Thu Jan 3 15:28:48 2019 -0800 kernel/sched/: remove caller signal_pending branch predictions This is already done for us internally by the signal machinery. Link: http://lkml.kernel.org/r/20181116002713.8474-3-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Reviewed-by: Andrew Morton Cc: Peter Zijlstra Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3bb5f4ac55dd91d516e7e36b45c94bd57efbb068 Author: Davidlohr Bueso Date: Thu Jan 3 15:28:44 2019 -0800 kernel/locking/mutex.c: remove caller signal_pending branch predictions This is already done for us internally by the signal machinery. Link: http://lkml.kernel.org/r/20181116002713.8474-2-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Reviewed-by: Andrew Morton Cc: Peter Zijlstra Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9f132f7e145506efc0744426cb338b18a54afc3b Author: Joel Fernandes (Google) Date: Thu Jan 3 15:28:41 2019 -0800 mm: select HAVE_MOVE_PMD on x86 for faster mremap Moving page-tables at the PMD-level on x86 is known to be safe. Enable this option so that we can do fast mremap when possible. Link: http://lkml.kernel.org/r/20181108181201.88826-4-joelaf@google.com Signed-off-by: Joel Fernandes (Google) Suggested-by: Kirill A. Shutemov Acked-by: Kirill A. Shutemov Cc: Julia Lawall Cc: Michal Hocko Cc: William Kucharski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2c91bd4a4e2e530582d6fd643ea7b86b27907151 Author: Joel Fernandes (Google) Date: Thu Jan 3 15:28:38 2019 -0800 mm: speed up mremap by 20x on large regions Android needs to mremap large regions of memory during memory management related operations. The mremap system call can be really slow if THP is not enabled. The bottleneck is move_page_tables, which is copying each pte at a time, and can be really slow across a large map. Turning on THP may not be a viable option, and is not for us. This patch speeds up the performance for non-THP system by copying at the PMD level when possible. The speedup is an order of magnitude on x86 (~20x). On a 1GB mremap, the mremap completion times drops from 3.4-3.6 milliseconds to 144-160 microseconds. Before: Total mremap time for 1GB data: 3521942 nanoseconds. Total mremap time for 1GB data: 3449229 nanoseconds. Total mremap time for 1GB data: 3488230 nanoseconds. After: Total mremap time for 1GB data: 150279 nanoseconds. Total mremap time for 1GB data: 144665 nanoseconds. Total mremap time for 1GB data: 158708 nanoseconds. If THP is enabled the optimization is mostly skipped except in certain situations. [joel@joelfernandes.org: fix 'move_normal_pmd' unused function warning] Link: http://lkml.kernel.org/r/20181108224457.GB209347@google.com Link: http://lkml.kernel.org/r/20181108181201.88826-3-joelaf@google.com Signed-off-by: Joel Fernandes (Google) Acked-by: Kirill A. Shutemov Reviewed-by: William Kucharski Cc: Julia Lawall Cc: Michal Hocko Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4cf58924951ef80eec636b863e7a53973c44261a Author: Joel Fernandes (Google) Date: Thu Jan 3 15:28:34 2019 -0800 mm: treewide: remove unused address argument from pte_alloc functions Patch series "Add support for fast mremap". This series speeds up the mremap(2) syscall by copying page tables at the PMD level even for non-THP systems. There is concern that the extra 'address' argument that mremap passes to pte_alloc may do something subtle architecture related in the future that may make the scheme not work. Also we find that there is no point in passing the 'address' to pte_alloc since its unused. This patch therefore removes this argument tree-wide resulting in a nice negative diff as well. Also ensuring along the way that the enabled architectures do not do anything funky with the 'address' argument that goes unnoticed by the optimization. Build and boot tested on x86-64. Build tested on arm64. The config enablement patch for arm64 will be posted in the future after more testing. The changes were obtained by applying the following Coccinelle script. (thanks Julia for answering all Coccinelle questions!). Following fix ups were done manually: * Removal of address argument from pte_fragment_alloc * Removal of pte_alloc_one_fast definitions from m68k and microblaze. // Options: --include-headers --no-includes // Note: I split the 'identifier fn' line, so if you are manually // running it, please unsplit it so it runs for you. virtual patch @pte_alloc_func_def depends on patch exists@ identifier E2; identifier fn =~ "^(__pte_alloc|pte_alloc_one|pte_alloc|__pte_alloc_kernel|pte_alloc_one_kernel)$"; type T2; @@ fn(... - , T2 E2 ) { ... } @pte_alloc_func_proto_noarg depends on patch exists@ type T1, T2, T3, T4; identifier fn =~ "^(__pte_alloc|pte_alloc_one|pte_alloc|__pte_alloc_kernel|pte_alloc_one_kernel)$"; @@ ( - T3 fn(T1, T2); + T3 fn(T1); | - T3 fn(T1, T2, T4); + T3 fn(T1, T2); ) @pte_alloc_func_proto depends on patch exists@ identifier E1, E2, E4; type T1, T2, T3, T4; identifier fn =~ "^(__pte_alloc|pte_alloc_one|pte_alloc|__pte_alloc_kernel|pte_alloc_one_kernel)$"; @@ ( - T3 fn(T1 E1, T2 E2); + T3 fn(T1 E1); | - T3 fn(T1 E1, T2 E2, T4 E4); + T3 fn(T1 E1, T2 E2); ) @pte_alloc_func_call depends on patch exists@ expression E2; identifier fn =~ "^(__pte_alloc|pte_alloc_one|pte_alloc|__pte_alloc_kernel|pte_alloc_one_kernel)$"; @@ fn(... -, E2 ) @pte_alloc_macro depends on patch exists@ identifier fn =~ "^(__pte_alloc|pte_alloc_one|pte_alloc|__pte_alloc_kernel|pte_alloc_one_kernel)$"; identifier a, b, c; expression e; position p; @@ ( - #define fn(a, b, c) e + #define fn(a, b) e | - #define fn(a, b) e + #define fn(a) e ) Link: http://lkml.kernel.org/r/20181108181201.88826-2-joelaf@google.com Signed-off-by: Joel Fernandes (Google) Suggested-by: Kirill A. Shutemov Acked-by: Kirill A. Shutemov Cc: Michal Hocko Cc: Julia Lawall Cc: Kirill A. Shutemov Cc: William Kucharski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ff1522bb7d98450c72aea729f0b4147bc9986aed Author: David Engraf Date: Thu Jan 3 15:28:31 2019 -0800 initramfs: cleanup incomplete rootfs Unpacking an external initrd may fail e.g. not enough memory. This leads to an incomplete rootfs because some files might be extracted already. Fixed by cleaning the rootfs so the kernel is not using an incomplete rootfs. Link: http://lkml.kernel.org/r/20181030151805.5519-1-david.engraf@sysgo.com Signed-off-by: David Engraf Cc: Dominik Brodowski Cc: Greg Kroah-Hartman Cc: Philippe Ombredanne Cc: Arnd Bergmann Cc: Luc Van Oostenryck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b058809bfc8faeb7b7cae047666e23375a060059 Author: Changbin Du Date: Thu Jan 3 15:28:27 2019 -0800 scripts/gdb: fix lx-version string output A bug is present in GDB which causes early string termination when parsing variables. This has been reported [0], but we should ensure that we can support at least basic printing of the core kernel strings. For current gdb version (has been tested with 7.3 and 8.1), 'lx-version' only prints one character. (gdb) lx-version L(gdb) This can be fixed by casting 'linux_banner' as (char *). (gdb) lx-version Linux version 4.19.0-rc1+ (changbin@acer) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #21 SMP Sat Sep 1 21:43:30 CST 2018 [0] https://sourceware.org/bugzilla/show_bug.cgi?id=20077 [kbingham@kernel.org: add detail to commit message] Link: http://lkml.kernel.org/r/20181111162035.8356-1-kieran.bingham@ideasonboard.com Fixes: 2d061d999424 ("scripts/gdb: add version command") Signed-off-by: Du Changbin Signed-off-by: Kieran Bingham Acked-by: Jan Kiszka Cc: Jan Kiszka Cc: Jason Wessel Cc: Daniel Thompson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 634724431607f6f46c495dfef801a1c8b44a96d9 Author: Anders Roxell Date: Thu Jan 3 15:28:24 2019 -0800 kernel/kcov.c: mark write_comp_data() as notrace Since __sanitizer_cov_trace_const_cmp4 is marked as notrace, the function called from __sanitizer_cov_trace_const_cmp4 shouldn't be traceable either. ftrace_graph_caller() gets called every time func write_comp_data() gets called if it isn't marked 'notrace'. This is the backtrace from gdb: #0 ftrace_graph_caller () at ../arch/arm64/kernel/entry-ftrace.S:179 #1 0xffffff8010201920 in ftrace_caller () at ../arch/arm64/kernel/entry-ftrace.S:151 #2 0xffffff8010439714 in write_comp_data (type=5, arg1=0, arg2=0, ip=18446743524224276596) at ../kernel/kcov.c:116 #3 0xffffff8010439894 in __sanitizer_cov_trace_const_cmp4 (arg1=, arg2=) at ../kernel/kcov.c:188 #4 0xffffff8010201874 in prepare_ftrace_return (self_addr=18446743524226602768, parent=0xffffff801014b918, frame_pointer=18446743524223531344) at ./include/generated/atomic-instrumented.h:27 #5 0xffffff801020194c in ftrace_graph_caller () at ../arch/arm64/kernel/entry-ftrace.S:182 Rework so that write_comp_data() that are called from __sanitizer_cov_trace_*_cmp*() are marked as 'notrace'. Commit 903e8ff86753 ("kernel/kcov.c: mark funcs in __sanitizer_cov_trace_pc() as notrace") missed to mark write_comp_data() as 'notrace'. When that patch was created gcc-7 was used. In lib/Kconfig.debug config KCOV_ENABLE_COMPARISONS depends on $(cc-option,-fsanitize-coverage=trace-cmp) That code path isn't hit with gcc-7. However, it were that with gcc-8. Link: http://lkml.kernel.org/r/20181206143011.23719-1-anders.roxell@linaro.org Signed-off-by: Anders Roxell Signed-off-by: Arnd Bergmann Co-developed-by: Arnd Bergmann Acked-by: Steven Rostedt (VMware) Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 81c9d43f94870be66146739c6e61df40dc17bb64 Author: Feng Tang Date: Thu Jan 3 15:28:20 2019 -0800 kernel/sysctl: add panic_print into sysctl So that we can also runtime chose to print out the needed system info for panic, other than setting the kernel cmdline. Link: http://lkml.kernel.org/r/1543398842-19295-3-git-send-email-feng.tang@intel.com Signed-off-by: Feng Tang Suggested-by: Steven Rostedt Acked-by: Steven Rostedt (VMware) Cc: Thomas Gleixner Cc: John Stultz Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Kees Cook Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d999bd9392dea7c1a9ac43b8680b22c4425ae4c7 Author: Feng Tang Date: Thu Jan 3 15:28:17 2019 -0800 panic: add options to print system info when panic happens Kernel panic issues are always painful to debug, partially because it's not easy to get enough information of the context when panic happens. And we have ramoops and kdump for that, while this commit tries to provide a easier way to show the system info by adding a cmdline parameter, referring some idea from sysrq handler. Link: http://lkml.kernel.org/r/1543398842-19295-2-git-send-email-feng.tang@intel.com Signed-off-by: Feng Tang Reviewed-by: Kees Cook Acked-by: Steven Rostedt (VMware) Cc: Thomas Gleixner Cc: John Stultz Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Steven Rostedt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d1877155891020cb26ad4fba45bfee52d8da9951 Author: Tigran Aivazian Date: Thu Jan 3 15:28:14 2019 -0800 bfs: extra sanity checking and static inode bitmap Strengthen validation of BFS superblock against corruption. Make in-core inode bitmap static part of superblock info structure. Print a warning when mounting a BFS filesystem created with "-N 512" option as only 510 files can be created in the root directory. Make the kernel messages more uniform. Update the 'prefix' passed to bfs_dump_imap() to match the current naming of operations. White space and comments cleanup. Link: http://lkml.kernel.org/r/CAK+_RLkFZMduoQF36wZFd3zLi-6ZutWKsydjeHFNdtRvZZEb4w@mail.gmail.com Signed-off-by: Tigran Aivazian Reported-by: Tetsuo Handa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 655c16a8ce9c15842547f40ce23fd148aeccc074 Author: Oleg Nesterov Date: Thu Jan 3 15:28:11 2019 -0800 exec: separate MM_ANONPAGES and RLIMIT_STACK accounting get_arg_page() checks bprm->rlim_stack.rlim_cur and re-calculates the "extra" size for argv/envp pointers every time, this is a bit ugly and even not strictly correct: acct_arg_size() must not account this size. Remove all the rlimit code in get_arg_page(). Instead, add bprm->argmin calculated once at the start of __do_execve_file() and change copy_strings to check bprm->p >= bprm->argmin. The patch adds the new helper, prepare_arg_pages() which initializes bprm->argc/envc and bprm->argmin. [oleg@redhat.com: fix !CONFIG_MMU version of get_arg_page()] Link: http://lkml.kernel.org/r/20181126122307.GA1660@redhat.com [akpm@linux-foundation.org: use max_t] Link: http://lkml.kernel.org/r/20181112160910.GA28440@redhat.com Signed-off-by: Oleg Nesterov Acked-by: Kees Cook Tested-by: Guenter Roeck Cc: "Eric W. Biederman" Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8099b047ecc431518b9bb6bdbba3549bbecdc343 Author: Oleg Nesterov Date: Thu Jan 3 15:28:07 2019 -0800 exec: load_script: don't blindly truncate shebang string load_script() simply truncates bprm->buf and this is very wrong if the length of shebang string exceeds BINPRM_BUF_SIZE-2. This can silently truncate i_arg or (worse) we can execute the wrong binary if buf[2:126] happens to be the valid executable path. Change load_script() to return ENOEXEC if it can't find '\n' or zero in bprm->buf. Note that '\0' can come from either prepare_binprm()->memset() or from kernel_read(), we do not care. Link: http://lkml.kernel.org/r/20181112160931.GA28463@redhat.com Signed-off-by: Oleg Nesterov Acked-by: Kees Cook Acked-by: Michal Hocko Cc: Ben Woodard Cc: "Eric W. Biederman" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fb5bf31722d0805a3f394f7d59f2e8cd07acccb7 Author: Yi Wang Date: Thu Jan 3 15:28:03 2019 -0800 fork: fix some -Wmissing-prototypes warnings We get a warning when building kernel with W=1: kernel/fork.c:167:13: warning: no previous prototype for `arch_release_thread_stack' [-Wmissing-prototypes] kernel/fork.c:779:13: warning: no previous prototype for `fork_init' [-Wmissing-prototypes] Add the missing declaration in head file to fix this. Also, remove arch_release_thread_stack() completely because no arch seems to implement it since bb9d81264 (arch: remove tile port). Link: http://lkml.kernel.org/r/1542170087-23645-1-git-send-email-wang.yi59@zte.com.cn Signed-off-by: Yi Wang Acked-by: Michal Hocko Acked-by: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 306790f75ac2fe021a900395255e468807002c42 Author: Carmeli Tamir Date: Thu Jan 3 15:28:00 2019 -0800 fat: new inline functions to determine the FAT variant (32, 16 or 12) This patch introduces 3 new inline functions - is_fat12, is_fat16 and is_fat32, and replaces every occurrence in the code in which the FS variant (whether this is FAT12, FAT16 or FAT32) was previously checked using msdos_sb_info->fat_bits. Link: http://lkml.kernel.org/r/1544990640-11604-4-git-send-email-carmeli.tamir@gmail.com Signed-off-by: Carmeli Tamir Acked-by: OGAWA Hirofumi Reviewed-by: Sergey Senozhatsky Cc: Johannes Thumshirn Cc: Bart Van Assche Cc: Martin K. Petersen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d19dc016187502dda6b8095e44eb46a18e89b2b3 Author: Carmeli Tamir Date: Thu Jan 3 15:27:56 2019 -0800 fat: move MAX_FAT to fat.h and change it to inline function MAX_FAT is useless in msdos_fs.h, since it uses the MSDOS_SB function that is defined in fat.h. So really, this macro can be only called from code that already includes fat.h. Hence, this patch moves it to fat.h, right after MSDOS_SB is defined. I also changed it to an inline function in order to save the double call to MSDOS_SB. This was suggested by joe@perches.com in the previous version. This patch is required for the next in the series, in which the variant (whether this is FAT12, FAT16 or FAT32) checks are replaced with new macros. Link: http://lkml.kernel.org/r/1544990640-11604-3-git-send-email-carmeli.tamir@gmail.com Signed-off-by: Carmeli Tamir Acked-by: OGAWA Hirofumi Reviewed-by: Sergey Senozhatsky Cc: Bart Van Assche Cc: Johannes Thumshirn Cc: Martin K. Petersen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b553337a57cf4f077464292520f4e975ea4cda83 Author: Carmeli Tamir Date: Thu Jan 3 15:27:53 2019 -0800 fat: remove FAT_FIRST_ENT macro The comment edited in this patch was the only reference to the FAT_FIRST_ENT macro, which is not used anymore. Moreover, the commented line of code does not compile with the current code. Since the FAT_FIRST_ENT macro checks the FAT variant in a way that the patch series changes, I removed it, and instead wrote a clear explanation of what was checked. I verified that the changed comment is correct according to Microsoft FAT spec, search for "BPB_Media" in the following references: 1. Microsoft FAT specification 2005 (http://read.pudn.com/downloads77/ebook/294884/FAT32%20Spec%20%28SDA%20Contribution%29.pdf). Search for 'volume label'. 2. Microsoft Extensible Firmware Initiative, FAT32 File System Specification (https://staff.washington.edu/dittrich/misc/fatgen103.pdf). Search for 'volume label'. Link: http://lkml.kernel.org/r/1544990640-11604-2-git-send-email-carmeli.tamir@gmail.com Signed-off-by: Carmeli Tamir Acked-by: OGAWA Hirofumi Reviewed-by: Sergey Senozhatsky Cc: Bart Van Assche Cc: Johannes Thumshirn Cc: Martin K. Petersen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9da22854761a76c45d78aa2ae2b4bbd504b4f171 Author: Carmeli Tamir Date: Thu Jan 3 15:27:49 2019 -0800 include/uapi/linux/msdos_fs.h: use MSDOS_NAME for volume label size The FAT file system volume label file stored in the root directory should match the volume label field in the FAT boot sector. As consequence, the max length of these fields ought to be the same. This patch replaces the magic '11' usef in the struct fat_boot_sector with MSDOS_NAME, which is used in struct msdos_dir_entry. Please check the following references: 1. Microsoft FAT specification 2005 (http://read.pudn.com/downloads77/ebook/294884/FAT32%20Spec%20%28SDA%20Contribution%29.pdf). Search for 'volume label'. 2. Microsoft Extensible Firmware Initiative, FAT32 File System Specification (https://staff.washington.edu/dittrich/misc/fatgen103.pdf). Search for 'volume label'. 3. User space code that creates FAT filesystem sometimes uses MSDOS_NAME for the label, sometimes not. Search for 'if (memcmp(label, NO_NAME, MSDOS_NAME))'. I consider to make the same patch there as well. https://github.com/dosfstools/dosfstools/blob/master/src/mkfs.fat.c Link: http://lkml.kernel.org/r/1543096879-82837-1-git-send-email-carmeli.tamir@gmail.com Signed-off-by: Carmeli Tamir Reviewed-by: Sergey Senozhatsky Reviewed-by: Johannes Thumshirn Acked-by: OGAWA Hirofumi Cc: Jens Axboe Cc: Bart Van Assche Cc: Martin K. Petersen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f93ca1ed9ba09fa54d372ab17649d781384e34f7 Author: Ernesto A. Fernández Date: Thu Jan 3 15:27:46 2019 -0800 hfsplus: return file attributes on statx The immutable, append-only and no-dump attributes can only be retrieved with an ioctl; implement the ->getattr() method to return them on statx. Do not return the inode birthtime yet, because the issue of how best to handle the post-2038 timestamps is still under discussion. This patch is needed to pass xfstests generic/424. Link: http://lkml.kernel.org/r/20181014163558.sxorxlzjqccq2lpw@eaf Signed-off-by: Ernesto A. Fernández Cc: Viacheslav Dubeyko Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f5162216b7dab0c07e070b8b7f98891a85047f59 Author: Ian Kent Date: Thu Jan 3 15:27:43 2019 -0800 autofs: add strictexpire mount option Commit 092a53452bb7 ("autofs: take more care to not update last_used on path walk") helped to (partially) resolve a problem where automounts were not expiring due to aggressive accesses from user space. This patch was later reverted because, for very large environments, it meant more mount requests from clients and when there are a lot of clients this caused a fairly significant increase in server load. But there is a need for both types of expire check, depending on use case, so add a mount option to allow for strict update of last use of autofs dentrys (which just means not updating the last use on path walk access). Link: http://lkml.kernel.org/r/154296973880.9889.14085372741514507967.stgit@pluto-themaw-net Signed-off-by: Ian Kent Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9d8719a42e4671cfe27733d82b5a071295ab9975 Author: Ian Kent Date: Thu Jan 3 15:27:39 2019 -0800 autofs: change catatonic setting to a bit flag Change the superblock info. catatonic setting to be part of a flags bit field. Link: http://lkml.kernel.org/r/154296973142.9889.17275721668508589639.stgit@pluto-themaw-net Signed-off-by: Ian Kent Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9bf964c9cee40285808ce973be7a266876404501 Author: Ian Kent Date: Thu Jan 3 15:27:36 2019 -0800 autofs: simplify parse_options() function call The parse_options() function uses a long list of parameters, most of which are present in the super block info structure already. The mount parameters set in parse_options() options don't require cleanup so using the super block info struct directly is simpler. Link: http://lkml.kernel.org/r/154296972423.9889.9368859245676473329.stgit@pluto-themaw-net Signed-off-by: Ian Kent Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 55f0d8205dc6399826332c21bc56626868cd453d Author: Ian Kent Date: Thu Jan 3 15:27:33 2019 -0800 autofs: improve ioctl sbi checks Al Viro made some suggestions to improve the implementation of commit 0633da48f0 ("fix autofs_sbi() does not check super block type"). The check is unnecessary in all cases except for ioctl usage so placing the check in the super block accessor function adds a small overhead to the common case where it isn't needed. So it's sufficient to do this in the ioctl code only. Also the check in the ioctl code is needlessly complex. [akpm@linux-foundation.org: declare autofs_fs_type in .h, not .c] Link: http://lkml.kernel.org/r/154296970987.9889.1597442413573683096.stgit@pluto-themaw-net Signed-off-by: Ian Kent Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7c8f71935a65a584c48cbe478aaffc52292d6e00 Author: Alexey Dobriyan Date: Thu Jan 3 15:27:29 2019 -0800 init/main.c: make "initcall_level_names[]" const char * Initcall names should not be changed. Link: http://lkml.kernel.org/r/20181124091829.GD10969@avx2 Signed-off-by: Alexey Dobriyan Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 86c051793b4c941ee4481725d57cf2a27f6b3aaf Author: Davidlohr Bueso Date: Thu Jan 3 15:27:26 2019 -0800 fs/epoll: deal with wait_queue only once There is no reason why we rearm the waitiqueue upon every fetch_events retry (for when events are found yet send_events() fails). If nothing else, this saves four lock operations per retry, and furthermore reduces the scope of the lock even further. [akpm@linux-foundation.org: restore code to original position, fix and reflow comment] Link: http://lkml.kernel.org/r/20181114182532.27981-2-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Cc: Jason Baron Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 35cff1a6e0236500584a8ae227fe08120d9b5ee2 Author: Davidlohr Bueso Date: Thu Jan 3 15:27:22 2019 -0800 fs/epoll: rename check_events label to send_events It is currently called check_events because it, well, did exactly that. However, since the lockless ep_events_available() call, the label no longer checks, but just sends the events. Rename as such. Link: http://lkml.kernel.org/r/20181114182532.27981-1-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Reviewed-by: Andrew Morton Cc: Al Viro Cc: Jason Baron Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit abc610e01c663e25c41a3bdcbc4115cd7fbb047b Author: Davidlohr Bueso Date: Thu Jan 3 15:27:19 2019 -0800 fs/epoll: avoid barrier after an epoll_wait(2) timeout Upon timeout, we can just exit out of the loop, without the cost of the changing the task's state with an smp_store_mb call. Just exit out of the loop and be done - setting the task state afterwards will be, of course, redundant. [dave@stgolabs.net: forgotten fixlets] Link: http://lkml.kernel.org/r/20181109155258.jxcr4t2pnz6zqct3@linux-r8p5 Link: http://lkml.kernel.org/r/20181108051006.18751-7-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Reviewed-by: Andrew Morton Cc: Al Viro Cc: Davidlohr Bueso Cc: Jason Baron Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c5a282e9635e9c7382821565083db5d260085e3e Author: Davidlohr Bueso Date: Thu Jan 3 15:27:15 2019 -0800 fs/epoll: reduce the scope of wq lock in epoll_wait() This patch aims at reducing ep wq.lock hold times in epoll_wait(2). For the blocking case, there is no need to constantly take and drop the spinlock, which is only needed to manipulate the waitqueue. The call to ep_events_available() is now lockless, and only exposed to benign races. Here, if false positive (returns available events and does not see another thread deleting an epi from the list) we call into send_events and then the list's state is correctly seen. Otoh, if a false negative and we don't see a list_add_tail(), for example, from irq callback, then it is rechecked again before blocking, which will see the correct state. In order for more accuracy to see concurrent list_del_init(), use the list_empty_careful() variant -- of course, this won't be safe against insertions from wakeup. For the overflow list we obviously need to prevent load/store tearing as we don't want to see partial values while the ready list is disabled. [dave@stgolabs.net: forgotten fixlets] Link: http://lkml.kernel.org/r/20181109155258.jxcr4t2pnz6zqct3@linux-r8p5 Link: http://lkml.kernel.org/r/20181108051006.18751-6-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Suggested-by: Jason Baron Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 21877e1a5b520132f54515f8835c963056418b4c Author: Davidlohr Bueso Date: Thu Jan 3 15:27:12 2019 -0800 fs/epoll: robustify ep->mtx held checks Insted of just commenting how important it is, lets make it more robust and add a lockdep_assert_held() call. Link: http://lkml.kernel.org/r/20181108051006.18751-5-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Reviewed-by: Andrew Morton Cc: Al Viro Cc: Jason Baron Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 76699a67f3041ff4c7af6d6ee9be2bfbf1ffb671 Author: Davidlohr Bueso Date: Thu Jan 3 15:27:09 2019 -0800 fs/epoll: drop ovflist branch prediction The ep->ovflist is a secondary ready-list to temporarily store events that might occur when doing sproc without holding the ep->wq.lock. This accounts for every time we check for ready events and also send events back to userspace; both callbacks, particularly the latter because of copy_to_user, can account for a non-trivial time. As such, the unlikely() check to see if the pointer is being used, seems both misleading and sub-optimal. In fact, we go to an awful lot of trouble to sync both lists, and populating the ovflist is far from an uncommon scenario. For example, profiling a concurrent epoll_wait(2) benchmark, with CONFIG_PROFILE_ANNOTATED_BRANCHES shows that for a two threads a 33% incorrect rate was seen; and when incrementally increasing the number of epoll instances (which is used, for example for multiple queuing load balancing models), up to a 90% incorrect rate was seen. Similarly, by deleting the prediction, 3% throughput boost was seen across incremental threads. Link: http://lkml.kernel.org/r/20181108051006.18751-4-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Reviewed-by: Andrew Morton Cc: Al Viro Cc: Jason Baron Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4e0982a00564c80cb849a892043450860ef91e14 Author: Davidlohr Bueso Date: Thu Jan 3 15:27:05 2019 -0800 fs/epoll: simplify ep_send_events_proc() ready-list loop The current logic is a bit convoluted. Lets simplify this with a standard list_for_each_entry_safe() loop instead and just break out after maxevents is reached. While at it, remove an unnecessary indentation level in the loop when there are in fact ready events. Link: http://lkml.kernel.org/r/20181108051006.18751-3-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Reviewed-by: Andrew Morton Cc: Al Viro Cc: Jason Baron Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 74bdc129850c32eaddc625ce557da560303fbf25 Author: Davidlohr Bueso Date: Thu Jan 3 15:27:02 2019 -0800 fs/epoll: remove max_nests argument from ep_call_nested() Patch series "epoll: some miscellaneous optimizations". The following are some incremental optimizations on some of the epoll core. Each patch has the details, but together, the series is seen to shave off measurable cycles on a number of systems and workloads. For example, on a 40-core IB, a pipetest as well as parallel epoll_wait() benchmark show around a 20-30% increase in raw operations per second when the box is fully occupied (incremental thread counts), and up to 15% performance improvement with lower counts. Passes ltp epoll related testcases. This patch(of 6): All callers pass the EP_MAX_NESTS constant already, so lets simplify this a tad and get rid of the redundant parameter for nested eventpolls. Link: http://lkml.kernel.org/r/20181108051006.18751-2-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Reviewed-by: Andrew Morton Cc: Al Viro Cc: Jason Baron Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 77b8c0a8e47484e205b01dfedcd224770aa9d800 Author: Joe Perches Date: Thu Jan 3 15:26:59 2019 -0800 checkpatch: warn on const char foo[] = "bar"; declarations These declarations should generally be static const to avoid poor compilation and runtime performance where compilers tend to initialize the const declaration for every call instead of using .rodata for the string. Miscellanea: - Convert spaces to tabs for indentation in 2 adjacent checks Link: http://lkml.kernel.org/r/10ea5f4b087dc911e41e187a4a2b5e79c7529aa3.camel@perches.com Signed-off-by: Joe Perches Cc: Rasmus Villemoes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 05391772a72d49c37e6e4cb8e871be57beb66155 Author: huang.zijiang Date: Thu Jan 3 15:26:55 2019 -0800 drivers/firmware/memmap.c: modify memblock_alloc to memblock_alloc_nopanic memblock_alloc() never returns NULL because panic never returns. Link: http://lkml.kernel.org/r/1545640882-42009-1-git-send-email-huang.zijiang@zte.com.cn Signed-off-by: huang.zijiang Acked-by: Mike Rapoport Cc: Michal Hocko Cc: Stephen Rothwell Cc: Michael Ellerman Cc: Yi Wang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6862d2fc81859f88c1f3f660886427893f2b4f3f Author: Huang Shijie Date: Thu Jan 3 15:26:51 2019 -0800 lib/genalloc.c: use vzalloc_node() to allocate the bitmap Some devices may have big memory on chip, such as over 1G. In some cases, the nbytes maybe bigger then 4M which is the bounday of the memory buddy system (4K default). So use vzalloc_node() to allocate the bitmap. Also use vfree to free it. Link: http://lkml.kernel.org/r/20181225015701.6289-1-sjhuang@iluvatar.ai Signed-off-by: Huang Shijie Reviewed-by: Andrew Morton Cc: Alexey Skidanov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 439e00b76a5fb1662e3ae49fc48bd3f950575b9d Author: Yury Norov Date: Thu Jan 3 15:26:48 2019 -0800 lib/find_bit_benchmark.c: align test_find_next_and_bit with others Contrary to other tests, test_find_next_and_bit() test uses tab formatting in output and get_cycles() instead of ktime_get(). get_cycles() is not supported by some arches, so ktime_get() fits better in generic code. Fix it and minor style issues, so the output looks like this: Start testing find_bit() with random-filled bitmap find_next_bit: 7142816 ns, 163282 iterations find_next_zero_bit: 8545712 ns, 164399 iterations find_last_bit: 6332032 ns, 163282 iterations find_first_bit: 20509424 ns, 16606 iterations find_next_and_bit: 4060016 ns, 73424 iterations Start testing find_bit() with sparse bitmap find_next_bit: 55984 ns, 656 iterations find_next_zero_bit: 19197536 ns, 327025 iterations find_last_bit: 65088 ns, 656 iterations find_first_bit: 5923712 ns, 656 iterations find_next_and_bit: 29088 ns, 1 iterations Link: http://lkml.kernel.org/r/20181123174803.10916-1-ynorov@caviumnetworks.com Signed-off-by: Yury Norov Reviewed-by: Andrew Morton Cc: "Norov, Yuri" Cc: Clement Courbet Cc: Geert Uytterhoeven Cc: Alexey Dobriyan Cc: Matthew Wilcox Cc: Rasmus Villemoes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 52fbf1134d479234d7e64ba9dcbaea23405f229e Author: Alexey Skidanov Date: Thu Jan 3 15:26:44 2019 -0800 lib/genalloc.c: fix allocation of aligned buffer from non-aligned chunk gen_pool_alloc_algo() uses different allocation functions implementing different allocation algorithms. With gen_pool_first_fit_align() allocation function, the returned address should be aligned on the requested boundary. If chunk start address isn't aligned on the requested boundary, the returned address isn't aligned too. The only way to get properly aligned address is to initialize the pool with chunks aligned on the requested boundary. If want to have an ability to allocate buffers aligned on different boundaries (for example, 4K, 1MB, ...), the chunk start address should be aligned on the max possible alignment. This happens because gen_pool_first_fit_align() looks for properly aligned memory block without taking into account the chunk start address alignment. To fix this, we provide chunk start address to gen_pool_first_fit_align() and change its implementation such that it starts looking for properly aligned block with appropriate offset (exactly as is done in CMA). Link: https://lkml.kernel.org/lkml/a170cf65-6884-3592-1de9-4c235888cc8a@intel.com Link: http://lkml.kernel.org/r/1541690953-4623-1-git-send-email-alexey.skidanov@intel.com Signed-off-by: Alexey Skidanov Reviewed-by: Andrew Morton Cc: Logan Gunthorpe Cc: Daniel Mentz Cc: Mathieu Desnoyers Cc: Laura Abbott Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3fc2579e6f162fcff964f5aa01c8a29438ca5c05 Author: Matthew Wilcox Date: Thu Jan 3 15:26:41 2019 -0800 fls: change parameter to unsigned int When testing in userspace, UBSAN pointed out that shifting into the sign bit is undefined behaviour. It doesn't really make sense to ask for the highest set bit of a negative value, so just turn the argument type into an unsigned int. Some architectures (eg ppc) already had it declared as an unsigned int, so I don't expect too many problems. Link: http://lkml.kernel.org/r/20181105221117.31828-1-willy@infradead.org Signed-off-by: Matthew Wilcox Acked-by: Thomas Gleixner Acked-by: Geert Uytterhoeven Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e6310f0fb5cd3f65244dbdef2fb264859891c7ec Author: Alexey Dobriyan Date: Thu Jan 3 15:26:37 2019 -0800 include/linux/printk.h: drop silly "static inline asmlinkage" from dump_stack() Empty function will be inlined so asmlinkage doesn't do anything. Link: http://lkml.kernel.org/r/20181124093530.GE10969@avx2 Signed-off-by: Alexey Dobriyan Reviewed-by: Andrew Morton Acked-by: Joey Pabalinas Cc: Petr Mladek Cc: Sergey Senozhatsky Cc: Steven Rostedt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 300133d372b7b541c7e7c5e8d63ea5439f9865b6 Author: Souptick Joarder Date: Thu Jan 3 15:26:34 2019 -0800 drivers/dma-buf/udmabuf.c: convert to use vm_fault_t Use new return type vm_fault_t for fault handler. Link: http://lkml.kernel.org/r/20181106173628.GA12989@jordon-HP-15-Notebook-PC Signed-off-by: Souptick Joarder Cc: Gerd Hoffmann Cc: Sumit Semwal Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 304ae42739b108305f8d7b3eb3c1aec7c2b643a9 Author: Tetsuo Handa Date: Thu Jan 3 15:26:31 2019 -0800 kernel/hung_task.c: break RCU locks based on jiffies check_hung_uninterruptible_tasks() is currently calling rcu_lock_break() for every 1024 threads. But check_hung_task() is very slow if printk() was called, and is very fast otherwise. If many threads within some 1024 threads called printk(), the RCU grace period might be extended enough to trigger RCU stall warnings. Therefore, calling rcu_lock_break() for every some fixed jiffies will be safer. Link: http://lkml.kernel.org/r/1544800658-11423-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp Signed-off-by: Tetsuo Handa Acked-by: Paul E. McKenney Cc: Petr Mladek Cc: Sergey Senozhatsky Cc: Dmitry Vyukov Cc: "Rafael J. Wysocki" Cc: Vitaly Kuznetsov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 168e06f7937d96c7222037d8a05565e8a6eb00fe Author: Liu, Chuansheng Date: Thu Jan 3 15:26:27 2019 -0800 kernel/hung_task.c: force console verbose before panic Based on commit 401c636a0eeb ("kernel/hung_task.c: show all hung tasks before panic"), we could get the call stack of hung task. However, if the console loglevel is not high, we still can not see the useful panic information in practice, and in most cases users don't set console loglevel to high level. This patch is to force console verbose before system panic, so that the real useful information can be seen in the console, instead of being like the following, which doesn't have hung task information. INFO: task init:1 blocked for more than 120 seconds. Tainted: G U W 4.19.0-quilt-2e5dc0ac-g51b6c21d76cc #1 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. Kernel panic - not syncing: hung_task: blocked tasks CPU: 2 PID: 479 Comm: khungtaskd Tainted: G U W 4.19.0-quilt-2e5dc0ac-g51b6c21d76cc #1 Call Trace: dump_stack+0x4f/0x65 panic+0xde/0x231 watchdog+0x290/0x410 kthread+0x12c/0x150 ret_from_fork+0x35/0x40 reboot: panic mode set: p,w Kernel Offset: 0x34000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) Link: http://lkml.kernel.org/r/27240C0AC20F114CBF8149A2696CBE4A6015B675@SHSMSX101.ccr.corp.intel.com Signed-off-by: Chuansheng Liu Reviewed-by: Petr Mladek Reviewed-by: Sergey Senozhatsky Cc: Tetsuo Handa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 527edbc18a70e745740ef31edb0ffefb2f161afa Author: Masahiro Yamada Date: Thu Jan 3 15:26:23 2019 -0800 build_bug.h: remove most of dummy BUILD_BUG_ON stubs for Sparse The introduction of these dummy BUILD_BUG_ON stubs dates back to commmit 903c0c7cdc21 ("sparse: define dummy BUILD_BUG_ON definition for sparse"). At that time, BUILD_BUG_ON() was implemented with the negative array trick *and* the link-time trick, like this: extern int __build_bug_on_failed; #define BUILD_BUG_ON(condition) \ do { \ ((void)sizeof(char[1 - 2*!!(condition)])); \ if (condition) __build_bug_on_failed = 1; \ } while(0) Sparse is more strict about the negative array trick than GCC because Sparse requires the array length to be really constant. Here is the simple test code for the macro above: static const int x = 0; BUILD_BUG_ON(x); GCC is absolutely fine with it (-Wvla was enabled only very recently), but Sparse warns like this: error: bad constant expression error: cannot size expression (If you are using a newer version of Sparse, you will see a different warning message, "warning: Variable length array is used".) Anyway, Sparse was producing many false positives, and noisier than it should be at that time. With the previous commit, the leftover negative array trick is gone. Sparse is fine with the current BUILD_BUG_ON(), which is implemented by using the 'error' attribute. I am keeping the stub for BUILD_BUG_ON_ZERO(). Otherwise, Sparse would complain about the following code, which GCC is fine with: static const int x = 0; int y = BUILD_BUG_ON_ZERO(x); Link: http://lkml.kernel.org/r/1542856462-18836-3-git-send-email-yamada.masahiro@socionext.com Signed-off-by: Masahiro Yamada Acked-by: Kees Cook Reviewed-by: Luc Van Oostenryck Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c60d3b79423aab402085c30b33bfff5354a61d8b Author: Masahiro Yamada Date: Thu Jan 3 15:26:20 2019 -0800 build_bug.h: remove negative-array fallback for BUILD_BUG_ON() The kernel can only be compiled with an optimization option (-O2, -Os, or the currently proposed -Og). Hence, __OPTIMIZE__ is always defined in the kernel source. The fallback for the -O0 case is just hypothetical and pointless. Moreover, commit 0bb95f80a38f ("Makefile: Globally enable VLA warning") enabled -Wvla warning. The use of variable length arrays is banned. Link: http://lkml.kernel.org/r/1542856462-18836-2-git-send-email-yamada.masahiro@socionext.com Signed-off-by: Masahiro Yamada Acked-by: Kees Cook Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers Cc: Luc Van Oostenryck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3fe5dbfef47e992b810cbe82af1df02d8255fb8c Author: Alexey Dobriyan Date: Thu Jan 3 15:26:16 2019 -0800 Documentation/process/coding-style.rst: don't use "extern" with function prototypes `extern' with function prototypes makes lines longer and creates more characters on the screen. Do not bug people with checkpatch.pl warnings for now as fallout can be devastating. Link: http://lkml.kernel.org/r/20181101134153.GA29267@avx2 Signed-off-by: Alexey Dobriyan Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 09be178400829dddc1189b50a7888495dd26aa84 Author: Cheng Lin Date: Thu Jan 3 15:26:13 2019 -0800 proc/sysctl: fix return error for proc_doulongvec_minmax() If the number of input parameters is less than the total parameters, an EINVAL error will be returned. For example, we use proc_doulongvec_minmax to pass up to two parameters with kern_table: { .procname = "monitor_signals", .data = &monitor_sigs, .maxlen = 2*sizeof(unsigned long), .mode = 0644, .proc_handler = proc_doulongvec_minmax, }, Reproduce: When passing two parameters, it's work normal. But passing only one parameter, an error "Invalid argument"(EINVAL) is returned. [root@cl150 ~]# echo 1 2 > /proc/sys/kernel/monitor_signals [root@cl150 ~]# cat /proc/sys/kernel/monitor_signals 1 2 [root@cl150 ~]# echo 3 > /proc/sys/kernel/monitor_signals -bash: echo: write error: Invalid argument [root@cl150 ~]# echo $? 1 [root@cl150 ~]# cat /proc/sys/kernel/monitor_signals 3 2 [root@cl150 ~]# The following is the result after apply this patch. No error is returned when the number of input parameters is less than the total parameters. [root@cl150 ~]# echo 1 2 > /proc/sys/kernel/monitor_signals [root@cl150 ~]# cat /proc/sys/kernel/monitor_signals 1 2 [root@cl150 ~]# echo 3 > /proc/sys/kernel/monitor_signals [root@cl150 ~]# echo $? 0 [root@cl150 ~]# cat /proc/sys/kernel/monitor_signals 3 2 [root@cl150 ~]# There are three processing functions dealing with digital parameters, __do_proc_dointvec/__do_proc_douintvec/__do_proc_doulongvec_minmax. This patch deals with __do_proc_doulongvec_minmax, just as __do_proc_dointvec does, adding a check for parameters 'left'. In __do_proc_douintvec, its code implementation explicitly does not support multiple inputs. static int __do_proc_douintvec(...){ ... /* * Arrays are not supported, keep this simple. *Do not* add * support for them. */ if (vleft != 1) { *lenp = 0; return -EINVAL; } ... } So, just __do_proc_doulongvec_minmax has the problem. And most use of proc_doulongvec_minmax/proc_doulongvec_ms_jiffies_minmax just have one parameter. Link: http://lkml.kernel.org/r/1544081775-15720-1-git-send-email-cheng.lin130@zte.com.cn Signed-off-by: Cheng Lin Acked-by: Luis Chamberlain Reviewed-by: Kees Cook Cc: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit afe922c2daae4a8f0101a30658c886c2b6eb2a96 Author: Alexey Dobriyan Date: Thu Jan 3 15:26:09 2019 -0800 fs/proc/base.c: slightly faster /proc/*/limits Header of /proc/*/limits is a fixed string, so print it directly without formatting specifiers. Link: http://lkml.kernel.org/r/20181203164242.GB6904@avx2 Signed-off-by: Alexey Dobriyan Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 230f72e9f6dc7b22ee92dc03a393429447b4395c Author: Alexey Dobriyan Date: Thu Jan 3 15:26:05 2019 -0800 fs/proc/inode.c: delete unnecessary variable in proc_alloc_inode() Link: http://lkml.kernel.org/r/20181203164015.GA6904@avx2 Signed-off-by: Alexey Dobriyan Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 81966d83492620bf42d94d580370c59ff8d02772 Author: Eric Biggers Date: Thu Jan 3 15:26:00 2019 -0800 fs/proc/util.c: include fs/proc/internal.h for name_to_int() name_to_int() is defined in fs/proc/util.c and declared in fs/proc/internal.h, but the declaration isn't included at the point of the definition. Include the header to enforce that the definition matches the declaration. This addresses a gcc warning when -Wmissing-prototypes is enabled. Link: http://lkml.kernel.org/r/20181115001833.49371-1-ebiggers@kernel.org Signed-off-by: Eric Biggers Reviewed-by: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8da0b4f692c6d90b09c91f271517db746a22ff67 Author: Benjamin Gordon Date: Thu Jan 3 15:25:56 2019 -0800 fs/proc/base.c: use ns_capable instead of capable for timerslack_ns Access to timerslack_ns is controlled by a process having CAP_SYS_NICE in its effective capability set, but the current check looks in the root namespace instead of the process' user namespace. Since a process is allowed to do other activities controlled by CAP_SYS_NICE inside a namespace, it should also be able to adjust timerslack_ns. Link: http://lkml.kernel.org/r/20181030180012.232896-1-bmgordon@google.com Signed-off-by: Benjamin Gordon Acked-by: "Eric W. Biederman" Cc: John Stultz Cc: "Eric W. Biederman" Cc: Kees Cook Cc: "Serge E. Hallyn" Cc: Thomas Gleixner Cc: Arjan van de Ven Cc: Oren Laadan Cc: Ruchi Kandoi Cc: Rom Lemarchand Cc: Todd Kjos Cc: Colin Cross Cc: Nick Kralevich Cc: Dmitry Shmidt Cc: Elliott Hughes Cc: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cff1e01f16f84083e5b4e3a98331ba405fb3fbb5 Author: Linus Walleij Date: Thu Jan 3 22:31:32 2019 +0100 net: dsa: mt7530: Drop unused GPIO include This driver uses GPIO descriptors only, is not used so drop the include. Signed-off-by: Linus Walleij Reviewed-by: Vivien Didelot Signed-off-by: David S. Miller commit 0c06a0919782cbe5f33d0f1411ca059e9bfb8190 Merge: 41e4e2cd75346 44039e00171b0 Author: David S. Miller Date: Fri Jan 4 13:06:07 2019 -0800 Merge branch 'GUE-error-recursion' Stefano Brivio says: ==================== Fix two further potential unbounded recursions in GUE error handlers Patch 1/2 takes care of preventing the issue fixed by commit 11789039da53 ("fou: Prevent unbounded recursion in GUE error handler") also with UDP-Lite payloads -- I just realised this might happen from a syzbot report. Patch 2/2 fixes the issue for both UDP and UDP-Lite on IPv6, which I also forgot to deal with in that same commit. ==================== Signed-off-by: David S. Miller commit 44039e00171b0fe930c07ff7b43e6023eaf1ed31 Author: Stefano Brivio Date: Thu Jan 3 21:43:35 2019 +0100 fou6: Prevent unbounded recursion in GUE error handler I forgot to deal with IPv6 in commit 11789039da53 ("fou: Prevent unbounded recursion in GUE error handler"). Now syzbot reported what might be the same type of issue, caused by gue6_err(), that is, handling exceptions for direct UDP encapsulation in GUE (UDP-in-UDP) leads to unbounded recursion in the GUE exception handler. As it probably doesn't make sense to set up GUE this way, and it's currently not even possible to configure this, skip exception handling for UDP (or UDP-Lite) packets encapsulated in UDP (or UDP-Lite) packets with GUE on IPv6. Reported-by: syzbot+4ad25edc7a33e4ab91e0@syzkaller.appspotmail.com Reported-by: Willem de Bruijn Reported-by: Eric Dumazet Fixes: b8a51b38e4d4 ("fou, fou6: ICMP error handlers for FoU and GUE") Signed-off-by: Stefano Brivio Signed-off-by: David S. Miller commit bc6e019b6ee65ff4ebf3ca272f774cf6c67db669 Author: Stefano Brivio Date: Thu Jan 3 21:43:34 2019 +0100 fou: Prevent unbounded recursion in GUE error handler also with UDP-Lite In commit 11789039da53 ("fou: Prevent unbounded recursion in GUE error handler"), I didn't take care of the case where UDP-Lite is encapsulated into UDP or UDP-Lite with GUE. From a syzbot report about a possibly similar issue with GUE on IPv6, I just realised the same thing might happen with a UDP-Lite inner payload. Also skip exception handling for inner UDP-Lite protocol. Fixes: 11789039da53 ("fou: Prevent unbounded recursion in GUE error handler") Signed-off-by: Stefano Brivio Signed-off-by: David S. Miller commit 41e4e2cd75346667b0c531c07dab05cce5b06d15 Author: Yi-Hung Wei Date: Thu Jan 3 09:51:57 2019 -0800 openvswitch: Fix IPv6 later frags parsing The previous commit fa642f08839b ("openvswitch: Derive IP protocol number for IPv6 later frags") introduces IP protocol number parsing for IPv6 later frags that can mess up the network header length calculation logic, i.e. nh_len < 0. However, the network header length calculation is mainly for deriving the transport layer header in the key extraction process which the later fragment does not apply. Therefore, this commit skips the network header length calculation to fix the issue. Reported-by: Chris Mi Reported-by: Greg Rose Fixes: fa642f08839b ("openvswitch: Derive IP protocol number for IPv6 later frags") Signed-off-by: Yi-Hung Wei Signed-off-by: David S. Miller commit ba3e1847d6471f30241f11069d8f153ed8cb052b Author: Claudiu Beznea Date: Thu Jan 3 14:59:35 2019 +0000 net: macb: remove unnecessary code Commit 653e92a9175e ("net: macb: add support for padding and fcs computation") introduced a bug fixed by commit 899ecaedd155 ("net: ethernet: cadence: fix socket buffer corruption problem"). Code removed in this patch is not reachable at all so remove it. Fixes: 653e92a9175e ("net: macb: add support for padding and fcs computation") Cc: Tristram Ha Signed-off-by: Claudiu Beznea Signed-off-by: David S. Miller commit a09b42ba1a5e1cbeb934fd94cb7b5b9018bf15c7 Author: Linus Walleij Date: Thu Jan 3 13:36:43 2019 +0100 net: dsa: microchip: Drop unused GPIO includes This driver does not use the old GPIO includes so drop them. Signed-off-by: Linus Walleij Reviewed-by: Vivien Didelot Signed-off-by: David S. Miller commit ebdefe4656470870579f1c42fa2e20dcda699263 Merge: f8c468e853792 46721c3d9e273 Author: David S. Miller Date: Fri Jan 4 12:57:31 2019 -0800 Merge branch 'qed-fixes' Denis Bolotin says: ==================== qed: Misc fixes in qed This patch series fixes 2 potential bugs in qed. Please consider applying to net. ==================== Signed-off-by: David S. Miller commit 46721c3d9e273aea880e9ff835b0e1271e1cd2fb Author: Denis Bolotin Date: Thu Jan 3 12:02:40 2019 +0200 qed: Fix qed_ll2_post_rx_buffer_notify_fw() by adding a write memory barrier Make sure chain element is updated before ringing the doorbell. Signed-off-by: Denis Bolotin Signed-off-by: Ariel Elior Signed-off-by: David S. Miller commit 2d533a9287f2011632977e87ce2783f4c689c984 Author: Denis Bolotin Date: Thu Jan 3 12:02:39 2019 +0200 qed: Fix qed_chain_set_prod() for PBL chains with non power of 2 page count In PBL chains with non power of 2 page count, the producer is not at the beginning of the chain when index is 0 after a wrap. Therefore, after the producer index wrap around, page index should be calculated more carefully. Signed-off-by: Denis Bolotin Signed-off-by: Ariel Elior Signed-off-by: David S. Miller commit 594cc251fdd0d231d342d88b2fdff4bc42fb0690 Author: Linus Torvalds Date: Fri Jan 4 12:56:09 2019 -0800 make 'user_access_begin()' do 'access_ok()' Originally, the rule used to be that you'd have to do access_ok() separately, and then user_access_begin() before actually doing the direct (optimized) user access. But experience has shown that people then decide not to do access_ok() at all, and instead rely on it being implied by other operations or similar. Which makes it very hard to verify that the access has actually been range-checked. If you use the unsafe direct user accesses, hardware features (either SMAP - Supervisor Mode Access Protection - on x86, or PAN - Privileged Access Never - on ARM) do force you to use user_access_begin(). But nothing really forces the range check. By putting the range check into user_access_begin(), we actually force people to do the right thing (tm), and the range check vill be visible near the actual accesses. We have way too long a history of people trying to avoid them. Signed-off-by: Linus Torvalds commit f8c468e8537925e0c4607263f498a1b7c0c8982e Author: David Rientjes Date: Wed Jan 2 13:01:43 2019 -0800 net, skbuff: do not prefer skb allocation fails early Commit dcda9b04713c ("mm, tree wide: replace __GFP_REPEAT by __GFP_RETRY_MAYFAIL with more useful semantic") replaced __GFP_REPEAT in alloc_skb_with_frags() with __GFP_RETRY_MAYFAIL when the allocation may directly reclaim. The previous behavior would require reclaim up to 1 << order pages for skb aligned header_len of order > PAGE_ALLOC_COSTLY_ORDER before failing, otherwise the allocations in alloc_skb() would loop in the page allocator looking for memory. __GFP_RETRY_MAYFAIL makes both allocations failable under memory pressure, including for the HEAD allocation. This can cause, among many other things, write() to fail with ENOTCONN during RPC when under memory pressure. These allocations should succeed as they did previous to dcda9b04713c even if it requires calling the oom killer and additional looping in the page allocator to find memory. There is no way to specify the previous behavior of __GFP_REPEAT, but it's unlikely to be necessary since the previous behavior only guaranteed that 1 << order pages would be reclaimed before failing for order > PAGE_ALLOC_COSTLY_ORDER. That reclaim is not guaranteed to be contiguous memory, so repeating for such large orders is usually not beneficial. Removing the setting of __GFP_RETRY_MAYFAIL to restore the previous behavior, specifically not allowing alloc_skb() to fail for small orders and oom kill if necessary rather than allowing RPCs to fail. Fixes: dcda9b04713c ("mm, tree wide: replace __GFP_REPEAT by __GFP_RETRY_MAYFAIL with more useful semantic") Signed-off-by: David Rientjes Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 8d68100ab4ad92560a16a68b72e068613ac4d573 Author: Wen Yang Date: Thu Jan 3 01:09:53 2019 +0800 soc/fsl/qe: fix err handling of ucc_of_parse_tdm Currently there are some issues with the ucc_of_parse_tdm function: 1, a possible null pointer dereference in ucc_of_parse_tdm, detected by the semantic patch deref_null.cocci, with the following warning: drivers/soc/fsl/qe/qe_tdm.c:177:21-24: ERROR: pdev is NULL but dereferenced. 2, dev gets modified, so in any case that devm_iounmap() will fail even when the new pdev is valid, because the iomap was done with a different pdev. 3, there is no driver bind with the "fsl,t1040-qe-si" or "fsl,t1040-qe-siram" device. So allocating resources using devm_*() with these devices won't provide a cleanup path for these resources when the caller fails. This patch fixes them. Suggested-by: Li Yang Suggested-by: Christophe LEROY Signed-off-by: Wen Yang Reviewed-by: Peng Hao CC: Julia Lawall CC: Zhao Qiang CC: David S. Miller CC: netdev@vger.kernel.org CC: linuxppc-dev@lists.ozlabs.org CC: linux-kernel@vger.kernel.org Signed-off-by: David S. Miller commit 36352991835ce99e46b4441dd0eb6980f9a83e8f Author: Kai-Heng Feng Date: Wed Jan 2 14:45:07 2019 +0800 r8169: Add support for new Realtek Ethernet There are two new Realtek Ethernet devices which are re-branded r8168h. Add the IDs to to support them. Signed-off-by: Kai-Heng Feng Reviewed-by: Heiner Kallweit Signed-off-by: David S. Miller commit 7c1e8a3817c55d73b27cc29b84075999c8894179 Author: Arthur Gautier Date: Mon Dec 31 02:10:58 2018 +0000 netlink: fixup regression in RTM_GETADDR This commit fixes a regression in AF_INET/RTM_GETADDR and AF_INET6/RTM_GETADDR. Before this commit, the kernel would stop dumping addresses once the first skb was full and end the stream with NLMSG_DONE(-EMSGSIZE). The error shouldn't be sent back to netlink_dump so the callback is kept alive. The userspace is expected to call back with a new empty skb. Changes from V1: - The error is not handled in netlink_dump anymore but rather in inet_dump_ifaddr and inet6_dump_addr directly as suggested by David Ahern. Fixes: d7e38611b81e ("net/ipv4: Put target net when address dump fails due to bad attributes") Fixes: 242afaa6968c ("net/ipv6: Put target net when address dump fails due to bad attributes") Cc: David Ahern Cc: "David S . Miller" Cc: netdev@vger.kernel.org Signed-off-by: Arthur Gautier Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 1492623e837fe7ca6296f7f5411328307e242771 Author: Christophe JAILLET Date: Sat Dec 29 17:42:22 2018 +0100 octeontx2-af: Fix a resource leak in an error handling path in 'cgx_probe()' If an error occurs after the call to 'pci_alloc_irq_vectors()', we must call 'pci_free_irq_vectors()' in order to avoid a resource leak. The same sequence is already in place in the corresponding 'cgx_remove()' function. Fixes: 1463f382f58d ("octeontx2-af: Add support for CGX link management") Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit e4f2283cc6ffefbe414317a0d89b602811b577ac Merge: 4addd2640fcae a40612ef0ee1e f91528955d009 Author: Al Viro Date: Fri Jan 4 14:02:59 2019 -0500 Merge branches 'misc.misc' and 'work.iov_iter' into for-linus commit 0b2c8f8b6b0c7530e2866c95862546d0da2057b0 Author: Linus Torvalds Date: Fri Jan 4 10:23:10 2019 -0800 i915: fix missing user_access_end() in page fault exception case When commit fddcd00a49e9 ("drm/i915: Force the slow path after a user-write error") unified the error handling for various user access problems, it didn't do the user_access_end() that is needed for the unsafe_put_user() case. It's not a huge deal: a missed user_access_end() will only mean that SMAP protection isn't active afterwards, and for the error case we'll be returning to user mode soon enough anyway. But it's wrong, and adding the proper user_access_end() is trivial enough (and doing it for the other error cases where it isn't needed doesn't hurt). I noticed it while doing the same prep-work for changing user_access_begin() that precipitated the access_ok() changes in commit 96d4f267e40f ("Remove 'type' argument from access_ok() function"). Fixes: fddcd00a49e9 ("drm/i915: Force the slow path after a user-write error") Cc: Chris Wilson Cc: Joonas Lahtinen Cc: stable@kernel.org # v4.20 Signed-off-by: Linus Torvalds commit 03fa483821c0b4db7c2b1453d3332f397d82313f Author: Arnaldo Carvalho de Melo Date: Fri Jan 4 15:10:00 2019 -0300 perf test shell: Use a fallback to get the pathname in vfs_getname Some kernels, like 4.19.13-300.fc29.x86_64 in fedora 29, fail with the existing probe definition asking for the contents of result->name, working when we ask for the 'filename' variable instead, so add a fallback to that. Now those tests are back working on fedora 29 systems with that kernel: # perf test vfs_getname 65: Use vfs_getname probe to get syscall args filenames : Ok 66: Add vfs_getname probe to get syscall args filenames : Ok 67: Check open filename arg using perf trace + vfs_getname: Ok # Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-klt3n0i58dfqttveti09q3fi@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4caf4ebfe4cf0ea262eb9e829bb254a6a6d58acc Author: Linus Torvalds Date: Fri Jan 4 09:58:25 2019 -0800 Fix access_ok() fallout for sparc32 and powerpc These two architectures actually had an intentional use of the 'type' argument to access_ok() just to avoid warnings. I had actually noticed the powerpc one, but forgot to then fix it up. And I missed the sparc32 case entirely. This is hopefully all of it. Reported-by: Mathieu Malaterre Reported-by: Guenter Roeck Fixes: 96d4f267e40f ("Remove 'type' argument from access_ok() function") Signed-off-by: Linus Torvalds commit 1f8ce09b36c41a026a37a24b20efa32000892a64 Author: YueHaibing Date: Fri Jan 4 06:03:40 2019 +0000 xen/pvcalls: remove set but not used variable 'intf' Fixes gcc '-Wunused-but-set-variable' warning: drivers/xen/pvcalls-back.c: In function 'pvcalls_sk_state_change': drivers/xen/pvcalls-back.c:286:28: warning: variable 'intf' set but not used [-Wunused-but-set-variable] It not used since e6587cdbd732 ("pvcalls-back: set -ENOTCONN in pvcalls_conn_back_read") Signed-off-by: YueHaibing Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit f712a86c1406abf50b0dcff0500c723e2aca050a Author: Arnaldo Carvalho de Melo Date: Thu Jan 3 16:03:46 2019 -0300 perf python: Make sure the python binding output directory is in place Instead of doing an unconditional mkdir, use a dummy Makefile variable to check if the directory is there and if not, create it. This is better than what we had and will help with other python bindings that are in development, like one involved with python backtraces. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-iis6us2nocw3y4uuoon9osd7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 099be748865eece21362aee416c350c0b1ae34df Author: Mattias Jacobsson <2pi@mok.nu> Date: Sat Dec 29 15:17:50 2018 +0100 perf strbuf: Remove redundant va_end() in strbuf_addv() Each call to va_copy() should have one, and only one, corresponding call to va_end(). In strbuf_addv() some code paths result in va_end() getting called multiple times. Remove the superfluous va_end(). Signed-off-by: Mattias Jacobsson <2pi@mok.nu> Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Sanskriti Sharma Link: http://lkml.kernel.org/r/20181229141750.16945-1-2pi@mok.nu Fixes: ce49d8436cff ("perf strbuf: Match va_{add,copy} with va_end") Signed-off-by: Arnaldo Carvalho de Melo commit 442b4eb3af44906fcbb526d98c314b27f8c9acf3 Author: Ivan Krylov Date: Sun Oct 14 11:18:03 2018 +0300 perf annotate: Pass filename to objdump via execl The symbol__disassemble() function uses shell to launch objdump and filter its output via grep. Passing filenames by interpolating them into the command line via "%s" may lead to problems if said filenames contain special characters. Instead, pass the filename as a command line argument where it is not subject to any kind of interpretation, then use quoted shell interpolation to build the strings we need safely. Signed-off-by: Ivan Krylov Acked-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20181014111803.5d83b806@Tarkus Signed-off-by: Arnaldo Carvalho de Melo commit a3366db06bb656cef2e03f30f780d93059bcc594 Author: Jin Yao Date: Fri Jan 4 14:10:30 2019 +0800 perf report: Fix wrong iteration count in --branch-history By calculating the removed loops, we can get the iteration count. But the iteration count could be reported incorrectly, reporting impossibly high counts. That's because previous code uses the number of removed LBR entries for the iteration count. That's not good. Fix this by increasing the iteration count when a loop is detected. When matching the chain, the iteration count would be added up, finally we need to compute the average value when printing out. For example, $ perf report --branch-history --stdio --no-children Before: ---f2 +0 | |--33.62%--f1 +9 (cycles:1) | f1 +0 | main +22 (cycles:1) | main +17 | main +38 (cycles:1) | main +27 | f1 +26 (cycles:1) | f1 +24 | f2 +27 (cycles:7) | f2 +0 | f1 +19 (cycles:1) | f1 +14 | f2 +27 (cycles:11) | f2 +0 | f1 +9 (cycles:1 iter:2968 avg_cycles:3) | f1 +0 | main +22 (cycles:1 iter:2968 avg_cycles:3) | main +17 | main +38 (cycles:1 iter:2968 avg_cycles:3) 2968 is an impossible high iteration count and avg_cycles is too small. After: ---f2 +0 | |--33.62%--f1 +9 (cycles:1) | f1 +0 | main +22 (cycles:1) | main +17 | main +38 (cycles:1) | main +27 | f1 +26 (cycles:1) | f1 +24 | f2 +27 (cycles:7) | f2 +0 | f1 +19 (cycles:1) | f1 +14 | f2 +27 (cycles:11) | f2 +0 | f1 +9 (cycles:1 iter:1 avg_cycles:23) | f1 +0 | main +22 (cycles:1 iter:1 avg_cycles:23) | main +17 | main +38 (cycles:1 iter:1 avg_cycles:23) avg_cycles:23 is the average cycles of this iteration. Fixes: c4ee06251d42 ("perf report: Calculate the average cycles of iterations") Signed-off-by: Jin Yao Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1546582230-17507-1-git-send-email-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 86c22ab7227f59169f64275875c97ef495668b77 Author: Arnaldo Carvalho de Melo Date: Fri Jan 4 12:13:34 2019 -0300 tools headers x86: Sync asm/cpufeatures.h copy with the kernel sources To get the changes from: a0aea130afeb ("KVM: x86: Add CPUID support for new instruction WBNOINVD") 20c3a2c33e9f ("x86/speculation: Add support for STIBP always-on preferred mode") Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Robert Hoo Cc: Thomas Gleixner Cc: Thomas Lendacky Link: https://lkml.kernel.org/n/tip-aonti3bu9rhnqe5hlawbidcp@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 8c91fd605e1a66050c9c4dbc3e159a08e8c5f7d4 Author: Arnaldo Carvalho de Melo Date: Fri Jan 4 12:08:31 2019 -0300 tools headers uapi: Sync copy of asm-generic/unistd.h with the kernel sources To get the changes in: b7d624ab4312 asm-generic: unistd.h: fixup broken macro include. 4e21565b7fd4 asm-generic: add kexec_file_load system call to unistd.h With this the 'kexec_file_load' syscall will be added to arm64's syscall table and will appear on the output of 'perf trace' on that platform. This silences this tools/perf build warning: 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 Cc: Adrian Hunter Cc: AKASHI Takahiro Cc: Arnd Bergmann Cc: Guo Ren Cc: Jiri Olsa Cc: Namhyung Kim Cc: Will Deacon Link: https://lkml.kernel.org/n/tip-er8j7qhavtdw0kdga3zswynm@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 558517c52c87da91a963708fe589044172470653 Author: Arnaldo Carvalho de Melo Date: Fri Jan 4 11:45:03 2019 -0300 tools headers uapi: Sync linux/kvm.h with the kernel sources To get the changes from these csets: 2bc39970e932 ("x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID") 2a31b9db1535 ("kvm: introduce manual dirty log reprotect") That results in these new KVM IOCTLs being supported in 'perf trace' when beautifying the cmd ioctl syscall argument: $ cp include/uapi/linux/kvm.h tools/include/uapi/linux/kvm.h $ tools/perf/trace/beauty/kvm_ioctl.sh > after $ diff -u before after --- before 2019-01-04 11:44:23.506605301 -0300 +++ after 2019-01-04 11:44:36.878730583 -0300 @@ -86,6 +86,8 @@ [0xbd] = "HYPERV_EVENTFD", [0xbe] = "GET_NESTED_STATE", [0xbf] = "SET_NESTED_STATE", + [0xc0] = "CLEAR_DIRTY_LOG", + [0xc1] = "GET_SUPPORTED_HV_CPUID", [0xe0] = "CREATE_DEVICE", [0xe1] = "SET_DEVICE_ATTR", [0xe2] = "GET_DEVICE_ATTR", $ At some point we should be able to do something: # perf trace -e ioctl(cmd == KVM_CLEAR_DIRTY_LOG) And have just those ioctls, optionally with callchains, etc. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Paolo Bonzini Cc: Vitaly Kuznetsov Link: https://lkml.kernel.org/n/tip-konm3iigl2os6ritt7d2bori@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4001b6a080aaca9a13ea07ae8972b82fdbd9ea6b Author: Arnaldo Carvalho de Melo Date: Fri Jan 4 11:41:42 2019 -0300 tools headers uapi: Sync linux/in.h copy from the kernel sources To get the changes in this cset: 65cab850f0ee ("net: Allow class-e address assignment via ifconfig ioctl") The macros changed in this cset are not used in tools/, so this is just to silence this perf tools build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/in.h' differs from latest version at 'include/uapi/linux/in.h' diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h Cc: Dave Taht Cc: David S. Miller Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-smghvyxb3budqd1e70i0ylw1@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 8858ecb5a28d871b79aa5b4eed45414b553a5b6e Author: Arnaldo Carvalho de Melo Date: Fri Jan 4 11:36:10 2019 -0300 tools headers uapi: Update i915_drm.h To get the changes in these csets: fe841686470d Revert "drm/i915/perf: add a parameter to control the size of OA buffer" cd956bfcd0f5 drm/i915/perf: add a parameter to control the size of OA buffer 4bdafb9ddfa4 drm/i915: Remove i915.enable_ppgtt override Not one of them result in any changes in tools/perf/, this is just to silence 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: Chris Wilson Cc: Jiri Olsa Cc: Joonas Lahtinen Cc: Lionel Landwerlin Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-mdw7ta6qz7d2rl77gf00uqe8@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 536cdb684d2d5139708d290b9dc124b1420886c1 Author: Jiri Olsa Date: Thu Jan 3 17:13:50 2019 +0100 tools iio: Override CFLAGS assignments So user could specify outside CFLAGS values. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andy Shevchenko Cc: Hartmut Knaack Cc: Jonathan Cameron Cc: Lars-Peter Clausen Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20190103161350.11446-3-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 302df34c4e64b9e83ee31cbf508b38b62b428bd6 Author: Jiri Olsa Date: Thu Jan 3 17:13:49 2019 +0100 tools thermal tmon: Use -O3 instead of -O1 if available Using -O3 instead of -O1 if it's supported by compiler. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Brian Norris Cc: Markus Mayer Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Zhang Rui Link: http://lkml.kernel.org/r/20190103161350.11446-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 6de92920a717ea2b7b45bb3d651b8bb951eab185 Merge: 97b6f89f7269b 07a496de4c7eb Author: Russell King Date: Fri Jan 4 14:34:46 2019 +0000 Merge commit 'smp-hotplug^{/omap2}' into for-linus commit 7e0b44e870cf265bb4a73fd25e0508c7363fcbd6 Author: Will Deacon Date: Thu Jan 3 17:55:12 2019 +0000 arm64: compat: Hook up io_pgetevents() for 32-bit tasks Commit 73aeb2cbcdc9 ("ARM: 8787/1: wire up io_pgetevents syscall") hooked up the io_pgetevents() system call for 32-bit ARM, so we can do the same for the compat wrapper on arm64. Signed-off-by: Will Deacon commit 53290432145a8eb143fe29e06e9c1465d43dc723 Author: Will Deacon Date: Thu Jan 3 18:00:39 2019 +0000 arm64: compat: Don't pull syscall number from regs in arm_compat_syscall The syscall number may have been changed by a tracer, so we should pass the actual number in from the caller instead of pulling it from the saved r7 value directly. Cc: Cc: Pi-Hsun Shih Reviewed-by: Dave Martin Signed-off-by: Will Deacon commit 169113ece0f29ebe884a6cfcf57c1ace04d8a36a Author: Will Deacon Date: Thu Jan 3 17:45:07 2019 +0000 arm64: compat: Avoid sending SIGILL for unallocated syscall numbers The ARM Linux kernel handles the EABI syscall numbers as follows: 0 - NR_SYSCALLS-1 : Invoke syscall via syscall table NR_SYSCALLS - 0xeffff : -ENOSYS (to be allocated in future) 0xf0000 - 0xf07ff : Private syscall or -ENOSYS if not allocated > 0xf07ff : SIGILL Our compat code gets this wrong and ends up sending SIGILL in response to all syscalls greater than NR_SYSCALLS which have a value greater than 0x7ff in the bottom 16 bits. Fix this by defining the end of the ARM private syscall region and checking the syscall number against that directly. Update the comment while we're at it. Cc: Cc: Dave Martin Reported-by: Pi-Hsun Shih Signed-off-by: Will Deacon commit 9966a05c7b80f075f2bc7e48dbb108d3f2927234 Author: Dave Martin Date: Fri Jan 4 13:09:51 2019 +0000 arm64/sve: Disentangle from Currently, provides common definitions for describing SVE context structures that are also used by the ptrace definitions in . For this reason, a #include of was added in ptrace.h, but it this turns out that this can interact badly with userspace code that tries to include ptrace.h on top of the libc headers (which may provide their own shadow definitions for sigcontext.h). To make the headers easier for userspace to consume, this patch bounces the common definitions into an __SVE_* namespace and moves them to a backend header that can be included by the other headers as appropriate. This should allow ptrace.h to be used alongside libc's sigcontext.h (if any) without ill effects. This should make the situation unambiguous: is the header to include for the sigframe-specific definitions, while is the header to include for ptrace-specific definitions. To avoid conflicting with existing usage, remains the canonical way to get the common definitions for SVE_VQ_MIN, sve_vq_from_vl() etc., both in userspace and in the kernel: relying on these being defined as a side effect of including just was never intended to be safe. Signed-off-by: Dave Martin Signed-off-by: Will Deacon commit ee1b465b303591d3a04d403122bbc0d7026520fb Author: Dave Martin Date: Fri Jan 4 13:09:50 2019 +0000 arm64/sve: ptrace: Fix SVE_PT_REGS_OFFSET definition SVE_PT_REGS_OFFSET is supposed to indicate the offset for skipping over the ptrace NT_ARM_SVE header (struct user_sve_header) to the start of the SVE register data proper. However, currently SVE_PT_REGS_OFFSET is defined in terms of struct sve_context, which is wrong: that structure describes the SVE header in the signal frame, not in the ptrace regset. This patch fixes the definition to use the ptrace header structure struct user_sve_header instead. By good fortune, the two structures are the same size anyway, so there is no functional or ABI change. Signed-off-by: Dave Martin Signed-off-by: Will Deacon commit 074400a7be61250d9f0ccec07d5c35ffec4d8d22 Author: Mathieu Malaterre Date: Fri Jan 4 10:27:58 2019 +0100 powerpc: Drop use of 'type' from access_ok() In commit 05a4ab823983 ("powerpc/uaccess: fix warning/error with access_ok()") an attempt was made to remove a warning by referencing the variable `type`. However in commit 96d4f267e40f ("Remove 'type' argument from access_ok() function") the variable `type` has been removed, breaking the build: arch/powerpc/include/asm/uaccess.h:66:32: error: ‘type’ undeclared (first use in this function) This essentially reverts commit 05a4ab823983 ("powerpc/uaccess: fix warning/error with access_ok()") to fix the error. Fixes: 96d4f267e40f ("Remove 'type' argument from access_ok() function") Signed-off-by: Mathieu Malaterre [mpe: Reword change log slightly.] Signed-off-by: Michael Ellerman commit 1690d8bb91e370ab772062b79bd434ce815c4729 Author: Viresh Kumar Date: Fri Jan 4 15:14:33 2019 +0530 cpufreq: scpi/scmi: Fix freeing of dynamic OPPs Since the commit 2a4eb7358aba "OPP: Don't remove dynamic OPPs from _dev_pm_opp_remove_table()", dynamically created OPP aren't automatically removed anymore by dev_pm_opp_cpumask_remove_table(). This affects the scpi and scmi cpufreq drivers which no longer free OPPs on failures or on invocations of the policy->exit() callback. Create a generic OPP helper dev_pm_opp_remove_all_dynamic() which can be called from these drivers instead of dev_pm_opp_cpumask_remove_table(). In dev_pm_opp_remove_all_dynamic(), we need to make sure that the opp_list isn't getting accessed simultaneously from other parts of the OPP core while the helper is freeing dynamic OPPs, i.e. we can't drop the opp_table->lock while traversing through the OPP list. And to accomplish that, this patch also creates _opp_kref_release_unlocked() which can be called from this new helper with the opp_table lock already held. Cc: 4.20 # v4.20 Reported-by: Valentin Schneider Fixes: 2a4eb7358aba "OPP: Don't remove dynamic OPPs from _dev_pm_opp_remove_table()" Signed-off-by: Viresh Kumar Tested-by: Valentin Schneider Reviewed-by: Sudeep Holla Signed-off-by: Rafael J. Wysocki commit d538d94f0ca86cfedc892cc427169219acb3c2f7 Merge: f460772291f81 96d4f267e40f9 Author: Michael Ellerman Date: Fri Jan 4 22:07:47 2019 +1100 Merge branch 'master' into fixes We have a fix to apply on top of commit 96d4f267e40f ("Remove 'type' argument from access_ok() function"), so merge master to get it. commit 09ad32dc6dc23beb638c48d0a2e5a9eaa8e85c6c Author: Rafael J. Wysocki Date: Thu Jan 3 11:30:07 2019 +0100 cpuidle / Documentation: Update cpuidle MAINTAINERS entry Update the MAINTAINERS entry for cpuidle by making it clear that it is not just drivers and adding a documentation record to it. Signed-off-by: Rafael J. Wysocki commit eb4f5213251833567570df1a09803f895653274d Author: Shaokun Zhang Date: Fri Jan 4 14:21:34 2019 +0800 drivers/perf: hisi: Fixup one DDRC PMU register offset For DDRC PMU, each PMU counter is fixed-purpose. There is a mismatch between perf list and driver definition on rw_chg event. # perf list | grep chg hisi_sccl1_ddrc0/rnk_chg/ [Kernel PMU event] hisi_sccl1_ddrc0/rw_chg/ [Kernel PMU event] But the register offset of rw_chg event is not defined in the driver, meanwhile bnk_chg register offset is mis-defined, let's fixup it. Fixes: 904dcf03f086 ("perf: hisi: Add support for HiSilicon SoC DDRC PMU driver") Cc: stable@vger.kernel.org Cc: John Garry Cc: Will Deacon Cc: Mark Rutland Reported-by: Weijian Huang Signed-off-by: Shaokun Zhang Signed-off-by: Will Deacon commit 2f328fea47ac9020ac47c88dd01cd8f93da55bcc Author: Masahiro Yamada Date: Fri Jan 4 09:18:41 2019 +0900 arm64: replace arm64-obj-* in Makefile with obj-* Use the standard obj-$(CONFIG_...) syntex. The behavior is still the same. Signed-off-by: Masahiro Yamada Signed-off-by: Will Deacon commit 48e638fb68be8fecdca0611beff53a9c947704e3 Author: Christoph Hellwig Date: Tue Jan 1 17:14:39 2019 +0100 dma-mapping: remove a few unused exports Now that the slow path DMA API calls are implemented out of line a few helpers only used by them don't need to be exported anymore. Signed-off-by: Christoph Hellwig commit ed6ccf10f24bdfc1955bc8b976ddedc370fc3869 Author: Christoph Hellwig Date: Wed Dec 26 07:52:13 2018 +0100 dma-mapping: properly stub out the DMA API for !CONFIG_HAS_DMA This avoids link failures in drivers using the DMA API, when they are compiled for user mode Linux with CONFIG_COMPILE_TEST=y. Fixes: 356da6d0cd ("dma-mapping: bypass indirect calls for dma-direct") Signed-off-by: Christoph Hellwig commit 4788ba5792cc1368ba4867e1488dc168b4fe97b7 Author: Christoph Hellwig Date: Wed Dec 26 07:51:44 2018 +0100 dma-mapping: remove dmam_{declare,release}_coherent_memory These functions have never been used. Signed-off-by: Christoph Hellwig commit d7076f07840851bbe57cb21ba052d6a4a9b1efa9 Author: Christoph Hellwig Date: Tue Dec 25 17:44:19 2018 +0100 dma-mapping: implement dmam_alloc_coherent using dmam_alloc_attrs dmam_alloc_coherent is just the default no-flags case of dmam_alloc_attrs, so take advantage of this similar to the non-managed version. Signed-off-by: Christoph Hellwig commit 2e05ea5cdc1ac55d9ef678ed5ea6c38acf7fd2a3 Author: Christoph Hellwig Date: Tue Dec 25 08:50:35 2018 +0100 dma-mapping: implement dma_map_single_attrs using dma_map_page_attrs And also switch the way we implement the unmap side around to stay consistent. This ensures dma-debug works again because it records which function we used for mapping to ensure it is also used for unmapping, and also reduces further code duplication. Last but not least this also officially allows calling dma_sync_single_* for mappings created using dma_map_page, which is perfectly fine given that the sync calls only take a dma_addr_t, but not a virtual address or struct page. Fixes: 7f0fee242e ("dma-mapping: merge dma_unmap_page_attrs and dma_unmap_single_attrs") Signed-off-by: Christoph Hellwig Tested-by: LABBE Corentin commit 9ddf32a8df9e342371aaf9233d59739a356231e6 Merge: 74136a3d47f51 c75ff001f4fe2 Author: Dave Airlie Date: Fri Jan 4 14:09:12 2019 +1000 Merge tag 'drm-misc-next-fixes-2019-01-02' of git://anongit.freedesktop.org/drm/drm-misc into drm-next Fixes for v4.21: - Fix null pointer dereference on null state pointer. - Fix leaking damage clip when destroying plane state. Signed-off-by: Dave Airlie From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/46c4dbcd-dc23-7b46-fda9-16fe33e6ceef@linux.intel.com commit dc56367cb5dbf9d593e4b12373489df9a7edb72c Author: Steven Rostedt (VMware) Date: Thu Jan 3 22:02:39 2019 -0500 sh: ftrace: Fix missing parenthesis in WARN_ON() Adding a function inside a WARN_ON() didn't close the WARN_ON parathesis. Link: http://lkml.kernel.org/r/201901020958.28Mzbs0O%fengguang.wu@intel.com Cc: linux-sh@vger.kernel.org Cc: Yoshinori Sato Cc: Rich Felker Reported-by: kbuild test robot Fixes: cec8d0e7f06e ("sh: ftrace: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack") Signed-off-by: Steven Rostedt (VMware) commit 96d4f267e40f9509e8a66e2b39e8b95655617693 Author: Linus Torvalds Date: Thu Jan 3 18:57:57 2019 -0800 Remove 'type' argument from access_ok() function Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument of the user address range verification function since we got rid of the old racy i386-only code to walk page tables by hand. It existed because the original 80386 would not honor the write protect bit when in kernel mode, so you had to do COW by hand before doing any user access. But we haven't supported that in a long time, and these days the 'type' argument is a purely historical artifact. A discussion about extending 'user_access_begin()' to do the range checking resulted this patch, because there is no way we're going to move the old VERIFY_xyz interface to that model. And it's best done at the end of the merge window when I've done most of my merges, so let's just get this done once and for all. This patch was mostly done with a sed-script, with manual fix-ups for the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form. There were a couple of notable cases: - csky still had the old "verify_area()" name as an alias. - the iter_iov code had magical hardcoded knowledge of the actual values of VERIFY_{READ,WRITE} (not that they mattered, since nothing really used it) - microblaze used the type argument for a debug printout but other than those oddities this should be a total no-op patch. I tried to fix up all architectures, did fairly extensive grepping for access_ok() uses, and the changes are trivial, but I may have missed something. Any missed conversion should be trivially fixable, though. Signed-off-by: Linus Torvalds commit 135143b2cac43d2a1ec73b53033b9473fbbcce6d Merge: 810574ca7e2f9 bf77ae4c98d72 Author: Linus Torvalds Date: Thu Jan 3 14:33:46 2019 -0800 Merge tag 'locks-v4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux Pull file locking bugfix from Jeff Layton: "This is a one-line fix for a bug that syzbot turned up in the new patches to mitigate the thundering herd when a lock is released" * tag 'locks-v4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux: locks: fix error in locks_move_blocks() commit 810574ca7e2f95d149023f4ea247d6672f69f9af Merge: 43d86ee8c639d 3e9ad24b0e91c Author: Linus Torvalds Date: Thu Jan 3 13:08:00 2019 -0800 Merge tag 'sound-fix-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Among a few HD-audio fixes, the only significant one is the regression fix on some machines like Dell XPS due to the default binding changes. We ended up reverting the whole since the fix for ASoC HD-audio driver won't be available immediately" * tag 'sound-fix-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda - Revert DSP detection on legacy HD-audio driver ALSA: hda/tegra: clear pending irq handlers ALSA: hda/realtek: Enable the headset mic auto detection for ASUS laptops commit 43d86ee8c639df750529b4d8f062b328b61c423e Merge: 645ff1e8e704c c5ee066333ebc Author: Linus Torvalds Date: Thu Jan 3 12:53:47 2019 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net Pull networking fixes from David Miller: "Several fixes here. Basically split down the line between newly introduced regressions and long existing problems: 1) Double free in tipc_enable_bearer(), from Cong Wang. 2) Many fixes to nf_conncount, from Florian Westphal. 3) op->get_regs_len() can throw an error, check it, from Yunsheng Lin. 4) Need to use GFP_ATOMIC in *_add_hash_mac_address() of fsl/fman driver, from Scott Wood. 5) Inifnite loop in fib_empty_table(), from Yue Haibing. 6) Use after free in ax25_fillin_cb(), from Cong Wang. 7) Fix socket locking in nr_find_socket(), also from Cong Wang. 8) Fix WoL wakeup enable in r8169, from Heiner Kallweit. 9) On 32-bit sock->sk_stamp is not thread-safe, from Deepa Dinamani. 10) Fix ptr_ring wrap during queue swap, from Cong Wang. 11) Missing shutdown callback in hinic driver, from Xue Chaojing. 12) Need to return NULL on error from ip6_neigh_lookup(), from Stefano Brivio. 13) BPF out of bounds speculation fixes from Daniel Borkmann" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (57 commits) ipv6: Consider sk_bound_dev_if when binding a socket to an address ipv6: Fix dump of specific table with strict checking bpf: add various test cases to selftests bpf: prevent out of bounds speculation on pointer arithmetic bpf: fix check_map_access smin_value test when pointer contains offset bpf: restrict unknown scalars of mixed signed bounds for unprivileged bpf: restrict stack pointer arithmetic for unprivileged bpf: restrict map value pointer arithmetic for unprivileged bpf: enable access to ax register also from verifier rewrite bpf: move tmp variable into ax register in interpreter bpf: move {prev_,}insn_idx into verifier env isdn: fix kernel-infoleak in capi_unlocked_ioctl ipv6: route: Fix return value of ip6_neigh_lookup() on neigh_create() error net/hamradio/6pack: use mod_timer() to rearm timers net-next/hinic:add shutdown callback net: hns3: call hns3_nic_net_open() while doing HNAE3_UP_CLIENT ip: validate header length on virtual device xmit tap: call skb_probe_transport_header after setting skb->dev ptr_ring: wrap back ->producer in __ptr_ring_swap_queue() net: rds: remove unnecessary NULL check ... commit d5c7076b772ad7dcdb92303397b36aee8fa0d25d Author: Steve French Date: Thu Jan 3 02:37:21 2019 -0600 smb3: add smb3.1.1 to default dialect list SMB3.1.1 dialect has additional security (among other) features and should be requested when mounting to modern servers so it can be used if the server supports it. Add SMB3.1.1 to the default list of dialects requested. Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg commit cdd6a4a0e2ec590c30ad0e965fa08bf37461cadb Author: Enric Balletbo i Serra Date: Mon Dec 17 10:54:09 2018 +0100 MAINTAINERS: add maintainers for ChromeOS EC sub-drivers There are multiple ChromeOS EC sub-drivers spread in different subsystems, as all of them are related to the Chrome stuff add Benson and myself as a maintainers for all these sub-drivers. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Benson Leung Acked-by: Wolfram Sang Acked-by: Chanwoo Choi Acked-by: Jonathan Cameron Acked-by: Alexandre Belloni Acked-by: Lee Jones Acked-by: Sebastian Reichel Acked-by: Guenter Roeck commit 4d5a91fd1f42a821d14b92b082b8e71be9911ba5 Author: Wei Yongjun Date: Thu Jan 3 07:02:30 2019 +0000 hwspinlock: fix return value check in stm32_hwspinlock_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: f24fcff1d267 ("hwspinlock: add STM32 hwspinlock device") Acked-by: Benjamin Gaignard Signed-off-by: Wei Yongjun Signed-off-by: Bjorn Andersson commit 81482d13f37b1c9354d9bf5491699d993b193246 Author: Parthiban Nallathambi Date: Tue Dec 11 09:04:47 2018 +0100 i2c: Add Actions Semiconductor Owl family S700 I2C support Add S700 to the list of devices supported by Owl I2C driver. Add Actions Semiconductor Owl family S700 I2C driver. Signed-off-by: Parthiban Nallathambi Reviewed-by: Manivannan Sadhasivam Signed-off-by: Wolfram Sang commit 78c0c25a8c08d76d12dd682de259f303baf25770 Author: Parthiban Nallathambi Date: Tue Dec 11 09:04:45 2018 +0100 dt-bindings: i2c: Add S700 support for Actions Semi Soc's Add s700 compatible string to Actions Semi SoC dt-bindings. Signed-off-by: Parthiban Nallathambi Reviewed-by: Rob Herring Signed-off-by: Wolfram Sang commit 5cda2d86de3ef7c926e441481c8e46ae3d1943cf Author: Jarkko Nikula Date: Wed Dec 19 09:01:58 2018 +0200 i2c: ismt: Add support for Intel Cedar Fork Add PCI ID for the Intel Cedar Fork iSMT SMBus controller. Signed-off-by: Jarkko Nikula Acked-by: Neil Horman [wsa: kept sorting] Signed-off-by: Wolfram Sang commit 805e4c8b61bd62f6d3f416c915cb9bb423835fee Author: Arnaldo Carvalho de Melo Date: Thu Jan 3 14:59:11 2019 -0300 tools beauty: Make the prctl option table generator catch all PR_ options In ba8308856564 ("arm64: add prctl control for resetting ptrauth keys") the PR_PAC_RESET_KEYS prctl option was introduced, get that into the regex in addition to PR_GET_* and PR_SET_*: So just get everything that matches '^#define PR_\w+' this ends up adding these entries: $ tools/perf/trace/beauty/prctl_option.sh > after $ diff -u before after --- before 2019-01-03 14:58:51.541807353 -0300 +++ after 2019-01-03 15:17:05.909583804 -0300 @@ -19,12 +19,18 @@ [20] = "SET_ENDIAN", [21] = "GET_SECCOMP", [22] = "SET_SECCOMP", + [23] = "CAPBSET_READ", + [24] = "CAPBSET_DROP", [25] = "GET_TSC", [26] = "SET_TSC", [27] = "GET_SECUREBITS", [28] = "SET_SECUREBITS", [29] = "SET_TIMERSLACK", [30] = "GET_TIMERSLACK", + [31] = "TASK_PERF_EVENTS_DISABLE", + [32] = "TASK_PERF_EVENTS_ENABLE", + [33] = "MCE_KILL", + [34] = "MCE_KILL_GET", [35] = "SET_MM", [36] = "SET_CHILD_SUBREAPER", [37] = "GET_CHILD_SUBREAPER", @@ -33,8 +39,13 @@ [40] = "GET_TID_ADDRESS", [41] = "SET_THP_DISABLE", [42] = "GET_THP_DISABLE", + [43] = "MPX_ENABLE_MANAGEMENT", + [44] = "MPX_DISABLE_MANAGEMENT", [45] = "SET_FP_MODE", [46] = "GET_FP_MODE", + [47] = "CAP_AMBIENT", + [50] = "SVE_SET_VL", + [51] = "SVE_GET_VL", [52] = "GET_SPECULATION_CTRL", [53] = "SET_SPECULATION_CTRL", [54] = "PAC_RESET_KEYS", $ Cc: Adrian Hunter Cc: Jiri Olsa Cc: Kristina Martsenko Cc: Namhyung Kim Cc: Will Deacon Link: https://lkml.kernel.org/n/tip-sg2pkmtjr5988bhbcp4yp6sw@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit c8a43c18a97845e7f94ed7d181c11f41964976a2 Author: Yueyi Li Date: Mon Dec 24 07:40:07 2018 +0000 arm64: kaslr: Reserve size of ARM64_MEMSTART_ALIGN in linear region When KASLR is enabled (CONFIG_RANDOMIZE_BASE=y), the top 4K of kernel virtual address space may be mapped to physical addresses despite being reserved for ERR_PTR values. Fix the randomization of the linear region so that we avoid mapping the last page of the virtual address space. Cc: Ard Biesheuvel Signed-off-by: liyueyi [will: rewrote commit message; merged in suggestion from Ard] Signed-off-by: Will Deacon commit acafce48b07bf5f9994a38e7fe237193d43d092e Author: James Morse Date: Fri Dec 21 19:25:19 2018 +0000 firmware: arm_sdei: Fix DT platform device creation It turns out the dt-probing part of this wasn't tested properly after it was merged. commit 3aa0582fdb82 ("of: platform: populate /firmware/ node from of_platform_default_populate_init()") changed the core-code to generate the platform devices, meaning the driver's attempt fails, and it bails out. Fix this by removing the manual platform-device creation for DT systems, core code has always done this for us. CC: Nicolas Saenz Julienne Signed-off-by: James Morse Signed-off-by: Will Deacon commit c3790b3799f8d75d93d26f6fd7bb569fc8c8b0cb Author: Nicolas Saenz Julienne Date: Fri Dec 21 19:25:18 2018 +0000 firmware: arm_sdei: fix wrong of_node_put() in init function After finding a "firmware" dt node arm_sdei tries to match it's compatible string with it. To do so it's calling of_find_matching_node() which already takes care of decreasing the refcount on the "firmware" node. We are then incorrectly decreasing the refcount on that node again. This patch removes the unwarranted call to of_node_put(). Signed-off-by: Nicolas Saenz Julienne Signed-off-by: James Morse Signed-off-by: Will Deacon commit 8c2c596f8f453ffa6ef3bf14abc48a86b5431e56 Author: Mark Rutland Date: Thu Jan 3 13:23:10 2019 +0000 arm64: entry: remove unused register aliases In commit: 3b7142752e4bee15 ("arm64: convert native/compat syscall entry to C") ... we moved the syscall invocation code from assembly to C, but left behind a number of register aliases which are now unused. Let's remove them before they confuse someone. Cc: Catalin Marinas Reviewed-by: Dave Martin Signed-off-by: Mark Rutland Signed-off-by: Will Deacon commit 3d32c4531958c433a6ee087f31891cb02d6b68d9 Author: Arnaldo Carvalho de Melo Date: Thu Jan 3 14:56:20 2019 -0300 tools headers uapi: Sync prctl.h with the kernel sources To get the changes in ba8308856564 ("arm64: add prctl control for resetting ptrauth keys"), that introduce a prctl with a name that needs to be catch by the prctl cmd table generator, which will be done in the next cset. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Kristina Martsenko Cc: Namhyung Kim Cc: Will Deacon Link: https://lkml.kernel.org/n/tip-a1pahzc8lci0ey1fjvv1chdm@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit abc856259a6dc513868ad91e00a70379825d59c4 Author: Likun Gao Date: Wed Jan 2 12:20:12 2019 +0800 drm/amdgpu: make gfx9 enter into rlc safe mode when set MGCG MGCG should RLC enter into safe mode first. Signed-off-by: Likun Gao Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 96d8f63c44e5d4db48d98c40bb74d0a0e47ae301 Author: Kent Russell Date: Thu Jan 3 08:33:15 2019 -0500 drm/amdgpu: Cleanup 2 compiler warnings These 2 variables are unused now, so remove their references. Fixes: e4ae0fc drm/amdgpu: implement gfx8 post_soft_reset Fixes: 5e01c09 drm/amdgpu/gfx_v8_0: Reorder the gfx, kiq and kcq rings test sequence Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 94f45df8aaa35471ab3fc802c2cf1b75c8107500 Author: Arnaldo Carvalho de Melo Date: Thu Jan 3 13:53:59 2019 -0300 tools headers x86: Sync disabled-features.h To silence the following tools/perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/asm/disabled-features.h' differs from latest version at 'arch/x86/include/asm/disabled-features.h' diff -u tools/arch/x86/include/asm/disabled-features.h arch/x86/include/asm/disabled-features.h Picking up the changes in dae0a1059300 ("x86/cpufeatures, x86/fault: Mark SMAP as disabled when configured out") that didn't entail any functionality change in the tooling side. Cc: Adrian Hunter Cc: Andy Lutomirski Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-vvge5xh6ii12oszexqknbgwp@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 93fb7f19985a08bbe3b76da0b35e97b6e472e4a5 Author: Otto Sabart Date: Wed Jan 2 21:01:21 2019 +0100 doc: filesystems: fix bad references to nonexistent ext4.rst file The ext4.rst file does not exist anymore. This patch changes all references to point to the whole ext4 directory. Fixes: d3091215921b ("docs: move ext4 administrative docs to admin-guide/") Signed-off-by: Otto Sabart Signed-off-by: Jonathan Corbet commit 2d457d5506f88b3f6e63577387203f68fce472a9 Author: Ramunas Geciauskas Date: Sat Dec 29 16:00:00 2018 -0500 Documentation/admin-guide: update URL of LKML information link Information regarding linux-kernel mailing list is no longer hosted on tux.org Update the link to point to the one available at kernel.org Signed-off-by: Ramunas Geciauskas Signed-off-by: Jonathan Corbet commit caaf3c83d2842c859d141711806d949f71c5f241 Author: Marcos Paulo de Souza Date: Tue Jan 1 22:40:14 2019 -0200 Docs/kernel-api.rst: Remove blk-tag.c reference After 7ca01926463a, legacy rq tagging was removed, so block/blk-tag.c does not exists anymore. When generating pdfdocs, sphinx complains about this missing file: Error: Cannot open file ./block/blk-tag.c Error: Cannot open file ./block/blk-tag.c Error: Cannot open file ./block/blk-tag.c Error: Cannot open file ./block/blk-tag.c So remove blk-tag.c traces from kernel-api.rst file to silence these warnings. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Jonathan Corbet commit 24ef9ec891c761483c5270528781b8637b908eef Author: Stephen Rothwell Date: Mon Dec 17 10:57:15 2018 +1100 thermal/intel: fixup for Kconfig string parsing tightening up Signed-off-by: Stephen Rothwell commit 43bfeb45109ad154df4dde67d3d04a8876a3bfc1 Author: Ming Lei Date: Thu Jan 3 09:19:48 2019 +0800 block: sunvdc: don't run hw queue synchronously from irq context vdc_blk_queue_start() may be called from irq context, so we can't run queue via blk_mq_start_hw_queues() since we never allow to run queue from irq context. Use blk_mq_start_stopped_hw_queues(q, true) to fix this issue. Fixes: fa182a1fa97dff56cd ("sunvdc: convert to blk-mq") Reported-by: Anatoly Pugachev Tested-by: Anatoly Pugachev Cc: Anatoly Pugachev Cc: sparclinux@vger.kernel.org Acked-by: David S. Miller Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit dc629c211c65ee5c8f1c4976886d4a5f33f50674 Merge: 645ff1e8e704c e820d55cb99dd Author: Jens Axboe Date: Thu Jan 3 08:21:02 2019 -0700 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md into for-linus Pull the pending 4.21 changes for md from Shaohua. * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md: md: fix raid10 hang issue caused by barrier raid10: refactor common wait code from regular read/write request md: remvoe redundant condition check lib/raid6: add option to skip algo benchmarking lib/raid6: sort algos in rough performance order lib/raid6: check for assembler SSSE3 support lib/raid6: avoid __attribute_const__ redefinition lib/raid6: add missing include for raid6test md: remove set but not used variable 'bi_rdev' commit 1236cd2bad8bc9038af90830cf017c770fdba03c Author: Shaokun Zhang Date: Sat Dec 29 09:43:17 2018 +0800 arm64: smp: Fix compilation error For arm64: updates for 4.21, there is a compilation error: arch/arm64/kernel/head.S: Assembler messages: arch/arm64/kernel/head.S:824: Error: missing ')' arch/arm64/kernel/head.S:824: Error: missing ')' arch/arm64/kernel/head.S:824: Error: missing ')' arch/arm64/kernel/head.S:824: Error: unexpected characters following instruction at operand 2 -- `mov x2,#(2)|(2U<<(8))' scripts/Makefile.build:391: recipe for target 'arch/arm64/kernel/head.o' failed make[1]: *** [arch/arm64/kernel/head.o] Error 1 GCC version is gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609 Let's fix it using the UL() macro. Fixes: 66f16a24512f ("arm64: smp: Rework early feature mismatched detection") Cc: Catalin Marinas Cc: Will Deacon Tested-by: John Stultz Signed-off-by: Shaokun Zhang [will: consistent use of UL() for all shifts in asm constants] Signed-off-by: Will Deacon commit 8a99255a50c0b4c2a449b96fd8d45fcc8d72c701 Author: Jin Yao Date: Thu Jan 3 15:40:45 2019 +0800 perf stat: Fix endless wait for child process We hit a 'perf stat' issue by using following script: #!/bin/bash sleep 1000 & exec perf stat -a -e cycles -I1000 -- sleep 5 Since "perf stat" is launched by exec, the "sleep 1000" would be the child process of "perf stat". The wait4() call will not return because it's waiting for the child process "sleep 1000" to end. So 'perf stat' doesn't return even after 5s passes. This patch lets 'perf stat' return when the specified child process ends (in this case, the specified child process is "sleep 5"). Committer testing: # cat test.sh #!/bin/bash sleep 10 & exec perf stat -a -e cycles -I1000 -- sleep 5 # Before: # time ./test.sh # time counts unit events 1.001113090 108,453,351 cycles 2.002062196 142,075,435 cycles 3.002896194 164,801,068 cycles 4.003731666 107,062,140 cycles 5.002068867 112,241,832 cycles real 0m10.066s user 0m0.016s sys 0m0.101s # After: # time ./test.sh # time counts unit events 1.001016096 91,412,027 cycles 2.002014963 124,063,708 cycles 3.002883964 125,993,929 cycles 4.003706470 120,465,734 cycles 5.002006778 163,560,355 cycles real 0m5.123s user 0m0.014s sys 0m0.105s # 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://lkml.kernel.org/r/1546501245-4512-1-git-send-email-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 2573be22e5b6f24a0cabc97715c808c47e29eaaf Merge: 6d101ba6be2a2 b25756df5b28c Author: Ingo Molnar Date: Thu Jan 3 14:05:16 2019 +0100 Merge tag 'perf-core-for-mingo-4.21-20190103' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: perf c2c: Jiri Olsa: - Change the default coalesce setup to from '--coalesce pid,iaddr' to just '--coalesce iaddr'. - Increase the HITM ratio limit for displayed cachelines. perf script: Andi Kleen: - Fix LBR skid dump problems in brstackinsn. perf trace: Arnaldo Carvalho de Melo: - Check if the raw_syscalls:sys_{enter,exit} are setup before setting tp filter. - Do not hardcode the size of the tracepoint common_ fields. - Beautify USBDEFFS_ ioctl commands. Colin Ian King: - Use correct SECCOMP prefix spelling, "SECOMP_*" -> "SECCOMP_*". perf python: Jiri Olsa: - Do not force closing original perf descriptor in evlist.get_pollfd(). tools misc: Jiri Olsa: - Allow overriding CFLAGS and LDFLAGS. perf build: Stanislav Fomichev: - Don't unconditionally link the libbfd feature test to -liberty and -lz thread-stack: Adrian Hunter: - Fix processing for the idle task, having a stack per cpu. Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar commit bd8879faafe6d057237461c4d58d8b0d37b9e3ee Merge: f8f807441eefd 8c32d47b151b6 0e1f37d120ec3 7f5592742a429 aeed35faee526 31a8b3ee16e30 16767229940fb 74fbc7d371d9a Author: Jiri Kosina Date: Thu Jan 3 12:50:28 2019 +0100 Merge branches 'for-4.20/upstream-fixes', 'for-4.21/core', 'for-4.21/hid-asus', 'for-4.21/hid-core', 'for-4.21/hid-cougar', 'for-4.21/hidraw', 'for-4.21/highres-wheel' and 'for-4.21/ish' into for-linus commit b9ced18acf68dffebe6888c7ec765a2b1db7a039 Author: Chao Fan Date: Wed Dec 26 11:34:50 2018 +0800 ACPI: NUMA: Use correct type for printing addresses on i386-PAE The addresses of NUMA nodes are not printed correctly on i386-PAE which is misleading. Here is a debian9-32bit with PAE in a QEMU guest having more than 4G of memory: qemu-system-i386 \ -hda /var/lib/libvirt/images/debian32.qcow2 \ -m 5G \ -enable-kvm \ -smp 10 \ -numa node,mem=512M,nodeid=0,cpus=0 \ -numa node,mem=512M,nodeid=1,cpus=1 \ -numa node,mem=512M,nodeid=2,cpus=2 \ -numa node,mem=512M,nodeid=3,cpus=3 \ -numa node,mem=512M,nodeid=4,cpus=4 \ -numa node,mem=512M,nodeid=5,cpus=5 \ -numa node,mem=512M,nodeid=6,cpus=6 \ -numa node,mem=512M,nodeid=7,cpus=7 \ -numa node,mem=512M,nodeid=8,cpus=8 \ -numa node,mem=512M,nodeid=9,cpus=9 \ -serial stdio Because of the wrong value type, it prints as below: [ 0.021049] ACPI: SRAT Memory (0x0 length 0xa0000) in proximity domain 0 enabled [ 0.021740] ACPI: SRAT Memory (0x100000 length 0x1ff00000) in proximity domain 0 enabled [ 0.022425] ACPI: SRAT Memory (0x20000000 length 0x20000000) in proximity domain 1 enabled [ 0.023092] ACPI: SRAT Memory (0x40000000 length 0x20000000) in proximity domain 2 enabled [ 0.023764] ACPI: SRAT Memory (0x60000000 length 0x20000000) in proximity domain 3 enabled [ 0.024431] ACPI: SRAT Memory (0x80000000 length 0x20000000) in proximity domain 4 enabled [ 0.025104] ACPI: SRAT Memory (0xa0000000 length 0x20000000) in proximity domain 5 enabled [ 0.025791] ACPI: SRAT Memory (0x0 length 0x20000000) in proximity domain 6 enabled [ 0.026412] ACPI: SRAT Memory (0x20000000 length 0x20000000) in proximity domain 7 enabled [ 0.027118] ACPI: SRAT Memory (0x40000000 length 0x20000000) in proximity domain 8 enabled [ 0.027802] ACPI: SRAT Memory (0x60000000 length 0x20000000) in proximity domain 9 enabled The upper half of the start address of the NUMA domains between 6 and 9 inclusive was cut, so the printed values are incorrect. Fix the value type, to get the correct values in the log as follows: [ 0.023698] ACPI: SRAT Memory (0x0 length 0xa0000) in proximity domain 0 enabled [ 0.024325] ACPI: SRAT Memory (0x100000 length 0x1ff00000) in proximity domain 0 enabled [ 0.024981] ACPI: SRAT Memory (0x20000000 length 0x20000000) in proximity domain 1 enabled [ 0.025659] ACPI: SRAT Memory (0x40000000 length 0x20000000) in proximity domain 2 enabled [ 0.026317] ACPI: SRAT Memory (0x60000000 length 0x20000000) in proximity domain 3 enabled [ 0.026980] ACPI: SRAT Memory (0x80000000 length 0x20000000) in proximity domain 4 enabled [ 0.027635] ACPI: SRAT Memory (0xa0000000 length 0x20000000) in proximity domain 5 enabled [ 0.028311] ACPI: SRAT Memory (0x100000000 length 0x20000000) in proximity domain 6 enabled [ 0.028985] ACPI: SRAT Memory (0x120000000 length 0x20000000) in proximity domain 7 enabled [ 0.029667] ACPI: SRAT Memory (0x140000000 length 0x20000000) in proximity domain 8 enabled [ 0.030334] ACPI: SRAT Memory (0x160000000 length 0x20000000) in proximity domain 9 enabled Signed-off-by: Chao Fan [ rjw: Subject & changelog ] Signed-off-by: Rafael J. Wysocki commit f8f807441eefddc3c6d8a378421f0ede6361d565 Author: Hans de Goede Date: Wed Dec 26 15:31:56 2018 +0100 HID: i2c-hid: Add Odys Winbook 13 to descriptor override The Odys Winbook 13 uses a SIPODEV SP1064 touchpad, which does not supply descriptors, add this to the DMI descriptor override list, fixing the touchpad not working. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1526312 Reported-by: Rene Wagner Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit 6ae16dfb61bce538d48b7fe98160fada446056c5 Author: Aditya Pakki Date: Mon Dec 24 15:39:14 2018 -0600 HID: lenovo: Add checks to fix of_led_classdev_register In lenovo_probe_tpkbd(), the function of_led_classdev_register() could return an error value that is unchecked. The fix adds these checks. Signed-off-by: Aditya Pakki Signed-off-by: Jiri Kosina commit 088d923a11e683af28ad9cea9b66782fff588495 Author: Rafael J. Wysocki Date: Wed Jan 2 12:13:52 2019 +0100 cpufreq / Documentation: Update cpufreq MAINTAINERS entry Update the MAINTAINERS entry for cpufreq by making it clear that it is not just drivers and adding current documentation records to it. Signed-off-by: Rafael J. Wysocki Acked-by: Viresh Kumar commit 3f2d347e851ef4464dea49504cde85e5eef67b2d Author: Beomho Seo Date: Fri Dec 21 15:32:28 2018 +0100 mfd: exynos-lpass: Enable UART module support This patch enables proper interrupts routing between UART module in Exynos Audio SubSystem and the rest of the SoC. This routing is completely transparent for UART device and CPU/GIC. UART driver requests interrupts from the respective controller and enables/masks/handles it by itself via standard methods. There are boards (for example TM2), which use UART module in Exynos Audio SubStem for communication with BlueTooth chip. Signed-off-by: Beomho Seo [mszyprow: rephrased commit message, added UART reset] Signed-off-by: Marek Szyprowski Reviewed-by: Sylwester Nawrocki Signed-off-by: Lee Jones commit 9e28989d41c0eab57ec0bb156617a8757406ff8a Author: Kangjie Lu Date: Thu Dec 20 15:12:11 2018 -0600 mfd: mc13xxx: Fix a missing check of a register-read failure When mc13xxx_reg_read() fails, "old_adc0" is uninitialized and will contain random value. Further execution uses "old_adc0" even when mc13xxx_reg_read() fails. The fix checks the return value of mc13xxx_reg_read(), and exits the execution when it fails. Signed-off-by: Kangjie Lu Signed-off-by: Lee Jones commit c1f3375be60c562e24460d41b75e564c0a429835 Author: Cheng-Yi Chiang Date: Tue Dec 18 17:06:26 2018 +0800 mfd: cros_ec: Add commands to control codec Add EC host commands to control codec on EC. Signed-off-by: Cheng-Yi Chiang Signed-off-by: Lee Jones commit 4bcb83e055033592e8672a8deb7b209eed936e11 Author: Richard Fitzgerald Date: Fri Dec 14 14:39:14 2018 +0000 mfd: madera: Remove spurious semicolon in while loop Coccinelle warning of a spurious semicolon on the closing brace of a while loop. Signed-off-by: Richard Fitzgerald Signed-off-by: Lee Jones commit f7b1e49c670370eeb21e0d7feb7eaa2468ad7ae2 Author: Yangtao Li Date: Sat Dec 15 03:29:18 2018 -0500 mfd: rave-sp: Fix typo in rave_sp_checksum comment Caculated -> Calculated Signed-off-by: Yangtao Li Signed-off-by: Lee Jones commit ddf5aaa8eecb6ccf51f311a513c3a5011fbe0d54 Author: Paul Cercueil Date: Sun Dec 16 15:10:44 2018 +0100 mfd: ingenic-tcu: Fix bit field description in header The description of the bit was inverted. Signed-off-by: Paul Cercueil Signed-off-by: Lee Jones commit 75d4c5e03c2ae9902ab521024b10291f6fc9515b Author: Keerthy Date: Sun Dec 9 19:29:31 2018 +0530 mfd: tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe() Use devm_regmap_add_irq_chip and clean up error path in probe and also the remove function. Reported-by: Christian Hohnstaedt Signed-off-by: Keerthy Reviewed-by: Sebastian Reichel Signed-off-by: Lee Jones commit 38df91cc0b82d053234accf4429eafd2f5a4d401 Author: Rob Herring Date: Wed Dec 5 13:50:31 2018 -0600 mfd: 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. Signed-off-by: Rob Herring Signed-off-by: Lee Jones commit 18e294ddafaeb80a1e2e10c9bd750a6cb8388d5b Author: Enric Balletbo i Serra Date: Mon Dec 10 19:00:02 2018 +0100 mfd: cros_ec_dev: Add missing mfd_remove_devices() call in remove The driver adds different MFD child devices via mfd_add_devices() and hence it is required to call mfd_remove_devices() to remove MFD child devices. Fixes: 5e0115581bbc ("cros_ec: Move cros_ec_dev module to drivers/mfd") Signed-off-by: Enric Balletbo i Serra Signed-off-by: Lee Jones commit ea90e7b47f0a8bd2fe14e9a88f523de7c67db90a Author: Oskari Lemmela Date: Sat Dec 8 19:58:47 2018 +0200 mfd: axp20x: Add supported cells for AXP803 Parts of the AXP803 are compatible with their counterparts on the AXP813. These include the GPIO, ADC, AC and battery power supplies. Signed-off-by: Oskari Lemmela Reviewed-by: Chen-Yu Tsai Tested-by: Vasily Khoruzhick Signed-off-by: Chen-Yu Tsai Signed-off-by: Lee Jones commit 753a8d083e085c6f552c7982749de4cc7c40e2ac Author: Chen-Yu Tsai Date: Sat Dec 8 19:58:46 2018 +0200 mfd: axp20x: Re-align MFD cell entries In the axp20x driver, the various mfd_cell lists had varying amounts of indentation, sometimes even within the same list. For the axp288, there's no alignment at all. Re-align the right hand side of the assignments with the least amount of tabs possible. Also collapse the closing bracket and the opening bracket of the next entry onto the same line for the axp288, to be consistent with all the other mfd_cell lists. This patch is whitespace change only. No functionality is modified. Signed-off-by: Chen-Yu Tsai Signed-off-by: Oskari Lemmela Signed-off-by: Lee Jones commit 4a19f9a65375ca9781b3ca9e810ece92edfc3e78 Author: Oskari Lemmela Date: Tue Nov 20 19:52:10 2018 +0200 mfd: axp20x: Add AC power supply cell for AXP813 As axp20x-ac-power-supply now supports AXP813, add a cell for it. Signed-off-by: Oskari Lemmela Reviewed-by: Quentin Schulz Reviewed-by: Chen-Yu Tsai Tested-by: Vasily Khoruzhick Signed-off-by: Lee Jones commit 04c801c18ded421845324255e660147a6f58dcd6 Author: Charles Keepax Date: Wed Nov 28 10:04:22 2018 +0000 mfd: wm5110: Add missing ASRC rate register Signed-off-by: Charles Keepax Signed-off-by: Lee Jones commit 504e4175829c44328773b96ad9c538e4783a8d22 Author: Jonathan Marek Date: Mon Nov 19 14:53:17 2018 -0500 mfd: qcom_rpm: write fw_version to CTRL_REG This is required as part of the initialization sequence on certain SoCs. If these registers are not initialized, the hardware can be unresponsive. This fixes the driver on apq8060 (HP TouchPad device). Signed-off-by: Jonathan Marek Signed-off-by: Lee Jones commit ac4ca4b9f4623ba5e1ea7a582f286567c611e027 Author: Jonathan Hunter Date: Tue Nov 13 08:56:31 2018 +0000 mfd: tps6586x: Handle interrupts on suspend The tps6586x driver creates an irqchip that is used by its various child devices for managing interrupts. The tps6586x-rtc device is one of its children that uses the tps6586x irqchip. When using the tps6586x-rtc as a wake-up device from suspend, the following is seen: PM: Syncing filesystems ... done. Freezing user space processes ... (elapsed 0.001 seconds) done. OOM killer disabled. Freezing remaining freezable tasks ... (elapsed 0.000 seconds) done. Disabling non-boot CPUs ... Entering suspend state LP1 Enabling non-boot CPUs ... CPU1 is up tps6586x 3-0034: failed to read interrupt status tps6586x 3-0034: failed to read interrupt status The reason why the tps6586x interrupt status cannot be read is because the tps6586x interrupt is not masked during suspend and when the tps6586x-rtc interrupt occurs, to wake-up the device, the interrupt is seen before the i2c controller has been resumed in order to read the tps6586x interrupt status. The tps6586x-rtc driver sets it's interrupt as a wake-up source during suspend, which gets propagated to the parent tps6586x interrupt. However, the tps6586x-rtc driver cannot disable it's interrupt during suspend otherwise we would never be woken up and so the tps6586x must disable it's interrupt instead. Prevent the tps6586x interrupt handler from executing on exiting suspend before the i2c controller has been resumed by disabling the tps6586x interrupt on entering suspend and re-enabling it on resuming from suspend. Cc: stable@vger.kernel.org Signed-off-by: Jon Hunter Reviewed-by: Dmitry Osipenko Tested-by: Dmitry Osipenko Acked-by: Thierry Reding Signed-off-by: Lee Jones commit 7f9472134a5af31bad191f074a5d416146da26f7 Author: Richard Fitzgerald Date: Mon Nov 12 15:28:37 2018 +0000 mfd: madera: Add shared data for accessory detection Add variables to struct madera that will be shared by the extcon and audio codec drivers to synchronize output state during accessory detection. Also add a mutex to protect the DAPM pointer. Signed-off-by: Richard Fitzgerald Signed-off-by: Lee Jones commit 628f3dfe4c7b35bbe63ec194ca6da857b00b0083 Author: Jean Delvare Date: Mon Nov 12 10:49:42 2018 +0100 mfd: at91-usart: Add platform dependency It doesn't make sense to present option MFD_AT91_USART by default if not building an AT91 kernel, as the drivers which depend on it are not available. Fixes: 7d3aa342cef7 ("mfd: at91-usart: Add MFD driver for USART") Signed-off-by: Jean Delvare Signed-off-by: Lee Jones commit b0aff01e7aa6ad2d6998ef1323843212d1db8b04 Author: Dien Pham Date: Wed Oct 3 15:58:41 2018 +0200 mfd: bd9571mwv: Add volatile register to make DVFS work Because BD9571MWV_DVFS_MONIVDAC is not defined in the volatile table, the physical register value is not updated by regmap and DVFS doesn't work as expected. Fix it! Fixes: d3ea21272094 ("mfd: Add ROHM BD9571MWV-M MFD PMIC driver") Signed-off-by: Dien Pham [wsa: rebase, add 'Fixes', reword commit message] Signed-off-by: Wolfram Sang Reviewed-by: Marek Vasut Signed-off-by: Lee Jones commit 10628e3ecf544fa2e4e24f8e112d95c37884dc98 Author: Dan Carpenter Date: Thu Oct 25 15:43:44 2018 +0300 mfd: ab8500-core: Return zero in get_register_interruptible() This function is supposed to return zero on success or negative error codes on error. Unfortunately, there is a bug so it sometimes returns non-zero, positive numbers on success. I noticed this bug during review and I can't test it. It does appear that the return is sometimes propogated back to _regmap_read() where all non-zero returns are treated as failure so this may affect run time. Fixes: 47c1697508f2 ("mfd: Align ab8500 with the abx500 interface") Signed-off-by: Dan Carpenter Reviewed-by: Linus Walleij Signed-off-by: Lee Jones commit a54e950fdec3cde98caa04bc601cbdc95d0d319c Author: Geert Uytterhoeven Date: Wed Nov 7 14:50:01 2018 +0100 mfd: tmio: Typo s/use use/use/ Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Reviewed-by: Simon Horman Signed-off-by: Lee Jones commit a177276aa098aa47a100d51a13eaaef029604b6d Author: Nicolas Boichat Date: Mon Oct 22 10:55:06 2018 +0800 mfd: mt6397: Do not call irq_domain_remove if PMIC unsupported If the PMIC ID is unknown, the current code would call irq_domain_remove and panic, as pmic->irq_domain is only initialized by mt6397_irq_init. Return immediately with an error, if the chip ID is unsupported. Signed-off-by: Nicolas Boichat Signed-off-by: Lee Jones commit a3888f62fe66429fad3be7f2ba962e1e08c26fd6 Author: Nathan Chancellor Date: Wed Oct 17 17:56:28 2018 -0700 mfd: db8500-prcmu: Fix some section annotations When building the kernel with Clang, the following section mismatch warnings appear: WARNING: vmlinux.o(.text+0x7239cc): Section mismatch in reference from the function db8500_prcmu_probe() to the function .init.text:init_prcm_registers() The function db8500_prcmu_probe() references the function __init init_prcm_registers(). This is often because db8500_prcmu_probe lacks a __init annotation or the annotation of init_prcm_registers is wrong. WARNING: vmlinux.o(.text+0x723e28): Section mismatch in reference from the function db8500_prcmu_probe() to the function .init.text:fw_project_name() The function db8500_prcmu_probe() references the function __init fw_project_name(). This is often because db8500_prcmu_probe lacks a __init annotation or the annotation of fw_project_name is wrong. db8500_prcmu_probe should not be marked as __init so remove the __init annotation from fw_project_name and init_prcm_registers. Signed-off-by: Nathan Chancellor Signed-off-by: Lee Jones commit 8838555089f0345b87f4277fe5a8dd647dc65589 Author: Nathan Chancellor Date: Wed Oct 17 10:13:23 2018 -0700 mfd: twl-core: Fix section annotations on {,un}protect_pm_master When building the kernel with Clang, the following section mismatch warning appears: WARNING: vmlinux.o(.text+0x3d84a3b): Section mismatch in reference from the function twl_probe() to the function .init.text:unprotect_pm_master() The function twl_probe() references the function __init unprotect_pm_master(). This is often because twl_probe lacks a __init annotation or the annotation of unprotect_pm_master is wrong. Remove the __init annotation on the *protect_pm_master functions so there is no more mismatch. Signed-off-by: Nathan Chancellor Signed-off-by: Lee Jones commit 55a7f0065533f71991c720457ea24ff2fe909f81 Author: Steve French Date: Tue Jan 1 17:19:45 2019 -0600 cifs: fix confusing warning message on reconnect When DFS is not used on the mount we should not be mentioning DFS in the warning message on reconnect (it could be confusing). Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg commit 6d2f84eee098540ae857998fe32f29b9e2cd9613 Author: Paul Aurich Date: Mon Dec 31 14:13:34 2018 -0800 smb3: fix large reads on encrypted connections When passing a large read to receive_encrypted_read(), ensure that the demultiplex_thread knows that a MID was processed. Without this, those operations never complete. This is a similar issue/fix to lease break handling: commit 7af929d6d05ba5564139718e30d5bc96bdbc716a ("smb3: fix lease break problem introduced by compounding") CC: Stable # 4.19+ Fixes: b24df3e30cbf ("cifs: update receive_encrypted_standard to handle compounded responses") Signed-off-by: Paul Aurich Tested-by: Yves-Alexis Perez Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg commit c5ee066333ebc322a24a00a743ed941a0c68617e Author: David Ahern Date: Wed Jan 2 18:57:09 2019 -0800 ipv6: Consider sk_bound_dev_if when binding a socket to an address IPv6 does not consider if the socket is bound to a device when binding to an address. The result is that a socket can be bound to eth0 and then bound to the address of eth1. If the device is a VRF, the result is that a socket can only be bound to an address in the default VRF. Resolve by considering the device if sk_bound_dev_if is set. This problem exists from the beginning of git history. Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 73155879b3c1ac3ace35208a54a3a160ec520bef Author: David Ahern Date: Wed Jan 2 18:26:13 2019 -0800 ipv6: Fix dump of specific table with strict checking Dump of a specific table with strict checking enabled is looping. The problem is that the end of the table dump is not marked in the cb. When dumping a specific table, cb args 0 and 1 are not used (they are the hash index and entry with an hash table index when dumping all tables). Re-use args[0] to hold a 'done' flag for the specific table dump. Fixes: 13e38901d46ca ("net/ipv6: Plumb support for filtering route dumps") Reported-by: Jakub Kicinski Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 645ff1e8e704c4f33ab1fcd3c87f95cb9b6d7144 Merge: d548e65904ae4 592b15ba7260f Author: Linus Torvalds Date: Wed Jan 2 18:56:59 2019 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: "A tiny pull request this merge window unfortunately, should get more material in for the next release: - new driver for Raspberry Pi's touchscreen (firmware interface) - miscellaneous input driver fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: elan_i2c - add ACPI ID for touchpad in ASUS Aspire F5-573G Input: atmel_mxt_ts - don't try to free unallocated kernel memory Input: drv2667 - fix indentation issues Input: touchscreen - fix coding style issue Input: add official Raspberry Pi's touchscreen driver Input: nomadik-ske-keypad - fix a loop timeout test Input: rotary-encoder - don't log EPROBE_DEFER to kernel log Input: olpc_apsp - remove set but not used variable 'np' Input: olpc_apsp - enable the SP clock Input: olpc_apsp - check FIFO status on open(), not probe() Input: olpc_apsp - drop CONFIG_OLPC dependency clk: mmp2: add SP clock dt-bindings: marvell,mmp2: Add clock id for the SP clock Input: ad7879 - drop platform data support commit d548e65904ae43b0637d200a2441fc94e0589c30 Merge: 77d0b194b2df0 a691ffb46edd7 Author: Linus Torvalds Date: Wed Jan 2 18:54:45 2019 -0800 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio/vhost updates from Michael Tsirkin: "Features, fixes, cleanups: - discard in virtio blk - misc fixes and cleanups" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: vhost: correct the related warning message vhost: split structs into a separate header file virtio: remove deprecated VIRTIO_PCI_CONFIG() vhost/vsock: switch to a mutex for vhost_vsock_hash virtio_blk: add discard and write zeroes support commit 77d0b194b2df04a1992f882d96ff4e2bd8bb8fe0 Merge: b79f9f93eb483 427c5ce4417cb Author: Linus Torvalds Date: Wed Jan 2 18:49:58 2019 -0800 Merge tag 'for-4.21/block-20190102' of git://git.kernel.dk/linux-block Pull more block updates from Jens Axboe: - Dead code removal for loop/sunvdc (Chengguang) - Mark BIDI support for bsg as deprecated, logging a single dmesg warning if anyone is actually using it (Christoph) - blkcg cleanup, killing a dead function and making the tryget_closest variant easier to read (Dennis) - Floppy fixes, one fixing a regression in swim3 (Finn) - lightnvm use-after-free fix (Gustavo) - gdrom leak fix (Wenwen) - a set of drbd updates (Lars, Luc, Nathan, Roland) * tag 'for-4.21/block-20190102' of git://git.kernel.dk/linux-block: (28 commits) block/swim3: Fix regression on PowerBook G3 block/swim3: Fix -EBUSY error when re-opening device after unmount block/swim3: Remove dead return statement block/amiflop: Don't log error message on invalid ioctl gdrom: fix a memory leak bug lightnvm: pblk: fix use-after-free bug block: sunvdc: remove redundant code block: loop: remove redundant code bsg: deprecate BIDI support in bsg blkcg: remove unused __blkg_release_rcu() blkcg: clean up blkg_tryget_closest() drbd: Change drbd_request_detach_interruptible's return type to int drbd: Avoid Clang warning about pointless switch statment drbd: introduce P_ZEROES (REQ_OP_WRITE_ZEROES on the "wire") drbd: skip spurious timeout (ping-timeo) when failing promote drbd: don't retry connection if peers do not agree on "authentication" settings drbd: fix print_st_err()'s prototype to match the definition drbd: avoid spurious self-outdating with concurrent disconnect / down drbd: do not block when adjusting "disk-options" while IO is frozen drbd: fix comment typos ... commit b79f9f93eb483f2757b089bb4e1eb3827a609080 Merge: 0f2107daec813 745d51dc8a29e Author: Linus Torvalds Date: Wed Jan 2 18:47:56 2019 -0800 Merge tag 'for-4.21/libata-20190102' of git://git.kernel.dk/linux-block Pull libata fix from Jens Axboe: "This libata change missed the original libata pull request. Just a single fix in here, fixing a missed reference drop" * tag 'for-4.21/libata-20190102' of git://git.kernel.dk/linux-block: ata: pata_macio: add of_node_put() commit 0f2107daec8137e1ea8bcd6df1323ffe46a2e873 Merge: 01766d27d265a 08972760d366b Author: Linus Torvalds Date: Wed Jan 2 18:45:50 2019 -0800 Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull more clk updates from Stephen Boyd: "One more patch to generalize a set of DT binding defines now before -rc1 comes out. This way the SoC DTS files can use the proper defines from a stable tag" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: imx8qxp: make the name of clock ID generic commit 01766d27d265afe7e93a8aa033afae5635d5aba0 Merge: 35ddb06a46753 f4747b9c68b88 Author: Linus Torvalds Date: Wed Jan 2 18:43:57 2019 -0800 Merge tag 'devprop-4.21-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull device properties framework fixes from Rafael Wysocki: "Fix two potential NULL pointer dereferences found by Coverity in the software nodes code introduced recently (Colin Ian King)" * tag 'devprop-4.21-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: drivers: base: swnode: check if swnode is NULL before dereferencing it drivers: base: swnode: check if pointer p is NULL before dereferencing it commit 35ddb06a467538434b4139fbf5c02a2ef073162a Merge: 6aa293d8ff093 d69e11648e486 Author: Linus Torvalds Date: Wed Jan 2 18:41:38 2019 -0800 Merge tag 'mailbox-v4.21' of git://git.linaro.org/landing-teams/working/fujitsu/integration Pull mailbox updates from Jassi Brar: - Introduce device-managed registration devm_mbox_controller_un/register and convert drivers to use it - Introduce flush api to support clients that must busy-wait in atomic context - Support multiple controllers per device - Hi3660: a bugfix and constify ops structure - TI-MsgMgr: off by one bugfix. - BCM: switch to spdx license - Tegra-HSP: support for shared mailboxes and suspend/resume. * tag 'mailbox-v4.21' of git://git.linaro.org/landing-teams/working/fujitsu/integration: (30 commits) mailbox: tegra-hsp: Use device-managed registration API mailbox: tegra-hsp: use devm_kstrdup_const() mailbox: tegra-hsp: Add suspend/resume support mailbox: tegra-hsp: Add support for shared mailboxes dt-bindings: tegra186-hsp: Add shared mailboxes mailbox: Allow multiple controllers per device mailbox: Support blocking transfers in atomic context mailbox: ti-msgmgr: Use device-managed registration API mailbox: stm32-ipcc: Use device-managed registration API mailbox: rockchip: Use device-managed registration API mailbox: qcom-apcs: Use device-managed registration API mailbox: platform-mhu: Use device-managed registration API mailbox: omap: Use device-managed registration API mailbox: mtk-cmdq: Remove needless devm_kfree() calls mailbox: mtk-cmdq: Use device-managed registration API mailbox: xgene-slimpro: Use device-managed registration API mailbox: sti: Use device-managed registration API mailbox: altera: Use device-managed registration API mailbox: imx: Use device-managed registration API mailbox: hi6220: Use device-managed registration API ... commit 6aa293d8ff0939802a6c86cee6cd152c1b0a7a0d Merge: 04a17edeca524 940b241d9050f Author: Linus Torvalds Date: Wed Jan 2 18:39:22 2019 -0800 Merge branch 'for-linus-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml Pull UML updates from Richard Weinberger: - DISCARD support for our block device driver - Many TLB flush optimizations - Various smaller fixes - And most important, Anton agreed to help me maintaining UML * 'for-linus-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: um: Remove obsolete reenable_XX calls um: writev needs Add Anton Ivanov to UML maintainers um: remove redundant generic-y um: Optimize Flush TLB for force/fork case um: Avoid marking pages with "changed protection" um: Skip TLB flushing where not needed um: Optimize TLB operations v2 um: Remove unnecessary faulted check in uaccess.c um: Add support for DISCARD in the UBD Driver um: Remove unsafe printks from the io thread um: Clean-up command processing in UML UBD driver um: Switch to block-mq constants in the UML UBD driver um: Make GCOV depend on !KCOV um: Include sys/uio.h to have writev() um: Add HAVE_DEBUG_BUGVERBOSE um: Update maintainers file entry commit 04a17edeca524b71dbb5be41a7002d247fbf34c0 Merge: e6b9257280846 ec10574d00da0 Author: Linus Torvalds Date: Wed Jan 2 18:37:01 2019 -0800 Merge tag 's390-4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Martin Schwidefsky: - A larger update for the zcrypt / AP bus code: + Update two inline assemblies in the zcrypt driver to make gcc happy + Add a missing reply code for invalid special commands for zcrypt + Allow AP device reset to be triggered from user space + Split the AP scan function into smaller, more readable functions - Updates for vfio-ccw and vfio-ap + Add maintainers and reviewer for vfio-ccw + Include facility.h in vfio_ap_drv.c to avoid fragile include chain + Simplicy vfio-ccw state machine - Use the common code version of bust_spinlocks - Make use of the DEFINE_SHOW_ATTRIBUTE - Fix three incorrect file permissions in the DASD driver - Remove bit spin-lock from the PCI interrupt handler - Fix GFP_ATOMIC vs GFP_KERNEL in the PCI code * tag 's390-4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/zcrypt: rework ap scan bus code s390/zcrypt: make sysfs reset attribute trigger queue reset s390/pci: fix sleeping in atomic during hotplug s390/pci: remove bit_lock usage in interrupt handler s390/drivers: fix proc/debugfs file permissions s390: convert to DEFINE_SHOW_ATTRIBUTE MAINTAINERS/vfio-ccw: add Farhan and Eric, make Halil Reviewer vfio: ccw: Merge BUSY and BOXED states s390: use common bust_spinlocks() s390/zcrypt: improve special ap message cmd handling s390/ap: rework assembler functions to use unions for in/out register variables s390: vfio-ap: include for test_facility() commit bf77ae4c98d721a9aae3840970d46669a78e034a Author: NeilBrown Date: Thu Jan 3 11:04:08 2019 +1100 locks: fix error in locks_move_blocks() After moving all requests from fl->fl_blocked_requests to new->fl_blocked_requests it is nonsensical to do anything to all the remaining elements, there aren't any. This should do something to all the requests that have been moved. For simplicity, it does it to all requests in the target list. Setting "f->fl_blocker = new" to all members of new->fl_blocked_requests is "obviously correct" as it preserves the invariant of the linkage among requests. Reported-by: syzbot+239d99847eb49ecb3899@syzkaller.appspotmail.com Fixes: 5946c4319ebb ("fs/locks: allow a lock request to block other requests.") Signed-off-by: NeilBrown Signed-off-by: Jeff Layton commit be63004336d008b71f93dfe166f503ae2e53a32e Merge: d63967e475ae1 a67825f519514 Author: David S. Miller Date: Wed Jan 2 16:38:59 2019 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Alexei Starovoitov says: ==================== pull-request: bpf 2019-01-02 The following pull-request contains BPF updates for your *net* tree. The main changes are: 1) prevent out of bounds speculation on pointer arithmetic, from Daniel. 2) typo fix, from Xiaozhou. ==================== Signed-off-by: David S. Miller commit e6b92572808467f35fd159d47c45b650de29e722 Merge: e45428a436765 260f71eff493a Author: Linus Torvalds Date: Wed Jan 2 16:35:23 2019 -0800 Merge tag 'nfs-for-4.21-1' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client updates from Anna Schumaker: "Stable bugfixes: - xprtrdma: Yet another double DMA-unmap # v4.20 Features: - Allow some /proc/sys/sunrpc entries without CONFIG_SUNRPC_DEBUG - Per-xprt rdma receive workqueues - Drop support for FMR memory registration - Make port= mount option optional for RDMA mounts Other bugfixes and cleanups: - Remove unused nfs4_xdev_fs_type declaration - Fix comments for behavior that has changed - Remove generic RPC credentials by switching to 'struct cred' - Fix crossing mountpoints with different auth flavors - Various xprtrdma fixes from testing and auditing the close code - Fixes for disconnect issues when using xprtrdma with krb5 - Clean up and improve xprtrdma trace points - Fix NFS v4.2 async copy reboot recovery" * tag 'nfs-for-4.21-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (63 commits) sunrpc: convert to DEFINE_SHOW_ATTRIBUTE sunrpc: Add xprt after nfs4_test_session_trunk() sunrpc: convert unnecessary GFP_ATOMIC to GFP_NOFS sunrpc: handle ENOMEM in rpcb_getport_async NFS: remove unnecessary test for IS_ERR(cred) xprtrdma: Prevent leak of rpcrdma_rep objects NFSv4.2 fix async copy reboot recovery xprtrdma: Don't leak freed MRs xprtrdma: Add documenting comment for rpcrdma_buffer_destroy xprtrdma: Replace outdated comment for rpcrdma_ep_post xprtrdma: Update comments in frwr_op_send SUNRPC: Fix some kernel doc complaints SUNRPC: Simplify defining common RPC trace events NFS: Fix NFSv4 symbolic trace point output xprtrdma: Trace mapping, alloc, and dereg failures xprtrdma: Add trace points for calls to transport switch methods xprtrdma: Relocate the xprtrdma_mr_map trace points xprtrdma: Clean up of xprtrdma chunk trace points xprtrdma: Remove unused fields from rpcrdma_ia xprtrdma: Cull dprintk() call sites ... commit e45428a436765fcd154d461a2739b5640916dc00 Merge: 85f78456f286d 0ad30ff67bd3e Author: Linus Torvalds Date: Wed Jan 2 16:21:50 2019 -0800 Merge tag 'nfsd-4.21' of git://linux-nfs.org/~bfields/linux Pull nfsd updates from Bruce Fields: "Thanks to Vasily Averin for fixing a use-after-free in the containerized NFSv4.2 client, and cleaning up some convoluted backchannel server code in the process. Otherwise, miscellaneous smaller bugfixes and cleanup" * tag 'nfsd-4.21' of git://linux-nfs.org/~bfields/linux: (25 commits) nfs: fixed broken compilation in nfs_callback_up_net() nfs: minor typo in nfs4_callback_up_net() sunrpc: fix debug message in svc_create_xprt() sunrpc: make visible processing error in bc_svc_process() sunrpc: remove unused xpo_prep_reply_hdr callback sunrpc: remove svc_rdma_bc_class sunrpc: remove svc_tcp_bc_class sunrpc: remove unused bc_up operation from rpc_xprt_ops sunrpc: replace svc_serv->sv_bc_xprt by boolean flag sunrpc: use-after-free in svc_process_common() sunrpc: use SVC_NET() in svcauth_gss_* functions nfsd: drop useless LIST_HEAD lockd: Show pid of lockd for remote locks NFSD remove OP_CACHEME from 4.2 op_flags nfsd: Return EPERM, not EACCES, in some SETATTR cases sunrpc: fix cache_head leak due to queued request nfsd: clean up indentation, increase indentation in switch statement svcrdma: Optimize the logic that selects the R_key to invalidate nfsd: fix a warning in __cld_pipe_upcall() nfsd4: fix crash on writing v4_end_grace before nfsd startup ... commit a67825f5195145f840939d0f85fc40b6b1077329 Merge: 8b6b25cf93b73 80c9b2fae87bb Author: Alexei Starovoitov Date: Wed Jan 2 16:01:25 2019 -0800 Merge branch 'prevent-oob-under-speculation' Daniel Borkmann says: ==================== This set fixes an out of bounds case under speculative execution by implementing masking of pointer alu into the verifier. For details please see the individual patches. Thanks! v2 -> v3: - 8/9: change states_equal condition into old->speculative && !cur->speculative, thanks Jakub! - 8/9: remove incorrect speculative state test in propagate_liveness(), thanks Jakub! v1 -> v2: - Typo fixes in commit msg and a comment, thanks David! ==================== Signed-off-by: Alexei Starovoitov commit 80c9b2fae87bb5c5698940da1a981f14f89518d1 Author: Daniel Borkmann Date: Thu Jan 3 00:58:35 2019 +0100 bpf: add various test cases to selftests Add various map value pointer related test cases to test_verifier kselftest to reflect recent changes and improve test coverage. The tests include basic masking functionality, unprivileged behavior on pointer arithmetic which goes oob, mixed bounds tests, negative unknown scalar but resulting positive offset for access and helper range, handling of arithmetic from multiple maps, various masking scenarios with subsequent map value access and others including two test cases from Jann Horn for prior fixes. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Signed-off-by: Alexei Starovoitov commit 979d63d50c0c0f7bc537bf821e056cc9fe5abd38 Author: Daniel Borkmann Date: Thu Jan 3 00:58:34 2019 +0100 bpf: prevent out of bounds speculation on pointer arithmetic Jann reported that the original commit back in b2157399cc98 ("bpf: prevent out-of-bounds speculation") was not sufficient to stop CPU from speculating out of bounds memory access: While b2157399cc98 only focussed on masking array map access for unprivileged users for tail calls and data access such that the user provided index gets sanitized from BPF program and syscall side, there is still a more generic form affected from BPF programs that applies to most maps that hold user data in relation to dynamic map access when dealing with unknown scalars or "slow" known scalars as access offset, for example: - Load a map value pointer into R6 - Load an index into R7 - Do a slow computation (e.g. with a memory dependency) that loads a limit into R8 (e.g. load the limit from a map for high latency, then mask it to make the verifier happy) - Exit if R7 >= R8 (mispredicted branch) - Load R0 = R6[R7] - Load R0 = R6[R0] For unknown scalars there are two options in the BPF verifier where we could derive knowledge from in order to guarantee safe access to the memory: i) While /<=/>= variants won't allow to derive any lower or upper bounds from the unknown scalar where it would be safe to add it to the map value pointer, it is possible through ==/!= test however. ii) another option is to transform the unknown scalar into a known scalar, for example, through ALU ops combination such as R &= followed by R |= or any similar combination where the original information from the unknown scalar would be destroyed entirely leaving R with a constant. The initial slow load still precedes the latter ALU ops on that register, so the CPU executes speculatively from that point. Once we have the known scalar, any compare operation would work then. A third option only involving registers with known scalars could be crafted as described in [0] where a CPU port (e.g. Slow Int unit) would be filled with many dependent computations such that the subsequent condition depending on its outcome has to wait for evaluation on its execution port and thereby executing speculatively if the speculated code can be scheduled on a different execution port, or any other form of mistraining as described in [1], for example. Given this is not limited to only unknown scalars, not only map but also stack access is affected since both is accessible for unprivileged users and could potentially be used for out of bounds access under speculation. In order to prevent any of these cases, the verifier is now sanitizing pointer arithmetic on the offset such that any out of bounds speculation would be masked in a way where the pointer arithmetic result in the destination register will stay unchanged, meaning offset masked into zero similar as in array_index_nospec() case. With regards to implementation, there are three options that were considered: i) new insn for sanitation, ii) push/pop insn and sanitation as inlined BPF, iii) reuse of ax register and sanitation as inlined BPF. Option i) has the downside that we end up using from reserved bits in the opcode space, but also that we would require each JIT to emit masking as native arch opcodes meaning mitigation would have slow adoption till everyone implements it eventually which is counter-productive. Option ii) and iii) have both in common that a temporary register is needed in order to implement the sanitation as inlined BPF since we are not allowed to modify the source register. While a push / pop insn in ii) would be useful to have in any case, it requires once again that every JIT needs to implement it first. While possible, amount of changes needed would also be unsuitable for a -stable patch. Therefore, the path which has fewer changes, less BPF instructions for the mitigation and does not require anything to be changed in the JITs is option iii) which this work is pursuing. The ax register is already mapped to a register in all JITs (modulo arm32 where it's mapped to stack as various other BPF registers there) and used in constant blinding for JITs-only so far. It can be reused for verifier rewrites under certain constraints. The interpreter's tmp "register" has therefore been remapped into extending the register set with hidden ax register and reusing that for a number of instructions that needed the prior temporary variable internally (e.g. div, mod). This allows for zero increase in stack space usage in the interpreter, and enables (restricted) generic use in rewrites otherwise as long as such a patchlet does not make use of these instructions. The sanitation mask is dynamic and relative to the offset the map value or stack pointer currently holds. There are various cases that need to be taken under consideration for the masking, e.g. such operation could look as follows: ptr += val or val += ptr or ptr -= val. Thus, the value to be sanitized could reside either in source or in destination register, and the limit is different depending on whether the ALU op is addition or subtraction and depending on the current known and bounded offset. The limit is derived as follows: limit := max_value_size - (smin_value + off). For subtraction: limit := umax_value + off. This holds because we do not allow any pointer arithmetic that would temporarily go out of bounds or would have an unknown value with mixed signed bounds where it is unclear at verification time whether the actual runtime value would be either negative or positive. For example, we have a derived map pointer value with constant offset and bounded one, so limit based on smin_value works because the verifier requires that statically analyzed arithmetic on the pointer must be in bounds, and thus it checks if resulting smin_value + off and umax_value + off is still within map value bounds at time of arithmetic in addition to time of access. Similarly, for the case of stack access we derive the limit as follows: MAX_BPF_STACK + off for subtraction and -off for the case of addition where off := ptr_reg->off + ptr_reg->var_off.value. Subtraction is a special case for the masking which can be in form of ptr += -val, ptr -= -val, or ptr -= val. In the first two cases where we know that the value is negative, we need to temporarily negate the value in order to do the sanitation on a positive value where we later swap the ALU op, and restore original source register if the value was in source. The sanitation of pointer arithmetic alone is still not fully sufficient as is, since a scenario like the following could happen ... PTR += 0x1000 (e.g. K-based imm) PTR -= BIG_NUMBER_WITH_SLOW_COMPARISON PTR += 0x1000 PTR -= BIG_NUMBER_WITH_SLOW_COMPARISON [...] ... which under speculation could end up as ... PTR += 0x1000 PTR -= 0 [ truncated by mitigation ] PTR += 0x1000 PTR -= 0 [ truncated by mitigation ] [...] ... and therefore still access out of bounds. To prevent such case, the verifier is also analyzing safety for potential out of bounds access under speculative execution. Meaning, it is also simulating pointer access under truncation. We therefore "branch off" and push the current verification state after the ALU operation with known 0 to the verification stack for later analysis. Given the current path analysis succeeded it is likely that the one under speculation can be pruned. In any case, it is also subject to existing complexity limits and therefore anything beyond this point will be rejected. In terms of pruning, it needs to be ensured that the verification state from speculative execution simulation must never prune a non-speculative execution path, therefore, we mark verifier state accordingly at the time of push_stack(). If verifier detects out of bounds access under speculative execution from one of the possible paths that includes a truncation, it will reject such program. Given we mask every reg-based pointer arithmetic for unprivileged programs, we've been looking into how it could affect real-world programs in terms of size increase. As the majority of programs are targeted for privileged-only use case, we've unconditionally enabled masking (with its alu restrictions on top of it) for privileged programs for the sake of testing in order to check i) whether they get rejected in its current form, and ii) by how much the number of instructions and size will increase. We've tested this by using Katran, Cilium and test_l4lb from the kernel selftests. For Katran we've evaluated balancer_kern.o, Cilium bpf_lxc.o and an older test object bpf_lxc_opt_-DUNKNOWN.o and l4lb we've used test_l4lb.o as well as test_l4lb_noinline.o. We found that none of the programs got rejected by the verifier with this change, and that impact is rather minimal to none. balancer_kern.o had 13,904 bytes (1,738 insns) xlated and 7,797 bytes JITed before and after the change. Most complex program in bpf_lxc.o had 30,544 bytes (3,817 insns) xlated and 18,538 bytes JITed before and after and none of the other tail call programs in bpf_lxc.o had any changes either. For the older bpf_lxc_opt_-DUNKNOWN.o object we found a small increase from 20,616 bytes (2,576 insns) and 12,536 bytes JITed before to 20,664 bytes (2,582 insns) and 12,558 bytes JITed after the change. Other programs from that object file had similar small increase. Both test_l4lb.o had no change and remained at 6,544 bytes (817 insns) xlated and 3,401 bytes JITed and for test_l4lb_noinline.o constant at 5,080 bytes (634 insns) xlated and 3,313 bytes JITed. This can be explained in that LLVM typically optimizes stack based pointer arithmetic by using K-based operations and that use of dynamic map access is not overly frequent. However, in future we may decide to optimize the algorithm further under known guarantees from branch and value speculation. Latter seems also unclear in terms of prediction heuristics that today's CPUs apply as well as whether there could be collisions in e.g. the predictor's Value History/Pattern Table for triggering out of bounds access, thus masking is performed unconditionally at this point but could be subject to relaxation later on. We were generally also brainstorming various other approaches for mitigation, but the blocker was always lack of available registers at runtime and/or overhead for runtime tracking of limits belonging to a specific pointer. Thus, we found this to be minimally intrusive under given constraints. With that in place, a simple example with sanitized access on unprivileged load at post-verification time looks as follows: # bpftool prog dump xlated id 282 [...] 28: (79) r1 = *(u64 *)(r7 +0) 29: (79) r2 = *(u64 *)(r7 +8) 30: (57) r1 &= 15 31: (79) r3 = *(u64 *)(r0 +4608) 32: (57) r3 &= 1 33: (47) r3 |= 1 34: (2d) if r2 > r3 goto pc+19 35: (b4) (u32) r11 = (u32) 20479 | 36: (1f) r11 -= r2 | Dynamic sanitation for pointer 37: (4f) r11 |= r2 | arithmetic with registers 38: (87) r11 = -r11 | containing bounded or known 39: (c7) r11 s>>= 63 | scalars in order to prevent 40: (5f) r11 &= r2 | out of bounds speculation. 41: (0f) r4 += r11 | 42: (71) r4 = *(u8 *)(r4 +0) 43: (6f) r4 <<= r1 [...] For the case where the scalar sits in the destination register as opposed to the source register, the following code is emitted for the above example: [...] 16: (b4) (u32) r11 = (u32) 20479 17: (1f) r11 -= r2 18: (4f) r11 |= r2 19: (87) r11 = -r11 20: (c7) r11 s>>= 63 21: (5f) r2 &= r11 22: (0f) r2 += r0 23: (61) r0 = *(u32 *)(r2 +0) [...] JIT blinding example with non-conflicting use of r10: [...] d5: je 0x0000000000000106 _ d7: mov 0x0(%rax),%edi | da: mov $0xf153246,%r10d | Index load from map value and e0: xor $0xf153259,%r10 | (const blinded) mask with 0x1f. e7: and %r10,%rdi |_ ea: mov $0x2f,%r10d | f0: sub %rdi,%r10 | Sanitized addition. Both use r10 f3: or %rdi,%r10 | but do not interfere with each f6: neg %r10 | other. (Neither do these instructions f9: sar $0x3f,%r10 | interfere with the use of ax as temp fd: and %r10,%rdi | in interpreter.) 100: add %rax,%rdi |_ 103: mov 0x0(%rdi),%eax [...] Tested that it fixes Jann's reproducer, and also checked that test_verifier and test_progs suite with interpreter, JIT and JIT with hardening enabled on x86-64 and arm64 runs successfully. [0] Speculose: Analyzing the Security Implications of Speculative Execution in CPUs, Giorgi Maisuradze and Christian Rossow, https://arxiv.org/pdf/1801.04084.pdf [1] A Systematic Evaluation of Transient Execution Attacks and Defenses, Claudio Canella, Jo Van Bulck, Michael Schwarz, Moritz Lipp, Benjamin von Berg, Philipp Ortner, Frank Piessens, Dmitry Evtyushkin, Daniel Gruss, https://arxiv.org/pdf/1811.05441.pdf Fixes: b2157399cc98 ("bpf: prevent out-of-bounds speculation") Reported-by: Jann Horn Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Signed-off-by: Alexei Starovoitov commit b7137c4eab85c1cf3d46acdde90ce1163b28c873 Author: Daniel Borkmann Date: Thu Jan 3 00:58:33 2019 +0100 bpf: fix check_map_access smin_value test when pointer contains offset In check_map_access() we probe actual bounds through __check_map_access() with offset of reg->smin_value + off for lower bound and offset of reg->umax_value + off for the upper bound. However, even though the reg->smin_value could have a negative value, the final result of the sum with off could be positive when pointer arithmetic with known and unknown scalars is combined. In this case we reject the program with an error such as "R min value is negative, either use unsigned index or do a if (index >=0) check." even though the access itself would be fine. Therefore extend the check to probe whether the actual resulting reg->smin_value + off is less than zero. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Signed-off-by: Alexei Starovoitov commit 9d7eceede769f90b66cfa06ad5b357140d5141ed Author: Daniel Borkmann Date: Thu Jan 3 00:58:32 2019 +0100 bpf: restrict unknown scalars of mixed signed bounds for unprivileged For unknown scalars of mixed signed bounds, meaning their smin_value is negative and their smax_value is positive, we need to reject arithmetic with pointer to map value. For unprivileged the goal is to mask every map pointer arithmetic and this cannot reliably be done when it is unknown at verification time whether the scalar value is negative or positive. Given this is a corner case, the likelihood of breaking should be very small. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Signed-off-by: Alexei Starovoitov commit e4298d25830a866cc0f427d4bccb858e76715859 Author: Daniel Borkmann Date: Thu Jan 3 00:58:31 2019 +0100 bpf: restrict stack pointer arithmetic for unprivileged Restrict stack pointer arithmetic for unprivileged users in that arithmetic itself must not go out of bounds as opposed to the actual access later on. Therefore after each adjust_ptr_min_max_vals() with a stack pointer as a destination we simulate a check_stack_access() of 1 byte on the destination and once that fails the program is rejected for unprivileged program loads. This is analog to map value pointer arithmetic and needed for masking later on. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Signed-off-by: Alexei Starovoitov commit 0d6303db7970e6f56ae700fa07e11eb510cda125 Author: Daniel Borkmann Date: Thu Jan 3 00:58:30 2019 +0100 bpf: restrict map value pointer arithmetic for unprivileged Restrict map value pointer arithmetic for unprivileged users in that arithmetic itself must not go out of bounds as opposed to the actual access later on. Therefore after each adjust_ptr_min_max_vals() with a map value pointer as a destination it will simulate a check_map_access() of 1 byte on the destination and once that fails the program is rejected for unprivileged program loads. We use this later on for masking any pointer arithmetic with the remainder of the map value space. The likelihood of breaking any existing real-world unprivileged eBPF program is very small for this corner case. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Signed-off-by: Alexei Starovoitov commit 9b73bfdd08e73231d6a90ae6db4b46b3fbf56c30 Author: Daniel Borkmann Date: Thu Jan 3 00:58:29 2019 +0100 bpf: enable access to ax register also from verifier rewrite Right now we are using BPF ax register in JIT for constant blinding as well as in interpreter as temporary variable. Verifier will not be able to use it simply because its use will get overridden from the former in bpf_jit_blind_insn(). However, it can be made to work in that blinding will be skipped if there is prior use in either source or destination register on the instruction. Taking constraints of ax into account, the verifier is then open to use it in rewrites under some constraints. Note, ax register already has mappings in every eBPF JIT. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Signed-off-by: Alexei Starovoitov commit 144cd91c4c2bced6eb8a7e25e590f6618a11e854 Author: Daniel Borkmann Date: Thu Jan 3 00:58:28 2019 +0100 bpf: move tmp variable into ax register in interpreter This change moves the on-stack 64 bit tmp variable in ___bpf_prog_run() into the hidden ax register. The latter is currently only used in JITs for constant blinding as a temporary scratch register, meaning the BPF interpreter will never see the use of ax. Therefore it is safe to use it for the cases where tmp has been used earlier. This is needed to later on allow restricted hidden use of ax in both interpreter and JITs. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Signed-off-by: Alexei Starovoitov commit c08435ec7f2bc8f4109401f696fd55159b4b40cb Author: Daniel Borkmann Date: Thu Jan 3 00:58:27 2019 +0100 bpf: move {prev_,}insn_idx into verifier env Move prev_insn_idx and insn_idx from the do_check() function into the verifier environment, so they can be read inside the various helper functions for handling the instructions. It's easier to put this into the environment rather than changing all call-sites only to pass it along. insn_idx is useful in particular since this later on allows to hold state in env->insn_aux_data[env->insn_idx]. Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Signed-off-by: Alexei Starovoitov commit 9c6260de505b63638dd86fcc33849b17f6146d94 Author: Aditya Pakki Date: Mon Dec 24 12:24:45 2018 -0600 infiniband/qedr: Potential null ptr dereference of qp idr_find() may fail and return a NULL pointer. The fix checks the return value of the function and returns an error in case of NULL. Signed-off-by: Aditya Pakki Acked-by: Michal Kalderon Signed-off-by: Jason Gunthorpe commit 94edd87a1c59f3efa6fdf4e98d6d492e6cec6173 Author: Aditya Pakki Date: Wed Dec 26 12:56:22 2018 -0600 infiniband: bnxt_re: qplib: Check the return value of send_message In bnxt_qplib_map_tc2cos(), bnxt_qplib_rcfw_send_message() can return an error value but it is lost. Propagate this error to the callers. Signed-off-by: Aditya Pakki Acked-By: Devesh Sharma Signed-off-by: Jason Gunthorpe commit 2fb458953a892020f36a323f386d8c7009f10777 Author: Julia Lawall Date: Sun Dec 23 09:57:01 2018 +0100 IB/ipoib: drop useless LIST_HEAD Drop LIST_HEAD where the variable it declares is never used. Commit 31c02e215700 ("IPoIB: Avoid using stale last_send counter when reaping AHs") removed the uses, but not the declaration. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; @@ - LIST_HEAD(x); ... when != x // Fixes: 31c02e215700 ("IPoIB: Avoid using stale last_send counter when reaping AHs") Signed-off-by: Julia Lawall Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit edefae94b7b9f10d5efe32dece5a36e9d9ecc29e Author: Aaro Koskinen Date: Wed Jan 2 20:43:01 2019 +0200 MIPS: OCTEON: mark RGMII interface disabled on OCTEON III Commit 885872b722b7 ("MIPS: Octeon: Add Octeon III CN7xxx interface detection") added RGMII interface detection for OCTEON III, but it results in the following logs: [ 7.165984] ERROR: Unsupported Octeon model in __cvmx_helper_rgmii_probe [ 7.173017] ERROR: Unsupported Octeon model in __cvmx_helper_rgmii_probe The current RGMII routines are valid only for older OCTEONS that use GMX/ASX hardware blocks. On later chips AGL should be used, but support for that is missing in the mainline. Until that is added, mark the interface as disabled. Fixes: 885872b722b7 ("MIPS: Octeon: Add Octeon III CN7xxx interface detection") Signed-off-by: Aaro Koskinen Signed-off-by: Paul Burton Cc: Ralf Baechle Cc: James Hogan Cc: linux-mips@vger.kernel.org Cc: stable@vger.kernel.org # 4.7+ commit 6e863844ad6effecac92a67a43b8467a8c2e129f Author: Lukasz Luba Date: Wed Dec 5 12:05:55 2018 +0100 PM: sleep: call devfreq suspend/resume Devfreq framework supports suspend of its devices. Call the the devfreq interface and allow devfreq devices preserve/restore their states during suspend/resume. Suggested-by: Tobias Jakobi Reviewed-by: Chanwoo Choi Signed-off-by: Lukasz Luba Signed-off-by: Rafael J. Wysocki commit 72199051af6205049e96ee7ed34f4fc5f44d1baf Merge: cdf4f4dc118ba 75cb8d20c112a Author: Bjorn Helgaas Date: Wed Jan 2 15:31:15 2019 -0600 Merge branch 'pci/imx6' - Enable MSI for imx6 downstream components (Richard Zhu) * pci/imx6: PCI: imx: Enable MSI from downstream components commit cdf4f4dc118bafd97d0148d53730e396ece11afa Merge: c266b026ae7a5 7e6d5cd88a6f4 Author: Bjorn Helgaas Date: Wed Jan 2 15:31:15 2019 -0600 Merge branch 'remotes/lorenzo/pci/uniphier' - Add UniPhier PCIe controller driver and DT bindings (Kunihiko Hayashi) * remotes/lorenzo/pci/uniphier: PCI: uniphier: Add UniPhier PCIe host controller support dt-bindings: PCI: Add UniPhier PCIe host controller description # Conflicts: # drivers/pci/controller/dwc/Kconfig # drivers/pci/controller/dwc/Makefile commit c266b026ae7a51f876eb74e15ff63f834fe35976 Merge: c8778707c23a9 41c5c5b0e7c8a Author: Bjorn Helgaas Date: Wed Jan 2 15:31:10 2019 -0600 Merge branch 'remotes/lorenzo/pci/mediatek' - Use devm resource parser in mediatek (Honghui Zhang) - Remove unused mediatek "num-lanes" DT property (Honghui Zhang) * remotes/lorenzo/pci/mediatek: arm64: dts: mt7622: Remove un-used property for PCIe arm: dts: mt7623: Remove un-used property for PCIe dt-bindings: PCI: MediaTek: Remove un-used property PCI: mediatek: Remove un-used variant in struct mtk_pcie_port PCI: mediatek: Use devm_of_pci_get_host_bridge_resources() to parse DT commit c8778707c23a906576c1fdb40dd6ba4090c11773 Merge: 6a790bf0eac44 3f7bb2ec20ce0 Author: Bjorn Helgaas Date: Wed Jan 2 15:31:09 2019 -0600 Merge branch 'remotes/lorenzo/pci/dwc-msi' - Mask DesignWare interrupts instead of disabling them to avoid lost interrupts (Marc Zyngier) - Add locking when acking DesignWare interrupts (Marc Zyngier) - Ack DesignWare interrupts in the proper callbacks (Marc Zyngier) * remotes/lorenzo/pci/dwc-msi: PCI: dwc: Move interrupt acking into the proper callback PCI: dwc: Take lock when ACKing an interrupt PCI: dwc: Use interrupt masking instead of disabling commit 6a790bf0eac449c3b4dd844c2e799037531f6401 Merge: 33f3fd75b7548 ffeccc22d59cd Author: Bjorn Helgaas Date: Wed Jan 2 15:31:08 2019 -0600 Merge branch 'remotes/lorenzo/pci/dwc' - Constify histb dw_pcie_host_ops structure (Julia Lawall) - Support multiple power domains for imx6 (Leonard Crestez) - Constify layerscape driver data (Stefan Agner) - Update imx6 Kconfig to allow imx6 PCIe in imx7 kernel (Trent Piepho) - Support armada8k GPIO reset (Baruch Siach) - Support suspend/resume support on imx6 (Leonard Crestez) - Don't hard-code DesignWare DBI/ATU offst (Stephen Warren) - Skip i.MX6 PHY setup on i.MX7D (Andrey Smirnov) - Remove Jianguo Sun from HiSilicon STB maintainers (Lorenzo Pieralisi) * remotes/lorenzo/pci/dwc: MAINTAINERS: Remove Jianguo Sun from HiSilicon STB DWC entry PCI: dwc: Don't hard-code DBI/ATU offset PCI: imx: Add imx6sx suspend/resume support PCI: armada8k: Add support for gpio controlled reset signal PCI: dwc: Adjust Kconfig to allow IMX6 PCIe host on IMX7 PCI: dwc: layerscape: Constify driver data PCI: imx: Add multi-pd support dt-bindings: imx6q-pcie: Add multi-pd bindings for imx6sx PCI: histb: Constify dw_pcie_host_ops structure commit 33f3fd75b754818a6a3d40c4dd441b68b48bea0d Merge: 6ee86cac1cc41 9c0ef6d34fdbf Author: Bjorn Helgaas Date: Wed Jan 2 15:31:07 2019 -0600 Merge branch 'remotes/lorenzo/pci/amlogic' - Add Amlogic Meson PCIe controller driver and DT bindings (Yue Wang) * remotes/lorenzo/pci/amlogic: PCI: amlogic: Add the Amlogic Meson PCIe controller driver dt-bindings: PCI: meson: add DT bindings for Amlogic Meson PCIe controller commit 6ee86cac1cc415031b443d8b584305696a300d1e Merge: 54aed1909db69 7dc20ab1b9c43 Author: Bjorn Helgaas Date: Wed Jan 2 15:31:06 2019 -0600 Merge branch 'pci/virtualization' - Skip VF scanning on powerpc, which does this in firmware (Sebastian Ott) * pci/virtualization: s390/pci: skip VF scanning PCI/IOV: Add flag so platforms can skip VF scanning PCI/IOV: Factor out sriov_add_vfs() commit 54aed1909db69f9b160bf36dd4ec314f0c91b56a Merge: 6f7cebea6b13d f7eb7b8a4f72b Author: Bjorn Helgaas Date: Wed Jan 2 15:31:05 2019 -0600 Merge branch 'pci/switchtec' - Remove status check after submitting Switchtec MRPC Firmware Download commands to avoid Completion Timeouts (Kelvin Cao) - Set Switchtec coherent DMA mask to allow 64-bit DMA (Boris Glimcher) - Fix Switchtec SWITCHTEC_IOCTL_EVENT_IDX_ALL flag overwrite issue (Joey Zhang) - Enable write combining for Switchtec MRPC Input buffers (Kelvin Cao) - Add Switchtec MRPC DMA mode support (Wesley Sheng) * pci/switchtec: switchtec: Add MRPC DMA mode support switchtec: Improve MRPC efficiency by enabling write combining switchtec: Fix SWITCHTEC_IOCTL_EVENT_IDX_ALL flags overwrite switchtec: Set DMA coherent mask switchtec: Remove immediate status check after submitting MRPC command commit 6f7cebea6b13d178ad9066bb3e190150cdfe9c75 Merge: baa12e5f3acb3 c5eb1190074cf Author: Bjorn Helgaas Date: Wed Jan 2 15:31:05 2019 -0600 Merge branch 'pci/pm' - Allow runtime PM even if driver doesn't supply callbacks (Jarkko Nikula) * pci/pm: PCI / PM: Allow runtime PM without callback functions commit baa12e5f3acb3cd500c85c4be2c97e769af199fd Merge: e6397dfcb58d8 fcf9ab35ba418 Author: Bjorn Helgaas Date: Wed Jan 2 15:31:04 2019 -0600 Merge branch 'pci/peer-to-peer' - Clean up P2PDMA documentation (Randy Dunlap) * pci/peer-to-peer: PCI/P2PDMA: Clean up documentation and kernel-doc commit e6397dfcb58d8fcecea314026d4539c85f0dd94b Merge: 84e0e72722098 03e6742584af8 Author: Bjorn Helgaas Date: Wed Jan 2 15:31:03 2019 -0600 Merge branch 'pci/misc' - Expand Kconfig "PF" acronyms (Randy Dunlap) - Update MAINTAINERS for arch/x86/kernel/early-quirks.c (Bjorn Helgaas) - Add missing include to drivers/pci.h (Alexandru Gagniuc) - Override Synopsys USB 3.x HAPS device class so dwc3-haps can claim it instead of xhci (Thinh Nguyen) * pci/misc: PCI: Override Synopsys USB 3.x HAPS device class PCI: Move Synopsys HAPS platform device IDs PCI: Add missing include to drivers/pci.h PCI: Remove unnecessary space before function pointer arguments MAINTAINERS: Add x86 early-quirks.c file pattern to PCI subsystem PCI: Expand the "PF" acronym in Kconfig help text commit 84e0e72722098c7ced6362d1219c2a40a9d109fa Merge: 2caa4dc607a70 53bb565fc5439 Author: Bjorn Helgaas Date: Wed Jan 2 15:31:02 2019 -0600 Merge branch 'pci/enumeration' - Fix Broadcom CNB20LE host bridge unintended sign extension (Colin Ian King) * pci/enumeration: x86/PCI: Fix Broadcom CNB20LE unintended sign extension (redux) commit 2caa4dc607a7025ab40c5bf9c2e2b0dae99ad09a Merge: 651022382c7f8 3c259a1c36636 Author: Bjorn Helgaas Date: Wed Jan 2 15:31:02 2019 -0600 Merge branch 'pci/aspm' - Remove unused lists from ASPM pcie_link_state (Frederick Lawler) * pci/aspm: PCI/ASPM: Remove unused lists from struct pcie_link_state commit e49cddcd0ab08f2a3bf3fea8554ea45ae1446d26 Author: Tiecheng Zhou Date: Mon Dec 24 08:55:45 2018 +0800 drm/amdgpu/gfx_v8_0: Reorder the gfx, kiq and kcq rings test sequence The kiq ring and the very first compute ring may fail occasionally if they are tested directly following kiq_kcq_enable. Insert the gfx ring test before kiq ring test to delay the kiq and kcq ring tests will fix the issue. Acked-by: Alex Deucher Signed-off-by: Tiecheng Zhou Signed-off-by: Alex Deucher commit b8cf66182eddb22e9c7539821ed6eecdb4f86d1a Author: Emily Deng Date: Sat Dec 29 17:46:05 2018 +0800 drm/amdgpu/sriov:Correct pfvf exchange logic The pfvf exchange need be in exclusive mode. And add pfvf exchange in gpu reset. Signed-off-by: Emily Deng Reviewed-By: Xiangliang Yu Signed-off-by: Alex Deucher commit 048b9b0f5ceefb2691834ac62f8459ebb7d3100e Author: Evan Quan Date: Thu Dec 27 14:23:30 2018 +0800 drm/amd/powerplay: support BOOTUP_DEFAULT power profile mode This can avoid unexpected profile mode change after running compute workload. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit baf3c982dfbf7b0742039e6fef3f1fe1ba4079ab Author: Emily Deng Date: Wed Dec 26 18:08:54 2018 +0800 drm/amdgpu/virtual_dce: No need to pin the cursor bo For virtual display feature, no need to pin cursor bo. Signed-off-by: Emily Deng Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 47bbcc1e92385b595e92e11e29076185c820a0b8 Author: Emily Deng Date: Wed Dec 26 18:09:33 2018 +0800 drm/amdgpu/virtual_dce: No need to pin the fb's bo For virtual display, no need to pin the fb's bo. Signed-off-by: Emily Deng Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 85f78456f286da46fb054c7d45e4193cb757ac83 Merge: cacf02df4b84d 574d356b7a02c Author: Linus Torvalds Date: Wed Jan 2 12:11:01 2019 -0800 Merge tag '9p-for-4.21' of git://github.com/martinetd/linux Pull 9p updates from Dominique Martinet: "Missing prototype warning fix and a syzkaller fix when a 9p server advertises a too small msize" * tag '9p-for-4.21' of git://github.com/martinetd/linux: 9p/net: put a lower bound on msize net/9p: include trans_common.h to fix missing prototype warning. commit cacf02df4b84d261d76db3d290ccb6b951df28c0 Merge: 74673fc50babc fea170804b4dc Author: Linus Torvalds Date: Wed Jan 2 12:08:29 2019 -0800 Merge tag '4.21-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs updates from Steve French: - four fixes for stable - improvements to DFS including allowing failover to alternate targets - some small performance improvements * tag '4.21-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: (39 commits) cifs: update internal module version number cifs: we can not use small padding iovs together with encryption cifs: Minor Kconfig clarification cifs: Always resolve hostname before reconnecting cifs: Add support for failover in cifs_reconnect_tcon() cifs: Add support for failover in smb2_reconnect() cifs: Only free DFS target list if we actually got one cifs: start DFS cache refresher in cifs_mount() cifs: Use GFP_ATOMIC when a lock is held in cifs_mount() cifs: Add support for failover in cifs_reconnect() cifs: Add support for failover in cifs_mount() cifs: remove set but not used variable 'sep' cifs: Make use of DFS cache to get new DFS referrals cifs: minor updates to documentation cifs: check kzalloc return cifs: remove set but not used variable 'server' cifs: Use kzfree() to free password cifs: Fix to use kmem_cache_free() instead of kfree() cifs: update for current_kernel_time64() removal cifs: Add DFS cache routines ... commit 74673fc50babc9be22b32c4ce697fceb51c7671a Merge: 19f2e267a5d0d 0db51ef26e878 Author: Linus Torvalds Date: Wed Jan 2 11:05:43 2019 -0800 Merge branch 'next-tpm' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security Pull TPM updates from James Morris: - Support for partial reads of /dev/tpm0. - Clean up for TPM 1.x code: move the commands to tpm1-cmd.c and make everything to use the same data structure for building TPM commands i.e. struct tpm_buf. * 'next-tpm' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (25 commits) tpm: add support for partial reads tpm: tpm_ibmvtpm: fix kdoc warnings tpm: fix kdoc for tpm2_flush_context_cmd() tpm: tpm_try_transmit() refactor error flow. tpm: use u32 instead of int for PCR index tpm1: reimplement tpm1_continue_selftest() using tpm_buf tpm1: reimplement SAVESTATE using tpm_buf tpm1: rename tpm1_pcr_read_dev to tpm1_pcr_read() tpm1: implement tpm1_pcr_read_dev() using tpm_buf structure tpm: tpm1: rewrite tpm1_get_random() using tpm_buf structure tpm: tpm-space.c remove unneeded semicolon tpm: tpm-interface.c drop unused macros tpm: add tpm_auto_startup() into tpm-interface.c tpm: factor out tpm_startup function tpm: factor out tpm 1.x pm suspend flow into tpm1-cmd.c tpm: move tpm 1.x selftest code from tpm-interface.c tpm1-cmd.c tpm: factor out tpm1_get_random into tpm1-cmd.c tpm: move tpm_getcap to tpm1-cmd.c tpm: move tpm1_pcr_extend to tpm1-cmd.c tpm: factor out tpm_get_timeouts() ... commit 19f2e267a5d0d26282a64f8f788c482852c95324 Merge: 1ac5cd4978794 20bb4cb4fb9fb Author: Linus Torvalds Date: Wed Jan 2 10:56:09 2019 -0800 Merge branch 'next-smack' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security Pull smack updates from James Morris: "Two Smack patches for 4.21. Jose's patch adds missing documentation and Zoran's fleshes out the access checks on keyrings" * 'next-smack' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: Smack: Improve Documentation smack: fix access permissions for keyring commit 1ac5cd4978794bd060d448acc0305e9fc996ba92 Author: Linus Torvalds Date: Wed Jan 2 10:46:03 2019 -0800 block: don't use un-ordered __set_current_state(TASK_UNINTERRUPTIBLE) This mostly reverts commit 849a370016a5 ("block: avoid ordered task state change for polled IO"). It was wrongly claiming that the ordering wasn't necessary. The memory barrier _is_ necessary. If something is truly polling and not going to sleep, it's the whole state setting that is unnecessary, not the memory barrier. Whenever you set your state to a sleeping state, you absolutely need the memory barrier. Note that sometimes the memory barrier can be elsewhere. For example, the ordering might be provided by an external lock, or by setting the process state to sleeping before adding yourself to the wait queue list that is used for waking up (where the wait queue lock itself will guarantee that any wakeup will correctly see the sleeping state). But none of those cases were true here. NOTE! Some of the polling paths may indeed be able to drop the state setting entirely, at which point the memory barrier also goes away. (Also note that this doesn't revert the TASK_RUNNING cases: there is no race between a wakeup and setting the process state to TASK_RUNNING, since the end result doesn't depend on ordering). Cc: Jens Axboe Cc: Christoph Hellwig Signed-off-by: Linus Torvalds commit d63967e475ae10f286dbd35e189cb241e0b1f284 Author: Eric Dumazet Date: Wed Jan 2 09:20:27 2019 -0800 isdn: fix kernel-infoleak in capi_unlocked_ioctl Since capi_ioctl() copies 64 bytes after calling capi20_get_manufacturer() we need to ensure to not leak information to user. BUG: KMSAN: kernel-infoleak in _copy_to_user+0x16b/0x1f0 lib/usercopy.c:32 CPU: 0 PID: 11245 Comm: syz-executor633 Not tainted 4.20.0-rc7+ #2 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+0x173/0x1d0 lib/dump_stack.c:113 kmsan_report+0x12e/0x2a0 mm/kmsan/kmsan.c:613 kmsan_internal_check_memory+0x9d4/0xb00 mm/kmsan/kmsan.c:704 kmsan_copy_to_user+0xab/0xc0 mm/kmsan/kmsan_hooks.c:601 _copy_to_user+0x16b/0x1f0 lib/usercopy.c:32 capi_ioctl include/linux/uaccess.h:177 [inline] capi_unlocked_ioctl+0x1a0b/0x1bf0 drivers/isdn/capi/capi.c:939 do_vfs_ioctl+0xebd/0x2bf0 fs/ioctl.c:46 ksys_ioctl fs/ioctl.c:713 [inline] __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl+0x1da/0x270 fs/ioctl.c:718 __x64_sys_ioctl+0x4a/0x70 fs/ioctl.c:718 do_syscall_64+0xbc/0xf0 arch/x86/entry/common.c:291 entry_SYSCALL_64_after_hwframe+0x63/0xe7 RIP: 0033:0x440019 Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 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 0f 83 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ffdd4659fb8 EFLAGS: 00000213 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440019 RDX: 0000000020000080 RSI: 00000000c0044306 RDI: 0000000000000003 RBP: 00000000006ca018 R08: 0000000000000000 R09: 00000000004002c8 R10: 0000000000000000 R11: 0000000000000213 R12: 00000000004018a0 R13: 0000000000401930 R14: 0000000000000000 R15: 0000000000000000 Local variable description: ----data.i@capi_unlocked_ioctl Variable was created at: capi_ioctl drivers/isdn/capi/capi.c:747 [inline] capi_unlocked_ioctl+0x82/0x1bf0 drivers/isdn/capi/capi.c:939 do_vfs_ioctl+0xebd/0x2bf0 fs/ioctl.c:46 Bytes 12-63 of 64 are uninitialized Memory access of size 64 starts at ffff88807ac5fce8 Data copied to user address 0000000020000080 Signed-off-by: Eric Dumazet Reported-by: syzbot Cc: Karsten Keil Signed-off-by: David S. Miller commit 7adf3246092f5e87ed0fa610e8088fae416c581f Author: Stefano Brivio Date: Wed Jan 2 13:29:27 2019 +0100 ipv6: route: Fix return value of ip6_neigh_lookup() on neigh_create() error In ip6_neigh_lookup(), we must not return errors coming from neigh_create(): if creation of a neighbour entry fails, the lookup should return NULL, in the same way as it's done in __neigh_lookup(). Otherwise, callers legitimately checking for a non-NULL return value of the lookup function might dereference an invalid pointer. For instance, on neighbour table overflow, ndisc_router_discovery() crashes ndisc_update() by passing ERR_PTR(-ENOBUFS) as 'neigh' argument. Reported-by: Jianlin Shi Fixes: f8a1b43b709d ("net/ipv6: Create a neigh_lookup for FIB entries") Signed-off-by: Stefano Brivio Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 202700e30740c6568b5a6943662f3829566dd533 Author: Eric Dumazet Date: Wed Jan 2 04:24:20 2019 -0800 net/hamradio/6pack: use mod_timer() to rearm timers Using del_timer() + add_timer() is generally unsafe on SMP, as noticed by syzbot. Use mod_timer() instead. kernel BUG at kernel/time/timer.c:1136! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 1026 Comm: kworker/u4:4 Not tainted 4.20.0+ #2 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events_unbound flush_to_ldisc RIP: 0010:add_timer kernel/time/timer.c:1136 [inline] RIP: 0010:add_timer+0xa81/0x1470 kernel/time/timer.c:1134 Code: 4d 89 7d 40 48 c7 85 70 fe ff ff 00 00 00 00 c7 85 7c fe ff ff ff ff ff ff 48 89 85 90 fe ff ff e9 e6 f7 ff ff e8 cf 42 12 00 <0f> 0b e8 c8 42 12 00 0f 0b e8 c1 42 12 00 4c 89 bd 60 fe ff ff e9 RSP: 0018:ffff8880a7fdf5a8 EFLAGS: 00010293 RAX: ffff8880a7846340 RBX: dffffc0000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff816f3ee1 RDI: ffff88808a514ff8 RBP: ffff8880a7fdf760 R08: 0000000000000007 R09: ffff8880a7846c58 R10: ffff8880a7846340 R11: 0000000000000000 R12: ffff88808a514ff8 R13: ffff88808a514ff8 R14: ffff88808a514dc0 R15: 0000000000000030 FS: 0000000000000000(0000) GS:ffff8880ae700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000000061c500 CR3: 00000000994d9000 CR4: 00000000001406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: decode_prio_command drivers/net/hamradio/6pack.c:903 [inline] sixpack_decode drivers/net/hamradio/6pack.c:971 [inline] sixpack_receive_buf drivers/net/hamradio/6pack.c:457 [inline] sixpack_receive_buf+0xf9c/0x1470 drivers/net/hamradio/6pack.c:434 tty_ldisc_receive_buf+0x164/0x1c0 drivers/tty/tty_buffer.c:465 tty_port_default_receive_buf+0x114/0x190 drivers/tty/tty_port.c:38 receive_buf drivers/tty/tty_buffer.c:481 [inline] flush_to_ldisc+0x3b2/0x590 drivers/tty/tty_buffer.c:533 process_one_work+0xd0c/0x1ce0 kernel/workqueue.c:2153 worker_thread+0x143/0x14a0 kernel/workqueue.c:2296 kthread+0x357/0x430 kernel/kthread.c:246 ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Reported-by: syzbot Cc: Andreas Koensgen Signed-off-by: David S. Miller commit 53fe3ed19df0bca6ce752fae8e483910b6f112f6 Author: Xue Chaojing Date: Tue Jan 1 19:39:33 2019 +0000 net-next/hinic:add shutdown callback If there is no shutdown callback, our board will report pcie UNF errors after restarting. This patch add shutdown callback for hinic. Signed-off-by: Xue Chaojing Signed-off-by: David S. Miller commit d9a7fa67b4bfe6ce93ee9aab23ae2e7ca0763e84 Merge: f218a29c25ad8 55b8cbe470d10 Author: Linus Torvalds Date: Wed Jan 2 09:48:13 2019 -0800 Merge branch 'next-seccomp' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security Pull seccomp updates from James Morris: - Add SECCOMP_RET_USER_NOTIF - seccomp fixes for sparse warnings and s390 build (Tycho) * 'next-seccomp' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: seccomp, s390: fix build for syscall type change seccomp: fix poor type promotion samples: add an example of seccomp user trap seccomp: add a return code to trap to userspace seccomp: switch system call argument type to void * seccomp: hoist struct seccomp_data recalculation higher commit 399382f8018204407174f0229b4087d40e1cdc82 Author: Bartlomiej Zolnierkiewicz Date: Wed Jan 2 18:47:37 2019 +0100 drm/nouveau: fix incorrect FB_BACKLIGHT usage in Kconfig Making FB_BACKLIGHT tristate by commit b4a1ed0cd18b ("fbdev: make FB_BACKLIGHT a tristate") caused unmet dependencies in some configurations: WARNING: unmet direct dependencies detected for FB_BACKLIGHT Depends on [m]: HAS_IOMEM [=y] && FB [=m] Selected by [y]: - DRM_NOUVEAU [=y] && HAS_IOMEM [=y] && DRM [=y] && PCI [=y] && MMU [=y] && DRM_NOUVEAU_BACKLIGHT [=y] Selected by [m]: - FB_NVIDIA [=m] && HAS_IOMEM [=y] && FB [=m] && PCI [=y] && FB_NVIDIA_BACKLIGHT [=y] Fix it by making DRM_NOUVEAU select BACKLIGHT_CLASS_DEVICE and BACKLIGHT_LCD_SUPPORT instead of FB_BACKLIGHT. Fixes: b4a1ed0cd18b ("fbdev: make FB_BACKLIGHT a tristate") Reported-by: Randy Dunlap Acked-by: Randy Dunlap # build-tested Cc: Rob Clark Cc: Arnd Bergmann Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: Stephen Rothwell Signed-off-by: Bartlomiej Zolnierkiewicz commit f218a29c25ad8abdb961435d6b8139f462061364 Merge: 8e143b90e4d45 c7f7e58fcbf33 Author: Linus Torvalds Date: Wed Jan 2 09:43:14 2019 -0800 Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security Pull integrity updates from James Morris: "In Linux 4.19, a new LSM hook named security_kernel_load_data was upstreamed, allowing LSMs and IMA to prevent the kexec_load syscall. Different signature verification methods exist for verifying the kexec'ed kernel image. This adds additional support in IMA to prevent loading unsigned kernel images via the kexec_load syscall, independently of the IMA policy rules, based on the runtime "secure boot" flag. An initial IMA kselftest is included. In addition, this pull request defines a new, separate keyring named ".platform" for storing the preboot/firmware keys needed for verifying the kexec'ed kernel image's signature and includes the associated IMA kexec usage of the ".platform" keyring. (David Howell's and Josh Boyer's patches for reading the preboot/firmware keys, which were previously posted for a different use case scenario, are included here)" * 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: integrity: Remove references to module keyring ima: Use inode_is_open_for_write ima: Support platform keyring for kernel appraisal efi: Allow the "db" UEFI variable to be suppressed efi: Import certificates from UEFI Secure Boot efi: Add an EFI signature blob parser efi: Add EFI signature data types integrity: Load certs to the platform keyring integrity: Define a trusted platform keyring selftests/ima: kexec_load syscall test ima: don't measure/appraise files on efivarfs x86/ima: retry detecting secure boot mode docs: Extend trusted keys documentation for TPM 2.0 x86/ima: define arch_get_ima_policy() for x86 ima: add support for arch specific policies ima: refactor ima_init_policy() ima: prevent kexec_load syscall based on runtime secureboot flag x86/ima: define arch_ima_get_secureboot integrity: support new struct public_key_signature encoding field commit 260f71eff493a844531629854c0935fa8de4fa2c Author: Yangtao Li Date: Fri Dec 21 10:59:36 2018 -0500 sunrpc: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Anna Schumaker commit 10e037d1e0d5d93cc057e4fad6911e481a462407 Author: Santosh kumar pradhan Date: Wed Dec 19 12:29:57 2018 +0530 sunrpc: Add xprt after nfs4_test_session_trunk() Multipathing: In case of NFSv3, rpc_clnt_test_and_add_xprt() adds the xprt to xprt switch (i.e. xps) if rpc_call_null_helper() returns success. But in case of NFSv4.1, it needs to do EXCHANGEID to verify the path along with check for session trunking. Add the xprt in nfs4_test_session_trunk() only when nfs4_detect_session_trunking() returns success. Also release refcount hold by rpc_clnt_setup_test_and_add_xprt(). Signed-off-by: Santosh kumar pradhan Tested-by: Suresh Jayaraman Reported-by: Aditya Agnihotri Signed-off-by: Anna Schumaker commit cb24e35b4fa8448e7ee963884958235b8de44f25 Author: J. Bruce Fields Date: Thu Dec 20 10:42:36 2018 -0500 sunrpc: convert unnecessary GFP_ATOMIC to GFP_NOFS It's OK to sleep here, we just don't want to recurse into the filesystem as a writeout could be waiting on this. Future work: the documentation for GFP_NOFS says "Please try to avoid using this flag directly and instead use memalloc_nofs_{save,restore} to mark the whole scope which cannot/shouldn't recurse into the FS layer with a short explanation why. All allocation requests will inherit GFP_NOFS implicitly." But I'm not sure where to do this. Should the workqueue be arranging that for us in the case of workqueues created with WQ_MEM_RECLAIM? Reported-by: Trond Myklebust Signed-off-by: J. Bruce Fields Signed-off-by: Anna Schumaker commit 81c88b18de1f11f70c97f28ced8d642c00bb3955 Author: J. Bruce Fields Date: Thu Dec 20 10:35:11 2018 -0500 sunrpc: handle ENOMEM in rpcb_getport_async If we ignore the error we'll hit a null dereference a little later. Reported-by: syzbot+4b98281f2401ab849f4b@syzkaller.appspotmail.com Signed-off-by: J. Bruce Fields Signed-off-by: Anna Schumaker commit c2c7d84fd173aff121ffd45cf15277eff43348d3 Author: NeilBrown Date: Thu Dec 20 10:29:55 2018 +1100 NFS: remove unnecessary test for IS_ERR(cred) As gte_current_cred() cannot return an error, this test is not necessary. It hasn't been necessary for years, but it wasn't so obvious before. Reported-by: Dan Carpenter Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 07e10308ee5da8e6132e0b737ece1c99dd651fb6 Author: Chuck Lever Date: Fri Dec 7 11:11:44 2018 -0500 xprtrdma: Prevent leak of rpcrdma_rep objects If a reply has been processed but the RPC is later retransmitted anyway, the req->rl_reply field still contains the only pointer to the old rpcrdma rep. When the next reply comes in, the reply handler will stomp on the rl_reply field, leaking the old rep. A trace event is added to capture such leaks. This problem seems to be worsened by the restructuring of the RPC Call path in v4.20. Fully addressing this issue will require at least a re-architecture of the disconnect logic, which is not appropriate during -rc. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 9aeaf8cfcb71f3663737bc21b93da7e1b8845c0d Author: Olga Kornievskaia Date: Thu Dec 6 11:10:36 2018 -0500 NFSv4.2 fix async copy reboot recovery Original commit (e4648aa4f98a "NFS recover from destination server reboot for copies") used memcmp() and then it was changed to use nfs4_stateid_match_other() but that function returns opposite of memcmp. As the result, recovery can't find the copy leading to copy hanging. Fixes: 80f42368868e ("NFSv4: Split out NFS v4.2 copy completion functions") Fixes: cb7a8384dc02 ("NFS: Split out the body of nfs4_reclaim_open_state") Signed-of-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit f85adb1bf59557909f86f71cf4b1e5a906bdb465 Author: Chuck Lever Date: Wed Dec 19 11:00:48 2018 -0500 xprtrdma: Don't leak freed MRs Defensive clean up. Don't set frwr->fr_mr until we know that the scatterlist allocation has succeeded. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit af65ed404c437684c9f58d0c37495abedcdfa3fc Author: Chuck Lever Date: Wed Dec 19 11:00:37 2018 -0500 xprtrdma: Add documenting comment for rpcrdma_buffer_destroy Make a note of the function's dependency on an earlier ib_drain_qp. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 995d312a28cc2a6a5640ceb2dcbdfde37d050c07 Author: Chuck Lever Date: Wed Dec 19 11:00:32 2018 -0500 xprtrdma: Replace outdated comment for rpcrdma_ep_post Since commit 7c8d9e7c8863 ("xprtrdma: Move Receive posting to Receive handler"), rpcrdma_ep_post is no longer responsible for posting Receive buffers. Update the documenting comment to reflect this change. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit e0f86bc4f990edb56440640964fdcf3f3cf4e240 Author: Chuck Lever Date: Wed Dec 19 11:00:27 2018 -0500 xprtrdma: Update comments in frwr_op_send Commit f2877623082b ("xprtrdma: Chain Send to FastReg WRs") was written before commit ce5b37178283 ("xprtrdma: Replace all usage of "frmr" with "frwr""), but was merged afterwards. Thus it still refers to FRMR and MWs. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit acf0a39f4f277d0cb7178be5ec8a808c6c2bcd9c Author: Chuck Lever Date: Wed Dec 19 11:00:22 2018 -0500 SUNRPC: Fix some kernel doc complaints Clean up some warnings observed when building with "make W=1". Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit dc5820bd21d84ee34770b0a1e2fca9378f8f7456 Author: Chuck Lever Date: Wed Dec 19 11:00:16 2018 -0500 SUNRPC: Simplify defining common RPC trace events Clean up, no functional change is expected. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 5b2095d0cefa218deca156eecbe0c656e5766129 Author: Chuck Lever Date: Wed Dec 19 11:00:11 2018 -0500 NFS: Fix NFSv4 symbolic trace point output These symbolic values were not being displayed in string form. TRACE_DEFINE_ENUM was missing in many cases. It also turns out that __print_symbolic wants an unsigned long in the first field... Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 53b2c1cb9b3cd901a200ddbbf08c77eabf1ab3e9 Author: Chuck Lever Date: Wed Dec 19 11:00:06 2018 -0500 xprtrdma: Trace mapping, alloc, and dereg failures These are rare, but can be helpful at tracking down DMAR and other problems. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 395069fc37e7a76280b176c0327d1ead6ca29838 Author: Chuck Lever Date: Wed Dec 19 11:00:00 2018 -0500 xprtrdma: Add trace points for calls to transport switch methods Name them "trace_xprtrdma_op_*" so they can be easily enabled as a group. No trace point is added where the generic layer already has observability. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit ba217ec64aef91f40c3cbdbfb0ab3a4000782504 Author: Chuck Lever Date: Wed Dec 19 10:59:55 2018 -0500 xprtrdma: Relocate the xprtrdma_mr_map trace points The mr_map trace points were capturing information about the previous use of the MR rather than about the segment that was just mapped. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit aba11831794356ff58da69de46a125e6335eb9ca Author: Chuck Lever Date: Wed Dec 19 10:59:49 2018 -0500 xprtrdma: Clean up of xprtrdma chunk trace points The chunk-related trace points capture nearly the same information as the MR-related trace points. Also, rename them so globbing can be used to enable or disable these trace points more easily. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 9bef848f44b4316fbe12e364eea527bd59fa1ed3 Author: Chuck Lever Date: Wed Dec 19 10:59:44 2018 -0500 xprtrdma: Remove unused fields from rpcrdma_ia Clean up. The last use of these fields was in commit 173b8f49b3af ("xprtrdma: Demote "connect" log messages") . Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit ddbb347f0c68a66cb20b78af4bc318b10d30e425 Author: Chuck Lever Date: Wed Dec 19 10:59:39 2018 -0500 xprtrdma: Cull dprintk() call sites Clean up: Remove dprintk() call sites that report rare or impossible errors. Leave a few that display high-value low noise status information. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 92f4433e567a034d87e1e2c9e5402ff5f58b545b Author: Chuck Lever Date: Wed Dec 19 10:59:33 2018 -0500 xprtrdma: Simplify locking that protects the rl_allreqs list Clean up: There's little chance of contention between the use of rb_lock and rb_reqslock, so merge the two. This avoids having to take both in some (possibly future) cases. Transport tear-down is already serialized, thus there is no need for locking at all when destroying rpcrdma_reqs. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 236b0943d1f21335a0fc4324f3bcc455cf99dfb7 Author: Chuck Lever Date: Wed Dec 19 10:59:28 2018 -0500 xprtrdma: Expose transport header errors For better observability of parsing errors, return the error code generated in the decoders to the upper layer consumer. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 889ee07f7ed26bb2cc525eb48f7f865bc407ef0b Author: Chuck Lever Date: Wed Dec 19 10:59:23 2018 -0500 xprtrdma: Remove request_module from backchannel Since commit ffe1f0df5862 ("rpcrdma: Merge svcrdma and xprtrdma modules into one"), the forward and backchannel components are part of the same kernel module. A separate request_module() call in the backchannel code is no longer necessary. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 15303d9ecd2f29168aea0b080bd1ec27c298da3f Author: Chuck Lever Date: Wed Dec 19 10:59:17 2018 -0500 xprtrdma: Recognize XDRBUF_SPARSE_PAGES Commit 431f6eb3570f ("SUNRPC: Add a label for RPC calls that require allocation on receive") didn't update similar logic in rpc_rdma.c. I don't think this is a bug, per-se; the commit just adds more careful checking for broken upper layer behavior. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 0dfbb5f05e7888903e7e1da6c2c4aa017ee1a207 Author: Chuck Lever Date: Wed Dec 19 10:59:12 2018 -0500 NFS: Make "port=" mount option optional for RDMA mounts Having to specify "proto=rdma,port=20049" is cumbersome. RFC 8267 Section 6.3 requires NFSv4 clients to use "the alternative well-known port number", which is 20049. Make the use of the well- known port number automatic, just as it is for NFS/TCP and port 2049. For NFSv2/3, Section 4.2 allows clients to simply choose 20049 as the default or use rpcbind. I don't know of an NFS/RDMA server implementation that registers it's NFS/RDMA service with rpcbind, so automatically choosing 20049 seems like the better choice. The other widely-deployed NFS/RDMA client, Solaris, also uses 20049 as the default port. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 0a93fbcb16e6b1f36780f9a20d6427f26cec761d Author: Chuck Lever Date: Wed Dec 19 10:59:07 2018 -0500 xprtrdma: Plant XID in on-the-wire RDMA offset (FRWR) Place the associated RPC transaction's XID in the upper 32 bits of each RDMA segment's rdma_offset field. There are two reasons to do this: - The R_key only has 8 bits that are different from registration to registration. The XID adds more uniqueness to each RDMA segment to reduce the likelihood of a software bug on the server reading from or writing into memory it's not supposed to. - On-the-wire RDMA Read and Write requests do not otherwise carry any identifier that matches them up to an RPC. The XID in the upper 32 bits will act as an eye-catcher in network captures. Suggested-by: Tom Talpey Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 5f62412be3ff738c9575b28c1f4a9b010ac22316 Author: Chuck Lever Date: Wed Dec 19 10:59:01 2018 -0500 xprtrdma: Remove rpcrdma_memreg_ops Clean up: Now that there is only FRWR, there is no need for a memory registration switch. The indirect calls to the memreg operations can be replaced with faster direct calls. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit ba69cd122ece618eba47589764c7f9c1f57aed95 Author: Chuck Lever Date: Wed Dec 19 10:58:56 2018 -0500 xprtrdma: Remove support for FMR memory registration FMR is not supported on most recent RDMA devices. It is also less secure than FRWR because an FMR memory registration can expose adjacent bytes to remote reading or writing. As discussed during the RDMA BoF at LPC 2018, it is time to remove support for FMR in the NFS/RDMA client stack. Note that NFS/RDMA server-side uses either local memory registration or FRWR. FMR is not used. There are a few Infiniband/RoCE devices in the kernel tree that do not appear to support MEM_MGT_EXTENSIONS (FRWR), and therefore will not support client-side NFS/RDMA after this patch. These are: - mthca - qib - hns (RoCE) Users of these devices can use NFS/TCP on IPoIB instead. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit a78868497c2e4858e2c73818eed7b4877ab2316d Author: Chuck Lever Date: Wed Dec 19 10:58:51 2018 -0500 xprtrdma: Reduce max_frwr_depth Some devices advertise a large max_fast_reg_page_list_len capability, but perform optimally when MRs are significantly smaller than that depth -- probably when the MR itself is no larger than a page. By default, the RDMA R/W core API uses max_sge_rd as the maximum page depth for MRs. For some devices, the value of max_sge_rd is 1, which is also not optimal. Thus, when max_sge_rd is larger than 1, use that value. Otherwise use the value of the max_fast_reg_page_list_len attribute. I've tested this with CX-3 Pro, FastLinq, and CX-5 devices. It reproducibly improves the throughput of large I/Os by several percent. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 6946f82380a83acb7023fab9d7033e1f016cb818 Author: Chuck Lever Date: Wed Dec 19 10:58:45 2018 -0500 xprtrdma: Fix ri_max_segs and the result of ro_maxpages With certain combinations of krb5i/p, MR size, and r/wsize, I/O can fail with EMSGSIZE. This is because the calculated value of ri_max_segs (the max number of MRs per RPC) exceeded RPCRDMA_MAX_HDR_SEGS, which caused Read or Write list encoding to walk off the end of the transport header. Once that was addressed, the ro_maxpages result has to be corrected to account for the number of MRs needed for Reply chunks, which is 2 MRs smaller than a normal Read or Write chunk. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 0c0829bcf51aef713806e49b8ea2bac7962f54e2 Author: Chuck Lever Date: Wed Dec 19 10:58:40 2018 -0500 xprtrdma: Don't wake pending tasks until disconnect is done Transport disconnect processing does a "wake pending tasks" at various points. Suppose an RPC Reply is being processed. The RPC task that Reply goes with is waiting on the pending queue. If a disconnect wake-up happens before reply processing is done, that reply, even if it is good, is thrown away, and the RPC has to be sent again. This window apparently does not exist for socket transports because there is a lock held while a reply is being received which prevents the wake-up call until after reply processing is done. To resolve this, all RPC replies being processed on an RPC-over-RDMA transport have to complete before pending tasks are awoken due to a transport disconnect. Callers that already hold the transport write lock may invoke ->ops->close directly. Others use a generic helper that schedules a close when the write lock can be taken safely. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 3d433ad812baad45fa697f1af45a651147360712 Author: Chuck Lever Date: Wed Dec 19 10:58:35 2018 -0500 xprtrdma: No qp_event disconnect After thinking about this more, and auditing other kernel ULP imple- mentations, I believe that a DISCONNECT cm_event will occur after a fatal QP event. If that's the case, there's no need for an explicit disconnect in the QP event handler. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 6d2d0ee27c7a12371a0ca51a5db414204901228c Author: Chuck Lever Date: Wed Dec 19 10:58:29 2018 -0500 xprtrdma: Replace rpcrdma_receive_wq with a per-xprt workqueue To address a connection-close ordering problem, we need the ability to drain the RPC completions running on rpcrdma_receive_wq for just one transport. Give each transport its own RPC completion workqueue, and drain that workqueue when disconnecting the transport. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 6ceea36890a01aa626ce08487eecc5fb43e749b1 Author: Chuck Lever Date: Wed Dec 19 10:58:24 2018 -0500 xprtrdma: Refactor Receive accounting Clean up: Divide the work cleanly: - rpcrdma_wc_receive is responsible only for RDMA Receives - rpcrdma_reply_handler is responsible only for RPC Replies - the posted send and receive counts both belong in rpcrdma_ep Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit b674c4b4a13dc3d37f1b4a449f3b9515f9a30615 Author: Chuck Lever Date: Wed Dec 19 10:58:19 2018 -0500 xprtrdma: Ensure MRs are DMA-unmapped when posting LOCAL_INV fails The recovery case in frwr_op_unmap_sync needs to DMA unmap each MR. frwr_release_mr does not DMA-unmap, but the recycle worker does. Fixes: 61da886bf74e ("xprtrdma: Explicitly resetting MRs is ... ") Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit e2f34e26710bfaa545a9d9cd0c70137406401467 Author: Chuck Lever Date: Wed Dec 19 10:58:13 2018 -0500 xprtrdma: Yet another double DMA-unmap While chasing yet another set of DMAR fault reports, I noticed that the frwr recycler conflates whether or not an MR has been DMA unmapped with frwr->fr_state. Actually the two have only an indirect relationship. It's in fact impossible to guess reliably whether the MR has been DMA unmapped based on its fr_state field, especially as the surrounding code and its assumptions have changed over time. A better approach is to track the DMA mapping status explicitly so that the recycler is less brittle to unexpected situations, and attempts to DMA-unmap a second time are prevented. Signed-off-by: Chuck Lever Cc: stable@vger.kernel.org # v4.20 Signed-off-by: Anna Schumaker commit 2f1927b090345d7e65e6e873baba1599b18a0e26 Author: Moni Shoua Date: Wed Dec 26 21:42:12 2018 +0200 IB/core: Add advise_mr to the list of known ops We need to add advise_mr to the list of operation setters on the ib_device or otherwise callers to ib_set_device_ops() for advise_mr operation will not have their callback registered. When the advise_mr series was merged with the device ops series the SET_DEVICE_OPS() was missed. Fixes: 813e90b1aeaa ("IB/mlx5: Add advise_mr() support") Signed-off-by: Moni Shoua Reviewed-by: Majd Dibbiny Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit ccffa545485714dcb001c78ffaa575a8192ed5e4 Author: Leon Romanovsky Date: Wed Dec 26 15:22:12 2018 +0200 Revert "IB/mlx5: Fix long EEH recover time with NVMe offloads" Longer term testing shows this patch didn't play well with MR cache and caused to call traces during remove_mkeys(). This reverts commit bb7e22a8ab00ff9ba911a45ba8784cef9e6d6f7a. Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 7422edce73559d2985f322145c865cea2da3c152 Author: Yishai Hadas Date: Sun Dec 23 13:12:21 2018 +0200 IB/mlx5: Allow XRC INI usage via verbs in DEVX context From device point of view both XRC target and initiator are XRC transport type. Fix to use the expected UID as was handled for the XRC target case to allow its usage via verbs in DEVX context. Fixes: 5aa3771ded54 ("IB/mlx5: Allow XRC usage via verbs in DEVX context") Signed-off-by: Yishai Hadas Reviewed-by: Artemy Kovalyov Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e6587cdbd732eacb4c7ce592ed46f7bbcefb655f Author: Stefano Stabellini Date: Fri Dec 21 15:06:33 2018 -0800 pvcalls-back: set -ENOTCONN in pvcalls_conn_back_read When a connection is closing we receive on pvcalls_sk_state_change notification. Instead of setting the connection as closed immediately (-ENOTCONN), let's read one more time from it: pvcalls_conn_back_read will set the connection as closed when necessary. That way, we avoid races between pvcalls_sk_state_change and pvcalls_back_ioworker. Signed-off-by: Stefano Stabellini Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit d90a1ca60a1eccb4383fe203c76223ab4c0799ed Author: Stefano Stabellini Date: Fri Dec 21 15:06:32 2018 -0800 pvcalls-front: don't return error when the ring is full When the ring is full, size == array_size. It is not an error condition, so simply return 0 instead of an error. Signed-off-by: Stefano Stabellini Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit beee1fbe8f7d57d6ebaa5188f9f4db89c2077196 Author: Stefano Stabellini Date: Fri Dec 21 15:06:31 2018 -0800 pvcalls-front: properly allocate sk Don't use kzalloc: it ends up leaving sk->sk_prot not properly initialized. Use sk_alloc instead and define our own trivial struct proto. Signed-off-by: Stefano Stabellini Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit 96283f9a084e23d7cda2d3c5d1ffa6df6cf1ecec Author: Stefano Stabellini Date: Fri Dec 21 15:06:30 2018 -0800 pvcalls-front: don't try to free unallocated rings inflight_req_id is 0 when initialized. If inflight_req_id is 0, there is no accept_map to free. Fix the check in pvcalls_front_release. Signed-off-by: Stefano Stabellini Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit b79470b64fa9266948d1ce8d825ced94c4f63293 Author: Stefano Stabellini Date: Fri Dec 21 15:06:29 2018 -0800 pvcalls-front: read all data before closing the connection When a connection is closing in_error is set to ENOTCONN. There could still be outstanding data on the ring left by the backend. Before closing the connection on the frontend side, drain the ring. Signed-off-by: Stefano Stabellini Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit f50fd2d8524c15b08da9e7e9d84752f0f1be7172 Author: Guo Ren Date: Wed Jan 2 22:09:25 2019 +0800 csky: Add perf support for C-SKY This adds basic perf support for all C-SKY CPUs. Hardware events are only supported by 807/810/860. Signed-off-by: Guo Ren commit b25756df5b28cd7b6e91200fc5012e7c76e8ec69 Author: Adrian Hunter Date: Fri Dec 21 14:06:20 2018 +0200 perf session: Add comment for perf_session__register_idle_thread() Add a comment to perf_session__register_idle_thread() to bring attention to a pitfall with the idle task thread structure. The pitfall is that there should really be a 'struct thread' for the idle task of each cpu, but there is only one that can have pid == tid == 0. Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Link: http://lkml.kernel.org/r/20181221120620.9659-9-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 256d92bc93fd40411a02be5cdba74a7bf91e6e09 Author: Adrian Hunter Date: Fri Dec 21 14:06:19 2018 +0200 perf thread-stack: Fix thread stack processing for the idle task perf creates a single 'struct thread' to represent the idle task. That is because threads are identified by PID and TID, and the idle task always has PID == TID == 0. However, there are actually separate idle tasks for each CPU. That creates a problem for thread stack processing which assumes that each thread has a single stack, not one stack per CPU. Fix that by passing through the CPU number, and in the case of the idle "thread", pick the thread stack from an array based on the CPU number. Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Link: http://lkml.kernel.org/r/20181221120620.9659-8-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 139f42f3b3b495e61bb2cfef40e1dd5e845e3052 Author: Adrian Hunter Date: Fri Dec 21 14:06:18 2018 +0200 perf thread-stack: Allocate an array of thread stacks In preparation for fixing thread stack processing for the idle task, allocate an array of thread stacks. Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Link: http://lkml.kernel.org/r/20181221120620.9659-7-adrian.hunter@intel.com [ No need to check for NULL when calling zfree(), noticed by Jiri Olsa ] Signed-off-by: Arnaldo Carvalho de Melo commit 2e9e8688763ff80f032d9a78c3b4b951fb6dd7a4 Author: Adrian Hunter Date: Fri Dec 21 14:06:17 2018 +0200 perf thread-stack: Factor out thread_stack__init() In preparation for fixing thread stack processing for the idle task, factor out thread_stack__init(). Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Link: http://lkml.kernel.org/r/20181221120620.9659-6-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit f6060ac60190c625101a0b94c2d96e9ca14a7d73 Author: Adrian Hunter Date: Fri Dec 21 14:06:16 2018 +0200 perf thread-stack: Allow for a thread stack array In preparation for fixing thread stack processing for the idle task, allow for a thread stack array. Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Link: http://lkml.kernel.org/r/20181221120620.9659-5-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit bd8e68ace110941f375f5d566b0cd99fe80634b8 Author: Adrian Hunter Date: Fri Dec 21 14:06:15 2018 +0200 perf thread-stack: Avoid direct reference to the thread's stack In preparation for fixing thread stack processing for the idle task, avoid direct reference to the thread's stack. The thread stack will change to an array of thread stacks, at which point the meaning of the direct reference will change. Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Link: http://lkml.kernel.org/r/20181221120620.9659-4-adrian.hunter@intel.com [ Rename thread_stack__ts() to thread__stack() since this operates on a 'thread' struct ] Signed-off-by: Arnaldo Carvalho de Melo commit e0b8951190c11797971864c845e0909561525621 Author: Adrian Hunter Date: Fri Dec 21 14:06:14 2018 +0200 perf thread-stack: Tidy thread_stack__bottom() usage In preparation for fixing thread stack processing for the idle task, tidy thread_stack__bottom() usage. Specifically, the parameter 'thread' is not needed. Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Link: http://lkml.kernel.org/r/20181221120620.9659-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 03b32cb2810814756095dbd91fce0c77617d096b Author: Adrian Hunter Date: Fri Dec 21 14:06:13 2018 +0200 perf thread-stack: Simplify some code in thread_stack__process() In preparation for fixing thread stack processing for the idle task, simplify some code in thread_stack__process(). Signed-off-by: Adrian Hunter Acked-by: Jiri Olsa Link: http://lkml.kernel.org/r/20181221120620.9659-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 9d216211fded20fff301d0317af3238d8383634c Author: Bjorn Andersson Date: Sun Dec 23 23:26:44 2018 -0800 thermal: generic-adc: Fix adc to temp interpolation First correct the edge case to return the last element if we're outside the range, rather than at the last element, so that interpolation is not omitted for points between the two last entries in the table. Then correct the formula to perform linear interpolation based the two points surrounding the read ADC value. The indices for temp are kept as "hi" and "lo" to pair with the adc indices, but there's no requirement that the temperature is provided in descendent order. mult_frac() is used to prevent issues with overflowing the int. Cc: Laxman Dewangan Signed-off-by: Bjorn Andersson Signed-off-by: Eduardo Valentin commit e36e13003efd8b0160d49138385b0cec570900aa Author: Yoshihiro Kaneko Date: Mon Dec 17 23:50:21 2018 +0900 thermal: rcar_thermal: add R8A77990 support Add support for R-Car E3 (R8A77990) thermal support. Signed-off-by: Yoshihiro Kaneko Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Eduardo Valentin commit 6471a52deeea8bba8163a1f8c7aa309d4e287eb1 Author: Yoshihiro Kaneko Date: Mon Dec 17 23:50:20 2018 +0900 dt-bindings: thermal: rcar-thermal: add R8A77990 support Document the R-Car E3 (R8A77990) SoC bindings. Signed-off-by: Yoshihiro Kaneko Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Tested-by: Simon Horman Signed-off-by: Eduardo Valentin commit b8d3d11203afddf9e6c4e8b8ccecd401b6a8cc3e Author: Fabrizio Castro Date: Thu Dec 13 20:23:10 2018 +0000 thermal: rcar_thermal: add R8A774C0 support Add thermal support for the RZ/G2E SoC (a.k.a. R8A774C0). Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Eduardo Valentin commit 69f8f55185ff2405366b1b193d3d2fea16589e54 Author: Fabrizio Castro Date: Thu Dec 13 20:19:48 2018 +0000 dt-bindings: thermal: rcar-thermal: add R8A774C0 support Document RZ/G2E SoC (a.k.a. r8a774c0) bindings. Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Signed-off-by: Eduardo Valentin commit bf9ff83f93baf4f404b7e3a90037604f86bea854 Author: Miquel Raynal Date: Wed Dec 12 10:36:43 2018 +0100 dt-bindings: cp110: document the thermal interrupt capabilities The thermal IP can produce interrupts on overheat situation. Describe them. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring Signed-off-by: Eduardo Valentin commit 1bc7523817215f94d8597f4daccb17a394a5703a Author: Miquel Raynal Date: Wed Dec 12 10:36:42 2018 +0100 dt-bindings: ap806: document the thermal interrupt capabilities The thermal IP can produce interrupts on overheat situation. Describe them. Signed-off-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit ad3e72030bff0cbd4409074374a2a0f37ca1e20d Author: Miquel Raynal Date: Wed Dec 12 10:36:41 2018 +0100 MAINTAINERS: thermal: add entry for Marvell MVEBU thermal driver Add myself as Marvell MVEBU thermal driver maintainer. Signed-off-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit 879d7362d1d01efd476a143c09048f5945936c32 Author: Miquel Raynal Date: Wed Dec 12 10:36:40 2018 +0100 thermal: armada: add overheat interrupt support The IP can manage to trigger interrupts on overheat situation from all the sensors. However, the interrupt source changes along with the last selected source (ie. the last read sensor), which is an inconsistent behavior. Avoid possible glitches by always selecting back only one channel which will then be referenced as the "overheat_sensor" (arbitrarily: the first in the DT which has a critical trip point filled in). It is possible that the scan of all thermal zone nodes did not bring a critical trip point from which the overheat interrupt could be configured. In this case just complain but do not fail the probe. Also disable sensor switch during overheat situations because changing the channel while the system is too hot could clear the overheat state by changing the source while the temperature is still very high. Even if the overheat state is not declared, overheat interrupt must be cleared by reading the DFX interrupt cause _after_ the temperature has fallen down to the low threshold, otherwise future possible interrupts would not be served. A work polls the corresponding register until the overheat flag gets cleared in this case. Suggested-by: David Sniatkiwicz Signed-off-by: Miquel Raynal Signed-off-by: Eduardo Valentin commit 5a78ad6d9c1b2c3c3226528346e9794ed3504381 Author: Arnd Bergmann Date: Mon Dec 10 22:57:27 2018 +0100 thermal: st: fix Makefile typo When STM32_THERMAL is enabled, this overrides all previously enabled files in the same directory, as seen from this link failure: ERROR: "st_thermal_pm_ops" [drivers/thermal/st/st_thermal_syscfg.ko] undefined! ERROR: "st_thermal_register" [drivers/thermal/st/st_thermal_syscfg.ko] undefined! ERROR: "st_thermal_unregister" [drivers/thermal/st/st_thermal_syscfg.ko] undefined! The correct syntax in Makefile requires using += instead of :=. Fixes: 1d6931556073 ("thermal: add stm32 thermal driver") Signed-off-by: Arnd Bergmann Reviewed-by: Daniel Lezcano Signed-off-by: Eduardo Valentin commit ca74472dead17ad8e5de92c054d71109ef8a4beb Author: Kunihiko Hayashi Date: Fri Dec 7 10:06:04 2018 +0900 thermal: uniphier: Convert to SPDX identifier This converts license boilerplate to SPDX identifier, and removes unnecessary lines. Signed-off-by: Kunihiko Hayashi Reviewed-by: Daniel Lezcano Signed-off-by: Eduardo Valentin commit 8632ed49c809160be3820cede35a7d0844c62c67 Author: Yangtao Li Date: Fri Nov 23 09:55:22 2018 -0500 thermal/intel_powerclamp: Change to use DEFINE_SHOW_ATTRIBUTE macro Use macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Eduardo Valentin commit 05c1b7058aeab8a121e9af57ef97233f83ebeb75 Author: Yangtao Li Date: Fri Nov 23 09:50:58 2018 -0500 thermal: tegra: soctherm: Change to use DEFINE_SHOW_ATTRIBUTE macro Use macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Eduardo Valentin commit 199bc54b4a1f3848a62ccb1fa22e9c43c352b8fa Author: Thierry Reding Date: Fri Nov 23 13:18:37 2018 +0100 dt-bindings: thermal: tegra-bpmp: Add Tegra194 support The thermal controller implementation on Tegra194 is very similar to the implementation on Tegra186. Add a compatible string for the new generation. Signed-off-by: Thierry Reding Signed-off-by: Eduardo Valentin commit 925b38361852ef314e9ecc649e830ad5319e3a65 Author: Anson Huang Date: Wed Nov 21 05:49:40 2018 +0000 thermal: imx: save one condition block for normal case of nvmem initialization Put return value checks of calling imx_init_from_nvmem_cells() into one block to save one condition block for normal case. Signed-off-by: Anson Huang Acked-by: Viresh Kumar Reviewed-by: Daniel Lezcano Signed-off-by: Eduardo Valentin commit c589c56671c914fbd6b56a6f92dce80edbbfdada Author: Anson Huang Date: Wed Nov 21 05:49:36 2018 +0000 thermal: imx: fix for dependency on cpu-freq The thermal driver is a standalone driver for monitoring SoC temperature by enabling thermal sensor, so it can be enabled even when CONFIG_CPU_FREQ is NOT set. So remove the dependency with CPU_THERMAL. Introduce dummy function of legacy cooling register/unregister to make thermal driver probe successfully when CONFIG_CPU_FREQ is NOT set. Signed-off-by: Anson Huang Acked-by: Viresh Kumar Reviewed-by: Daniel Lezcano Signed-off-by: Eduardo Valentin commit 4ab248b3b10a58e379e2d32333fff99ea5ca256c Author: Srinivas Kandagatla Date: Thu Nov 15 17:43:30 2018 +0000 thermal: tsens: qcom: do not create duplicate regmap debugfs entries Regmap would use device name to create debugfs entries. If the device has multiple regmaps it is recommended to use name field in regmap_config. Fix this by providing name to the regmap configs correctly. Without this patch we would see below error on DB820c. qcom-tsens 4a9000.thermal-sensor: Failed to create 4a9000.thermal-sensor debugfs directory Signed-off-by: Srinivas Kandagatla Acked-by: Amit Kucheria Tested-by: Amit Kucheria Signed-off-by: Eduardo Valentin commit ac31f6e25d4e9e9dfda9c0621242036b291b7754 Author: YueHaibing Date: Tue Nov 13 14:13:45 2018 +0000 thermal: armada: Use PTR_ERR_OR_ZERO in armada_thermal_probe_legacy() Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Signed-off-by: YueHaibing Reviewed-by: Daniel Lezcano Signed-off-by: Eduardo Valentin commit 24f1c13fa5f1599c373c53783f74de8a639f7999 Author: Geert Uytterhoeven Date: Wed Nov 7 14:35:00 2018 +0100 dt-bindings: thermal: rcar-gen3-thermal: All variants use 3 interrupts RZ/G2M also has 3 interrupts routed to the TSC, but the list was not updated to reflect this. Just drop the list, as this is the case for this TSC variant in all R-Car Gen3 and RZ/G2 SoCs. Fixes: be6af481f3b2d508 ("dt-bindings: thermal: rcar-gen3-thermal: Add r8a774a1 support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Fabrizio Castro Reviewed-by: Simon Horman Signed-off-by: Eduardo Valentin commit adad7c7d6a0ce3e9308fc6596865cdf570b5c466 Author: Julia Lawall Date: Tue Oct 30 17:08:51 2018 +0100 thermal: broadcom: use devm_thermal_zone_of_sensor_register Using devm_thermal_zone_of_sensor_register allows to simplify some error handling code, drop a label, and drop the remove function. Signed-off-by: Julia Lawall Reviewed-by: Daniel Lezcano Signed-off-by: Eduardo Valentin commit d56c19d07e0bc3ceff366a49b7d7a2440c967b1b Author: Matthias Brugger Date: Sun Oct 21 23:58:48 2018 +0200 thermal: bcm2835: enable hwmon explicitly By defaul of-based thermal driver do not enable hwmon. This patch does this explicitly, so that the temperature can be read through the common hwmon sysfs. Signed-off-by: Matthias Brugger Acked-by: Stefan Wahren Signed-off-by: Eduardo Valentin commit 03334ba8b425b2ad275c8f390cf83c7b081c3095 Author: Eduardo Valentin Date: Wed Jan 2 00:34:03 2019 +0000 thermal: hwmon: inline helpers when CONFIG_THERMAL_HWMON is not set Avoid warnings like this: thermal_hwmon.h:29:1: warning: ‘thermal_remove_hwmon_sysfs’ defined but not used [-Wunused-function] thermal_remove_hwmon_sysfs(struct thermal_zone_device *tz) Fixes: 0dd88793aacd ("thermal: hwmon: move hwmon support to single file") Reviewed-by: Geert Uytterhoeven Signed-off-by: Eduardo Valentin commit 7d7b467cb95bf29597b417d4990160d4ea6d69b9 Author: Hans de Goede Date: Sun Dec 30 18:25:00 2018 +0100 ACPI: power: Skip duplicate power resource references in _PRx Some ACPI tables contain duplicate power resource references like this: Name (_PR0, Package (0x04) // _PR0: Power Resources for D0 { P28P, P18P, P18P, CLK4 }) This causes a WARN_ON in sysfs_add_link_to_group() because we end up adding a link to the same acpi_device twice: sysfs: cannot create duplicate filename '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/808622C1:00/OVTI2680:00/power_resources_D0/LNXPOWER:0a' CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.12-301.fc29.x86_64 #1 Hardware name: Insyde CherryTrail/Type2 - Board Product Name, BIOS jumperx.T87.KFBNEEA02 04/13/2016 Call Trace: dump_stack+0x5c/0x80 sysfs_warn_dup.cold.3+0x17/0x2a sysfs_do_create_link_sd.isra.2+0xa9/0xb0 sysfs_add_link_to_group+0x30/0x50 acpi_power_expose_list+0x74/0xa0 acpi_power_add_remove_device+0x50/0xa0 acpi_add_single_object+0x26b/0x5f0 acpi_bus_check_add+0xc4/0x250 ... To address this issue, make acpi_extract_power_resources() check for duplicates and simply skip them when found. Cc: All applicable Signed-off-by: Hans de Goede [ rjw: Subject & changelog, comments ] Signed-off-by: Rafael J. Wysocki commit 97b6f89f7269b746b68e7985c16d2354c688d29a Merge: 344eb5539abf3 039bc3b7f29f7 d6951f582cc50 Author: Russell King Date: Wed Jan 2 10:37:05 2019 +0000 Merge branches 'misc', 'sa1100-for-next' and 'spectre' into for-linus commit 2e61069b056f7ac3cde5f84a4be8aa703b57089d Author: Sinan Kaya Date: Sun Dec 30 20:40:05 2018 +0000 ACPI: Fix build failure when CONFIG_NLS is set to 'n' Observing link failure as follows when CONFIG_ACPI is set but both CONFIG_NLS and CONFIG_PCI are no set: drivers/acpi/device_sysfs.o: In function `description_show': device_sysfs.c:(.text+0x48a): undefined reference to `utf16s_to_utf8s' This issue was previously addressed implicitly by commit 8a226e00eeed (PCI: pci-label: Fix build failure when CONFIG_NLS is set to 'm' by allmodconfig) causing PCI_LABEL to be selected when ACPI was set which caused NLS to be selected too in that case. However, after commit 5d32a66541c46 (PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set) it is possible to build ACPI support without PCI, so make ACPI select NLS directly to cover that case. Fixes: 5d32a66541c46 (PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set) Signed-off-by: Sinan Kaya [ rjw: Changelog ] Signed-off-by: Rafael J. Wysocki commit 75cb8d20c112aba70f23d98e3f8d0a38ace16006 Author: Richard Zhu Date: Fri Dec 21 04:33:38 2018 +0000 PCI: imx: Enable MSI from downstream components The MSI Enable bit in the MSI Capability (PCIe r4.0, sec 7.7.1.2) controls whether a Function can request service using MSI. i.MX6 Root Ports implement the MSI Capability and may use MSI to request service for events like PME, hotplug, AER, etc. In addition, on i.MX6, the MSI Enable bit controls delivery of MSI interrupts from components below the Root Port. Prior to f3fdfc4ac3a2 ("PCI: Remove host driver Kconfig selection of CONFIG_PCIEPORTBUS"), enabling CONFIG_PCI_IMX6 automatically also enabled CONFIG_PCIEPORTBUS, and when portdrv claimed the Root Ports, it set the MSI Enable bit so it could use PME, hotplug, AER, etc. As a side effect, that also enabled delivery of MSI interrupts from downstream components. The imx6q-pcie driver itself does not depend on portdrv, so set MSI Enable in imx6q-pcie so MSI from downstream components works even if nobody uses MSI for the Root Port events. Fixes: f3fdfc4ac3a2 ("PCI: Remove host driver Kconfig selection of CONFIG_PCIEPORTBUS") Signed-off-by: Richard Zhu Signed-off-by: Bjorn Helgaas Tested-by: Sven Van Asbroeck Tested-by: Trent Piepho Reviewed-by: Lucas Stach Acked-by: Lorenzo Pieralisi commit 7dc20ab1b9c431b792a6fe1e78baf36b63edc5e3 Author: Sebastian Ott Date: Fri Dec 21 15:14:20 2018 +0100 s390/pci: skip VF scanning Set the flag to skip scanning for VFs after SR-IOV enablement. VF creation will be triggered by the hotplug code. Signed-off-by: Sebastian Ott Signed-off-by: Bjorn Helgaas Reviewed-by: Christoph Hellwig commit aff68a5a621e2569d126b817d0d42f658df524bf Author: Sebastian Ott Date: Fri Dec 21 15:14:19 2018 +0100 PCI/IOV: Add flag so platforms can skip VF scanning Provide a flag to skip scanning for new VFs after SR-IOV enablement. This can be set by implementations for which the VFs are already reported by other means. Signed-off-by: Sebastian Ott Signed-off-by: Bjorn Helgaas Reviewed-by: Christoph Hellwig commit 18f9e9d150fccfa747875df6f0a9f606740762b3 Author: Sebastian Ott Date: Fri Dec 21 15:14:18 2018 +0100 PCI/IOV: Factor out sriov_add_vfs() Provide sriov_add_vfs() as a wrapper to scan for VFs that cleans up after itself. This is just a code simplification. No functional change. Signed-off-by: Sebastian Ott Signed-off-by: Bjorn Helgaas Reviewed-by: Christoph Hellwig commit 8e143b90e4d45cca3dc53760d3cfab988bc74571 Merge: 78e8696c234ab 03ebe48e235f1 Author: Linus Torvalds Date: Tue Jan 1 15:55:29 2019 -0800 Merge tag 'iommu-updates-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull IOMMU updates from Joerg Roedel: - Page table code for AMD IOMMU now supports large pages where smaller page-sizes were mapped before. VFIO had to work around that in the past and I included a patch to remove it (acked by Alex Williamson) - Patches to unmodularize a couple of IOMMU drivers that would never work as modules anyway. - Work to unify the the iommu-related pointers in 'struct device' into one pointer. This work is not finished yet, but will probably be in the next cycle. - NUMA aware allocation in iommu-dma code - Support for r8a774a1 and r8a774c0 in the Renesas IOMMU driver - Scalable mode support for the Intel VT-d driver - PM runtime improvements for the ARM-SMMU driver - Support for the QCOM-SMMUv2 IOMMU hardware from Qualcom - Various smaller fixes and improvements * tag 'iommu-updates-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (78 commits) iommu: Check for iommu_ops == NULL in iommu_probe_device() ACPI/IORT: Don't call iommu_ops->add_device directly iommu/of: Don't call iommu_ops->add_device directly iommu: Consolitate ->add/remove_device() calls iommu/sysfs: Rename iommu_release_device() dmaengine: sh: rcar-dmac: Use device_iommu_mapped() xhci: Use device_iommu_mapped() powerpc/iommu: Use device_iommu_mapped() ACPI/IORT: Use device_iommu_mapped() iommu/of: Use device_iommu_mapped() driver core: Introduce device_iommu_mapped() function iommu/tegra: Use helper functions to access dev->iommu_fwspec iommu/qcom: Use helper functions to access dev->iommu_fwspec iommu/of: Use helper functions to access dev->iommu_fwspec iommu/mediatek: Use helper functions to access dev->iommu_fwspec iommu/ipmmu-vmsa: Use helper functions to access dev->iommu_fwspec iommu/dma: Use helper functions to access dev->iommu_fwspec iommu/arm-smmu: Use helper functions to access dev->iommu_fwspec ACPI/IORT: Use helper functions to access dev->iommu_fwspec iommu: Introduce wrappers around dev->iommu_fwspec ... commit 78e8696c234ab637c4dd516cabeac344d84ec10b Merge: fcf010449ebe1 660611827c03a Author: Linus Torvalds Date: Tue Jan 1 15:45:48 2019 -0800 Merge tag 'dmaengine-4.21-rc1' of git://git.infradead.org/users/vkoul/slave-dma Pull dmaengine updates from Vinod Koul: "This includes a new driver, removes R-Mobile APE6 as it is no longer used, sprd cyclic dma support, last batch of dma_slave_config direction removal and random updates to bunch of drivers. Summary: - New driver for UniPhier MIO DMA controller - Remove R-Mobile APE6 support - Sprd driver updates and support for cyclic link-list - Remove dma_slave_config direction usage from rest of drivers - Minor updates to dmatest, dw-dmac, zynqmp and bcm dma drivers" * tag 'dmaengine-4.21-rc1' of git://git.infradead.org/users/vkoul/slave-dma: (48 commits) dmaengine: qcom_hidma: convert to DEFINE_SHOW_ATTRIBUTE dmaengine: pxa: remove DBGFS_FUNC_DECL() dmaengine: mic_x100_dma: convert to DEFINE_SHOW_ATTRIBUTE dmaengine: amba-pl08x: convert to DEFINE_SHOW_ATTRIBUTE dmaengine: Documentation: Add documentation for multi chan testing dmaengine: dmatest: Add transfer_size parameter dmaengine: dmatest: Add alignment parameter dmaengine: dmatest: Use fixed point div to calculate iops dmaengine: dmatest: Add support for multi channel testing dmaengine: rcar-dmac: Document R8A774C0 bindings dt-bindings: dmaengine: usb-dmac: Add binding for r8a774c0 dmaengine: zynqmp_dma: replace spin_lock_bh with spin_lock_irqsave dmaengine: sprd: Add me as one of the module authors dmaengine: sprd: Support DMA 2-stage transfer mode dmaengine: sprd: Support DMA link-list cyclic callback dmaengine: sprd: Set cur_desc as NULL when free or terminate one dma channel dmaengine: sprd: Fix the last link-list configuration dmaengine: sprd: Get transfer residue depending on the transfer direction dmaengine: sprd: Remove direction usage from struct dma_slave_config dmaengine: dmatest: fix a small memory leak in dmatest_func() ... commit fcf010449ebe1db0cb68b2c6410972a782f2bd14 Merge: fbea8c7c79339 cc0282975b3f8 Author: Linus Torvalds Date: Tue Jan 1 15:38:14 2019 -0800 Merge tag 'kgdb-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux Pull kgdb updates from Daniel Thompson: "Mostly clean ups although while Doug's was chasing down a odd lockdep warning he also did some work to improved debugger resilience when some CPUs fail to respond to the round up request. The main changes are: - Fixing a lockdep warning on architectures that cannot use an NMI for the round up plus related changes to make CPU round up and all CPU backtrace more resilient. - Constify the arch ops tables - A couple of other small clean ups Two of the three patchsets here include changes that spill over into arch/. Changes in the arch space are relatively narrow in scope (and directly related to kgdb). Didn't get comprehensive acks but all impacted maintainers were Cc:ed in good time" * tag 'kgdb-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/danielt/linux: kgdb/treewide: constify struct kgdb_arch arch_kgdb_ops mips/kgdb: prepare arch_kgdb_ops for constness kdb: use bool for binary state indicators kdb: Don't back trace on a cpu that didn't round up kgdb: Don't round up a CPU that failed rounding up before kgdb: Fix kgdb_roundup_cpus() for arches who used smp_call_function() kgdb: Remove irq flags from roundup commit fbea8c7c793397cdf4ba53a32f99b656467b7c7f Merge: 28e8c4bc8eb48 57ce8ba0fd3a9 Author: Linus Torvalds Date: Tue Jan 1 15:35:55 2019 -0800 Merge tag 'for-linus' of git://github.com/openrisc/linux Pull OpenRISC update from Stafford Horne: "Just one change for 4.21: Update comments for name change or32 -> or1k from Geert Uytterhoeven" * tag 'for-linus' of git://github.com/openrisc/linux: openrisc: Fix broken paths to arch/or32 commit 28e8c4bc8eb483c22d977e147a0b98fc63efadf7 Merge: c9bef4a651769 36e14f5fdfdf7 Author: Linus Torvalds Date: Tue Jan 1 13:24:31 2019 -0800 Merge tag 'rtc-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "Subsystem: - new %ptR printk format - rename core files - allow registration of multiple nvmem devices New driver: - i.MX system controller RTC Driver updates: - abx80x: handle voltage ioctls, correct binding doc - m41t80: correct month in alarm reads - pcf85363: add pcf85263 support - pcf8523: properly handle battery low flag - s3c: limit alarm to one year in the future as ALMYEAR is broken - sun6i: rework clock output binding" * tag 'rtc-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (54 commits) rtc: rename core files rtc: nvmem: fix possible use after free rtc: add i.MX system controller RTC support dt-bindings: fsl: scu: add rtc binding rtc: pcf2123: Add Microcrystal rv2123 rtc: class: reimplement devm_rtc_device_register rtc: enforce rtc_timer_init private_data type rtc: abx80x: Implement RTC_VL_READ,CLR ioctls rtc: pcf85363: Add support for NXP pcf85263 rtc dt-bindings: rtc: pcf85363: Document pcf85263 real-time clock rtc: pcf8523: don't return invalid date when battery is low dt-bindings: rtc: use a generic node name for ds1307 PM: Switch to use %ptR m68k/mac: Switch to use %ptR Input: hp_sdc_rtc - Switch to use %ptR rtc: tegra: Switch to use %ptR rtc: s5m: Switch to use %ptR rtc: s3c: Switch to use %ptR rtc: rx8025: Switch to use %ptR rtc: rx6110: Switch to use %ptR ... commit c9bef4a651769927445900564781a9c99fdf6258 Merge: 115502a6f31d8 88cc9fc41c731 Author: Linus Torvalds Date: Tue Jan 1 13:19:16 2019 -0800 Merge tag 'pinctrl-v4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control updates from Linus Walleij: "We have no core changes but lots of incremental development in drivers all over the place: Renesas, NXP, Mediatek and Actions Semiconductor keep churning out new SoCs. I have some subtree maintainers for Renesas and Intel helping out to keep down the load, it's been working smoothly (Samsung also have a subtree but it was not used this cycle.) New drivers: - NXP (ex Freescale) i.MX 8 QXP SoC driver. - Mediatek MT6797 SoC driver. - Mediatek MT7629 SoC driver. - Actions Semiconductor S700 SoC driver. - Renesas RZ/A2 SoC driver. - Allwinner sunxi suniv F1C100 SoC driver. - Qualcomm PMS405 PMIC driver. - Microsemi Ocelot Jaguar2 SoC driver. Improvements: - Some RT improvements (using raw spinlocks where appropriate). - A lot of new pin sets on the Renesas PFC pin controllers. - GPIO hogs now work on the Qualcomm SPMI/SSBI pin controller GPIO chips, and Xway. - Major modernization of the Intel pin control drivers. - STM32 pin control driver will now synchronize usage of pins with another CPU using a hardware spinlock" * tag 'pinctrl-v4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (145 commits) dt-bindings: arm: fsl-scu: add imx8qm pinctrl support pinctrl: freescale: Break dependency on SOC_IMX8MQ for i.MX8MQ pinctrl: imx-scu: Depend on IMX_SCU pinctrl: ocelot: Add dependency on HAS_IOMEM pinctrl: ocelot: add MSCC Jaguar2 support pinctrl: bcm: ns: support updated DT binding as syscon subnode dt-bindings: pinctrl: bcm4708-pinmux: rework binding to use syscon MAINTAINERS: merge at91 pinctrl entries pinctrl: imx8qxp: break the dependency on SOC_IMX8QXP pinctrl: uniphier: constify uniphier_pinctrl_socdata pinctrl: mediatek: improve Kconfig dependencies pinctrl: msm: mark PM functions as __maybe_unused dt-bindings: pinctrl: sunxi: Add supply properties pinctrl: meson: meson8b: add the missing GPIO_GROUPs for BOOT and CARD pinctrl: meson: meson8: add the missing GPIO_GROUPs for BOOT and CARD pinctrl: meson: meson8: rename the "gpio" function to "gpio_periphs" pinctrl: meson: meson8: rename the "gpio" function to "gpio_periphs" pinctrl: meson: meson8b: fix the GPIO function for the GPIOAO pins pinctrl: meson: meson8: fix the GPIO function for the GPIOAO pins pinctrl: sh-pfc: Make pinmux_cfg_reg.var_field_width[] variable-length ... commit 115502a6f31d84d8172a71283aaea266302a8ad5 Merge: 57b0e31453209 e3c21e088f893 Author: Linus Torvalds Date: Tue Jan 1 13:16:45 2019 -0800 Merge tag 'linux-watchdog-4.21-rc1' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog updates from Wim Van Sebroeck: - add TQ-Systems TQMX86 watchdog driver - add Qualcomm PM8916 watchdog driver - w83627hf_wdt: add quirk for Inves system - renesas_wdt: several improvements and document r8a774c0 support - mena21_wdt, mtx-1: Convert to use GPIO descriptor - bcm281xx, ie6xx_wdt: convert to DEFINE_SHOW_ATTRIBUTE - documentation: add PM usage and kernel-api: don't reference removed functions - update bindings for MT7629 SoC - several small fixes * tag 'linux-watchdog-4.21-rc1' of git://www.linux-watchdog.org/linux-watchdog: (22 commits) watchdog: tqmx86: Add watchdog driver for the IO controller dt-bindings: watchdog: renesas-wdt: Document r8a774c0 support watchdog: docs: kernel-api: don't reference removed functions watchdog: add documentation for PM usage watchdog: mtx-1: Convert to use GPIO descriptor watchdog: mena21_wdt: Convert to GPIO descriptors dt-bindings: watchdog: Add Qualcomm PM8916 watchdog watchdog: Add pm8916 watchdog driver dt-bindings: watchdog: update bindings for MT7629 SoC watchdog: renesas_wdt: don't keep timer value during suspend/resume watchdog: ie6xx_wdt: convert to DEFINE_SHOW_ATTRIBUTE watchdog: bcm281xx: convert to DEFINE_SHOW_ATTRIBUTE watchdog: asm9260_wdt: make array mode_name static, shrinks object size watchdog/hpwdt: Update driver version. watchdog/hpwdt: Do not claim unsupported hardware watchdog/hpwdt: Exclude via blacklist Watchdog: remove outdated comment watchdog: w83627hf_wdt: Add quirk for Inves system watchdog: cpwd: add of_node_put() watchdog: renesas_wdt: don't set divider while watchdog is running ... commit 57b0e31453209d746c99e513d80b3d0c44a80891 Author: Eric Biggers Date: Sat Nov 3 10:30:35 2018 -0700 KEYS: fix parsing invalid pkey info string We need to check the return value of match_token() for Opt_err before doing anything with it. [ Not only did the old "-1" value for Opt_err cause problems for the __test_and_set_bit(), as fixed in commit 94c13f66e13c ("security: don't use a negative Opt_err token index"), but accessing "args[0].from" is invalid for the Opt_err case, as pointed out by Eric later. - Linus ] Reported-by: syzbot+a22e0dc07567662c50bc@syzkaller.appspotmail.com Fixes: 00d60fd3b932 ("KEYS: Provide keyctls to drive the new key type ops for asymmetric keys [ver #2]") Signed-off-by: Eric Biggers Cc: stable@kernel.org # 4.20 Signed-off-by: Linus Torvalds commit e888402789b9db5de4fcda361331d66dbf0cd9fd Author: Huazhong Tan Date: Mon Dec 31 10:58:29 2018 +0800 net: hns3: call hns3_nic_net_open() while doing HNAE3_UP_CLIENT For HNAE3_DOWN_CLIENT calling hns3_nic_net_stop(), HNAE3_UP_CLIENT should call hns3_nic_net_open(), since if the number of queue or the map of TC has is changed before HHAE3_UP_CLIENT is called, it will cause problem. Also the HNS3_NIC_STATE_RESETTING flag needs to be cleared before hns3_nic_net_open() called, and set it back while hns3_nic_net_open() failed. Fixes: bb6b94a896d4 ("net: hns3: Add reset interface implementation in client") Signed-off-by: Huazhong Tan Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: David S. Miller commit cb9f1b783850b14cbd7f87d061d784a666dfba1f Author: Willem de Bruijn Date: Sun Dec 30 17:24:36 2018 -0500 ip: validate header length on virtual device xmit KMSAN detected read beyond end of buffer in vti and sit devices when passing truncated packets with PF_PACKET. The issue affects additional ip tunnel devices. Extend commit 76c0ddd8c3a6 ("ip6_tunnel: be careful when accessing the inner header") and commit ccfec9e5cb2d ("ip_tunnel: be careful when accessing the inner header"). Move the check to a separate helper and call at the start of each ndo_start_xmit function in net/ipv4 and net/ipv6. Minor changes: - convert dev_kfree_skb to kfree_skb on error path, as dev_kfree_skb calls consume_skb which is not for error paths. - use pskb_network_may_pull even though that is pedantic here, as the same as pskb_may_pull for devices without llheaders. - do not cache ipv6 hdrs if used only once (unsafe across pskb_may_pull, was more relevant to earlier patch) Reported-by: syzbot Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit 8c76e77f9069f10505c08e02646c3ee11ad79038 Author: Willem de Bruijn Date: Sun Dec 30 17:21:05 2018 -0500 tap: call skb_probe_transport_header after setting skb->dev The BPF flow dissector expects either skb->sk or skb->dev set on all skbs. Delay flow dissection until after skb->dev is set. This requires calling from within an rcu read-side critical section. That is fine, see also the call from tun_xdp_one. Fixes: d0e13a1488ad ("flow_dissector: lookup netns by skb->sk if skb->dev is NULL") Reported-by: Christian Borntraeger Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit aff6db454599d62191aabc208930e891748e4322 Author: Cong Wang Date: Sun Dec 30 12:43:42 2018 -0800 ptr_ring: wrap back ->producer in __ptr_ring_swap_queue() __ptr_ring_swap_queue() tries to move pointers from the old ring to the new one, but it forgets to check if ->producer is beyond the new size at the end of the operation. This leads to an out-of-bound access in __ptr_ring_produce() as reported by syzbot. Reported-by: syzbot+8993c0fa96d57c399735@syzkaller.appspotmail.com Fixes: 5d49de532002 ("ptr_ring: resize support") Cc: "Michael S. Tsirkin" Cc: John Fastabend Cc: Jason Wang Signed-off-by: Cong Wang Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit 3e9ad24b0e91c066311a958afbd6210dda8a43eb Author: Takashi Iwai Date: Mon Dec 31 19:02:01 2018 +0100 ALSA: hda - Revert DSP detection on legacy HD-audio driver This essentially reverts the commits c337104b1a16 ("ALSA: HD-Audio: SKL+: abort probe if DSP is present and Skylake driver selected") and d82b51c855a2 ("ALSA: HD-Audio: SKL+: force HDaudio legacy or SKL+ driver selection") for the path of legacy HD-audio controller (snd-hda-intel). The automatic DSP detection and skip of binding with the legacy driver caused regressions on several machines like Dell XPS13. They give the PCI class 0x40380 indicating the availability of DSP while they don't work with ASoC SKL driver (yet). As the support of ASoC driver for such devices isn't available, it's better to revert the whole DSP-detection-and-skip behavior of the legacy driver, so that we can get the old good driver working on such devices. The pci_binding option for ASoC SKL driver is still kept so that it can work without blacklisting. Fixes: c337104b1a16 ("ALSA: HD-Audio: SKL+: abort probe if DSP is present and Skylake driver selected") Reported-by: Linus Torvalds Reported-by: Hans de Goede Reported-by: Azat Khuzhin Cc: Pierre-Louis Bossart Signed-off-by: Takashi Iwai commit 4087d2bc0d9469835f8d19d63a4a56739e5b8c5b Author: Zhu Yanjun Date: Sun Dec 30 23:24:11 2018 +0800 net: rds: remove unnecessary NULL check In kfree, the NULL check is done. Signed-off-by: Zhu Yanjun Signed-off-by: David S. Miller commit 2b96547223e3a036efb51733dbf37a1e4be92068 Author: yupeng Date: Sat Dec 29 21:46:38 2018 -0800 add document for TCP OFO, PAWS and skip ACK counters add document and examples for below counters: TcpExtTCPOFOQueue TcpExtTCPOFODrop TcpExtTCPOFOMerge TcpExtPAWSActive TcpExtPAWSEstab TcpExtTCPACKSkippedSynRecv TcpExtTCPACKSkippedPAWS TcpExtTCPACKSkippedSeq TcpExtTCPACKSkippedFinWait2 TcpExtTCPACKSkippedTimeWait TcpExtTCPACKSkippedChallenge Signed-off-by: yupeng Signed-off-by: David S. Miller commit 3a0ed3e9619738067214871e9cb826fa23b2ddb9 Author: Deepa Dinamani Date: Thu Dec 27 18:55:09 2018 -0800 sock: Make sock->sk_stamp thread-safe Al Viro mentioned (Message-ID <20170626041334.GZ10672@ZenIV.linux.org.uk>) that there is probably a race condition lurking in accesses of sk_stamp on 32-bit machines. sock->sk_stamp is of type ktime_t which is always an s64. On a 32 bit architecture, we might run into situations of unsafe access as the access to the field becomes non atomic. Use seqlocks for synchronization. This allows us to avoid using spinlocks for readers as readers do not need mutual exclusion. Another approach to solve this is to require sk_lock for all modifications of the timestamps. The current approach allows for timestamps to have their own lock: sk_stamp_lock. This allows for the patch to not compete with already existing critical sections, and side effects are limited to the paths in the patch. The addition of the new field maintains the data locality optimizations from commit 9115e8cd2a0c ("net: reorganize struct sock for better data locality") Note that all the instances of the sk_stamp accesses are either through the ioctl or the syscall recvmsg. Signed-off-by: Deepa Dinamani Signed-off-by: David S. Miller commit 8b6b25cf93b73e8e399adc55b0ffb9db32b881e0 Author: Xiaozhou Liu Date: Fri Dec 21 17:35:11 2018 +0800 selftests/bpf: fix error printing in test_devmap() As a simple fix, just print the correct map type. Signed-off-by: Xiaozhou Liu Signed-off-by: Daniel Borkmann commit 63d2a9ec310d8bcc955574220d4631aa55c1a80c Author: Sameer Pujar Date: Wed Dec 26 16:04:49 2018 +0530 ALSA: hda/tegra: clear pending irq handlers Even after disabling interrupts on the module, it could be possible that irq handlers are still running. System hang is seen during suspend path. It was found that, there were pending writes on the HDA bus and clock was disabled by that time. Above mentioned issue is fixed by clearing any pending irq handlers before disabling clocks and returning from hda suspend. Suggested-by: Mohan Kumar Suggested-by: Dara Ramesh Signed-off-by: Sameer Pujar Cc: Signed-off-by: Takashi Iwai commit 82b01149ec94d746867d7f9156c44d775d4d2d67 Author: Jian-Hong Pan Date: Thu Dec 27 16:46:31 2018 +0800 ALSA: hda/realtek: Enable the headset mic auto detection for ASUS laptops The headset mic of ASUS laptops like UX533FD, UX433FN and UX333FA, whose CODEC is Realtek ALC294 has jack auto detection feature. This patch enables the feature. Fixes: 4e051106730d ("ALSA: hda/realtek: Enable audio jacks of ASUS UX533FD with ALC294") Signed-off-by: Daniel Drake Signed-off-by: Jian-Hong Pan Cc: Signed-off-by: Takashi Iwai commit 191ce17876c9367819c4b0a25b503c0f6d9054d8 Author: Theodore Ts'o Date: Mon Dec 31 22:34:31 2018 -0500 ext4: fix special inode number checks in __ext4_iget() The check for special (reserved) inode number checks in __ext4_iget() was broken by commit 8a363970d1dc: ("ext4: avoid declaring fs inconsistent due to invalid file handles"). This was caused by a botched reversal of the sense of the flag now known as EXT4_IGET_SPECIAL (when it was previously named EXT4_IGET_NORMAL). Fix the logic appropriately. Fixes: 8a363970d1dc ("ext4: avoid declaring fs inconsistent...") Signed-off-by: Theodore Ts'o Reported-by: Dan Carpenter Cc: stable@kernel.org commit e1ef035d272ef4dbfdda98e58699698305138856 Merge: b7badd1d7aa61 82c7b351be3fa Author: Linus Torvalds Date: Mon Dec 31 17:40:14 2018 -0800 Merge tag 'armsoc-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC defconfig updates from Olof Johansson: "Most changes here are to enable new drivers and platforms in the various configs that affect them. Most of these have been covered and described in the other branches, we mostly keep defconfig separate to avoid conflicts between SoC/dt/driver updates that they otherwise would be grouped with. One thing worth mentioning here is that OMAP changes from using their own UART driver, to 8250, for the multi_v7_defconfig shared config on 32-bit. This means that the console is now named ttyS* instead of ttyO*. This change was already done for omap2_defconfig a while back, so most users of these configs have either already updated, or can easily follow the same patterns as they did at that time. This makes platform support slightly easier for distros, since they no longer need to keep track of a separate console prefix for these platforms" * tag 'armsoc-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (31 commits) Revert "arm64: defconfig: Enable FSL_MC_BUS and FSL_MC_DPIO" arm64: defconfig: Enable FSL_MC_BUS and FSL_MC_DPIO arm64: defconfig: Replace PINCTRL_MT7622 with PINCTRL_MTK_MOORE arm64: defconfig: Regenerate for v4.20 ARM: multi_v7_defconfig: Add TOSHIBA TC358764 bridge driver ARM: multi_v7_defconfig: Add MAX8952 regulator driver ARM: exynos_defconfig: Add TOSHIBA TC358764 bridge driver ARM: exynos_defconfig: Add MAX8952 regulator driver ARM: exynos_defconfig: Add MAX8998 RTC and charger drivers ARM: imx_v6_v7_defconfig: add imx7ulp support ARM: imx_v6_v7_defconfig: Select TOUCHSCREEN_GOODIX ARM: multi_v7_defconfig: enable STM32 analog & timer drivers arm64: defconfig: Enable GCC and PINCTRL for MSM8998 arm64: defconfig: Enable core Qualcomm SDM845 options ARM: defconfig: Enable the PL111 DRM driver on vexpress ARM: defconfig: Update the vexpress defconfig arm64: defconfig: Enable some qcom remoteproc configs arm64: defconfig: Enable QCS404 configs ARM: imx_v6_v7_defconfig: Enable USB_ANNOUNCE_NEW_DEVICES ARM: imx_v6_v7_defconfig: Enable BT_BNEP ... commit b7badd1d7aa61087010803affa19bb83fb5a0af1 Merge: d36377c6eb071 3f47de2c6b606 Author: Linus Torvalds Date: Mon Dec 31 17:36:02 2018 -0800 Merge tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM Device-tree updates from Olof Johansson: "As usual, this is where the bulk of our changes end up landing each merge window. The individual updates are too many to enumerate, many many platforms have seen additions of device descriptions such that they are functionally more complete (in fact, this is often the bulk of updates we see). Instead I've mostly focused on highlighting the new platforms below as they are introduced. Sometimes the introduction is of mostly a fragment, that later gets filled in on later releases, and in some cases it's near-complete platform support. The latter is more common for derivative platforms that already has similar support in-tree. Two SoCs are slight outliers from the usual range of additions. Allwinner support for F1C100s, a quite old SoC (ARMv5-based) shipping in the Lychee Pi Nano platform. At the other end is NXP Layerscape LX2160A, a 16-core 2.2GHz Cortex-A72 SoC with a large amount of I/O aimed at infrastructure/networking. TI updates stick out in the diff stats too, in particular because they have moved the description of their L4 on-chip interconnect to devicetree, which opens up for removal of even more of their platform-specific 'hwmod' description tables over the next few releases. SoCs: - Qualcomm QCS404 (4x Cortex-A53) - Allwinner T3 (rebranded R40) and f1c100s (armv5) - NXP i.MX7ULP (1x Cortex-A7 + 1x Cortex-M4) - NXP LS1028A (2x Cortex-A72), LX2160A (16x Cortex-A72) New platforms: - Rockchip: Gru Scarlet (RK3188 Tablet) - Amlogic: Phicomm N1 (S905D), Libretech S805-AC - Broadcom: Linksys EA6500 v2 Wi-Fi router (BCM4708) - Qualcomm: QCS404 base platform and EVB - Qualcomm: Remove of Arrow SD600 - PXA: First PXA3xx DT board: Raumfeld - Aspeed: Facebook Backpack-CMM BMC - Renesas iWave G20D-Q7 (RZ/G1N) - Allwinner t3-cqa3t-bv3 (T3/R40) and Lichee Pi Nano (F1C100s) - Allwinner Emlid Neutis N5, Mapleboard MP130 - Marvell Macchiatobin Single Shot (Armada 8040, no 10GbE) - i.MX: mtrion emCON-MX6, imx6ul-pico-pi, imx7d-sdb-reva - VF610: Liebherr's BK4 device, ZII SCU4 AIB board - i.MX7D PICO Hobbit baseboard - i.MX7ULP EVK board - NXP LX2160AQDS and LX2160ARDB boards Other: - Coresight binding updates across the board - CPU cooling maps updates across the board" * tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (648 commits) ARM: dts: suniv: Fix improper bindings include patch ARM: dts: sunxi: Enable Broadcom-based Bluetooth for multiple boards arm64: dts: allwinner: a64: bananapi-m64: Add Bluetooth device node ARM: dts: suniv: Fix improper bindings include patch arm64: dts: Add spi-[tx/rx]-bus-width for the FSL QSPI controller arm64: dts: Remove unused properties from FSL QSPI driver nodes ARM: dts: Add spi-[tx/rx]-bus-width for the FSL QSPI controller ARM: dts: imx6sx-sdb: Fix the reg properties for the FSL QSPI nodes ARM: dts: Remove unused properties from FSL QSPI driver nodes arm64: dts: ti: k3-am654: Enable main domain McSPI0 arm64: dts: ti: k3-am654: Add McSPI DT nodes arm64: dts: ti: k3-am654: Populate power-domain property for UART nodes arm64: dts: ti: k3-am654-base-board: Enable ECAP PWM arm64: dts: ti: k3-am65-main: Add ECAP PWM node arm64: dts: ti: k3-am654-base-board: Add I2C nodes arm64: dts: ti: am654-base-board: Add pinmux for main uart0 arm64: dts: ti: k3-am65: Add pinctrl regions dt-bindings: pinctrl: k3: Introduce pinmux definitions ARM: dts: exynos: Specify I2S assigned clocks in proper node ARM: dts: exynos: Add missing CPUs in cooling maps for Odroid X2 ... commit d36377c6eb071e3d0751e9e0e3c19198c58d9a5d Merge: 0922275ef157b a6f119a06960e Author: Linus Torvalds Date: Mon Dec 31 17:32:35 2018 -0800 Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC driver updates from Olof Johansson: "Misc driver updates for platforms, many of them power related. - Rockchip adds power domain support for rk3066 and rk3188 - Amlogic adds a power measurement driver - Allwinner adds SRAM support for three platforms (F1C100, H5, A64 C1) - Wakeup and ti-sysc (platform bus) fixes for OMAP/DRA7 - Broadcom fixes suspend/resume with Thumb2 kernels, and improves stability of a handful of firmware/platform interfaces - PXA completes their conversion to dmaengine framework - Renesas does a bunch of PM cleanups across many platforms - Tegra adds support for suspend/resume on T186/T194, which includes some driver cleanups and addition of wake events - Tegra also adds a driver for memory controller (EMC) on Tegra2 - i.MX tweaks power domain bindings, and adds support for i.MX8MQ in GPC - Atmel adds identifiers and LPDDR2 support for a new SoC, SAM9X60 and misc cleanups across several platforms" * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (73 commits) ARM: at91: add support in soc driver for new SAM9X60 ARM: at91: add support in soc driver for LPDDR2 SiP memory: omap-gpmc: Use of_node_name_eq for node name comparisons bus: ti-sysc: Check for no-reset and no-idle flags at the child level ARM: OMAP2+: Check also the first dts child for hwmod flags soc: amlogic: meson-clk-measure: Add missing REGMAP_MMIO dependency soc: imx: gpc: Increase GPC_CLK_MAX to 7 soc: renesas: rcar-sysc: Fix power domain control after system resume soc: renesas: rcar-sysc: Merge PM Domain registration and linking soc: renesas: rcar-sysc: Remove rcar_sysc_power_{down,up}() helpers soc: renesas: r8a77990-sysc: Fix initialization order of 3DG-{A,B} dt-bindings: sram: sunxi: Add compatible for the A64 SRAM C1 dt-bindings: sram: sunxi: Add bindings for the H5 with SRAM C1 dt-bindings: sram: Add Allwinner suniv F1C100s soc: sunxi: sram: Add support for the H5 SoC system control soc: sunxi: sram: Enable EMAC clock access for H3 variant soc: imx: gpcv2: add support for i.MX8MQ SoC soc: imx: gpcv2: move register access table to domain data soc: imx: gpcv2: prefix i.MX7 specific defines dmaengine: pxa: make the filter function internal ... commit 0922275ef157ba8ac93e7e7857087eb0442d5397 Merge: 495d714ad140e cac1fc8fb561a Author: Linus Torvalds Date: Mon Dec 31 17:27:54 2018 -0800 Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull arm SoC platform updates from Olof Johansson: "SoC updates, mostly refactorings and cleanups of old legacy platforms, but also a few more things: New SoC support this release: - NXP/Freescale i.MX7ULP (1x Cortex-A7, Cortex-M4, graphics, etc) - Allwinner F1C100, older platform with an ARM926-EJS (ARMv5) core Cleanups of various platforms: - OMAP1 ams-delta does some GPIO cleanups - Davinci removes of at24 platform data - Samsung cleans up old wakeup, PM debug and secondary core boot code - Renesas moves around config options and PM code to drivers/soc for sharing with 64-bit and more consistency - i.MX, Broadcom and SoCFPGA all have tweaks to lowlevel debug console setups - SoCFPGA adds explicit selection of ARM errata and removes some unused code This also contains a few patches that I had queued up as fixes for 4.20 but didn't send in before the release" * tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (68 commits) arm64: dts: renesas: draak: Fix CVBS input ARM: omap2: avoid section mismatch warning ARM: tegra: avoid section mismatch warning ARM: ks8695: fix section mismatch warning ARM: pxa: avoid section mismatch warning ARM: mmp: fix pxa168_device_usb_phy use on aspenite ARM: mmp: fix timer_init calls ARM: OMAP1: fix USB configuration for device-only setups ARM: OMAP1: add MMC configuration for Palm Tungsten E ARM: imx: fix dependencies on imx7ulp ARM: meson: select HAVE_ARM_TWD and ARM_GLOBAL_TIMER MAINTAINERS: add drivers/soc/amlogic/ to amlogic list ARM: imx: add initial support for imx7ulp ARM: debug-imx: only define DEBUG_IMX_UART_PORT if needed ARM: dts: Fix OMAP4430 SDP Ethernet startup ARM: dts: am335x-pdu001: Fix polarity of card detection input ARM: OMAP1: ams-delta: Fix audio permanently muted ARM: dts: omap5: Fix dual-role mode on Super-Speed port arm64: dts: rockchip: fix rk3399-rockpro64 regulator gpios ARM: davinci: da850-evm: remove unnecessary include ... commit 756af9c642329d54f048bac2a62f829b391f6944 Author: Tyrel Datwyler Date: Mon Dec 31 15:43:01 2018 -0600 ibmveth: fix DMA unmap error in ibmveth_xmit_start error path Commit 33a48ab105a7 ("ibmveth: Fix DMA unmap error") fixed an issue in the normal code path of ibmveth_xmit_start() that was originally introduced by Commit 6e8ab30ec677 ("ibmveth: Add scatter-gather support"). This original fix missed the error path where dma_unmap_page is wrongly called on the header portion in descs[0] which was mapped with dma_map_single. As a result a failure to DMA map any of the frags results in a dmesg warning when CONFIG_DMA_API_DEBUG is enabled. ------------[ cut here ]------------ DMA-API: ibmveth 30000002: device driver frees DMA memory with wrong function [device address=0x000000000a430000] [size=172 bytes] [mapped as page] [unmapped as single] WARNING: CPU: 1 PID: 8426 at kernel/dma/debug.c:1085 check_unmap+0x4fc/0xe10 ... ... DMA-API: Mapped at: ibmveth_start_xmit+0x30c/0xb60 dev_hard_start_xmit+0x100/0x450 sch_direct_xmit+0x224/0x490 __qdisc_run+0x20c/0x980 __dev_queue_xmit+0x1bc/0xf20 This fixes the API misuse by unampping descs[0] with dma_unmap_single. Fixes: 6e8ab30ec677 ("ibmveth: Add scatter-gather support") Signed-off-by: Tyrel Datwyler Signed-off-by: David S. Miller commit 4d9226fd9a0d747030575d7cb184b30c6e64f155 Author: Stefan Wahren Date: Fri Dec 28 17:53:23 2018 +0100 arm64: defconfig: Re-enable bcm2835-thermal driver The bcm2835-thermal driver was added with commit ac178e4280e6 ("ARM64: bcm2835: add thermal driver to default config"). Unfortunately this was accidentally dropped by commit eb1e6716cc9c ("arm64: defconfig: sync with savedefconfig"). So enable the driver again. Fixes: eb1e6716cc9c ("arm64: defconfig: sync with savedefconfig") Signed-off-by: Stefan Wahren Signed-off-by: Olof Johansson commit 2081076ac735de4eab6b9809d8b6ad8432d34d54 Merge: 8a66c20e66cc0 704cfd7f5f71c Author: Olof Johansson Date: Mon Dec 31 13:12:02 2018 -0800 Merge tag 'sti-soc-for-v4.21-round1' of git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti into next/late Highlights: ----------- - Following pen_release and boot_lock cleanup initiated by Russell King, .smp_prepare_cpus and .smp_boot_secondary STi callbacks must be reworked to keep secondary CPU's bringup. * tag 'sti-soc-for-v4.21-round1' of git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti: ARM: sti: remove pen_release and boot_lock Signed-off-by: Olof Johansson commit 8a66c20e66cc0d961d6b98cd766de4040f6e485f Merge: c6f9fa88a3982 74ebbdda7cecf Author: Olof Johansson Date: Mon Dec 31 13:11:04 2018 -0800 Merge tag 'samsung-dt64-4.21-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/late Samsung DTS ARM64 changes for v4.21, part 2 Add IMEM clock controller (for Security SubSystem) and Bluetooth chip to Exynos5433 TM2(e) boards. * tag 'samsung-dt64-4.21-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: arm64: dts: exynos: Add Bluetooth chip to TM2(e) boards arm64: dts: exynos: Add IMEM clock controller to Exynos5433 arm64: dts: exynos: Add all CPUs in cooling maps arm64: dts: exynos: Update DWC3 modules on Exynos5433 SoCs Signed-off-by: Olof Johansson commit c6f9fa88a398288613bbf3387d0f6b0b280cf9a2 Merge: a684afa7b10f6 8ac686d7dfed7 Author: Olof Johansson Date: Mon Dec 31 13:10:16 2018 -0800 Merge tag 'samsung-dt-4.21-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/late Samsung DTS ARM changes for v4.21, part 2 1. Add missing CPUs in cooling maps for Odroid X2 (missed in previous round of fixups). 2. Fix clock configuration in audio subsystem on Odroid XU3/XU4. * tag 'samsung-dt-4.21-2' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: dts: exynos: Specify I2S assigned clocks in proper node ARM: dts: exynos: Add missing CPUs in cooling maps for Odroid X2 ARM: dts: exynos: remove display-port node from Arndale ARM: dts: exynos: Add opp-suspend to DMC and leftbus devfreq OPPs on Exynos4 ARM: dts: s5pv210: Add s5p-jpeg codec node. ARM: dts: exynos: Use Samsung SoC specific compatible for DWC2 module ARM: dts: exynos: Add all CPUs in cooling maps ARM: dts: exynos: Clarify comment explaining purpose of Odroid XU3 DTSI ARM: dts: exynos: Add pin configuration for SD write protect on Odroid XU3/XU4/HC1 ARM: dts: exynos: Update maximum frequency for eMMC to 200MHz on Odroid XU3/XU4 ARM: dts: exynos: Update maximum frequency for SD card to 200MHz on Odroid XU3/XU4/HC1 ARM: dts: exynos: Fix LDO13 min values on Odroid XU3/XU4/HC1 ARM: dts: exynos: Add UHS-I bus speed support to Odroid XU3/XU4/HC1 ARM: dts: exynos: Add missing clocks to RTC node for Arndale board ARM: dts: exynos: Add compatible for s5m8767 clocks node on Itop Core ARM: dts: exynos: Add compatible for s2mps11 clocks node on Exynos542x Signed-off-by: Olof Johansson commit a684afa7b10f6bcd0fc51f212b4ad60dc2721fbe Author: Manivannan Sadhasivam Date: Tue Dec 18 20:32:38 2018 +0530 MAINTAINERS: Add entry for RDA Micro SoC architecture Add MAINTAINERS entry for RDA Micro SoC architecture with myself as the maintainer. Signed-off-by: Manivannan Sadhasivam Acked-by: Arnd Bergmann Signed-off-by: Olof Johansson commit c10b13325ced237f6129e8ee73cd8c72e1bd10ed Author: Manivannan Sadhasivam Date: Tue Dec 18 20:32:37 2018 +0530 tty: serial: Add RDA8810PL UART driver Add UART driver for RDA Micro RDA8810PL SoC. Signed-off-by: Andreas Färber Signed-off-by: Manivannan Sadhasivam Reviewed-by: Greg Kroah-Hartman Acked-by: Arnd Bergmann Signed-off-by: Olof Johansson commit 6fc66a5c68af56c28b08267bfb7f7ac45afc21a8 Author: Manivannan Sadhasivam Date: Tue Dec 18 20:32:36 2018 +0530 ARM: dts: rda8810pl: Add interrupt support for UART Add interrupt support for UART in RDA Micro RDA8810PL SoC. Signed-off-by: Andreas Färber Signed-off-by: Manivannan Sadhasivam Acked-by: Arnd Bergmann Signed-off-by: Olof Johansson commit 804584a61ca0d4547965630d5a433ad1c39e0b27 Author: Andreas Färber Date: Tue Dec 18 20:32:35 2018 +0530 dt-bindings: serial: Document RDA Micro UART Add an initial binding for the UART in RDA Micro RDA8810PL SoC. Signed-off-by: Andreas Färber Signed-off-by: Manivannan Sadhasivam Reviewed-by: Rob Herring Acked-by: Arnd Bergmann Signed-off-by: Olof Johansson commit 5a9fe404b984cec1e3d51a8a377219a2592f3214 Author: Manivannan Sadhasivam Date: Tue Dec 18 20:32:34 2018 +0530 ARM: dts: rda8810pl: Add timer support Add timer support for RDA Micro RDA8810PL SoC. Signed-off-by: Andreas Färber Signed-off-by: Manivannan Sadhasivam Acked-by: Arnd Bergmann Signed-off-by: Olof Johansson commit 7581d836bdbe2533e732f3bceb97a89d4f81de7b Author: Manivannan Sadhasivam Date: Tue Dec 18 20:32:33 2018 +0530 ARM: dts: Add devicetree for OrangePi i96 board Add initial devicetree for Orange Pi i96 board from Xunlong. It is one of the 96Boards IoT Edition board. Signed-off-by: Andreas Färber Signed-off-by: Manivannan Sadhasivam Acked-by: Arnd Bergmann Signed-off-by: Olof Johansson commit f0d319d26ea60f9dceaf00051b5876de039e49ca Author: Manivannan Sadhasivam Date: Tue Dec 18 20:32:32 2018 +0530 ARM: dts: Add devicetree for OrangePi 2G IoT board Add initial devicetree support for OrangePi 2G IoT board from Xunlong. Signed-off-by: Andreas Färber Signed-off-by: Manivannan Sadhasivam Acked-by: Arnd Bergmann Signed-off-by: Olof Johansson commit 542e1c9dbad9137e84e136cb4ee53c89627d87fe Author: Manivannan Sadhasivam Date: Tue Dec 18 20:32:31 2018 +0530 ARM: dts: Add devicetree for RDA8810PL SoC Add initial device tree for RDA8810PL SoC from RDA Microelectronics. Signed-off-by: Andreas Färber Signed-off-by: Manivannan Sadhasivam Acked-by: Arnd Bergmann Signed-off-by: Olof Johansson commit 78e3dbc166a137c5f796151281d39bec1b8e1cd0 Author: Andreas Färber Date: Tue Dec 18 20:32:30 2018 +0530 ARM: Prepare RDA8810PL SoC Introduce ARCH_RDA and mach-rda for RDA Micro SoCs. Signed-off-by: Andreas Färber Signed-off-by: Manivannan Sadhasivam Acked-by: Arnd Bergmann Signed-off-by: Olof Johansson commit 56f73e4bc145730c94894d5b5c557f19b89e073a Author: Andreas Färber Date: Tue Dec 18 20:32:29 2018 +0530 dt-bindings: arm: Document RDA8810PL and reference boards Add bindings for RDA Micro RDA8810PL SoC and below reference boards: 1. Orange Pi 2G-IoT - http://www.orangepi.org/OrangePi2GIOT/ 2. Orange Pi i96 - https://www.96boards.org/product/orangepi-i96/ Cc: zhao_steven@263.net Signed-off-by: Andreas Färber Signed-off-by: Manivannan Sadhasivam Reviewed-by: Rob Herring Acked-by: Arnd Bergmann Signed-off-by: Olof Johansson commit 1def98f69807518e26dcb0ac70142dcbbd953dc6 Author: Andreas Färber Date: Tue Dec 18 20:32:28 2018 +0530 dt-bindings: Add RDA Micro vendor prefix Add vendor prefix for RDA Micro which now merged into Unisoc Communications Inc. Signed-off-by: Andreas Färber Signed-off-by: Manivannan Sadhasivam Reviewed-by: Rob Herring Acked-by: Arnd Bergmann Signed-off-by: Olof Johansson commit a2edaf7893e2bd0247ea4bc13f21302fecb30d95 Merge: 5e0bd98f8ceff 3bbc9abbfb8cc Author: Olof Johansson Date: Mon Dec 31 13:07:11 2018 -0800 Merge tag 'imx8mq-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/late i.MX8MQ device tree support for 4.21: - It contains the initial device tree support for i.MX8MQ - the first ARM64 i.MX processor. It features a quad Cortex-A53 core that operates at speeds of up to 1.3 GHz, a Cortex-M4 core for low-power processing, a DRAM controller that supports 32-bit/16-bit LPDDR4/DDR4/DDR3L memory, and hardware acceleration for 4K video playback. - A couple of patches from Baruch that add watchdog device for i.MX8MQ enable it for imx8mq-evk board. * tag 'imx8mq-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: arm64: dts: imx8mq-evk: enable watchdog arm64: dts: imx8mq: add watchdog devices MAINTAINERS: add i.MX8 DT path to i.MX architecture arm64: add support for i.MX8M EVK board arm64: add basic DTS for i.MX8MQ arm64: add basic Kconfig symbols for i.MX8 arm64: dts: ls1046a: add qdma device tree nodes arm64: dts: ls1043a: add qdma device tree nodes arm64: dts: ls1088a: Add missing dma-ranges property arm64: dts: ls1088a: Move fsl-mc node arm64: dts: fsl: Add all CPUs in cooling maps arm64: dts: Add support for NXP LS1028A SoC arm64: dts: layerscape: removed compatible string "snps,dw-pcie" arm64: dts: fsl: Add the status property disable PCIe arm64: dts: ls1012a: Add FRWY-LS1012A board support dt-bindings: Add binding for i.MX8MQ CCM arm64: dts: add LX2160AQDS board support arm64: dts: add LX2160ARDB board support arm64: dts: add QorIQ LX2160A SoC support Signed-off-by: Olof Johansson commit 5e0bd98f8ceffce3da9c09cdcf5f5f30d4d9bd59 Merge: 6ae284ab58a2e 3c15ddb97c77f Author: Olof Johansson Date: Mon Dec 31 13:06:30 2018 -0800 Merge tag 'tee-subsys-optee-for-4.21' of https://git.linaro.org/people/jens.wiklander/linux-tee into next/late OP-TEE dynamic shm log message Adds a log message in the OP-TEE driver to inform that dynamic shared memory is enabled. * tag 'tee-subsys-optee-for-4.21' of https://git.linaro.org/people/jens.wiklander/linux-tee: tee: optee: log message if dynamic shm is enabled Signed-off-by: Olof Johansson commit 6ae284ab58a2e990a5f4daba1eb42fc600cf004b Merge: 8fe28cb58bcb2 b2d102bd0146d Author: Olof Johansson Date: Mon Dec 31 13:05:53 2018 -0800 Merge tag 'tee-subsys-fix-for-4.21' of https://git.linaro.org/people/jens.wiklander/linux-tee into next/late Avoid possible double list_del in supplicant comms A fix for the OP-TEE driver to avoid possible double list_del during tee-supplicant communication while the system is shutting down. * tag 'tee-subsys-fix-for-4.21' of https://git.linaro.org/people/jens.wiklander/linux-tee: tee: optee: avoid possible double list_del() Signed-off-by: Olof Johansson commit cac1fc8fb561ac766468394d49c3dd11a2b8cb44 Merge: bd3fde386decf 54518ed45734b Author: Olof Johansson Date: Mon Dec 31 11:54:03 2018 -0800 Merge branch 'fixes' into next/soc Merge in fixes here, since the last batch didn't make it in before the release of 4.20, and we might as well group them with this set of patches. * fixes: (822 commits) arm64: dts: renesas: draak: Fix CVBS input ARM: dts: Fix OMAP4430 SDP Ethernet startup ARM: dts: am335x-pdu001: Fix polarity of card detection input ARM: OMAP1: ams-delta: Fix audio permanently muted ARM: dts: omap5: Fix dual-role mode on Super-Speed port arm64: dts: rockchip: fix rk3399-rockpro64 regulator gpios ARM: dts: imx7d-nitrogen7: Fix the description of the Wifi clock ARM: imx: update the cpu power up timing setting on i.mx6sx Revert "arm64: dts: marvell: add CPU Idle power state support on Armada 7K/8K" ARM: dts: imx7d-pico: Describe the Wifi clock ARM: dts: realview: Fix some more duplicate regulator nodes MAINTAINERS: update entry for MMP platform ARM: mmp/mmp2: fix cpu_is_mmp2() on mmp2-dt MAINTAINERS: mediatek: Update SoC entry ARM: dts: bcm2837: Fix polarity of wifi reset GPIOs + Linux 4.20-rc5 Signed-off-by: Olof Johansson commit 495d714ad140e1732e66c45d0409054b24c1a0d6 Merge: f12e840c819ba 3d739c1f6156c Author: Linus Torvalds Date: Mon Dec 31 11:46:59 2018 -0800 Merge tag 'trace-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing updates from Steven Rostedt: - Rework of the kprobe/uprobe and synthetic events to consolidate all the dynamic event code. This will make changes in the future easier. - Partial rewrite of the function graph tracing infrastructure. This will allow for multiple users of hooking onto functions to get the callback (return) of the function. This is the ground work for having kprobes and function graph tracer using one code base. - Clean up of the histogram code that will facilitate adding more features to the histograms in the future. - Addition of str_has_prefix() and a few use cases. There currently is a similar function strstart() that is used in a few places, but only returns a bool and not a length. These instances will be removed in the future to use str_has_prefix() instead. - A few other various clean ups as well. * tag 'trace-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (57 commits) tracing: Use the return of str_has_prefix() to remove open coded numbers tracing: Have the historgram use the result of str_has_prefix() for len of prefix tracing: Use str_has_prefix() instead of using fixed sizes tracing: Use str_has_prefix() helper for histogram code string.h: Add str_has_prefix() helper function tracing: Make function ‘ftrace_exports’ static tracing: Simplify printf'ing in seq_print_sym tracing: Avoid -Wformat-nonliteral warning tracing: Merge seq_print_sym_short() and seq_print_sym_offset() tracing: Add hist trigger comments for variable-related fields tracing: Remove hist trigger synth_var_refs tracing: Use hist trigger's var_ref array to destroy var_refs tracing: Remove open-coding of hist trigger var_ref management tracing: Use var_refs[] for hist trigger reference checking tracing: Change strlen to sizeof for hist trigger static strings tracing: Remove unnecessary hist trigger struct field tracing: Fix ftrace_graph_get_ret_stack() to use task and not current seq_buf: Use size_t for len in seq_buf_puts() seq_buf: Make seq_buf_puts() null-terminate the buffer arm64: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack ... commit 74d4b4e0f43e5ffb61b63f4e3cfcfad3d7398765 Author: Matti Vaittinen Date: Thu Dec 27 10:44:43 2018 +0200 regmap: regmap-irq: silently ignore unsupported type settings Do not return error if irq-type setting is requested for controlloer which does not support this. This is how regmap-irq has previously handled the undupported type settings and existing drivers seem to be upset if failure is now reported. Fixes: 1c2928e3e321 ("regmap: regmap-irq/gpio-max77620: add level-irq support") Signed-off-by: Matti Vaittinen Reported-by: Geert Uytterhoeven Signed-off-by: Mark Brown commit f12e840c819bab42621685558a01d3f46ab9a226 Merge: e3ed513bcf009 1c3243f61fa7d Author: Linus Torvalds Date: Mon Dec 31 09:57:14 2018 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha Pull alpha architecture updates from Matt Turner: "A few small changes for alpha as well as the new system call table generation support from Firoz Khan" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha: alpha: Remove some unused variables alpha: rtc: simplify alpha_rtc_init alpha: Fix a typo on ptrace.h alpha: fix spelling mistake QSD_PORT_ACTUVE -> QSD_PORT_ACTIVE alpha: generate uapi header and syscall table header files alpha: add system call table generation support alpha: add __NR_syscalls along with NR_SYSCALLS alpha: remove CONFIG_OSF4_COMPAT flag from syscall table alpha: move __IGNORE* entries to non uapi header commit e3ed513bcf0097c0b8a1f1b4d791a8d0d8933b3b Merge: 2a1a2c1a76cf8 c40f7d74c741a Author: Linus Torvalds Date: Mon Dec 31 09:54:17 2018 -0800 Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fix from Ingo Molnar: "This is a revert for a lockup in cgroups-intense workloads - the real fixes will come later" * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c commit 2a1a2c1a76cf89aaeb98a89179c2942c7882f68a Merge: 9ab97aea85cca d8a706414af48 Author: Linus Torvalds Date: Mon Dec 31 09:46:39 2018 -0800 Merge tag 'dax-fix-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull dax fix from Dan Williams: "Clean up unnecessary usage of prepare_to_wait_exclusive(). While I feel a bit silly sending a single-commit pull-request there is nothing else queued up for dax this cycle. This change has shipped in -next for multiple releases" * tag 'dax-fix-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: dax: Use non-exclusive wait in wait_entry_unlocked() commit 9ab97aea85cca43a6aedc90e0d1feba91eebe1ad Merge: 195303136f192 64beba0558fce Author: Linus Torvalds Date: Mon Dec 31 09:41:37 2018 -0800 Merge tag 'f2fs-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs Pull f2fs updates from Jaegeuk Kim: "In this round, we've focused on bug fixes since Pixel devices have been shipping with f2fs. Some of them were related to hardware encryption support which are actually not an issue in mainline, but would be better to merge them in order to avoid potential bugs. Enhancements: - do GC sub-sections when the section is large - add a flag in ioctl(SHUTDOWN) to trigger fsck for QA - use kvmalloc() in order to give another chance to avoid ENOMEM Bug fixes: - fix accessing memory boundaries in a malformed iamge - GC gives stale unencrypted block - GC counts in large sections - detect idle time more precisely - block allocation of DIO writes - race conditions between write_begin and write_checkpoint - allow GCs for node segments via ioctl() There are various clean-ups and minor bug fixes as well" * tag 'f2fs-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (43 commits) f2fs: sanity check of xattr entry size f2fs: fix use-after-free issue when accessing sbi->stat_info f2fs: check PageWriteback flag for ordered case f2fs: fix validation of the block count in sanity_check_raw_super f2fs: fix missing unlock(sbi->gc_mutex) f2fs: fix to dirty inode synchronously f2fs: clean up structure extent_node f2fs: fix block address for __check_sit_bitmap f2fs: fix sbi->extent_list corruption issue f2fs: clean up checkpoint flow f2fs: flush stale issued discard candidates f2fs: correct wrong spelling, issing_* f2fs: use kvmalloc, if kmalloc is failed f2fs: remove redundant comment of unused wio_mutex f2fs: fix to reorder set_page_dirty and wait_on_page_writeback f2fs: clear PG_writeback if IPU failed f2fs: add an ioctl() to explicitly trigger fsck later f2fs: avoid frequent costly fsck triggers f2fs: fix m_may_create to make OPU DIO write correctly f2fs: fix to update new block address correctly for OPU ... commit 427c5ce4417cba0801fbf79c8525d1330704759c Author: Finn Thain Date: Mon Dec 31 16:44:09 2018 +1100 block/swim3: Fix regression on PowerBook G3 As of v4.20, the swim3 driver crashes when loaded on a PowerBook G3 (Wallstreet). MacIO PCI driver attached to Gatwick chipset MacIO PCI driver attached to Heathrow chipset swim3 0.00015000:floppy: [fd0] SWIM3 floppy controller in media bay 0.00013020:ch-a: ttyS0 at MMIO 0xf3013020 (irq = 16, base_baud = 230400) is a Z85c30 ESCC - Serial port 0.00013000:ch-b: ttyS1 at MMIO 0xf3013000 (irq = 17, base_baud = 230400) is a Z85c30 ESCC - Infrared port macio: fixed media-bay irq on gatwick macio: fixed left floppy irqs swim3 1.00015000:floppy: [fd1] Couldn't request interrupt Unable to handle kernel paging request for data at address 0x00000024 Faulting instruction address: 0xc02652f8 Oops: Kernel access of bad area, sig: 11 [#1] BE SMP NR_CPUS=2 PowerMac Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.20.0 #2 NIP: c02652f8 LR: c026915c CTR: c0276d1c REGS: df43ba10 TRAP: 0300 Not tainted (4.20.0) MSR: 00009032 CR: 28228288 XER: 00000100 DAR: 00000024 DSISR: 40000000 GPR00: c026915c df43bac0 df439060 c0731524 df494700 00000000 c06e1c08 00000001 GPR08: 00000001 00000000 df5ff220 00001032 28228282 00000000 c0004ca4 00000000 GPR16: 00000000 00000000 00000000 c073144c dfffe064 c0731524 00000120 c0586108 GPR24: c073132c c073143c c073143c 00000000 c0731524 df67cd70 df494700 00000001 NIP [c02652f8] blk_mq_free_rqs+0x28/0xf8 LR [c026915c] blk_mq_sched_tags_teardown+0x58/0x84 Call Trace: [df43bac0] [c0045f50] flush_workqueue_prep_pwqs+0x178/0x1c4 (unreliable) [df43bae0] [c026915c] blk_mq_sched_tags_teardown+0x58/0x84 [df43bb00] [c02697f0] blk_mq_exit_sched+0x9c/0xb8 [df43bb20] [c0252794] elevator_exit+0x84/0xa4 [df43bb40] [c0256538] blk_exit_queue+0x30/0x50 [df43bb50] [c0256640] blk_cleanup_queue+0xe8/0x184 [df43bb70] [c034732c] swim3_attach+0x330/0x5f0 [df43bbb0] [c034fb24] macio_device_probe+0x58/0xec [df43bbd0] [c032ba88] really_probe+0x1e4/0x2f4 [df43bc00] [c032bd28] driver_probe_device+0x64/0x204 [df43bc20] [c0329ac4] bus_for_each_drv+0x60/0xac [df43bc50] [c032b824] __device_attach+0xe8/0x160 [df43bc80] [c032ab38] bus_probe_device+0xa0/0xbc [df43bca0] [c0327338] device_add+0x3d8/0x630 [df43bcf0] [c0350848] macio_add_one_device+0x444/0x48c [df43bd50] [c03509f8] macio_pci_add_devices+0x168/0x1bc [df43bd90] [c03500ec] macio_pci_probe+0xc0/0x10c [df43bda0] [c02ad884] pci_device_probe+0xd4/0x184 [df43bdd0] [c032ba88] really_probe+0x1e4/0x2f4 [df43be00] [c032bd28] driver_probe_device+0x64/0x204 [df43be20] [c032bfcc] __driver_attach+0x104/0x108 [df43be40] [c0329a00] bus_for_each_dev+0x64/0xb4 [df43be70] [c032add8] bus_add_driver+0x154/0x238 [df43be90] [c032ca24] driver_register+0x84/0x148 [df43bea0] [c0004aa0] do_one_initcall+0x40/0x188 [df43bf00] [c0690100] kernel_init_freeable+0x138/0x1d4 [df43bf30] [c0004cbc] kernel_init+0x18/0x10c [df43bf40] [c00121e4] ret_from_kernel_thread+0x14/0x1c Instruction dump: 5484d97e 4bfff4f4 9421ffe0 7c0802a6 bf410008 7c9e2378 90010024 8124005c 2f890000 419e0078 81230004 7c7c1b78 <81290024> 2f890000 419e0064 81440000 ---[ end trace 12025ab921a9784c ]--- Reverting commit 8ccb8cb1892b ("swim3: convert to blk-mq") resolves the problem. That commit added a struct blk_mq_tag_set to struct floppy_state and initialized it with a blk_mq_init_sq_queue() call. Unfortunately, there is a memset() in swim3_add_device() that subsequently clears the floppy_state struct. That means fs->tag_set->ops is a NULL pointer, and it gets dereferenced by blk_mq_free_rqs() which gets called in the request_irq() error path. Move the memset() to fix this bug. BTW, the request_irq() failure for the left mediabay floppy (fd1) is not a regression. I don't know why it happens. The right media bay floppy (fd0) works fine however. Reported-and-tested-by: Stan Johnson Fixes: 8ccb8cb1892b ("swim3: convert to blk-mq") Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Finn Thain Signed-off-by: Jens Axboe commit 296dcc40f2f2e402facf7cd26cf3f2c8f4b17d47 Author: Finn Thain Date: Mon Dec 31 16:44:09 2018 +1100 block/swim3: Fix -EBUSY error when re-opening device after unmount When the block device is opened with FMODE_EXCL, ref_count is set to -1. This value doesn't get reset when the device is closed which means the device cannot be opened again. Fix this by checking for refcount <= 0 in the release method. Reported-and-tested-by: Stan Johnson Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Finn Thain Signed-off-by: Jens Axboe commit f3010ec5b7963b63f5f455725f947a95e55e0c03 Author: Finn Thain Date: Mon Dec 31 16:44:09 2018 +1100 block/swim3: Remove dead return statement Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Finn Thain Signed-off-by: Jens Axboe commit d4d179c37c74dd18684d3b197fb16642a39e27ee Author: Finn Thain Date: Mon Dec 31 16:44:09 2018 +1100 block/amiflop: Don't log error message on invalid ioctl Cc: linux-m68k@lists.linux-m68k.org Signed-off-by: Finn Thain Signed-off-by: Jens Axboe commit 0ad30ff67bd3e82da8c1dc4d74b88aca846dbbd9 Author: Vasily Averin Date: Sat Dec 29 16:38:51 2018 +0300 nfs: fixed broken compilation in nfs_callback_up_net() Patch fixes compilation error in nfs_callback_up_net() serv->sv_bc_enabled is defined under enabled CONFIG_SUNRPC_BACKCHANNEL, however nfs_callback_up_net() can access it even if this config option was not set. Fixes: a289ce5311f4 (sunrpc: replace svc_serv->sv_bc_xprt by boolean flag) Reported-by: kbuild test robot Signed-off-by: Vasily Averin Signed-off-by: J. Bruce Fields commit 6256734f9173b19e8dd1e21e04b1398a0137f99b Author: Guo Ren Date: Mon Dec 31 22:27:29 2018 +0800 csky: Add EM_CSKY_OLD 39 C-SKY historically used 39, the same value as MCORE, from which the architecture was derived. C-SKY binutils support both EM_CSKY and EM_CSKY_OLD, confirmed by binutils:include/elf/common.h Signed-off-by: Guo Ren commit 0c87bb0e872cbbad59a965fc67668364066aa85e Author: Guo Ren Date: Mon Dec 31 20:52:41 2018 +0800 clocksource/drivers/c-sky: fixup ftrace call-graph panic We must add notrace on sched_clock_read, because it's called by ftrace_graph_caller. Signed-off-by: Guo Ren commit d7950be145c84ca5094c52bc1ad1e7f1893d0f19 Author: Guo Ren Date: Sat Dec 15 21:04:27 2018 +0800 csky: ftrace call graph supported. With csky-gcc -pg -mbacktrace, ftrace call graph supported. Signed-off-by: Guo Ren commit db1ce3f5d01d2d6d5714aefba0159d2cb5167a0b Author: Huacai Chen Date: Tue Dec 25 08:51:01 2018 +0800 MIPS: Fix a R10000_LLSC_WAR logic in atomic.h Commit 4936084c2ee2 ("MIPS: Cleanup R10000_LLSC_WAR logic in atomic.h") introduce a mistake in atomic64_fetch_##op##_relaxed(), because it forget to delete R10000_LLSC_WAR in the if-condition. So fix it. Fixes: 4936084c2ee2 ("MIPS: Cleanup R10000_LLSC_WAR logic in atomic.h") Signed-off-by: Huacai Chen Signed-off-by: Paul Burton Cc: Joshua Kinard Cc: Ralf Baechle Cc: Steven J . Hill Cc: Fuxin Zhang Cc: Zhangjin Wu Cc: linux-mips@linux-mips.org Cc: stable@vger.kernel.org # 4.19+ commit 230c77a5e92a29bf21e98ee35e22b0537f61c55b Author: Guo Ren Date: Sun Dec 9 14:29:59 2018 +0800 csky: basic ftrace supported When gcc with -pg, it'll add _mcount stub in every function. We need implement the _mcount in kernel and ftrace depends on stackstrace. To do: call-graph, dynamic ftrace Signed-off-by: Guo Ren commit 17a68777bc883c8044c8b2d40aa112ff4e8a4fb1 Author: Guo Ren Date: Sun Dec 9 17:31:53 2018 +0800 csky: remove unused members in processor.h Cleanup struct cpuinfo_csky and struct thread_struct, remove all esp0 related code. We could get pt_regs from sp and backtrace could use fp in switch_stack. Signed-off-by: Guo Ren commit 8f4f1639a19db231e4579612dbc6d147e8d07ffd Author: Guo Ren Date: Sun Dec 9 17:07:20 2018 +0800 csky: optimize kernel panic print. Use STACKTRACE to optimize panic print more pretty and align registers printing. Signed-off-by: Guo Ren commit 682fee802843b332f9c51ffc8e062de5ff773f2e Author: Jonas Gorski Date: Sun Dec 30 12:55:09 2018 +0100 MIPS: BCM63XX: drop unused and broken DSP platform device Trying to register the DSP platform device results in a null pointer access: [ 0.124184] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 804e305c, ra == 804e6f20 [ 0.135208] Oops[#1]: [ 0.137514] CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.87 ... [ 0.197117] epc : 804e305c bcm63xx_dsp_register+0x80/0xa4 [ 0.202838] ra : 804e6f20 board_register_devices+0x258/0x390 ... This happens because it tries to copy the passed platform data over the platform_device's unpopulated platform_data. Since this code has been broken since its submission, no driver was ever submitted for it, and apparently nobody was using it, just remove it instead of trying to fix it. Fixes: e7300d04bd08 ("MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs.") Signed-off-by: Jonas Gorski Signed-off-by: Paul Burton Acked-by: Florian Fainelli Cc: linux-mips@linux-mips.org Cc: Ralf Baechle Cc: James Hogan commit 0ea2dc7cd668be5475babecaf6fdeaa464e2847b Author: Guo Ren Date: Sun Dec 9 14:18:05 2018 +0800 csky: stacktrace supported. The gcc option "-mbacktrace" will push fp(r8),lr into stack and we could unwind the stack with: fp = *fp lr = (unsigned int *)fp[1] Signed-off-by: Guo Ren commit 859e5f45cbb33fe5d591a8e429667f0b7d4f4be8 Author: Guo Ren Date: Wed Dec 19 19:56:14 2018 +0800 csky: CPU-hotplug supported for SMP This is a simple implement of CPU-hotplug for power saving. CPU use wait instruction to enter power saving mode and waiting for IPI wakeup signal. Signed-off-by: Guo Ren commit 1d95fe4d3de42e915bc22d5fd6cd4de103c5e517 Author: Guo Ren Date: Thu Dec 20 15:21:41 2018 +0800 clocksource/drivers/c-sky: fixup qemu fail to bootup sometimes. Timer startup must after timer_irq_enable. For qemu, timer tick irq hanppens but irq not enable, so it will cause qemu boot failed. Signed-off-by: Guo Ren Tested-by: Liu Zhiwei commit 789154c2ad74c29c3c60c5136c1785745abe4897 Author: Guo Ren Date: Mon Dec 31 15:17:48 2018 +0800 csky: fixup save hi,lo,dspcr regs in switch_stack. HI, LO, DSPCR registers are 807/810 related regs and no need for 610/860. All of the regs must be saved in pt_regs and switch_stack. This patch fixup saving dspcr reg in switch_stack and pt_regs. Signed-off-by: Guo Ren commit 31295a72b525721d10737260aea6918fb34607be Author: Guo Ren Date: Sun Dec 9 13:18:15 2018 +0800 csky: remove syscall_exit_work Remove syscall_exit_work and union all to ret_from_exception. Signed-off-by: Guo Ren commit 35ff802af1c49dab21af8ef47b492ff952831d72 Author: Guo Ren Date: Mon Dec 31 01:19:29 2018 +0800 csky: fixup remove vdsp implement for kernel. The vr regs for vdsp only saved in task_switch not in every exception trap-in. The memcpy with vdsp instructions will destroy the vr regs for user space applications. Signed-off-by: Guo Ren commit 660611827c03afeb0eec178dc1fb9f842332d908 Merge: 69ca36b3d629f aeaebcc17cdf3 Author: Vinod Koul Date: Mon Dec 31 19:32:32 2018 +0530 Merge branch 'topic/xilinx' into for-linus commit 69ca36b3d629f1fcdaa9e7abb8b6b2084ff947dd Merge: 990beed934fc4 32e74aabebc8d Author: Vinod Koul Date: Mon Dec 31 19:32:27 2018 +0530 Merge branch 'topic/uniphier' into for-linus commit 990beed934fc4568d6e76a5117e71a92fd9fd9d1 Merge: f782086a49b7e 531971231dac0 Author: Vinod Koul Date: Mon Dec 31 19:32:21 2018 +0530 Merge branch 'topic/sprd' into for-linus commit f782086a49b7e7eb713d09370fa4525b04fe0dbe Merge: 56e8e1a118a96 47ec4cf405e23 Author: Vinod Koul Date: Mon Dec 31 19:32:16 2018 +0530 Merge branch 'topic/sh' into for-linus commit 56e8e1a118a96b9d0d02efa6290b94d9082f69d3 Merge: 68ded1dcd138c bc822e80170d6 Author: Vinod Koul Date: Mon Dec 31 19:32:10 2018 +0530 Merge branch 'topic/sa11x0' into for-linus commit 68ded1dcd138cccb7b0e7b23c7a0c5f7e3785535 Merge: 23a1bff764060 b1f01e48df5a3 Author: Vinod Koul Date: Mon Dec 31 19:31:59 2018 +0530 Merge branch 'topic/mtk' into for-linus commit 23a1bff76406070c287c8c5a0b528ae7ffd07d1a Merge: b7ff66ca30f88 af8bf89a8e0b8 Author: Vinod Koul Date: Mon Dec 31 19:31:54 2018 +0530 Merge branch 'topic/imx' into for-linus commit b7ff66ca30f88dfd63763d12b848520baddc5ae5 Merge: 010299bfc2df1 9b68cc012a73b Author: Vinod Koul Date: Mon Dec 31 19:31:47 2018 +0530 Merge branch 'topic/ep93xx' into for-linus commit 010299bfc2df19c2c330c75c048805939e5ab91b Merge: 466e601a68da7 7b0c03ecc42fb Author: Vinod Koul Date: Mon Dec 31 19:31:42 2018 +0530 Merge branch 'topic/dw' into for-linus commit 466e601a68da7554da84e87d81dac74608deedbe Merge: 77ee1aacdd5ba f80f9988a26d7 Author: Vinod Koul Date: Mon Dec 31 19:31:37 2018 +0530 Merge branch 'topic/dmatest' into for-linus commit 77ee1aacdd5bad4617a9617bb838d79840cf1f20 Merge: 5f443256e3a1e 9e314ef35c384 Author: Vinod Koul Date: Mon Dec 31 19:31:31 2018 +0530 Merge branch 'topic/dirn_remove' into for-linus commit 5f443256e3a1e22a0969878428bcfbd3639439d9 Merge: 7c2269e95883a 35faaf0df42d2 Author: Vinod Koul Date: Mon Dec 31 19:31:25 2018 +0530 Merge branch 'topic/coh' into for-linus commit 7c2269e95883a2123dc5c273df54d6c9e05ab880 Merge: f7f41722efacc 80c4445e56f4f Author: Vinod Koul Date: Mon Dec 31 19:31:21 2018 +0530 Merge branch 'topic/bcm' into for-linus commit 36e14f5fdfdf7cec8887b7ff69cd9bb5051ecf62 Author: Alexandre Belloni Date: Mon Dec 31 11:36:16 2018 +0100 rtc: rename core files Rename core files so there is a clearer separation between the RTC core and the RTC drivers. Signed-off-by: Alexandre Belloni commit fea170804b4dc44cd79f8cb1ce236f3a824951cd Author: Steve French Date: Tue Nov 6 16:20:46 2018 -0600 cifs: update internal module version number To version 2.15 Signed-off-by: Steve French commit e77fe73c7e38c36145825d84cfe385d400aba4fd Author: Ronnie Sahlberg Date: Mon Dec 31 13:43:40 2018 +1000 cifs: we can not use small padding iovs together with encryption We can not append small padding buffers as separate iovs when encryption is used. For this case we must flatten the request into a single buffer containing both the data from all the iovs as well as the padding bytes. This is at least needed for 4.20 as well due to compounding changes. CC: Stable Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 95cb67138746451cc84cf8e516e14989746e93b0 Author: Theodore Ts'o Date: Mon Dec 31 00:11:07 2018 -0500 ext4: track writeback errors using the generic tracking infrastructure We already using mapping_set_error() in fs/ext4/page_io.c, so all we need to do is to use file_check_and_advance_wb_err() when handling fsync() requests in ext4_sync_file(). Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit ad211f3e94b314a910d4af03178a0b52a7d1ee0a Author: Theodore Ts'o Date: Mon Dec 31 00:10:48 2018 -0500 ext4: use ext4_write_inode() when fsyncing w/o a journal In no-journal mode, we previously used __generic_file_fsync() in no-journal mode. This triggers a lockdep warning, and in addition, it's not safe to depend on the inode writeback mechanism in the case ext4. We can solve both problems by calling ext4_write_inode() directly. Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 3bd8264511035dc97c902f03fa9f1d07f95f8f62 Author: Heiner Kallweit Date: Sun Dec 30 13:16:12 2018 +0100 r8169: fix WoL device wakeup enable In rtl8169_runtime_resume() we configure WoL but don't set the device to wakeup-enabled. This prevents PME generation once the cable is re-plugged. Fix this by moving the call to device_set_wakeup_enable() to __rtl8169_set_wol(). Fixes: 433f9d0ddcc6 ("r8169: improve saved_wolopts handling") Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 7314f5480f3e37e570104dc5e0f28823ef849e72 Author: Cong Wang Date: Sat Dec 29 13:56:38 2018 -0800 netrom: fix locking in nr_find_socket() nr_find_socket(), nr_find_peer() and nr_find_listener() lock the sock after finding it in the global list. However, the call path requires BH disabled for the sock lock consistently. Actually the locking is unnecessary at this point, we can just hold the sock refcnt to make sure it is not gone after we unlock the global list, and lock it later only when needed. Reported-and-tested-by: syzbot+f621cda8b7e598908efa@syzkaller.appspotmail.com Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit d5c7c745f254c6cb98b3b3f15fe789b8bd770c72 Author: Cong Wang Date: Sat Dec 29 13:56:37 2018 -0800 net/wan: fix a double free in x25_asy_open_tty() When x25_asy_open() fails, it already cleans up by itself, so its caller doesn't need to free the memory again. It seems we still have to call x25_asy_free() to clear the SLF_INUSE bit, so just set these pointers to NULL after kfree(). Reported-and-tested-by: syzbot+5e5e969e525129229052@syzkaller.appspotmail.com Fixes: 3b780bed3138 ("x25_asy: Free x25_asy on x25_asy_open() failure.") Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit e86807862e6880809f191c4cea7f88a489f0ed34 Author: Theodore Ts'o Date: Sun Dec 30 23:20:39 2018 -0500 ext4: avoid kernel warning when writing the superblock to a dead device The xfstests generic/475 test switches the underlying device with dm-error while running a stress test. This results in a large number of file system errors, and since we can't lock the buffer head when marking the superblock dirty in the ext4_grp_locked_error() case, it's possible the superblock to be !buffer_uptodate() without buffer_write_io_error() being true. We need to set buffer_uptodate() before we call mark_buffer_dirty() or this will trigger a WARN_ON. It's safe to do this since the superblock must have been properly read into memory or the mount would have been successful. So if buffer_uptodate() is not set, we can safely assume that this happened due to a failed attempt to write the superblock. Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org commit 2054f4af19575d9d2a43bcefa48d2e64f10a25de Author: Guo Ren Date: Mon Dec 31 01:06:53 2018 +0800 csky: bugfix gdb coredump error. In gdb/bfd elf32-csky.c, csky_elf_grok_prstatus() use fixed size of elf_prstatus. It's 148 for abiv1 and 220 for abiv2, the size is enough for coredump and no need full sizeof(struct pt_regs). Signed-off-by: Guo Ren Reported-by: Lu Baoquan Reported-by: Liu Mao commit 2b070ccdf8c020fb6c4911263852c021d8aa843c Author: Guo Ren Date: Sun Dec 30 21:47:28 2018 +0800 csky: fixup abiv2 mmap(... O_SYNC) failed. Glibc function mmap(... O_SYNC) will make page to _PAGE_UNCACHE + _PAGE_SO and strong-order page couldn't support unalignment access. So remove _PAGE_SO from _PAGE_UNCACHE, also sync abiv1 with the macro of _PAGE_SO. Signed-off-by: Guo Ren Reported-by: Liu Renwei Tested-by: Yuan Qiyun commit bba3d2daa8a9bc888902275401f15ef48fcdd378 Author: Alexandre Belloni Date: Mon Dec 31 00:49:36 2018 +0100 rtc: nvmem: fix possible use after free In cas of probe failure, devres may free the memory allocated for rtc->nvram before devm_rtc_release_device() is called. This leads to rtc_nvram_unregister using it after being freed which may lead to a crash. This has been shown to happen after commit 461e557b9727 ("rtc: nvmem: use devm_nvmem_register()") Reported-by: kernel test robot Signed-off-by: Alexandre Belloni commit 74136a3d47f51ae72ee8b9ebc1ec2a29bcf30676 Merge: 4bcd2ffd214c1 f6653a0e08775 Author: Dave Airlie Date: Mon Dec 31 08:29:38 2018 +1000 Merge branch 'drm-next-4.21' of git://people.freedesktop.org/~agd5f/linux into drm-next Fixes for 4.21. A bit more than usual due to the holidays. Highlights: - add new vegaM pci id - sr-iov fixes - DC fix for fast cursor updates - DC freesync fix - DC display clock fix for polaris - DC fixes for dongles - DC fix for some eDP panels - misc vega20 fixes - kfd return code fix for dma_buf support - VCN fixes for PCO - nbio hw bug workaround Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20181229183307.3330-1-alexander.deucher@amd.com commit c433570458e49bccea5c551df628d058b3526289 Author: Cong Wang Date: Sat Dec 29 13:56:36 2018 -0800 ax25: fix a use-after-free in ax25_fillin_cb() There are multiple issues here: 1. After freeing dev->ax25_ptr, we need to set it to NULL otherwise we may use a dangling pointer. 2. There is a race between ax25_setsockopt() and device notifier as reported by syzbot. Close it by holding RTNL lock. 3. We need to test if dev->ax25_ptr is NULL before using it. Reported-and-tested-by: syzbot+ae6bb869cbed29b29040@syzkaller.appspotmail.com Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit 7f334a7e1ae113212e39aafba51352ea9ab8c9f9 Author: Su Yanjun Date: Sat Dec 29 14:07:55 2018 -0500 ipv6: fix typo in net/ipv6/reassembly.c Signed-off-by: Su Yanjun Signed-off-by: David S. Miller commit 58075ff523af85002bfeace07304d57c59251605 Author: YueHaibing Date: Sat Dec 29 14:45:23 2018 +0800 ipv4: fib_rules: Fix possible infinite loop in fib_empty_table gcc warn this: net/ipv4/fib_rules.c:203 fib_empty_table() warn: always true condition '(id <= 4294967295) => (0-u32max <= u32max)' 'id' is u32, which always not greater than RT_TABLE_MAX (0xFFFFFFFF), So add a check to break while wrap around. Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 178fe94405bffbd1acd83b6ff3b40211185ae9c9 Author: Christophe JAILLET Date: Fri Dec 28 23:28:21 2018 +0100 net/ipv6: Fix a test against 'ipv6_find_idev()' return value 'ipv6_find_idev()' returns NULL on error, not an error pointer. Update the test accordingly and return -ENOBUFS, as already done in 'addrconf_add_dev()', if NULL is returned. Fixes: ("ipv6: allow userspace to add IFA_F_OPTIMISTIC addresses") Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit f989d03ef25df3fc26d3ea0fe7c19c9830577166 Author: Nikolay Aleksandrov Date: Sun Dec 30 14:33:20 2018 +0200 net: rtnetlink: address is mandatory for rtnl_fdb_get We must have an address to lookup otherwise we'll derefence a null pointer in the ndo_fdb_get callbacks. CC: Roopa Prabhu CC: David Ahern Reported-by: syzbot+017b1f61c82a1c3e7efd@syzkaller.appspotmail.com Fixes: 5b2f94b27622 ("net: rtnetlink: support for fdb get") Signed-off-by: Nikolay Aleksandrov Acked-by: Roopa Prabhu Signed-off-by: David S. Miller commit d770b25653447b4c57303859e2ac04ebe9318f8e Author: Dmitry V. Levin Date: Thu Dec 13 20:22:07 2018 +0300 csky: define syscall_get_arch() syscall_get_arch() is required to be implemented on all architectures in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Cc: Guo Ren Cc: Paul Moore Cc: Eric Paris Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: linux-audit@redhat.com Signed-off-by: Dmitry V. Levin Signed-off-by: Guo Ren arch/csky/include/asm/syscall.h | 7 +++++++ include/uapi/linux/audit.h | 1 + 2 files changed, 8 insertions(+) commit 077b930adafead095cd38600539ec129f1379d8c Author: Dmitry V. Levin Date: Thu Dec 13 20:22:00 2018 +0300 elf-em.h: add EM_CSKY The uapi/linux/audit.h header is going to use EM_CSKY in order to define AUDIT_ARCH_CSKY which is needed to implement syscall_get_arch() which in turn is required to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. The value for EM_CSKY has been taken from arch/csky/include/asm/elf.h and confirmed by binutils:include/elf/common.h Cc: Guo Ren Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Signed-off-by: Dmitry V. Levin Signed-off-by: Guo Ren commit c40f7d74c741a907cfaeb73a7697081881c497d0 Author: Linus Torvalds Date: Thu Dec 27 13:46:17 2018 -0800 sched/fair: Fix infinite loop in update_blocked_averages() by reverting a9e7f6544b9c Zhipeng Xie, Xie XiuQi and Sargun Dhillon reported lockups in the scheduler under high loads, starting at around the v4.18 time frame, and Zhipeng Xie tracked it down to bugs in the rq->leaf_cfs_rq_list manipulation. Do a (manual) revert of: a9e7f6544b9c ("sched/fair: Fix O(nr_cgroups) in load balance path") It turns out that the list_del_leaf_cfs_rq() introduced by this commit is a surprising property that was not considered in followup commits such as: 9c2791f936ef ("sched/fair: Fix hierarchical order in rq->leaf_cfs_rq_list") As Vincent Guittot explains: "I think that there is a bigger problem with commit a9e7f6544b9c and cfs_rq throttling: Let take the example of the following topology TG2 --> TG1 --> root: 1) The 1st time a task is enqueued, we will add TG2 cfs_rq then TG1 cfs_rq to leaf_cfs_rq_list and we are sure to do the whole branch in one path because it has never been used and can't be throttled so tmp_alone_branch will point to leaf_cfs_rq_list at the end. 2) Then TG1 is throttled 3) and we add TG3 as a new child of TG1. 4) The 1st enqueue of a task on TG3 will add TG3 cfs_rq just before TG1 cfs_rq and tmp_alone_branch will stay on rq->leaf_cfs_rq_list. With commit a9e7f6544b9c, we can del a cfs_rq from rq->leaf_cfs_rq_list. So if the load of TG1 cfs_rq becomes NULL before step 2) above, TG1 cfs_rq is removed from the list. Then at step 4), TG3 cfs_rq is added at the beginning of rq->leaf_cfs_rq_list but tmp_alone_branch still points to TG3 cfs_rq because its throttled parent can't be enqueued when the lock is released. tmp_alone_branch doesn't point to rq->leaf_cfs_rq_list whereas it should. So if TG3 cfs_rq is removed or destroyed before tmp_alone_branch points on another TG cfs_rq, the next TG cfs_rq that will be added, will be linked outside rq->leaf_cfs_rq_list - which is bad. In addition, we can break the ordering of the cfs_rq in rq->leaf_cfs_rq_list but this ordering is used to update and propagate the update from leaf down to root." Instead of trying to work through all these cases and trying to reproduce the very high loads that produced the lockup to begin with, simplify the code temporarily by reverting a9e7f6544b9c - which change was clearly not thought through completely. This (hopefully) gives us a kernel that doesn't lock up so people can continue to enjoy their holidays without worrying about regressions. ;-) [ mingo: Wrote changelog, fixed weird spelling in code comment while at it. ] Analyzed-by: Xie XiuQi Analyzed-by: Vincent Guittot Reported-by: Zhipeng Xie Reported-by: Sargun Dhillon Reported-by: Xie XiuQi Tested-by: Zhipeng Xie Tested-by: Sargun Dhillon Signed-off-by: Linus Torvalds Acked-by: Vincent Guittot Cc: # v4.13+ Cc: Bin Li Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Tejun Heo Cc: Thomas Gleixner Fixes: a9e7f6544b9c ("sched/fair: Fix O(nr_cgroups) in load balance path") Link: http://lkml.kernel.org/r/1545879866-27809-1-git-send-email-xiexiuqi@huawei.com Signed-off-by: Ingo Molnar commit dc3e0896003ee9b3bcc34c53965dc4bbc8671c44 Author: Masahiro Yamada Date: Mon Dec 17 01:03:25 2018 +0900 csky: remove meaningless header-y Since commit fcc8487d477a ("uapi: export all headers under uapi directories"), header-y is meaningless because headers under uapi are all exported. Signed-off-by: Masahiro Yamada Signed-off-by: Guo Ren commit 398539dd69341f8e3b87b8fea9355c7edfb6d99a Author: Yangtao Li Date: Thu Dec 27 12:45:51 2018 -0500 csky: Don't leak device tree node reference of_find_node_by_type() acquires a reference to the node returned by it and that reference needs to be dropped by its caller. setup_smp() doesn't do that, so fix it by converting to for_each_of_cpu_node(). Signed-off-by: Yangtao Li Signed-off-by: Guo Ren commit cc0282975b3f887005c380adcf0af95915f0c1bb Author: Christophe Leroy Date: Thu Dec 6 20:07:40 2018 +0000 kgdb/treewide: constify struct kgdb_arch arch_kgdb_ops checkpatch.pl reports the following: WARNING: struct kgdb_arch should normally be const #28: FILE: arch/mips/kernel/kgdb.c:397: +struct kgdb_arch arch_kgdb_ops = { This report makes sense, as all other ops struct, this one should also be const. This patch does the change. Cc: Vineet Gupta Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Yoshinori Sato Cc: Richard Kuo Cc: Michal Simek Cc: Ralf Baechle Cc: Paul Burton Cc: James Hogan Cc: Ley Foon Tan Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Rich Felker Cc: "David S. Miller" Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x86@kernel.org Acked-by: Daniel Thompson Acked-by: Paul Burton Signed-off-by: Christophe Leroy Acked-by: Borislav Petkov Acked-by: Michael Ellerman (powerpc) Signed-off-by: Daniel Thompson commit 911b7afdeb1b6058056c3a74e15d5ebb7eb6225e Author: Christophe Leroy Date: Thu Dec 6 20:07:38 2018 +0000 mips/kgdb: prepare arch_kgdb_ops for constness MIPS is the only architecture modifying arch_kgdb_ops during init. This patch makes the init static, so that it can be changed to const in following patch, as recommended by checkpatch.pl Suggested-by: Paul Burton Acked-by: Daniel Thompson Acked-by: Paul Burton Signed-off-by: Christophe Leroy Signed-off-by: Daniel Thompson commit 7faedcd4de4356dfcda30841a5ffef3bf35fa06c Author: Nicholas Mc Guire Date: Fri Jul 20 11:23:37 2018 +0200 kdb: use bool for binary state indicators defcmd_in_progress is the state trace for command group processing - within a command group or not - usable is an indicator if a command set is valid (allocated/non-empty) - so use a bool for those binary indication here. Signed-off-by: Nicholas Mc Guire Reviewed-by: Daniel Thompson Signed-off-by: Daniel Thompson commit 162bc7f5afd75b72acbe3c5f3488ef7e64a3fe36 Author: Douglas Anderson Date: Tue Dec 4 19:38:28 2018 -0800 kdb: Don't back trace on a cpu that didn't round up If you have a CPU that fails to round up and then run 'btc' you'll end up crashing in kdb becaue we dereferenced NULL. Let's add a check. It's wise to also set the task to NULL when leaving the debugger so that if we fail to round up on a later entry into the debugger we won't backtrace a stale task. Signed-off-by: Douglas Anderson Acked-by: Daniel Thompson Signed-off-by: Daniel Thompson commit 87b095928584da7d5cb3149016f00b0b139c2292 Author: Douglas Anderson Date: Tue Dec 4 19:38:27 2018 -0800 kgdb: Don't round up a CPU that failed rounding up before If we're using the default implementation of kgdb_roundup_cpus() that uses smp_call_function_single_async() we can end up hanging kgdb_roundup_cpus() if we try to round up a CPU that failed to round up before. Specifically smp_call_function_single_async() will try to wait on the csd lock for the CPU that we're trying to round up. If the previous round up never finished then that lock could still be held and we'll just sit there hanging. There's not a lot of use trying to round up a CPU that failed to round up before. Let's keep a flag that indicates whether the CPU started but didn't finish to round up before. If we see that flag set then we'll skip the next round up. In general we have a few goals here: - We never want to end up calling smp_call_function_single_async() when the csd is still locked. This is accomplished because flush_smp_call_function_queue() unlocks the csd _before_ invoking the callback. That means that when kgdb_nmicallback() runs we know for sure the the csd is no longer locked. Thus when we set "rounding_up = false" we know for sure that the csd is unlocked. - If there are no timeouts rounding up we should never skip a round up. NOTE #1: In general trying to continue running after failing to round up CPUs doesn't appear to be supported in the debugger. When I simulate this I find that kdb reports "Catastrophic error detected" when I try to continue. I can overrule and continue anyway, but it should be noted that we may be entering the land of dragons here. Possibly the "Catastrophic error detected" was added _because_ of the future failure to round up, but even so this is an area of the code that hasn't been strongly tested. NOTE #2: I did a bit of testing before and after this change. I introduced a 10 second hang in the kernel while holding a spinlock that I could invoke on a certain CPU with 'taskset -c 3 cat /sys/...". Before this change if I did: - Invoke hang - Enter debugger - g (which warns about Catastrophic error, g again to go anyway) - g - Enter debugger ...I'd hang the rest of the 10 seconds without getting a debugger prompt. After this change I end up in the debugger the 2nd time after only 1 second with the standard warning about 'Timed out waiting for secondary CPUs.' I'll also note that once the CPU finished waiting I could actually debug it (aka "btc" worked) I won't promise that everything works perfectly if the errant CPU comes back at just the wrong time (like as we're entering or exiting the debugger) but it certainly seems like an improvement. NOTE #3: setting 'kgdb_info[cpu].rounding_up = false' is in kgdb_nmicallback() instead of kgdb_call_nmi_hook() because some implementations override kgdb_call_nmi_hook(). It shouldn't hurt to have it in kgdb_nmicallback() in any case. NOTE #4: this logic is really only needed because there is no API call like "smp_try_call_function_single_async()" or "smp_csd_is_locked()". If such an API existed then we'd use it instead, but it seemed a bit much to add an API like this just for kgdb. Signed-off-by: Douglas Anderson Acked-by: Daniel Thompson Signed-off-by: Daniel Thompson commit 3cd99ac3559855f69afbc1d5080e17eaa12394ff Author: Douglas Anderson Date: Tue Dec 4 19:38:26 2018 -0800 kgdb: Fix kgdb_roundup_cpus() for arches who used smp_call_function() When I had lockdep turned on and dropped into kgdb I got a nice splat on my system. Specifically it hit: DEBUG_LOCKS_WARN_ON(current->hardirq_context) Specifically it looked like this: sysrq: SysRq : DEBUG ------------[ cut here ]------------ DEBUG_LOCKS_WARN_ON(current->hardirq_context) WARNING: CPU: 0 PID: 0 at .../kernel/locking/lockdep.c:2875 lockdep_hardirqs_on+0xf0/0x160 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.19.0 #27 pstate: 604003c9 (nZCv DAIF +PAN -UAO) pc : lockdep_hardirqs_on+0xf0/0x160 ... Call trace: lockdep_hardirqs_on+0xf0/0x160 trace_hardirqs_on+0x188/0x1ac kgdb_roundup_cpus+0x14/0x3c kgdb_cpu_enter+0x53c/0x5cc kgdb_handle_exception+0x180/0x1d4 kgdb_compiled_brk_fn+0x30/0x3c brk_handler+0x134/0x178 do_debug_exception+0xfc/0x178 el1_dbg+0x18/0x78 kgdb_breakpoint+0x34/0x58 sysrq_handle_dbg+0x54/0x5c __handle_sysrq+0x114/0x21c handle_sysrq+0x30/0x3c qcom_geni_serial_isr+0x2dc/0x30c ... ... irq event stamp: ...45 hardirqs last enabled at (...44): [...] __do_softirq+0xd8/0x4e4 hardirqs last disabled at (...45): [...] el1_irq+0x74/0x130 softirqs last enabled at (...42): [...] _local_bh_enable+0x2c/0x34 softirqs last disabled at (...43): [...] irq_exit+0xa8/0x100 ---[ end trace adf21f830c46e638 ]--- Looking closely at it, it seems like a really bad idea to be calling local_irq_enable() in kgdb_roundup_cpus(). If nothing else that seems like it could violate spinlock semantics and cause a deadlock. Instead, let's use a private csd alongside smp_call_function_single_async() to round up the other CPUs. Using smp_call_function_single_async() doesn't require interrupts to be enabled so we can remove the offending bit of code. In order to avoid duplicating this across all the architectures that use the default kgdb_roundup_cpus(), we'll add a "weak" implementation to debug_core.c. Looking at all the people who previously had copies of this code, there were a few variants. I've attempted to keep the variants working like they used to. Specifically: * For arch/arc we passed NULL to kgdb_nmicallback() instead of get_irq_regs(). * For arch/mips there was a bit of extra code around kgdb_nmicallback() NOTE: In this patch we will still get into trouble if we try to round up a CPU that failed to round up before. We'll try to round it up again and potentially hang when we try to grab the csd lock. That's not new behavior but we'll still try to do better in a future patch. Suggested-by: Daniel Thompson Signed-off-by: Douglas Anderson Cc: Vineet Gupta Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Richard Kuo Cc: Ralf Baechle Cc: Paul Burton Cc: James Hogan Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Yoshinori Sato Cc: Rich Felker Cc: "David S. Miller" Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Acked-by: Will Deacon Signed-off-by: Daniel Thompson commit 9ef7fa507d6b53a96de4da3298c5f01bde603c0a Author: Douglas Anderson Date: Tue Dec 4 19:38:25 2018 -0800 kgdb: Remove irq flags from roundup The function kgdb_roundup_cpus() was passed a parameter that was documented as: > the flags that will be used when restoring the interrupts. There is > local_irq_save() call before kgdb_roundup_cpus(). Nobody used those flags. Anyone who wanted to temporarily turn on interrupts just did local_irq_enable() and local_irq_disable() without looking at them. So we can definitely remove the flags. Signed-off-by: Douglas Anderson Cc: Vineet Gupta Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Cc: Richard Kuo Cc: Ralf Baechle Cc: Paul Burton Cc: James Hogan Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Yoshinori Sato Cc: Rich Felker Cc: "David S. Miller" Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Acked-by: Will Deacon Signed-off-by: Daniel Thompson commit f460772291f8171988b2b60141a45706123d0c69 Author: Michael Ellerman Date: Sun Dec 30 14:05:13 2018 +1100 KVM: PPC: Book3S HV: radix: Fix uninitialized var build error Old GCCs (4.6.3 at least), aren't able to follow the logic in __kvmhv_copy_tofrom_guest_radix() and warn that old_pid is used uninitialized: arch/powerpc/kvm/book3s_64_mmu_radix.c:75:3: error: 'old_pid' may be used uninitialized in this function The logic is OK, we only use old_pid if quadrant == 1, and in that case it has definitely be initialised, eg: if (quadrant == 1) { old_pid = mfspr(SPRN_PID); ... if (quadrant == 1 && pid != old_pid) mtspr(SPRN_PID, old_pid); Annotate it to fix the error. Signed-off-by: Michael Ellerman commit 42aee37298f4b1d91ecb55530a62de249ecf4266 Author: Michael Ellerman Date: Thu Dec 27 20:40:40 2018 +1100 powerpc/configs: Add PPC4xx_OCM to ppc40x_defconfig There was recently a compilation break to this driver, but we didn't notice because none of our defconfigs have it enabled. Fix that. Signed-off-by: Michael Ellerman commit 52b88fa1e8c7bae03bb691178a9f8bfb64e5679f Author: Michael Ellerman Date: Thu Dec 27 20:37:29 2018 +1100 powerpc/4xx/ocm: Fix phys_addr_t printf warnings Currently the code produces several warnings, eg: arch/powerpc/platforms/4xx/ocm.c:240:38: error: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'phys_addr_t {aka unsigned int}' seq_printf(m, "PhysAddr : 0x%llx\n", ocm->phys); ~~~^ ~~~~~~~~~ Fix it by using the special %pa[p] format for printing phys_addr_t. Note we need to pass the value by reference for the special specifier to work. Signed-off-by: Michael Ellerman commit d0757237d7b18b1ce74293be7c077d86f7a732e8 Author: Christian Lamparter Date: Sat Dec 22 15:35:38 2018 +0100 powerpc/4xx/ocm: Fix compilation error due to PAGE_KERNEL usage This patch fixes a recent compilation regression in ocm: ocm.c: In function ‘ocm_init_node’: ocm.c:182:18: error: invalid operands to binary | (have ‘int’ and ‘pgprot_t’ {aka ‘struct ’}) _PAGE_EXEC | PAGE_KERNEL_NCG); ^ ocm.c:197:17: error: invalid operands to binary | (have ‘int’ and ‘pgprot_t’ {aka ‘struct ’}) _PAGE_EXEC | PAGE_KERNEL); ^ Fixes: 56f3c1413f5c ("powerpc/mm: properly set PAGE_KERNEL flags in ioremap()") Cc: stable@vger.kernel.org # v4.20 Signed-off-by: Christian Lamparter Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 039daac5526932ec731e4499613018d263af8b3e Author: Diana Craciun Date: Sun Dec 23 22:34:25 2018 +0200 powerpc/fsl: Fixed warning: orphan section `__btb_flush_fixup' Fixed the following build warning: powerpc-linux-gnu-ld: warning: orphan section `__btb_flush_fixup' from `arch/powerpc/kernel/head_44x.o' being placed in section `__btb_flush_fixup'. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit f7d18ef6a95f399544d7b767291980cecddc32eb Merge: 0d9c9a238faf9 a007232066f68 Author: David S. Miller Date: Sat Dec 29 14:25:52 2018 -0800 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, specifically fixes for the nf_conncount infrastructure which is causing troubles since 5c789e131cbb9 ("netfilter: nf_conncount: Add list lock and gc worker, and RCU for init tree search"). Patches aim to simplify this infrastructure while fixing up the problems: 1) Use fixed size CONNCOUNT_SLOTS in nf_conncount, from Shawn Bohrer. 2) Incorrect signedness in age calculation from find_or_evict(), from Florian Westphal. 3) Proper locking for the garbage collector workqueue callback, first make a patch to count how many nodes can be collected without holding locks, then grab lock and release them. Also from Florian. 4) Restart node lookup from the insertion path, after releasing nodes via packet path garbage collection. Shawn Bohrer described a scenario that may result in inserting a connection in an already dead list node. Patch from Florian. 5) Merge lookup and add function to avoid a hold release and re-grab. From Florian. 6) Be safe and iterate over the node lists under the spinlock. 7) Speculative list nodes removal via garbage collection, check if list node got a connection while it was scheduled for deletion via gc. 8) Accidental argument swap in find_next_bit() that leads to more frequent scheduling of the workqueue. From Florian Westphal. ==================== Signed-off-by: David S. Miller commit 195303136f192d37b89e20a8d1d2670d0d825266 Merge: 769e47094dcc0 5cfc879caee81 Author: Linus Torvalds Date: Sat Dec 29 13:40:29 2018 -0800 Merge tag 'kconfig-v4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kconfig file consolidation from Masahiro Yamada: "Consolidation of bus (PCI, PCMCIA, EISA, RapidIO) config entries by Christoph Hellwig. Currently, every architecture that wants to provide common peripheral busses needs to add some boilerplate code and include the right Kconfig files. This series instead just selects the presence (when needed) and then handles everything in the bus-specific Kconfig file under drivers/" * tag 'kconfig-v4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: pcmcia: remove per-arch PCMCIA config entry eisa: consolidate EISA Kconfig entry in drivers/eisa rapidio: consolidate RAPIDIO config entry in drivers/rapidio pcmcia: allow PCMCIA support independent of the architecture PCI: consolidate the PCI_SYSCALL symbol PCI: consolidate the PCI_DOMAINS and PCI_DOMAINS_GENERIC config options PCI: consolidate PCI config entry in drivers/pci MIPS: remove the HT_PCI config option commit 769e47094dcc0ddc8fe8e04c13565a71134ec1a2 Merge: 668c35f69cc75 f222b7f43661c Author: Linus Torvalds Date: Sat Dec 29 13:03:29 2018 -0800 Merge tag 'kconfig-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kconfig updates from Masahiro Yamada: - support -y option for merge_config.sh to avoid downgrading =y to =m - remove S_OTHER symbol type, and touch include/config/*.h files correctly - fix file name and line number in lexer warnings - fix memory leak when EOF is encountered in quotation - resolve all shift/reduce conflicts of the parser - warn no new line at end of file - make 'source' statement more strict to take only string literal - rewrite the lexer and remove the keyword lookup table - convert to SPDX License Identifier - compile C files independently instead of including them from zconf.y - fix various warnings of gconfig - misc cleanups * tag 'kconfig-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (39 commits) kconfig: surround dbg_sym_flags with #ifdef DEBUG to fix gconf warning kconfig: split images.c out of qconf.cc/gconf.c to fix gconf warnings kconfig: add static qualifiers to fix gconf warnings kconfig: split the lexer out of zconf.y kconfig: split some C files out of zconf.y kconfig: convert to SPDX License Identifier kconfig: remove keyword lookup table entirely kconfig: update current_pos in the second lexer kconfig: switch to ASSIGN_VAL state in the second lexer kconfig: stop associating kconf_id with yylval kconfig: refactor end token rules kconfig: stop supporting '.' and '/' in unquoted words treewide: surround Kconfig file paths with double quotes microblaze: surround string default in Kconfig with double quotes kconfig: use T_WORD instead of T_VARIABLE for variables kconfig: use specific tokens instead of T_ASSIGN for assignments kconfig: refactor scanning and parsing "option" properties kconfig: use distinct tokens for type and default properties kconfig: remove redundant token defines kconfig: rename depends_list to comment_option_list ... commit 668c35f69cc750aaf07bd5fe7710a47e2aed6e43 Merge: d8372ba8ce288 dec28d8ea2f73 Author: Linus Torvalds Date: Sat Dec 29 12:03:17 2018 -0800 Merge tag 'kbuild-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild updates from Masahiro Yamada: "Kbuild core: - remove unneeded $(call cc-option,...) switches - consolidate Clang compiler flags into CLANG_FLAGS - announce the deprecation of SUBDIRS - fix single target build for external module - simplify the dependencies of 'prepare' stage targets - allow fixdep to directly write to .*.cmd files - simplify dependency generation for CONFIG_TRIM_UNUSED_KSYMS - change if_changed_rule to accept multi-line recipe - move .SECONDARY special target to scripts/Kbuild.include - remove redundant 'set -e' - improve parallel execution for CONFIG_HEADERS_CHECK - misc cleanups Treewide fixes and cleanups - set Clang flags correctly for PowerPC boot images - fix UML build error with CONFIG_GCC_PLUGINS - remove unneeded patterns from .gitignore files - refactor firmware/Makefile - remove unneeded rules for *offsets.s - avoid unneeded regeneration of intermediate .s files - clean up ./Kbuild Modpost: - remove unused -M, -K options - fix false positive warnings about section mismatch - use simple devtable lookup instead of linker magic - misc cleanups Coccinelle: - relax boolinit.cocci checks for overall consistency - fix warning messages of boolinit.cocci Other tools: - improve -dirty check of scripts/setlocalversion - add a tool to generate compile_commands.json from .*.cmd files" * tag 'kbuild-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (51 commits) kbuild: remove unused cmd_gentimeconst kbuild: remove $(obj)/ prefixes in ./Kbuild treewide: add intermediate .s files to targets treewide: remove explicit rules for *offsets.s firmware: refactor firmware/Makefile firmware: remove unnecessary patterns from .gitignore scripts: remove unnecessary ihex2fw and check-lc_ctypes from .gitignore um: remove unused filechk_gen_header in Makefile scripts: add a tool to produce a compile_commands.json file kbuild: add -Werror=implicit-int flag unconditionally kbuild: add -Werror=strict-prototypes flag unconditionally kbuild: add -fno-PIE flag unconditionally scripts: coccinelle: Correct warning message scripts: coccinelle: only suggest true/false in files that already use them kbuild: handle part-of-module correctly for *.ll and *.symtypes kbuild: refactor part-of-module kbuild: refactor quiet_modtag kbuild: remove redundant quiet_modtag for $(obj-m) kbuild: refactor Makefile.asm-generic user/Makefile: Fix typo and capitalization in comment section ... commit d8372ba8ce288acdfce67cb873b2a741785c2e88 Author: NeilBrown Date: Sat Dec 29 13:58:09 2018 +1100 lib: don't depend on linux headers being installed. gen_crc64table requires linux include files to be installed in /usr/include/linux. This is a new requrement so hosts that could previously build the kernel, now cannot. gen_crc64table makes this requirement by including , but nothing from that header is actaully used. So remove the #include, so that the linux headers no longer need to be installed. Fixes: feba04fd2cf8 ("lib: add crc64 calculation routines") Signed-off-by: NeilBrown Acked-by: Coly Li Signed-off-by: Linus Torvalds commit 3868772b99e3146d02cf47e739d79022eba1d77c Merge: 6f9d71c9c759b 942104a21ce49 Author: Linus Torvalds Date: Sat Dec 29 11:21:49 2018 -0800 Merge tag 'docs-5.0' of git://git.lwn.net/linux Pull documentation update from Jonathan Corbet: "A fairly normal cycle for documentation stuff. We have a new document on perf security, more Italian translations, more improvements to the memory-management docs, improvements to the pathname lookup documentation, and the usual array of smaller fixes. As is often the case, there are a few reaches outside of Documentation/ to adjust kerneldoc comments" * tag 'docs-5.0' of git://git.lwn.net/linux: (38 commits) docs: improve pathname-lookup document structure configfs: fix wrong name of struct in documentation docs/mm-api: link slab_common.c to "The Slab Cache" section slab: make kmem_cache_create{_usercopy} description proper kernel-doc doc:process: add links where missing docs/core-api: make mm-api.rst more structured x86, boot: documentation whitespace fixup Documentation: devres: note checking needs when converting doc:it: add some process/* translations doc:it: fixes in process/1.Intro Documentation: convert path-lookup from markdown to resturctured text Documentation/admin-guide: update admin-guide index.rst Documentation/admin-guide: introduce perf-security.rst file scripts/kernel-doc: Fix struct and struct field attribute processing Documentation: dev-tools: Fix typos in index.rst Correct gen_init_cpio tool's documentation Document /proc/pid PID reuse behavior Documentation: update path-lookup.md for parallel lookups Documentation: Use "while" instead of "whilst" dmaengine: Add mailing list address to the documentation ... commit 6f9d71c9c759b1e7d31189a4de228983192c7dc7 Merge: 55db91fbaad9e 3fc9c12d27b4d Author: Linus Torvalds Date: Sat Dec 29 10:57:20 2018 -0800 Merge branch 'for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup updates from Tejun Heo: - Waiman's cgroup2 cpuset support has been finally merged closing one of the last remaining feature gaps. - cgroup.procs could show non-leader threads when cgroup2 threaded mode was used in certain ways. I forgot to push the fix during the last cycle. - A patch to fix mount option parsing when all mount options have been consumed by someone else (LSM). - cgroup_no_v1 boot param can now block named cgroup1 hierarchies too. * 'for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup: Add named hierarchy disabling to cgroup_no_v1 boot param cgroup: fix parsing empty mount option string cpuset: Remove set but not used variable 'cs' cgroup: fix CSS_TASK_ITER_PROCS cgroup: Add .__DEBUG__. prefix to debug file names cpuset: Minor cgroup2 interface updates cpuset: Expose cpuset.cpus.subpartitions with cgroup_debug cpuset: Add documentation about the new "cpuset.sched.partition" flag cpuset: Use descriptive text when reading/writing cpuset.sched.partition cpuset: Expose cpus.effective and mems.effective on cgroup v2 root cpuset: Make generate_sched_domains() work with partition cpuset: Make CPU hotplug work with partition cpuset: Track cpusets that use parent's effective_cpus cpuset: Add an error state to cpuset.sched.partition cpuset: Add new v2 cpuset.sched.partition flag cpuset: Simply allocation and freeing of cpumasks cpuset: Define data structures to support scheduling partition cpuset: Enable cpuset controller in default hierarchy cgroup: remove unnecessary unlikely() commit 90be9b86da9039fe6cf2880dc16fd0b0899603a5 Author: Julia Lawall Date: Sun Dec 23 14:52:12 2018 -0800 xfs: xfs_fsops: drop useless LIST_HEAD Drop LIST_HEAD where the variable it declares is never used. Commit 0410c3bb2b88 ("xfs: factor ag btree root block initialisation") stopped using buffer_list and started using a buffer list in an aghdr_init_data structure, but the declaration of buffer_list was not removed. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; @@ - LIST_HEAD(x); ... when != x // Fixes: 0410c3bb2b88 ("xfs: factor ag btree root block initialisation") Signed-off-by: Julia Lawall Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 89be677b6b39f7be4533fea3281d49ff3e3af835 Author: Julia Lawall Date: Sun Dec 23 14:52:11 2018 -0800 xfs: xfs_buf: drop useless LIST_HEAD Drop LIST_HEAD where the variable it declares has never been used. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; @@ - LIST_HEAD(x); ... when != x // Fixes: 26f1fe858f274 ("xfs: reduce lock hold times in buffer writeback") Signed-off-by: Julia Lawall Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 55db91fbaad9ea769d516e6867195808b4399894 Merge: 9ef10340749e1 6ab7d47bcbf01 Author: Linus Torvalds Date: Sat Dec 29 10:13:23 2018 -0800 Merge branch 'for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu Pull percpu update from Dennis Zhou: "Michael Cree noted generic UP Alpha has been broken since v3.18. This is a small fix for locking in UP percpu code that fixes the issue" * 'for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu: percpu: convert spin_lock_irq to spin_lock_irqsave. commit 9ef10340749e1da0c7fde609cedd5360f8484a0b Merge: 889bb74302e5a 64711f9a47d4d Author: Linus Torvalds Date: Sat Dec 29 09:40:40 2018 -0800 Merge tag 'xtensa-20181228' of git://github.com/jcmvbkbc/linux-xtensa Pull Xtensa updates from Max Filippov: - switch to generated syscall table - switch ptrace to regsets, use regsets for core dumps - complete tracehook implementation - add syscall tracepoints support - add jumplabels support - add memtest support - drop unused/duplicated code from entry.S, ptrace.c, coprocessor.S, elf.h and syscall.h - clean up warnings caused by WSR/RSR macros - clean up DTC warnings about SPI controller node names in xtfpga.dtsi - simplify coprocessor.S - get rid of explicit 'l32r' instruction usage in assembly * tag 'xtensa-20181228' of git://github.com/jcmvbkbc/linux-xtensa: (25 commits) xtensa: implement jump_label support xtensa: implement syscall tracepoints xtensa: implement tracehook functions and enable HAVE_ARCH_TRACEHOOK xtensa: enable CORE_DUMP_USE_REGSET xtensa: implement TIE regset xtensa: implement task_user_regset_view xtensa: call do_syscall_trace_{enter,leave} selectively xtensa: use NO_SYSCALL instead of -1 xtensa: define syscall_get_arch() Move EM_XTENSA to uapi/linux/elf-em.h xtensa: support memtest xtensa: don't use l32r opcode directly xtensa: xtfpga.dtsi: fix dtc warnings about SPI xtensa: don't clear cpenable unconditionally on release xtensa: simplify coprocessor.S xtensa: clean up WSR*/RSR*/get_sr/set_sr xtensa: drop unused declarations from elf.h xtensa: clean up syscall.h xtensa: drop unused coprocessor helper functions xtensa: drop custom PTRACE_{PEEK,POKE}{TEXT,DATA} ... commit 889bb74302e5aba85d987b4093344150984d7cda Merge: 903b77c631673 e2f3f8b4a497d Author: Linus Torvalds Date: Sat Dec 29 09:37:03 2018 -0800 Merge tag 'nds32-for-linus-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/greentime/linux Pull nds32 updates from Greentime Hu: - Perf support - Power management support - FPU support - Hardware prefetcher support - Build error fixed - Performance enhancement * tag 'nds32-for-linus-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/greentime/linux: nds32: support hardware prefetcher nds32: Fix the items of hwcap_str ordering issue. math-emu/soft-fp.h: (_FP_ROUND_ZERO) cast 0 to void to fix warning math-emu/op-2.h: Use statement expressions to prevent negative constant shift nds32: support denormalized result through FP emulator nds32: Support FP emulation nds32: nds32 FPU port nds32: Remove duplicated include from pm.c nds32: Power management for nds32 nds32: Add document for NDS32 PMU. nds32: Add perf call-graph support. nds32: Perf porting nds32: Fix bug in bitfield.h nds32: Fix gcc 8.0 compiler option incompatible. nds32: Fill all TLB entries with kernel image mapping nds32: Remove the redundant assignment commit 093c48213ee37c3c3ff1cf5ac1aa2a9d8bc66017 Author: Wenwen Wang Date: Wed Dec 26 20:15:13 2018 -0600 gdrom: fix a memory leak bug In probe_gdrom(), the buffer pointed by 'gd.cd_info' is allocated through kzalloc() and is used to hold the information of the gdrom device. To register and unregister the device, the pointer 'gd.cd_info' is passed to the functions register_cdrom() and unregister_cdrom(), respectively. However, this buffer is not freed after it is used, which can cause a memory leak bug. This patch simply frees the buffer 'gd.cd_info' in exit_gdrom() to fix the above issue. Signed-off-by: Wenwen Wang Signed-off-by: Jens Axboe commit 0d9c9a238faf925823bde866182c663b6d734f2e Author: Scott Wood Date: Thu Dec 27 18:29:09 2018 -0600 fsl/fman: Use GFP_ATOMIC in {memac,tgec}_add_hash_mac_address() These functions are called from atomic context: [ 9.150239] BUG: sleeping function called from invalid context at /home/scott/git/linux/mm/slab.h:421 [ 9.158159] in_atomic(): 1, irqs_disabled(): 0, pid: 4432, name: ip [ 9.163128] CPU: 8 PID: 4432 Comm: ip Not tainted 4.20.0-rc2-00169-g63d86876f324 #29 [ 9.163130] Call Trace: [ 9.170701] [c0000002e899a980] [c0000000009c1068] .dump_stack+0xa8/0xec (unreliable) [ 9.177140] [c0000002e899aa10] [c00000000007a7b4] .___might_sleep+0x138/0x164 [ 9.184440] [c0000002e899aa80] [c0000000001d5bac] .kmem_cache_alloc_trace+0x238/0x30c [ 9.191216] [c0000002e899ab40] [c00000000065ea1c] .memac_add_hash_mac_address+0x104/0x198 [ 9.199464] [c0000002e899abd0] [c00000000065a788] .set_multi+0x1c8/0x218 [ 9.206242] [c0000002e899ac80] [c0000000006615ec] .dpaa_set_rx_mode+0xdc/0x17c [ 9.213544] [c0000002e899ad00] [c00000000083d2b0] .__dev_set_rx_mode+0x80/0xd4 [ 9.219535] [c0000002e899ad90] [c00000000083d334] .dev_set_rx_mode+0x30/0x54 [ 9.225271] [c0000002e899ae10] [c00000000083d4a0] .__dev_open+0x148/0x1c8 [ 9.230751] [c0000002e899aeb0] [c00000000083d934] .__dev_change_flags+0x19c/0x1e0 [ 9.230755] [c0000002e899af60] [c00000000083d9a4] .dev_change_flags+0x2c/0x80 [ 9.242752] [c0000002e899aff0] [c0000000008554ec] .do_setlink+0x350/0xf08 [ 9.248228] [c0000002e899b170] [c000000000857ad0] .rtnl_newlink+0x588/0x7e0 [ 9.253965] [c0000002e899b740] [c000000000852424] .rtnetlink_rcv_msg+0x3e0/0x498 [ 9.261440] [c0000002e899b820] [c000000000884790] .netlink_rcv_skb+0x134/0x14c [ 9.267607] [c0000002e899b8e0] [c000000000851840] .rtnetlink_rcv+0x18/0x2c [ 9.274558] [c0000002e899b950] [c000000000883c8c] .netlink_unicast+0x214/0x318 [ 9.281163] [c0000002e899ba00] [c000000000884220] .netlink_sendmsg+0x348/0x444 [ 9.287076] [c0000002e899bae0] [c00000000080d13c] .sock_sendmsg+0x2c/0x54 [ 9.287080] [c0000002e899bb50] [c0000000008106c0] .___sys_sendmsg+0x2d0/0x2d8 [ 9.298375] [c0000002e899bd30] [c000000000811a80] .__sys_sendmsg+0x5c/0xb0 [ 9.303939] [c0000002e899be20] [c0000000000006b0] system_call+0x60/0x6c Signed-off-by: Scott Wood Signed-off-by: David S. Miller commit 7418e6520f22a2e35815122fa5a53d5bbfa2c10f Author: Jia-Ju Bai Date: Wed Dec 26 22:09:34 2018 +0800 isdn: hisax: hfc_pci: Fix a possible concurrency use-after-free bug in HFCPCI_l1hw() In drivers/isdn/hisax/hfc_pci.c, the functions hfcpci_interrupt() and HFCPCI_l1hw() may be concurrently executed. HFCPCI_l1hw() line 1173: if (!cs->tx_skb) hfcpci_interrupt() line 942: spin_lock_irqsave(); line 1066: dev_kfree_skb_irq(cs->tx_skb); Thus, a possible concurrency use-after-free bug may occur in HFCPCI_l1hw(). To fix these bugs, the calls to spin_lock_irqsave() and spin_unlock_irqrestore() are added in HFCPCI_l1hw(), to protect the access to cs->tx_skb. Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 903b77c631673eeec9e9114e9524171cdf9a2646 Merge: 457fa3469a65a 283ac6d5fb2a4 Author: Linus Torvalds Date: Fri Dec 28 21:27:13 2018 -0800 Merge tag 'linux-kselftest-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest updates from Shuah Khan: - fixes and improvements to the framework, and individual tests - a new media test for IR encoders from Sean Young - a new watchdog test option to find time left on a timer * tag 'linux-kselftest-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests: Fix test errors related to lib.mk khdr target fix dma-buf/udmabuf selftest selftests: watchdog: fix spelling mistake "experies" -> "expires" selftests: watchdog: Add gettimeleft command line arg selftests: do not macro-expand failed assertion expressions selftests/ftrace: Fix invalid SPDX identifiers selftests: gpio: Find libmount with pkg-config if available selftests: firmware: add CONFIG_FW_LOADER_USER_HELPER_FALLBACK to config selftests: firmware: remove use of non-standard diff -Z option media: rc: self test for IR encoders and decoders commit f9fc54d313fab2834f44f516459cdc8ac91d797f Author: Yunsheng Lin Date: Wed Dec 26 19:51:46 2018 +0800 ethtool: check the return value of get_regs_len The return type for get_regs_len in struct ethtool_ops is int, the hns3 driver may return error when failing to get the regs len by sending cmd to firmware. Signed-off-by: Yunsheng Lin Signed-off-by: David S. Miller commit 457fa3469a65a524be04412f5cd497fa3b11c9fd Merge: b07039b79c9ea fbc4904c28777 Author: Linus Torvalds Date: Fri Dec 28 20:54:57 2018 -0800 Merge tag 'char-misc-4.21-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 big set of char and misc driver patches for 4.21-rc1. Lots of different types of driver things in here, as this tree seems to be the "collection of various driver subsystems not big enough to have their own git tree" lately. Anyway, some highlights of the changes in here: - binderfs: is it a rule that all driver subsystems will eventually grow to have their own filesystem? Binder now has one to handle the use of it in containerized systems. This was discussed at the Plumbers conference a few months ago and knocked into mergable shape very fast by Christian Brauner. Who also has signed up to be another binder maintainer, showing a distinct lack of good judgement :) - binder updates and fixes - mei driver updates - fpga driver updates and additions - thunderbolt driver updates - soundwire driver updates - extcon driver updates - nvmem driver updates - hyper-v driver updates - coresight driver updates - pvpanic driver additions and reworking for more device support - lp driver updates. Yes really, it's _finally_ moved to the proper parallal port driver model, something I never thought I would see happen. Good stuff. - other tiny driver updates and fixes. All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (116 commits) MAINTAINERS: add another Android binder maintainer intel_th: msu: Fix an off-by-one in attribute store stm class: Add a reference to the SyS-T document stm class: Fix a module refcount leak in policy creation error path char: lp: use new parport device model char: lp: properly count the lp devices char: lp: use first unused lp number while registering char: lp: detach the device when parallel port is removed char: lp: introduce list to save port number bus: qcom: remove duplicated include from qcom-ebi2.c VMCI: Use memdup_user() rather than duplicating its implementation char/rtc: Use of_node_name_eq for node name comparisons misc: mic: fix a DMA pool free failure ptp: fix an IS_ERR() vs NULL check genwqe: Fix size check binder: implement binderfs binder: fix use-after-free due to ksys_close() during fdget() bus: fsl-mc: remove duplicated include files bus: fsl-mc: explicitly define the fsl_mc_command endianness misc: ti-st: make array read_ver_cmd static, shrinks object size ... commit b07039b79c9ea64c1eacda1e01d645082e4a0d5d Merge: 02061181d3a9c 16df1456aa858 Author: Linus Torvalds Date: Fri Dec 28 20:44:29 2018 -0800 Merge tag 'driver-core-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here is the "big" set of driver core patches for 4.21-rc1. It's not really big, just a number of small changes for some reported issues, some documentation updates to hopefully make it harder for people to abuse the driver model, and some other minor cleanups. All of these have been in linux-next for a while with no reported issues" * tag 'driver-core-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: mm, memory_hotplug: update a comment in unregister_memory() component: convert to DEFINE_SHOW_ATTRIBUTE sysfs: Disable lockdep for driver bind/unbind files driver core: Add missing dev->bus->need_parent_lock checks kobject: return error code if writing /sys/.../uevent fails driver core: Move async_synchronize_full call driver core: platform: Respect return code of platform_device_register_full() kref/kobject: Improve documentation drivers/base/memory.c: Use DEVICE_ATTR_RO and friends driver core: Replace simple_strto{l,ul} by kstrtou{l,ul} kernfs: Improve kernfs_notify() poll notification latency kobject: Fix warnings in lib/kobject_uevent.c kobject: drop unnecessary cast "%llu" for u64 driver core: fix comments for device_block_probing() driver core: Replace simple_strtol by kstrtoint commit 02061181d3a9ccfe15ef6bc15fa56283acc47620 Merge: 117eda8f71ff5 215852f4b8bbf Author: Linus Torvalds Date: Fri Dec 28 20:39:58 2018 -0800 Merge tag 'staging-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging/IIO driver updates from Greg KH: "Here is the big staging and iio driver pull request for 4.21-rc1. Lots and lots of tiny patches here, nothing major at all. Which is good, tiny cleanups is nice to see. No new huge driver removal or addition, this release cycle, although there are lots of good IIO driver changes, addtions, and movement from staging into the "real" part of the kernel, which is always great. Full details are in the shortlog, and all of these have been in linux-next for a while with no reported issues" * tag 'staging-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (553 commits) staging: mt7621-mmc: Correct spelling mistakes in comments staging: wilc1000: fix missing read_write setting when reading data mt7621-mmc: char * array declaration might be better as static const mt7621-mmc: return statement in void function unnecessary mt7621-mmc: Alignment should match open parenthesis mt7621-mmc: Removed unnecessary blank lines mt7621-mmc: Fix some coding style issues staging: android: ashmem: doc: Fix spelling staging: rtl8188eu: cleanup brace coding style issues staging: rtl8188eu: add spaces around '&' in rtw_mlme_ext.c staging: rtl8188eu: change return type of is_basicrate() to bool staging: rtl8188eu: simplify null array initializations staging: rtl8188eu: change order of declarations to improve readability staging: rtl8188eu: make some arrays static in rtw_mlme_ext.c staging: rtl8188eu: constify some arrays staging: rtl8188eu: convert unsigned char arrays to u8 staging: rtl8188eu: remove redundant declaration in rtw_mlme_ext.c staging: rtl8188eu: remove unused arrays WFD_OUI and WMM_INFO_OUI staging: rtl8188eu: remove unnecessary parentheses in rtw_mlme_ext.c staging: rtl8188eu: remove unnecessary comments in rtw_mlme_ext.c ... commit 117eda8f71ff545cfdec8fe8073adbd173a1ceff Merge: c0ea81b4d3783 598134ffcab5b Author: Linus Torvalds Date: Fri Dec 28 20:33:54 2018 -0800 Merge tag 'tty-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial driver updates from Greg KH: "Here is the large TTY/Serial driver set of patches for 4.21-rc1. A number of small serial driver changes along with some good tty core fixes for long-reported issues with locking. There is also a new console font added to the tree, for high-res screens, so that should be helpful for many. The last patch in the series is a revert of an older one in the tree, it came late but it resolves a reported issue that linux-next was having for some people. Full details are in the shortlog, and all of these, with the exception of the revert, have been in linux-next for a while with no reported issues" * tag 'tty-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (85 commits) Revert "serial: 8250: Default SERIAL_OF_PLATFORM to SERIAL_8250" serial: sccnxp: Allow to use non-standard baud rates serial: sccnxp: Adds a delay between sequential read/write cycles tty: serial: qcom_geni_serial: Fix UART hang tty: serial: qcom_geni_serial: Fix wrap around of TX buffer serial: max310x: Fix tx_empty() callback dt-bindings: serial: sh-sci: Document r8a774c0 bindings dt-bindings: serial: sh-sci: Document r8a774a1 bindings Fonts: New Terminus large console font dt-bindings: serial: lpuart: add imx8qxp compatible string serial: uartps: Fix interrupt mask issue to handle the RX interrupts properly serial: uartps: Fix error path when alloc failed serial: uartps: Check if the device is a console serial: uartps: Add the device_init_wakeup tty: serial: samsung: Increase maximum baudrate tty: serial: samsung: Properly set flags in autoCTS mode tty: Use of_node_name_{eq,prefix} for node name comparisons tty/serial: do not free trasnmit buffer page under port lock serial: 8250: Rate limit serial port rx interrupts during input overruns dt-bindings: serial: 8250: Add rate limit for serial port input overruns ... commit c0ea81b4d37837409d0dfd2036098a7babb312ed Merge: 4d6ad6fba6b7a 4b2c01ad902ec Author: Linus Torvalds Date: Fri Dec 28 20:30:00 2018 -0800 Merge tag 'usb-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB/PHY updates from Greg KH: "Here is the big set of USB and PHY driver patches for 4.21-rc1. All of the usual bits are in here: - loads of USB gadget driver updates and additions - new device ids - phy driver updates - xhci reworks and new features - typec updates Full details are in the shortlog. All of these have been in linux-next for a long time with no reported issues" * tag 'usb-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (142 commits) USB: serial: option: add Fibocom NL678 series cdc-acm: fix abnormal DATA RX issue for Mediatek Preloader. usb: r8a66597: Fix a possible concurrency use-after-free bug in r8a66597_endpoint_disable() usb: typec: tcpm: Extend the matching rules on PPS APDO selection usb: typec: Improve Alt Mode documentation usb: musb: dsps: fix runtime pm for peripheral mode usb: musb: dsps: fix otg state machine USB: serial: pl2303: add ids for Hewlett-Packard HP POS pole displays usb: renesas_usbhs: add support for RZ/G2E usb: ehci-omap: Fix deferred probe for phy handling usb: roles: Add a description for the class to Kconfig usb: renesas_usbhs: mark PM functions as __maybe_unused usb: core: Remove unnecessary memset() usb: host: isp1362-hcd: convert to DEFINE_SHOW_ATTRIBUTE phy: qcom-qmp: Expose provided clocks to DT dt-bindings: phy-qcom-qmp: Move #clock-cells to child phy: qcom-qmp: Utilize fully-specified DT registers dt-bindings: phy-qcom-qmp: Fix register underspecification phy: ti: fix semicolon.cocci warnings phy: dphy: Add configuration helpers ... commit 4d6ad6fba6b7af06143c67964f4095c74c9ce87c Merge: 579a70035949b 3a658e09a2155 Author: Linus Torvalds Date: Fri Dec 28 20:28:25 2018 -0800 Merge tag 'hsi-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi Pull HSI update from Sebastian Reichel: "omap-ssi: use DEFINE_SHOW_ATTRIBUTE" * tag 'hsi-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi: HSI: omap_ssi: Change to use DEFINE_SHOW_ATTRIBUTE macro commit 579a70035949b771a63a686db8becdd9b197d986 Merge: 030672aea826a 9580913966488 Author: Linus Torvalds Date: Fri Dec 28 20:22:45 2018 -0800 Merge tag 'for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: - New core support: - battery internal resistance - battery OCV capacity lookup table - support for custom sysfs attributes - Convert all drivers to use power-supply core support for custom sysfs attributes - bq24190-charger: bq24196 support - axp20x-charger: AXP813 support - sc27xx-battery: new fuel gauge driver - gpio-poweroff: support for specific active and inactive delays - Misc fixes * tag 'for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (53 commits) power: supply: bq25890: fix BAT_COMP field definition power: supply: gpio-charger: Do not use deprecated POWER_SUPPLY_TYPE_USB_* power: supply: ds2781: switch to devm_power_supply_register power: supply: ds2780: switch to devm_power_supply_register power: supply: ds2781: fix race-condition in bin attribute registration power: supply: ds2780: fix race-condition in bin attribute registration power: supply: pcf50633: fix race-condition in sysfs registration power: supply: charger-manager: fix race-condition in sysfs registration power: supply: charger-manager: simplify generation of sysfs attribute group name power: supply: bq24257: fix race-condition in sysfs registration power: supply: bq24190_charger: fix race-condition in sysfs registration power: supply: lp8788: fix race-condition in sysfs registration power: supply: ds2781: fix race-condition in sysfs registration power: supply: ds2780: fix race-condition in sysfs registration power: supply: bq2415x: fix race-condition in sysfs registration power: supply: core: add support for custom sysfs attributes power: supply: sc27xx: Save last battery capacity power: reset: at91-poweroff: move shdwc related data to one structure power: supply: sc27xx: Add suspend/resume interfaces power: supply: sc27xx: Add fuel gauge low voltage alarm ... commit 030672aea826adf3dee9100ee8ac303b62c8fe7f Merge: 24dc83635ffe3 5801169a2ed20 Author: Linus Torvalds Date: Fri Dec 28 20:08:34 2018 -0800 Merge tag 'devicetree-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull Devicetree updates from Rob Herring: "The biggest highlight here is the start of using json-schema for DT bindings. Being able to validate bindings has been discussed for years with little progress. - Initial support for DT bindings using json-schema language. This is the start of converting DT bindings from free-form text to a structured format. - Reworking of initrd address initialization. This moves to using the phys address instead of virt addr in the DT parsing code. This rework was motivated by CONFIG_DEV_BLK_INITRD causing unnecessary rebuilding of lots of files. - Fix stale phandle entries in phandle cache - DT overlay validation improvements. This exposed several memory leak bugs which have been fixed. - Use node name and device_type helper functions in DT code - Last remaining conversions to using %pOFn printk specifier instead of device_node.name directly - Create new common RTC binding doc and move all trivial RTC devices out of trivial-devices.txt. - New bindings for Freescale MAG3110 magnetometer, Cadence Sierra PHY, and Xen shared memory - Update dtc to upstream version v1.4.7-57-gf267e674d145" * tag 'devicetree-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (68 commits) of: __of_detach_node() - remove node from phandle cache of: of_node_get()/of_node_put() nodes held in phandle cache gpio-omap.txt: add reg and interrupts properties dt-bindings: mrvl,intc: fix a trivial typo dt-bindings: iio: magnetometer: add dt-bindings for freescale mag3110 dt-bindings: Convert trivial-devices.txt to json-schema dt-bindings: arm: mrvl: amend Browstone compatible string dt-bindings: arm: Convert Tegra board/soc bindings to json-schema dt-bindings: arm: Convert ZTE board/soc bindings to json-schema dt-bindings: arm: Add missing Xilinx boards dt-bindings: arm: Convert Xilinx board/soc bindings to json-schema dt-bindings: arm: Convert VIA board/soc bindings to json-schema dt-bindings: arm: Convert ST STi board/soc bindings to json-schema dt-bindings: arm: Convert SPEAr board/soc bindings to json-schema dt-bindings: arm: Convert CSR SiRF board/soc bindings to json-schema dt-bindings: arm: Convert QCom board/soc bindings to json-schema dt-bindings: arm: Convert TI nspire board/soc bindings to json-schema dt-bindings: arm: Convert TI davinci board/soc bindings to json-schema dt-bindings: arm: Convert Calxeda board/soc bindings to json-schema dt-bindings: arm: Convert Altera board/soc bindings to json-schema ... commit 24dc83635ffe3c93d8122099a83ee228c9b7e4f7 Merge: 7e59fad9c9d1a a7c23f8d154f7 Author: Linus Torvalds Date: Fri Dec 28 20:00:21 2018 -0800 Merge tag 'gpio-v4.21-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 v4.21 kernel series. Core changes: - Some core changes are already in outside of this pull request as they came through the regulator tree, most notably devm_gpiod_unhinge() that removes devres refcount management from a GPIO descriptor. This is needed in subsystems such as regulators where the regulator core need to take over the reference counting and lifecycle management for a GPIO descriptor. - We dropped devm_gpiochip_remove() and devm_gpio_chip_match() as nothing needs it. We can bring it back if need be. - Add a global TODO so people see where we are going. This helps setting the direction now that we are two GPIO maintainers. - Handle the MMC CD/WP properties in the device tree core. (The bulk of patches activating this code is already merged through the MMC/SD tree.) - Augment gpiochip_request_own_desc() to pass a flag so we as gpiochips can request lines as active low or open drain etc even from ourselves. New drivers: - New driver for Cadence GPIO blocks. - New driver for Atmel SAMA5D2 PIOBU GPIO lines. Driver improvements: - A major refactoring of the PCA953x driver - this driver has been around for ages, and is now modernized to reduce code duplication that has stacked up and is using regmap to read write and cache registers. - Intel drivers are now maintained in a separate tree and start with a round of cleanups and unifications" * tag 'gpio-v4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (99 commits) gpio: sama5d2-piobu: Depend on OF_GPIO gpio: Add Cadence GPIO driver dt-bindings: gpio: Add bindings for Cadence GPIO gpiolib-acpi: remove unused variable 'err', cleans up build warning gpio: mxs: read pin level directly instead of using .get gpio: aspeed: remove duplicated statement gpio: add driver for SAMA5D2 PIOBU pins dt-bindings: arm: atmel: describe SECUMOD usage as a GPIO controller gpio/mmc/of: Respect polarity in the device tree dt-bindings: gpio: rcar: Add r8a774c0 (RZ/G2E) support memory: omap-gpmc: Get the header of the enum ARM: omap1: Fix new user of gpiochip_request_own_desc() gpio: pca953x: Add regmap dependency for PCA953x driver gpio: raspberrypi-exp: decrease refcount on firmware dt node gpiolib: Fix return value of gpio_to_desc() stub if !GPIOLIB gpio: pca953x: Restore registers after suspend/resume cycle gpio: pca953x: Zap single use of pca953x_read_single() gpio: pca953x: Zap ad-hoc reg_output cache gpio: pca953x: Zap ad-hoc reg_direction cache gpio: pca953x: Perform basic regmap conversion ... commit 7e59fad9c9d1aeacdc96dfffd35f9e12ddc34dbf Merge: 8754040378e4f 221b35fedee1b Author: Linus Torvalds Date: Fri Dec 28 19:57:29 2018 -0800 Merge tag 'drm-next-2018-12-27' of git://anongit.freedesktop.org/drm/drm Pull more drm updates from Dave Airlie: "Daniel collected a couple of pulls after I want on holidays, back for a couple of days, so may as well send them out. This has exynos and etnaviv work for 4.21. exynos: - plane alpha and blending configurability etnaviv: - mostly cleanups in prep for new features" * tag 'drm-next-2018-12-27' of git://anongit.freedesktop.org/drm/drm: drm/etnaviv: remove lastctx member from gpu struct drm/etnaviv: replace header include with forward declaration drm/etnaviv: remove unnecessary local irq disable drm/exynos: fimd: Make pixel blend mode configurable drm/exynos: fimd: Make plane alpha configurable drm/etnaviv: Replace drm_dev_unref with drm_dev_put drm/etnaviv: consolidate hardware fence handling in etnaviv_gpu drm/etnaviv: kill active fence tracking commit 8754040378e4ff70b3bb96b1dabac62da5dfb870 Merge: 1984f65c2fbc0 9aa3aa15f4c2f Author: Linus Torvalds Date: Fri Dec 28 19:48:25 2018 -0800 Merge tag 'hwmon-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: "The big change in this series is for the most part automatic: Introducing SENSOR[_DEVICE]_ATTR_{RO,RW,WO} variants and conversion of various drivers to use it. This is similar to DEVICE_ATTR variants. Other than that, we have - Some conversions of S_ with octal values, also automated - Added support for Hygon Dhyana CPUs to k10temp driver - Added support for STLM75 to lm75 driver - B57891S0103 to ntc_thermistor - Added pm-runtime support to ina3221 driver - Support for PowerPC On-Chip Controller (OCC) - Various minor bug fices and improvements" * tag 'hwmon-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (80 commits) hwmon: (lm80) fix a missing check of bus read in lm80 probe hwmon: (lm80) fix a missing check of the status of SMBus read hwmon: (asus_atk0110) Fix debugfs_simple_attr.cocci warnings hwmon: (ftsteutates) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (fschmd) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (emc6w201) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (emc2103) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (emc1403) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (ds620) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (ds1621) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (dell-smm-hwmon) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (da9055-hwmon) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (da9052-hwmon) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (coretemp) Replace S_ with octal values hwmon: (asus_atk0110) Replace S_ with octal values hwmon: (aspeed-pwm-tacho) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (applesmc) Replace S_ with octal values hwmon: (amc6821) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (adt7x10) Use permission specific SENSOR[_DEVICE]_ATTR variants hwmon: (adt7475) Use permission specific SENSOR[_DEVICE]_ATTR variants ... commit 1984f65c2fbc0d2b557d6e89ece9b39267e215c6 Merge: f346b0becb1bc 8ba35b3a0046d Author: Linus Torvalds Date: Fri Dec 28 19:41:58 2018 -0800 Merge tag 'vfio-v4.21-rc1' of git://github.com/awilliam/linux-vfio Pull VFIO updates from Alex Williamson: - Replace global vfio-pci lock with per bus lock to allow concurrent open and release (Alex Williamson) - Declare mdev function as static (Paolo Cretaro) - Convert char to u8 in mdev/mtty sample driver (Nathan Chancellor) * tag 'vfio-v4.21-rc1' of git://github.com/awilliam/linux-vfio: vfio-mdev/samples: Use u8 instead of char for handle functions vfio/mdev: add static modifier to add_mdev_supported_type vfio/pci: Parallelize device open and release commit a007232066f6839d6f256bab21e825d968f1a163 Author: Florian Westphal Date: Fri Dec 28 01:24:49 2018 +0100 netfilter: nf_conncount: fix argument order to find_next_bit Size and 'next bit' were swapped, this bug could cause worker to reschedule itself even if system was idle. Fixes: 5c789e131cbb9 ("netfilter: nf_conncount: Add list lock and gc worker, and RCU for init tree search") Reviewed-by: Shawn Bohrer Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit c80f10bc973af2ace6b1414724eeff61eaa71837 Author: Pablo Neira Ayuso Date: Fri Dec 28 01:24:48 2018 +0100 netfilter: nf_conncount: speculative garbage collection on empty lists Instead of removing a empty list node that might be reintroduced soon thereafter, tentatively place the empty list node on the list passed to tree_nodes_free(), then re-check if the list is empty again before erasing it from the tree. [ Florian: rebase on top of pending nf_conncount fixes ] Fixes: 5c789e131cbb9 ("netfilter: nf_conncount: Add list lock and gc worker, and RCU for init tree search") Reviewed-by: Shawn Bohrer Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 2f971a8f425545da52ca0e6bee81f5b1ea0ccc5f Author: Pablo Neira Ayuso Date: Fri Dec 28 01:24:47 2018 +0100 netfilter: nf_conncount: move all list iterations under spinlock Two CPUs may race to remove a connection from the list, the existing conn->dead will result in a use-after-free. Use the per-list spinlock to protect list iterations. As all accesses to the list now happen while holding the per-list lock, we no longer need to delay free operations with rcu. Joint work with Florian. Fixes: 5c789e131cbb9 ("netfilter: nf_conncount: Add list lock and gc worker, and RCU for init tree search") Reviewed-by: Shawn Bohrer Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit df4a902509766897f7371fdfa4c3bf8bc321b55d Author: Florian Westphal Date: Fri Dec 28 01:24:46 2018 +0100 netfilter: nf_conncount: merge lookup and add functions 'lookup' is always followed by 'add'. Merge both and make the list-walk part of nf_conncount_add(). This also avoids one unneeded unlock/re-lock pair. Extra care needs to be taken in count_tree, as we only hold rcu read lock, i.e. we can only insert to an existing tree node after acquiring its lock and making sure it has a nonzero count. As a zero count should be rare, just fall back to insert_tree() (which acquires tree lock). This issue and its solution were pointed out by Shawn Bohrer during patch review. Reviewed-by: Shawn Bohrer Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit e8cfb372b38a1b8979aa7f7631fb5e7b11c3793c Author: Florian Westphal Date: Fri Dec 28 01:24:45 2018 +0100 netfilter: nf_conncount: restart search when nodes have been erased Shawn Bohrer reported a following crash: |RIP: 0010:rb_erase+0xae/0x360 [..] Call Trace: nf_conncount_destroy+0x59/0xc0 [nf_conncount] cleanup_match+0x45/0x70 [ip_tables] ... Shawn tracked this down to bogus 'parent' pointer: Problem is that when we insert a new node, then there is a chance that the 'parent' that we found was also passed to tree_nodes_free() (because that node was empty) for erase+free. Instead of trying to be clever and detect when this happens, restart the search if we have evicted one or more nodes. To prevent frequent restarts, do not perform gc on the second round. Also, unconditionally schedule the gc worker. The condition gc_count > ARRAY_SIZE(gc_nodes)) cannot be true unless tree grows very large, as the height of the tree will be low even with hundreds of nodes present. Fixes: 5c789e131cbb9 ("netfilter: nf_conncount: Add list lock and gc worker, and RCU for init tree search") Reported-by: Shawn Bohrer Reviewed-by: Shawn Bohrer Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit f7fcc98dfc2d136722007fec0debbed761679b94 Author: Florian Westphal Date: Fri Dec 28 01:24:44 2018 +0100 netfilter: nf_conncount: split gc in two phases The lockless workqueue garbage collector can race with packet path garbage collector to delete list nodes, as it calls tree_nodes_free() with the addresses of nodes that might have been free'd already from another cpu. To fix this, split gc into two phases. One phase to perform gc on the connections: From a locking perspective, this is the same as count_tree(): we hold rcu lock, but we do not change the tree, we only change the nodes' contents. The second phase acquires the tree lock and reaps empty nodes. This avoids a race condition of the garbage collection vs. packet path: If a node has been free'd already, the second phase won't find it anymore. This second phase is, from locking perspective, same as insert_tree(). The former only modifies nodes (list content, count), latter modifies the tree itself (rb_erase or rb_insert). Fixes: 5c789e131cbb9 ("netfilter: nf_conncount: Add list lock and gc worker, and RCU for init tree search") Reviewed-by: Shawn Bohrer Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 4cd273bb91b3001f623f516ec726c49754571b1a Author: Florian Westphal Date: Fri Dec 28 01:24:43 2018 +0100 netfilter: nf_conncount: don't skip eviction when age is negative age is signed integer, so result can be negative when the timestamps have a large delta. In this case we want to discard the entry. Instead of using age >= 2 || age < 0, just make it unsigned. Fixes: b36e4523d4d56 ("netfilter: nf_conncount: fix garbage collection confirm race") Reviewed-by: Shawn Bohrer Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit c78e7818f16f687389174c4569243abbec8dc68f Author: Shawn Bohrer Date: Fri Dec 28 01:24:42 2018 +0100 netfilter: nf_conncount: replace CONNCOUNT_LOCK_SLOTS with CONNCOUNT_SLOTS Most of the time these were the same value anyway, but when CONFIG_LOCKDEP was enabled we would use a smaller number of locks to reduce overhead. Unfortunately having two values is confusing and not worth the complexity. This fixes a bug where tree_gc_worker() would only GC up to CONNCOUNT_LOCK_SLOTS trees which meant when CONFIG_LOCKDEP was enabled not all trees would be GCed by tree_gc_worker(). Fixes: 5c789e131cbb9 ("netfilter: nf_conncount: Add list lock and gc worker, and RCU for init tree search") Signed-off-by: Florian Westphal Signed-off-by: Shawn Bohrer Signed-off-by: Pablo Neira Ayuso commit eb8950861c1bfd3eecc8f6faad213e3bca0dc395 Author: Kangjie Lu Date: Fri Dec 21 00:46:23 2018 -0600 netfilter: nf_tables: fix a missing check of nla_put_failure If nla_nest_start() may fail. The fix checks its return value and goes to nla_put_failure if it fails. Signed-off-by: Kangjie Lu Signed-off-by: Pablo Neira Ayuso commit 592b15ba7260f8dec8bfc71ef0ea1934801a35aa Merge: 7db54c89f0b30 1e3c336ad8f40 Author: Dmitry Torokhov Date: Fri Dec 28 17:10:54 2018 -0800 Merge branch 'next' into for-linus Prepare input updates for 4.21 merge window. commit 7db54c89f0b30a101584e09d3729144e6170059d Author: Patrick Dreyer Date: Sun Dec 23 10:06:35 2018 -0800 Input: elan_i2c - add ACPI ID for touchpad in ASUS Aspire F5-573G This adds ELAN0501 to the ACPI table to support Elan touchpad found in ASUS Aspire F5-573G. Signed-off-by: Patrick Dreyer Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov commit 1e3c336ad8f40f88a8961c434640920fe35cc08b Author: Sanjeev Chugh Date: Fri Dec 28 17:04:31 2018 -0800 Input: atmel_mxt_ts - don't try to free unallocated kernel memory If the user attempts to update Atmel device with an invalid configuration cfg file, error handling code is trying to free cfg file memory which is not allocated yet hence results into kernel crash. This patch fixes the order of memory free operations. Signed-off-by: Sanjeev Chugh Fixes: a4891f105837 ("Input: atmel_mxt_ts - zero terminate config firmware file") Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov commit f346b0becb1bc62e45495f9cdbae3eef35d0b635 Merge: 00d59fde8532b 0f4991e8fd489 Author: Linus Torvalds Date: Fri Dec 28 16:55:46 2018 -0800 Merge branch 'akpm' (patches from Andrew) Merge misc updates from Andrew Morton: - large KASAN update to use arm's "software tag-based mode" - a few misc things - sh updates - ocfs2 updates - just about all of MM * emailed patches from Andrew Morton : (167 commits) kernel/fork.c: mark 'stack_vm_area' with __maybe_unused memcg, oom: notify on oom killer invocation from the charge path mm, swap: fix swapoff with KSM pages include/linux/gfp.h: fix typo mm/hmm: fix memremap.h, move dev_page_fault_t callback to hmm hugetlbfs: Use i_mmap_rwsem to fix page fault/truncate race hugetlbfs: use i_mmap_rwsem for more pmd sharing synchronization memory_hotplug: add missing newlines to debugging output mm: remove __hugepage_set_anon_rmap() include/linux/vmstat.h: remove unused page state adjustment macro mm/page_alloc.c: allow error injection mm: migrate: drop unused argument of migrate_page_move_mapping() blkdev: avoid migration stalls for blkdev pages mm: migrate: provide buffer_migrate_page_norefs() mm: migrate: move migrate_page_lock_buffers() mm: migrate: lock buffers before migrate_page_move_mapping() mm: migration: factor out code to compute expected number of page references mm, page_alloc: enable pcpu_drain with zone capability kmemleak: add config to select auto scan mm/page_alloc.c: don't call kasan_free_pages() at deferred mem init ... commit 00d59fde8532b2d42e80909d2e58678755e04da9 Merge: 75f95da078b28 5215b2e952f3f Author: Linus Torvalds Date: Fri Dec 28 16:52:18 2018 -0800 Merge tag 'mmc-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC updates from Ulf Hansson: "This time, this pull request contains changes crossing subsystems and archs/platforms, which is mainly because of a bigger modernization of moving from legacy GPIO to GPIO descriptors for MMC (by Linus Walleij). Additionally, once again, I am funneling changes to drivers/misc/cardreader/* and drivers/memstick/* through my MMC tree, mostly due to that we lack a maintainer for these. Summary: MMC core: - Cleanup BKOPS support - Introduce MMC_CAP_SYNC_RUNTIME_PM - slot-gpio: Delete legacy slot GPIO handling MMC host: - alcor: Add new mmc host driver for Alcor Micro PCI based cardreader - bcm2835: Several improvements to better recover from errors - jz4740: Rework and fixup pre|post_req support - mediatek: Add support for SDIO IRQs - meson-gx: Improve clock phase management - meson-gx: Stop descriptor on errors - mmci: Complete the sbc error path by sending a stop command - renesas_sdhi/tmio: Fixup reset/resume operations - renesas_sdhi: Add support for r8a774c0 and R7S9210 - renesas_sdhi: Whitelist R8A77990 SDHI - renesas_sdhi: Fixup eMMC HS400 compatibility issues for H3 and M3-W - rtsx_usb_sdmmc: Re-work card detection/removal support - rtsx_usb_sdmmc: Re-work runtime PM support - sdhci: Fix timeout loops for some variant drivers - sdhci: Improve support for error handling due to failing commands - sdhci-acpi/pci: Disable LED control for Intel BYT-based controllers - sdhci_am654: Add new SDHCI variant driver to support TI's AM654 SOCs - sdhci-of-esdhc: Add support for eMMC HS400 mode - sdhci-omap: Fixup reset support - sdhci-omap: Workaround errata regarding SDR104/HS200 tuning failures - sdhci-msm: Fixup sporadic write transfers issues for SDR104/HS200 - sdhci-msm: Fixup dynamical clock gating issues - various: Complete converting all hosts into using slot GPIO descriptors Other: - Move GPIO mmc platform data for mips/sh/arm to GPIO descriptors - Add new Alcor Micro cardreader PCI driver - Support runtime power management for memstick rtsx_usb_ms driver - Use USB remote wakeups for card detection for rtsx_usb misc driver" * tag 'mmc-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (99 commits) mmc: mediatek: Add MMC_CAP_SDIO_IRQ support mmc: renesas_sdhi_internal_dmac: Whitelist r8a774c0 dt-bindings: mmc: renesas_sdhi: Add r8a774c0 support mmc: core: Cleanup BKOPS support mmc: core: Drop redundant check in mmc_send_hpi_cmd() mmc: sdhci-omap: Workaround errata regarding SDR104/HS200 tuning failures (i929) dt-bindings: sdhci-omap: Add note for cpu_thermal mmc: sdhci-acpi: Disable LED control for Intel BYT-based controllers mmc: sdhci-pci: Disable LED control for Intel BYT-based controllers mmc: sdhci: Add quirk to disable LED control mmc: mmci: add variant property to set command stop bit misc: alcor_pci: fix spelling mistake "invailid" -> "invalid" mmc: meson-gx: add signal resampling mmc: meson-gx: align default phase on soc vendor tree mmc: meson-gx: remove useless lock mmc: meson-gx: make sure the descriptor is stopped on errors mmc: sdhci_am654: Add Initial Support for AM654 SDHCI driver dt-bindings: mmc: sdhci-of-arasan: Add deprecated message for AM65 dt-bindings: mmc: sdhci-am654: Document bindings for the host controllers on TI's AM654 SOCs mmc: sdhci-msm: avoid unused function warning ... commit 75f95da078b2891cd186f074ffc15a8e7c3f082d Merge: 4ed7bdc1eb4c8 4b5f747e82b12 Author: Linus Torvalds Date: Fri Dec 28 15:05:13 2018 -0800 Merge tag 'libnvdimm-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm updates from Dan Williams: "The vast bulk of this update is the new support for the security capabilities of some nvdimms. The userspace tooling for this capability is still a work in progress, but the changes survive the existing libnvdimm unit tests. The changes also pass manual checkout on hardware and the new nfit_test emulation of the security capability. The touches of the security/keys/ files have received the necessary acks from Mimi and David. Those changes were necessary to allow for a new generic encrypted-key type, and allow the nvdimm sub-system to lookup key material referenced by the libnvdimm-sysfs interface. Summary: - Add support for the security features of nvdimm devices that implement a security model similar to ATA hard drive security. The security model supports locking access to the media at device-power-loss, to be unlocked with a passphrase, and secure-erase (crypto-scramble). Unlike the ATA security case where the kernel expects device security to be managed in a pre-OS environment, the libnvdimm security implementation allows key provisioning and key-operations at OS runtime. Keys are managed with the kernel's encrypted-keys facility to provide data-at-rest security for the libnvdimm key material. The usage model mirrors fscrypt key management, but is driven via libnvdimm sysfs. - Miscellaneous updates for api usage and comment fixes" * tag 'libnvdimm-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: (21 commits) libnvdimm/security: Quiet security operations libnvdimm/security: Add documentation for nvdimm security support tools/testing/nvdimm: add Intel DSM 1.8 support for nfit_test tools/testing/nvdimm: Add overwrite support for nfit_test tools/testing/nvdimm: Add test support for Intel nvdimm security DSMs acpi/nfit, libnvdimm/security: add Intel DSM 1.8 master passphrase support acpi/nfit, libnvdimm/security: Add security DSM overwrite support acpi/nfit, libnvdimm: Add support for issue secure erase DSM to Intel nvdimm acpi/nfit, libnvdimm: Add enable/update passphrase support for Intel nvdimms acpi/nfit, libnvdimm: Add disable passphrase support to Intel nvdimm. acpi/nfit, libnvdimm: Add unlock of nvdimm support for Intel DIMMs acpi/nfit, libnvdimm: Add freeze security support to Intel nvdimm acpi/nfit, libnvdimm: Introduce nvdimm_security_ops keys-encrypted: add nvdimm key format type to encrypted keys keys: Export lookup_user_key to external users acpi/nfit, libnvdimm: Store dimm id as a member to struct nvdimm libnvdimm, namespace: Replace kmemdup() with kstrndup() libnvdimm, label: Switch to bitmap_zalloc() ACPI/nfit: Adjust annotation for why return 0 if fail to find NFIT at start libnvdimm, bus: Check id immediately following ida_simple_get ... commit 4ed7bdc1eb4c82cf4bfdf6a94dd36fd695f6f387 Merge: 5d24ae67a961c c6d6e9b0f6b42 Author: Linus Torvalds Date: Fri Dec 28 15:02:26 2018 -0800 Merge tag 'for-4.21/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper updates from Mike Snitzer: - Eliminate a couple indirect calls from bio-based DM core. - Fix DM to allow reads that exceed readahead limits by setting io_pages in the backing_dev_info. - A couple code cleanups in request-based DM. - Fix various DM targets to check for device sector overflow if CONFIG_LBDAF is not set. - Use u64 instead of sector_t to store iv_offset in DM crypt; sector_t isn't large enough on 32bit when CONFIG_LBDAF is not set. - Performance fixes to DM's kcopyd and the snapshot target focused on limiting memory use and workqueue stalls. - Fix typos in the integrity and writecache targets. - Log which algorithm is used for dm-crypt's encryption and dm-integrity's hashing. - Fix false -EBUSY errors in DM raid target's handling of check/repair messages. - Fix DM flakey target's corrupt_bio_byte feature to reliably corrupt the Nth byte in a bio's payload. * tag 'for-4.21/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm: do not allow readahead to limit IO size dm raid: fix false -EBUSY when handling check/repair message dm rq: cleanup leftover code from recently removed q->mq_ops branching dm verity: log the hash algorithm implementation dm crypt: log the encryption algorithm implementation dm integrity: fix spelling mistake in workqueue name dm flakey: Properly corrupt multi-page bios. dm: Check for device sector overflow if CONFIG_LBDAF is not set dm crypt: use u64 instead of sector_t to store iv_offset dm kcopyd: Fix bug causing workqueue stalls dm snapshot: Fix excessive memory usage and workqueue stalls dm bufio: update comment in dm-bufio.c dm writecache: fix typo in error msg for creating writecache_flush_thread dm: remove indirect calls from __send_changing_extent_only() dm mpath: only flush workqueue when needed dm rq: remove unused arguments from rq_completed() dm: avoid indirect call in __dm_make_request commit 5d24ae67a961c51beb255a28c9c417d9710247c2 Merge: 938edb8a31b97 f617e5ffe04fd Author: Linus Torvalds Date: Fri Dec 28 14:57:10 2018 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma updates from Jason Gunthorpe: "This has been a fairly typical cycle, with the usual sorts of driver updates. Several series continue to come through which improve and modernize various parts of the core code, and we finally are starting to get the uAPI command interface cleaned up. - Various driver fixes for bnxt_re, cxgb3/4, hfi1, hns, i40iw, mlx4, mlx5, qib, rxe, usnic - Rework the entire syscall flow for uverbs to be able to run over ioctl(). Finally getting past the historic bad choice to use write() for command execution - More functional coverage with the mlx5 'devx' user API - Start of the HFI1 series for 'TID RDMA' - SRQ support in the hns driver - Support for new IBTA defined 2x lane widths - A big series to consolidate all the driver function pointers into a big struct and have drivers provide a 'static const' version of the struct instead of open coding initialization - New 'advise_mr' uAPI to control device caching/loading of page tables - Support for inline data in SRPT - Modernize how umad uses the driver core and creates cdev's and sysfs files - First steps toward removing 'uobject' from the view of the drivers" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (193 commits) RDMA/srpt: Use kmem_cache_free() instead of kfree() RDMA/mlx5: Signedness bug in UVERBS_HANDLER() IB/uverbs: Signedness bug in UVERBS_HANDLER() IB/mlx5: Allocate the per-port Q counter shared when DEVX is supported IB/umad: Start using dev_groups of class IB/umad: Use class_groups and let core create class file IB/umad: Refactor code to use cdev_device_add() IB/umad: Avoid destroying device while it is accessed IB/umad: Simplify and avoid dynamic allocation of class IB/mlx5: Fix wrong error unwind IB/mlx4: Remove set but not used variable 'pd' RDMA/iwcm: Don't copy past the end of dev_name() string IB/mlx5: Fix long EEH recover time with NVMe offloads IB/mlx5: Simplify netdev unbinding IB/core: Move query port to ioctl RDMA/nldev: Expose port_cap_flags2 IB/core: uverbs copy to struct or zero helper IB/rxe: Reuse code which sets port state IB/rxe: Make counters thread safe IB/mlx5: Use the correct commands for UMEM and UCTX allocation ... commit 938edb8a31b976c9a92eb0cd4ff481e93f76c1f1 Merge: af7ddd8a627c6 da7903092b880 Author: Linus Torvalds Date: Fri Dec 28 14:48:06 2018 -0800 Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI updates from James Bottomley: "This is mostly update of the usual drivers: smarpqi, lpfc, qedi, megaraid_sas, libsas, zfcp, mpt3sas, hisi_sas. Additionally, we have a pile of annotation, unused variable and minor updates. The big API change is the updates for Christoph's DMA rework which include removing the DISABLE_CLUSTERING flag. And finally there are a couple of target tree updates" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (259 commits) scsi: isci: request: mark expected switch fall-through scsi: isci: remote_node_context: mark expected switch fall-throughs scsi: isci: remote_device: Mark expected switch fall-throughs scsi: isci: phy: Mark expected switch fall-through scsi: iscsi: Capture iscsi debug messages using tracepoints scsi: myrb: Mark expected switch fall-throughs scsi: megaraid: fix out-of-bound array accesses scsi: mpt3sas: mpt3sas_scsih: Mark expected switch fall-through scsi: fcoe: remove set but not used variable 'port' scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown() scsi: smartpqi: fix build warnings scsi: smartpqi: update driver version scsi: smartpqi: add ofa support scsi: smartpqi: increase fw status register read timeout scsi: smartpqi: bump driver version scsi: smartpqi: add smp_utils support scsi: smartpqi: correct lun reset issues scsi: smartpqi: correct volume status scsi: smartpqi: do not offline disks for transient did no connect conditions scsi: smartpqi: allow for larger raid maps ... commit af7ddd8a627c62a835524b3f5b471edbbbcce025 Merge: fe2b0cdabcd9e 8b1cce9f5832a Author: Linus Torvalds Date: Fri Dec 28 14:12:21 2018 -0800 Merge tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping Pull DMA mapping updates from Christoph Hellwig: "A huge update this time, but a lot of that is just consolidating or removing code: - provide a common DMA_MAPPING_ERROR definition and avoid indirect calls for dma_map_* error checking - use direct calls for the DMA direct mapping case, avoiding huge retpoline overhead for high performance workloads - merge the swiotlb dma_map_ops into dma-direct - provide a generic remapping DMA consistent allocator for architectures that have devices that perform DMA that is not cache coherent. Based on the existing arm64 implementation and also used for csky now. - improve the dma-debug infrastructure, including dynamic allocation of entries (Robin Murphy) - default to providing chaining scatterlist everywhere, with opt-outs for the few architectures (alpha, parisc, most arm32 variants) that can't cope with it - misc sparc32 dma-related cleanups - remove the dma_mark_clean arch hook used by swiotlb on ia64 and replace it with the generic noncoherent infrastructure - fix the return type of dma_set_max_seg_size (Niklas Söderlund) - move the dummy dma ops for not DMA capable devices from arm64 to common code (Robin Murphy) - ensure dma_alloc_coherent returns zeroed memory to avoid kernel data leaks through userspace. We already did this for most common architectures, but this ensures we do it everywhere. dma_zalloc_coherent has been deprecated and can hopefully be removed after -rc1 with a coccinelle script" * tag 'dma-mapping-4.21' of git://git.infradead.org/users/hch/dma-mapping: (73 commits) dma-mapping: fix inverted logic in dma_supported dma-mapping: deprecate dma_zalloc_coherent dma-mapping: zero memory returned from dma_alloc_* sparc/iommu: fix ->map_sg return value sparc/io-unit: fix ->map_sg return value arm64: default to the direct mapping in get_arch_dma_ops PCI: Remove unused attr variable in pci_dma_configure ia64: only select ARCH_HAS_DMA_COHERENT_TO_PFN if swiotlb is enabled dma-mapping: bypass indirect calls for dma-direct vmd: use the proper dma_* APIs instead of direct methods calls dma-direct: merge swiotlb_dma_ops into the dma_direct code dma-direct: use dma_direct_map_page to implement dma_direct_map_sg dma-direct: improve addressability error reporting swiotlb: remove dma_mark_clean swiotlb: remove SWIOTLB_MAP_ERROR ACPI / scan: Refactor _CCA enforcement dma-mapping: factor out dummy DMA ops dma-mapping: always build the direct mapping code dma-mapping: move dma_cache_sync out of line dma-mapping: move various slow path functions out of line ... commit fe2b0cdabcd9e6aeca66a104bc03576946e5fee2 Merge: 956eb6cb36765 9f83cfdb1ace3 Author: Linus Torvalds Date: Fri Dec 28 14:06:43 2018 -0800 Merge tag 'for-4.21/libata-20181221' of git://git.kernel.dk/linux-block Pull libata updates from Jens Axboe: "Here are the libata changes for this merge window. Nothing major in here. This contains: - GPIO descriptor conversions (Linus Walleij) - rcar deferred probing fix (Sergei Shtylyov)" * tag 'for-4.21/libata-20181221' of git://git.kernel.dk/linux-block: sata_rcar: fix deferred probing ata: palmld: Introduce state container ata: palmld: Convert to GPIO descriptors ata: rb532_cf: Convert to use GPIO descriptors ata: sata_highbank: Convert to use GPIO descriptors ata: pxa: Drop include commit 956eb6cb36765e3a79a744e6c9364dab1548e460 Merge: 0e9da3fbf7d81 875736bb3f3de Author: Linus Torvalds Date: Fri Dec 28 13:57:59 2018 -0800 Merge tag 'for-4.21/aio-20181221' of git://git.kernel.dk/linux-block Pull aio updates from Jens Axboe: "Flushing out pre-patches for the buffered/polled aio series. Some fixes in here, but also optimizations" * tag 'for-4.21/aio-20181221' of git://git.kernel.dk/linux-block: aio: abstract out io_event filler helper aio: split out iocb copy from io_submit_one() aio: use iocb_put() instead of open coding it aio: only use blk plugs for > 2 depth submissions aio: don't zero entire aio_kiocb aio_get_req() aio: separate out ring reservation from req allocation aio: use assigned completion handler commit 0e9da3fbf7d81f0f913b491c8de1ba7883d4f217 Merge: b12a9124eeb71 00203ba40d40d Author: Linus Torvalds Date: Fri Dec 28 13:19:59 2018 -0800 Merge tag 'for-4.21/block-20181221' of git://git.kernel.dk/linux-block Pull block updates from Jens Axboe: "This is the main pull request for block/storage for 4.21. Larger than usual, it was a busy round with lots of goodies queued up. Most notable is the removal of the old IO stack, which has been a long time coming. No new features for a while, everything coming in this week has all been fixes for things that were previously merged. This contains: - Use atomic counters instead of semaphores for mtip32xx (Arnd) - Cleanup of the mtip32xx request setup (Christoph) - Fix for circular locking dependency in loop (Jan, Tetsuo) - bcache (Coly, Guoju, Shenghui) * Optimizations for writeback caching * Various fixes and improvements - nvme (Chaitanya, Christoph, Sagi, Jay, me, Keith) * host and target support for NVMe over TCP * Error log page support * Support for separate read/write/poll queues * Much improved polling * discard OOM fallback * Tracepoint improvements - lightnvm (Hans, Hua, Igor, Matias, Javier) * Igor added packed metadata to pblk. Now drives without metadata per LBA can be used as well. * Fix from Geert on uninitialized value on chunk metadata reads. * Fixes from Hans and Javier to pblk recovery and write path. * Fix from Hua Su to fix a race condition in the pblk recovery code. * Scan optimization added to pblk recovery from Zhoujie. * Small geometry cleanup from me. - Conversion of the last few drivers that used the legacy path to blk-mq (me) - Removal of legacy IO path in SCSI (me, Christoph) - Removal of legacy IO stack and schedulers (me) - Support for much better polling, now without interrupts at all. blk-mq adds support for multiple queue maps, which enables us to have a map per type. This in turn enables nvme to have separate completion queues for polling, which can then be interrupt-less. Also means we're ready for async polled IO, which is hopefully coming in the next release. - Killing of (now) unused block exports (Christoph) - Unification of the blk-rq-qos and blk-wbt wait handling (Josef) - Support for zoned testing with null_blk (Masato) - sx8 conversion to per-host tag sets (Christoph) - IO priority improvements (Damien) - mq-deadline zoned fix (Damien) - Ref count blkcg series (Dennis) - Lots of blk-mq improvements and speedups (me) - sbitmap scalability improvements (me) - Make core inflight IO accounting per-cpu (Mikulas) - Export timeout setting in sysfs (Weiping) - Cleanup the direct issue path (Jianchao) - Export blk-wbt internals in block debugfs for easier debugging (Ming) - Lots of other fixes and improvements" * tag 'for-4.21/block-20181221' of git://git.kernel.dk/linux-block: (364 commits) kyber: use sbitmap add_wait_queue/list_del wait helpers sbitmap: add helpers for add/del wait queue handling block: save irq state in blkg_lookup_create() dm: don't reuse bio for flushes nvme-pci: trace SQ status on completions nvme-rdma: implement polling queue map nvme-fabrics: allow user to pass in nr_poll_queues nvme-fabrics: allow nvmf_connect_io_queue to poll nvme-core: optionally poll sync commands block: make request_to_qc_t public nvme-tcp: fix spelling mistake "attepmpt" -> "attempt" nvme-tcp: fix endianess annotations nvmet-tcp: fix endianess annotations nvme-pci: refactor nvme_poll_irqdisable to make sparse happy nvme-pci: only set nr_maps to 2 if poll queues are supported nvmet: use a macro for default error location nvmet: fix comparison of a u16 with -1 blk-mq: enable IO poll if .nr_queues of type poll > 0 blk-mq: change blk_mq_queue_busy() to blk_mq_queue_inflight() blk-mq: skip zero-queue maps in blk_mq_map_swqueue ... commit b12a9124eeb71d766a3e3eb594ebbb3fefc66902 Merge: 1a80dade010c7 e4b92b108c6cd Author: Linus Torvalds Date: Fri Dec 28 12:45:04 2018 -0800 Merge tag 'y2038-for-4.21' of ssh://gitolite.kernel.org:/pub/scm/linux/kernel/git/arnd/playground Pull y2038 updates from Arnd Bergmann: "More syscalls and cleanups This concludes the main part of the system call rework for 64-bit time_t, which has spread over most of year 2018, the last six system calls being - ppoll - pselect6 - io_pgetevents - recvmmsg - futex - rt_sigtimedwait As before, nothing changes for 64-bit architectures, while 32-bit architectures gain another entry point that differs only in the layout of the timespec structure. Hopefully in the next release we can wire up all 22 of those system calls on all 32-bit architectures, which gives us a baseline version for glibc to start using them. This does not include the clock_adjtime, getrusage/waitid, and getitimer/setitimer system calls. I still plan to have new versions of those as well, but they are not required for correct operation of the C library since they can be emulated using the old 32-bit time_t based system calls. Aside from the system calls, there are also a few cleanups here, removing old kernel internal interfaces that have become unused after all references got removed. The arch/sh cleanups are part of this, there were posted several times over the past year without a reaction from the maintainers, while the corresponding changes made it into all other architectures" * tag 'y2038-for-4.21' of ssh://gitolite.kernel.org:/pub/scm/linux/kernel/git/arnd/playground: timekeeping: remove obsolete time accessors vfs: replace current_kernel_time64 with ktime equivalent timekeeping: remove timespec_add/timespec_del timekeeping: remove unused {read,update}_persistent_clock sh: remove board_time_init() callback sh: remove unused rtc_sh_get/set_time infrastructure sh: sh03: rtc: push down rtc class ops into driver sh: dreamcast: rtc: push down rtc class ops into driver y2038: signal: Add compat_sys_rt_sigtimedwait_time64 y2038: signal: Add sys_rt_sigtimedwait_time32 y2038: socket: Add compat_sys_recvmmsg_time64 y2038: futex: Add support for __kernel_timespec y2038: futex: Move compat implementation into futex.c io_pgetevents: use __kernel_timespec pselect6: use __kernel_timespec ppoll: use __kernel_timespec signal: Add restore_user_sigmask() signal: Add set_user_sigmask() commit 1a80dade010c7a7f4885a4c4c2a7ac22cc7b34df Author: Matthew Wilcox Date: Fri Dec 28 07:22:26 2018 -0800 Fix failure path in alloc_pid() The failure path removes the allocated PIDs from the wrong namespace. This could lead to us inadvertently reusing PIDs in the leaf namespace and leaking PIDs in parent namespaces. Fixes: 95846ecf9dac ("pid: replace pid bitmap implementation with IDR API") Cc: Signed-off-by: Matthew Wilcox Acked-by: "Eric W. Biederman" Reviewed-by: Oleg Nesterov Signed-off-by: Linus Torvalds commit 0f4991e8fd48987ae476a92cdee6bfec4aff31b8 Author: YueHaibing Date: Fri Dec 28 00:40:00 2018 -0800 kernel/fork.c: mark 'stack_vm_area' with __maybe_unused Fixes gcc '-Wunused-but-set-variable' warning when CONFIG_VMAP_STACK is not set: kernel/fork.c: In function 'dup_task_struct': kernel/fork.c:843:20: warning: variable 'stack_vm_area' set but not used [-Wunused-but-set-variable] Link: http://lkml.kernel.org/r/1545965190-2381-1-git-send-email-yuehaibing@huawei.com Signed-off-by: YueHaibing Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7056d3a37d2c6aaaab10c13e8e69adc67ec1fc65 Author: Michal Hocko Date: Fri Dec 28 00:39:57 2018 -0800 memcg, oom: notify on oom killer invocation from the charge path Burt Holzman has noticed that memcg v1 doesn't notify about OOM events via eventfd anymore. The reason is that 29ef680ae7c2 ("memcg, oom: move out_of_memory back to the charge path") has moved the oom handling back to the charge path. While doing so the notification was left behind in mem_cgroup_oom_synchronize. Fix the issue by replicating the oom hierarchy locking and the notification. Link: http://lkml.kernel.org/r/20181224091107.18354-1-mhocko@kernel.org Fixes: 29ef680ae7c2 ("memcg, oom: move out_of_memory back to the charge path") Signed-off-by: Michal Hocko Reported-by: Burt Holzman Acked-by: Johannes Weiner Cc: Vladimir Davydov [4.19+] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7af7a8e19f0c5425ff639b0f0d2d244c2a647724 Author: Huang Ying Date: Fri Dec 28 00:39:53 2018 -0800 mm, swap: fix swapoff with KSM pages KSM pages may be mapped to the multiple VMAs that cannot be reached from one anon_vma. So during swapin, a new copy of the page need to be generated if a different anon_vma is needed, please refer to comments of ksm_might_need_to_copy() for details. During swapoff, unuse_vma() uses anon_vma (if available) to locate VMA and virtual address mapped to the page, so not all mappings to a swapped out KSM page could be found. So in try_to_unuse(), even if the swap count of a swap entry isn't zero, the page needs to be deleted from swap cache, so that, in the next round a new page could be allocated and swapin for the other mappings of the swapped out KSM page. But this contradicts with the THP swap support. Where the THP could be deleted from swap cache only after the swap count of every swap entry in the huge swap cluster backing the THP has reach 0. So try_to_unuse() is changed in commit e07098294adf ("mm, THP, swap: support to reclaim swap space for THP swapped out") to check that before delete a page from swap cache, but this has broken KSM swapoff too. Fortunately, KSM is for the normal pages only, so the original behavior for KSM pages could be restored easily via checking PageTransCompound(). That is how this patch works. The bug is introduced by e07098294adf ("mm, THP, swap: support to reclaim swap space for THP swapped out"), which is merged by v4.14-rc1. So I think we should backport the fix to from 4.14 on. But Hugh thinks it may be rare for the KSM pages being in the swap device when swapoff, so nobody reports the bug so far. Link: http://lkml.kernel.org/r/20181226051522.28442-1-ying.huang@intel.com Fixes: e07098294adf ("mm, THP, swap: support to reclaim swap space for THP swapped out") Signed-off-by: "Huang, Ying" Reported-by: Hugh Dickins Tested-by: Hugh Dickins Acked-by: Hugh Dickins Cc: Rik van Riel Cc: Johannes Weiner Cc: Minchan Kim Cc: Shaohua Li Cc: Daniel Jordan Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 70c6066e19c15749b579dde7d5722c7d7fb05d57 Author: Kyle Spiers Date: Fri Dec 28 00:39:49 2018 -0800 include/linux/gfp.h: fix typo Fix misspelled "satisfied" Link: http://lkml.kernel.org/r/20181227232354.64562-1-ksspiers@google.com Signed-off-by: Kyle Spiers Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 063a7d1d3623db31ca5d2309cab6030ebf93b72f Author: Dan Williams Date: Fri Dec 28 00:39:46 2018 -0800 mm/hmm: fix memremap.h, move dev_page_fault_t callback to hmm The kbuild robot reported the following on a development branch that used memremap.h in a new path: In file included from arch/m68k/include/asm/pgtable_mm.h:148:0, from arch/m68k/include/asm/pgtable.h:5, from include/linux/memremap.h:7, from drivers//dax/bus.c:3: arch/m68k/include/asm/motorola_pgtable.h: In function 'pgd_offset': >> arch/m68k/include/asm/motorola_pgtable.h:199:11: error: dereferencing pointer to incomplete type 'const struct mm_struct' return mm->pgd + pgd_index(address); ^~ The ->page_fault() callback is specific to HMM. Move it to 'struct hmm_devmem' where the unusual asm/pgtable.h dependency can be contained in include/linux/hmm.h. Longer term refactoring this dependency out of HMM is recommended, but in the meantime memremap.h remains generic. Link: http://lkml.kernel.org/r/154534090899.3120190.6652620807617715272.stgit@dwillia2-desk3.amr.corp.intel.com Fixes: 5042db43cc26 ("mm/ZONE_DEVICE: new type of ZONE_DEVICE memory...") Signed-off-by: Dan Williams Reviewed-by: "Jérôme Glisse" Cc: Logan Gunthorpe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c86aa7bbfd5568ba8a82d3635d8f7b8a8e06fe54 Author: Mike Kravetz Date: Fri Dec 28 00:39:42 2018 -0800 hugetlbfs: Use i_mmap_rwsem to fix page fault/truncate race hugetlbfs page faults can race with truncate and hole punch operations. Current code in the page fault path attempts to handle this by 'backing out' operations if we encounter the race. One obvious omission in the current code is removing a page newly added to the page cache. This is pretty straight forward to address, but there is a more subtle and difficult issue of backing out hugetlb reservations. To handle this correctly, the 'reservation state' before page allocation needs to be noted so that it can be properly backed out. There are four distinct possibilities for reservation state: shared/reserved, shared/no-resv, private/reserved and private/no-resv. Backing out a reservation may require memory allocation which could fail so that needs to be taken into account as well. Instead of writing the required complicated code for this rare occurrence, just eliminate the race. i_mmap_rwsem is now held in read mode for the duration of page fault processing. Hold i_mmap_rwsem longer in truncation and hold punch code to cover the call to remove_inode_hugepages. With this modification, code in remove_inode_hugepages checking for races becomes 'dead' as it can not longer happen. Remove the dead code and expand comments to explain reasoning. Similarly, checks for races with truncation in the page fault path can be simplified and removed. [mike.kravetz@oracle.com: incorporat suggestions from Kirill] Link: http://lkml.kernel.org/r/20181222223013.22193-3-mike.kravetz@oracle.com Link: http://lkml.kernel.org/r/20181218223557.5202-3-mike.kravetz@oracle.com Fixes: ebed4bfc8da8 ("hugetlb: fix absurd HugePages_Rsvd") Signed-off-by: Mike Kravetz Acked-by: Kirill A. Shutemov Cc: Michal Hocko Cc: Hugh Dickins Cc: Naoya Horiguchi Cc: "Aneesh Kumar K . V" Cc: Andrea Arcangeli Cc: Davidlohr Bueso Cc: Prakash Sangappa Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b43a9990055958e70347c56f90ea2ae32c67334c Author: Mike Kravetz Date: Fri Dec 28 00:39:38 2018 -0800 hugetlbfs: use i_mmap_rwsem for more pmd sharing synchronization While looking at BUGs associated with invalid huge page map counts, it was discovered and observed that a huge pte pointer could become 'invalid' and point to another task's page table. Consider the following: A task takes a page fault on a shared hugetlbfs file and calls huge_pte_alloc to get a ptep. Suppose the returned ptep points to a shared pmd. Now, another task truncates the hugetlbfs file. As part of truncation, it unmaps everyone who has the file mapped. If the range being truncated is covered by a shared pmd, huge_pmd_unshare will be called. For all but the last user of the shared pmd, huge_pmd_unshare will clear the pud pointing to the pmd. If the task in the middle of the page fault is not the last user, the ptep returned by huge_pte_alloc now points to another task's page table or worse. This leads to bad things such as incorrect page map/reference counts or invalid memory references. To fix, expand the use of i_mmap_rwsem as follows: - i_mmap_rwsem is held in read mode whenever huge_pmd_share is called. huge_pmd_share is only called via huge_pte_alloc, so callers of huge_pte_alloc take i_mmap_rwsem before calling. In addition, callers of huge_pte_alloc continue to hold the semaphore until finished with the ptep. - i_mmap_rwsem is held in write mode whenever huge_pmd_unshare is called. [mike.kravetz@oracle.com: add explicit check for mapping != null] Link: http://lkml.kernel.org/r/20181218223557.5202-2-mike.kravetz@oracle.com Fixes: 39dde65c9940 ("shared page table for hugetlb page") Signed-off-by: Mike Kravetz Acked-by: Kirill A. Shutemov Cc: Michal Hocko Cc: Hugh Dickins Cc: Naoya Horiguchi Cc: "Aneesh Kumar K . V" Cc: Andrea Arcangeli Cc: Davidlohr Bueso Cc: Prakash Sangappa Cc: Colin Ian King Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1ecc07fd0a6d350bbf4dc176e0d654661b304a30 Author: Michal Hocko Date: Fri Dec 28 00:39:34 2018 -0800 memory_hotplug: add missing newlines to debugging output pages_correctly_probed is missing new lines which means that the line is not printed rightaway but it rather waits for additional printks. Add \n to all three messages in pages_correctly_probed. Link: http://lkml.kernel.org/r/20181218162307.10518-1-mhocko@kernel.org Fixes: b77eab7079d9 ("mm/memory_hotplug: optimize probe routine") Signed-off-by: Michal Hocko Reviewed-by: Oscar Salvador Reviewed-by: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 451b9514a59f3379d3bedd5a0e4909ef3ef1b98c Author: Kirill Tkhai Date: Fri Dec 28 00:39:31 2018 -0800 mm: remove __hugepage_set_anon_rmap() This function is identical to __page_set_anon_rmap() since the time, when it was introduced (8 years ago). The patch removes the function, and makes its users to use __page_set_anon_rmap() instead. Link: http://lkml.kernel.org/r/154504875359.30235.6237926369392564851.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Kirill A. Shutemov Reviewed-by: Andrew Morton Reviewed-by: Mike Kravetz Cc: Jerome Glisse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4918e7625ffa82f388ea70538f0e1df20ea35a54 Author: Wei Yang Date: Fri Dec 28 00:39:27 2018 -0800 include/linux/vmstat.h: remove unused page state adjustment macro These four macro are not used anymore. Just remove them. Link: http://lkml.kernel.org/r/20181214063211.2290-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Acked-by: Michal Hocko Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit af3b854492f351d1ff3b4744a83bf5ff7eed4920 Author: Benjamin Poirier Date: Fri Dec 28 00:39:23 2018 -0800 mm/page_alloc.c: allow error injection Model call chain after should_failslab(). Likewise, we can now use a kprobe to override the return value of should_fail_alloc_page() and inject allocation failures into alloc_page*(). This will allow injecting allocation failures using the BCC tools even without building kernel with CONFIG_FAIL_PAGE_ALLOC and booting it with a fail_page_alloc= parameter, which incurs some overhead even when failures are not being injected. On the other hand, this patch adds an unconditional call to should_fail_alloc_page() from page allocation hotpath. That overhead should be rather negligible with CONFIG_FAIL_PAGE_ALLOC=n when there's no kprobe attached, though. [vbabka@suse.cz: changelog addition] Link: http://lkml.kernel.org/r/20181214074330.18917-1-bpoirier@suse.com Signed-off-by: Benjamin Poirier Acked-by: Vlastimil Babka Cc: Arnd Bergmann Cc: Michal Hocko Cc: Pavel Tatashin Cc: Oscar Salvador Cc: Mike Rapoport Cc: Joonsoo Kim Cc: Alexander Duyck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ab41ee6879981b3d3a16a1079a33fa6fd043eb3c Author: Jan Kara Date: Fri Dec 28 00:39:20 2018 -0800 mm: migrate: drop unused argument of migrate_page_move_mapping() All callers of migrate_page_move_mapping() now pass NULL for 'head' argument. Drop it. Link: http://lkml.kernel.org/r/20181211172143.7358-7-jack@suse.cz Signed-off-by: Jan Kara Acked-by: Mel Gorman Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 88dbcbb3a4847f5e6dfeae952d3105497700c128 Author: Jan Kara Date: Fri Dec 28 00:39:16 2018 -0800 blkdev: avoid migration stalls for blkdev pages Currently, block device pages don't provide a ->migratepage callback and thus fallback_migrate_page() is used for them. This handler cannot deal with dirty pages in async mode and also with the case a buffer head is in the LRU buffer head cache (as it has elevated b_count). Thus such page can block memory offlining. Fix the problem by using buffer_migrate_page_norefs() for migrating block device pages. That function takes care of dropping bh LRU in case migration would fail due to elevated buffer refcount to avoid stalls and can also migrate dirty pages without writing them. Link: http://lkml.kernel.org/r/20181211172143.7358-6-jack@suse.cz Signed-off-by: Jan Kara Acked-by: Mel Gorman Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 89cb0888ca1483ad72648844ddd1b801863a8949 Author: Jan Kara Date: Fri Dec 28 00:39:12 2018 -0800 mm: migrate: provide buffer_migrate_page_norefs() Provide a variant of buffer_migrate_page() that also checks whether there are no unexpected references to buffer heads. This function will then be safe to use for block device pages. [akpm@linux-foundation.org: remove EXPORT_SYMBOL(buffer_migrate_page_norefs)] Link: http://lkml.kernel.org/r/20181211172143.7358-5-jack@suse.cz Signed-off-by: Jan Kara Acked-by: Mel Gorman Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 84ade7c15ccfb46f852f4e2469b007a33651904d Author: Jan Kara Date: Fri Dec 28 00:39:09 2018 -0800 mm: migrate: move migrate_page_lock_buffers() buffer_migrate_page() is the only caller of migrate_page_lock_buffers() move it close to it and also drop the now unused stub for !CONFIG_BLOCK. Link: http://lkml.kernel.org/r/20181211172143.7358-4-jack@suse.cz Signed-off-by: Jan Kara Acked-by: Mel Gorman Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cc4f11e69fd00c61c38619759b07d00631bda5ca Author: Jan Kara Date: Fri Dec 28 00:39:05 2018 -0800 mm: migrate: lock buffers before migrate_page_move_mapping() Lock buffers before calling into migrate_page_move_mapping() so that that function doesn't have to know about buffers (which is somewhat unexpected anyway) and all the buffer head logic is in buffer_migrate_page(). Link: http://lkml.kernel.org/r/20181211172143.7358-3-jack@suse.cz Signed-off-by: Jan Kara Acked-by: Mel Gorman Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0b3901b38d9d916f634e903ce7cd2a8ddd5b1559 Author: Jan Kara Date: Fri Dec 28 00:39:01 2018 -0800 mm: migration: factor out code to compute expected number of page references Patch series "mm: migrate: Fix page migration stalls for blkdev pages". This patchset deals with page migration stalls that were reported by our customer due to a block device page that had a bufferhead that was in the bh LRU cache. The patchset modifies the page migration code so that bufferheads are completely handled inside buffer_migrate_page() and then provides a new migration helper for pages with buffer heads that is safe to use even for block device pages and that also deals with bh lrus. This patch (of 6): Factor out function to compute number of expected page references in migrate_page_move_mapping(). Note that we move hpage_nr_pages() and page_has_private() checks from under xas_lock_irq() however this is safe since we hold page lock. [jack@suse.cz: fix expected_page_refs()] Link: http://lkml.kernel.org/r/20181217131710.GB8611@quack2.suse.cz Link: http://lkml.kernel.org/r/20181211172143.7358-2-jack@suse.cz Signed-off-by: Jan Kara Acked-by: Mel Gorman Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d9367bd06faa1beb2951899272f925bdf877d28b Author: Wei Yang Date: Fri Dec 28 00:38:58 2018 -0800 mm, page_alloc: enable pcpu_drain with zone capability drain_all_pages is documented to drain per-cpu pages for a given zone (if non-NULL). The current implementation doesn't match the description though. It will drain all pcp pages for all zones that happen to have cached pages on the same cpu as the given zone. This will lead to premature pcp cache draining for zones that are not of any interest to the caller - e.g. compaction, hwpoison or memory offline. This forces the page allocator to take locks and potential lock contention as a result. There is no real reason for this sub-optimal implementation. Replace per-cpu work item with a dedicated structure which contains a pointer to the zone and pass it over to the worker. This will get the zone information all the way down to the worker function and do the right job. [akpm@linux-foundation.org: avoid 80-col tricks] [mhocko@suse.com: refactor the whole changelog] Link: http://lkml.kernel.org/r/20181212142550.61686-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Acked-by: Michal Hocko Reviewed-by: Oscar Salvador Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d53ce042277a94eadf9a8a31fc41fac54c67dec5 Author: Sri Krishna chowdary Date: Fri Dec 28 00:38:54 2018 -0800 kmemleak: add config to select auto scan Kmemleak scan can be cpu intensive and can stall user tasks at times. To prevent this, add config DEBUG_KMEMLEAK_AUTO_SCAN to enable/disable auto scan on boot up. Also protect first_run with DEBUG_KMEMLEAK_AUTO_SCAN as this is meant for only first automatic scan. Link: http://lkml.kernel.org/r/1540231723-7087-1-git-send-email-prpatel@nvidia.com Signed-off-by: Sri Krishna chowdary Signed-off-by: Sachin Nikam Signed-off-by: Prateek Reviewed-by: Catalin Marinas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3c0c12cc8f00ca5f81acb010023b8eb13e9a7004 Author: Waiman Long Date: Fri Dec 28 00:38:51 2018 -0800 mm/page_alloc.c: don't call kasan_free_pages() at deferred mem init When CONFIG_KASAN is enabled on large memory SMP systems, the deferrred pages initialization can take a long time. Below were the reported init times on a 8-socket 96-core 4TB IvyBridge system. 1) Non-debug kernel without CONFIG_KASAN [ 8.764222] node 1 initialised, 132086516 pages in 7027ms 2) Debug kernel with CONFIG_KASAN [ 146.288115] node 1 initialised, 132075466 pages in 143052ms So the page init time in a debug kernel was 20X of the non-debug kernel. The long init time can be problematic as the page initialization is done with interrupt disabled. In this particular case, it caused the appearance of following warning messages as well as NMI backtraces of all the cores that were doing the initialization. [ 68.240049] rcu: INFO: rcu_sched detected stalls on CPUs/tasks: [ 68.241000] rcu: 25-...0: (100 ticks this GP) idle=b72/1/0x4000000000000000 softirq=915/915 fqs=16252 [ 68.241000] rcu: 44-...0: (95 ticks this GP) idle=49a/1/0x4000000000000000 softirq=788/788 fqs=16253 [ 68.241000] rcu: 54-...0: (104 ticks this GP) idle=03a/1/0x4000000000000000 softirq=721/825 fqs=16253 [ 68.241000] rcu: 60-...0: (103 ticks this GP) idle=cbe/1/0x4000000000000000 softirq=637/740 fqs=16253 [ 68.241000] rcu: 72-...0: (105 ticks this GP) idle=786/1/0x4000000000000000 softirq=536/641 fqs=16253 [ 68.241000] rcu: 84-...0: (99 ticks this GP) idle=292/1/0x4000000000000000 softirq=537/537 fqs=16253 [ 68.241000] rcu: 111-...0: (104 ticks this GP) idle=bde/1/0x4000000000000000 softirq=474/476 fqs=16253 [ 68.241000] rcu: (detected by 13, t=65018 jiffies, g=249, q=2) The long init time was mainly caused by the call to kasan_free_pages() to poison the newly initialized pages. On a 4TB system, we are talking about almost 500GB of memory probably on the same node. In reality, we may not need to poison the newly initialized pages before they are ever allocated. So KASAN poisoning of freed pages before the completion of deferred memory initialization is now disabled. Those pages will be properly poisoned when they are allocated or freed after deferred pages initialization is done. With this change, the new page initialization time became: [ 21.948010] node 1 initialised, 132075466 pages in 18702ms This was still about double the non-debug kernel time, but was much better than before. Link: http://lkml.kernel.org/r/1544459388-8736-1-git-send-email-longman@redhat.com Signed-off-by: Waiman Long Reviewed-by: Andrew Morton Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Michal Hocko Cc: Pasha Tatashin Cc: Oscar Salvador Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3cfd22be0ad663248fadfc8f6ffa3e255c394552 Author: Peter Xu Date: Fri Dec 28 00:38:47 2018 -0800 userfaultfd: clear flag if remap event not enabled When the process being tracked does mremap() without UFFD_FEATURE_EVENT_REMAP on the corresponding tracking uffd file handle, we should not generate the remap event, and at the same time we should clear all the uffd flags on the new VMA. Without this patch, we can still have the VM_UFFD_MISSING|VM_UFFD_WP flags on the new VMA even the fault handling process does not even know the existance of the VMA. Link: http://lkml.kernel.org/r/20181211053409.20317-1-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: Andrea Arcangeli Acked-by: Mike Rapoport Reviewed-by: William Kucharski Cc: Andrea Arcangeli Cc: Mike Rapoport Cc: Kirill A. Shutemov Cc: Hugh Dickins Cc: Pavel Emelyanov Cc: Pravin Shedge Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 125b860b251ad226b1384b6db06be37485127f69 Author: Pingfan Liu Date: Fri Dec 28 00:38:43 2018 -0800 mm/pageblock: throw compile error if pageblock_bits cannot hold MIGRATE_TYPES Currently, NR_PAGEBLOCK_BITS and MIGRATE_TYPES are not associated by code. If someone adds extra migrate type, then he may forget to enlarge the NR_PAGEBLOCK_BITS. Hence it requires some way to fix. NR_PAGEBLOCK_BITS depends on MIGRATE_TYPES, while these macro spread on two different .h file with reverse dependency, it is a little hard to refer to MIGRATE_TYPES in pageblock-flag.h. This patch tries to remind such relation in compiling-time. Link: http://lkml.kernel.org/r/1544508709-11358-1-git-send-email-kernelfans@gmail.com Signed-off-by: Pingfan Liu Reviewed-by: Andrew Morton Acked-by: Vlastimil Babka Cc: Michal Hocko Cc: Pavel Tatashin Cc: Oscar Salvador Cc: Mike Rapoport Cc: Joonsoo Kim Cc: Alexander Duyck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fcf9a0ef8dc3a3fb8be9de12b0e006c85ed5dc29 Author: Kirill Tkhai Date: Fri Dec 28 00:38:40 2018 -0800 ksm: react on changing "sleep_millisecs" parameter faster ksm thread unconditionally sleeps in ksm_scan_thread() after each iteration: schedule_timeout_interruptible( msecs_to_jiffies(ksm_thread_sleep_millisecs)) The timeout is configured in /sys/kernel/mm/ksm/sleep_millisecs. In case of user writes a big value by a mistake, and the thread enters into schedule_timeout_interruptible(), it's not possible to cancel the sleep by writing a new smaler value; the thread is just sleeping till timeout expires. The patch fixes the problem by waking the thread each time after the value is updated. This also may be useful for debug purposes; and also for userspace daemons, which change sleep_millisecs value in dependence of system load. Link: http://lkml.kernel.org/r/154454107680.3258.3558002210423531566.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Cyrill Gorcunov Reviewed-by: Andrew Morton Cc: Michal Hocko Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e0975b2aae0e669f995f7d5f11db25c3080ae11c Author: Michal Hocko Date: Fri Dec 28 00:38:36 2018 -0800 mm, fault_around: do not take a reference to a locked page filemap_map_pages takes a speculative reference to each page in the range before it tries to lock that page. While this is correct it also can influence page migration which will bail out when seeing an elevated reference count. The faultaround code would bail on seeing a locked page so we can pro-actively check the PageLocked bit before page_cache_get_speculative and prevent from pointless reference count churn. Link: http://lkml.kernel.org/r/20181211142741.2607-4-mhocko@kernel.org Signed-off-by: Michal Hocko Suggested-by: Jan Kara Acked-by: Kirill A. Shutemov Reviewed-by: David Hildenbrand Acked-by: Hugh Dickins Reviewed-by: William Kucharski Cc: Oscar Salvador Cc: Pavel Tatashin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bb8965bd82fd4ed433a888f1383016ab3fa0d7de Author: Michal Hocko Date: Fri Dec 28 00:38:32 2018 -0800 mm, memory_hotplug: deobfuscate migration part of offlining Memory migration might fail during offlining and we keep retrying in that case. This is currently obfuscated by goto retry loop. The code is hard to follow and as a result it is even suboptimal becase each retry round scans the full range from start_pfn even though we have successfully scanned/migrated [start_pfn, pfn] range already. This is all only because check_pages_isolated failure has to rescan the full range again. De-obfuscate the migration retry loop by promoting it to a real for loop. In fact remove the goto altogether by making it a proper double loop (yeah, gotos are nasty in this specific case). In the end we will get a slightly more optimal code which is better readable. [akpm@linux-foundation.org: reflow comments to 80 cols] Link: http://lkml.kernel.org/r/20181211142741.2607-3-mhocko@kernel.org Signed-off-by: Michal Hocko Reviewed-by: David Hildenbrand Reviewed-by: Oscar Salvador Cc: Hugh Dickins Cc: Jan Kara Cc: Kirill A. Shutemov Cc: Pavel Tatashin Cc: William Kucharski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a85009c377929d119fad5a75a16c4b7198946603 Author: Michal Hocko Date: Fri Dec 28 00:38:29 2018 -0800 mm, memory_hotplug: try to migrate full pfn range Patch series "few memory offlining enhancements". I have been chasing memory offlining not making progress recently. On the way I have noticed few weird decisions in the code. The migration itself is restricted without a reasonable justification and the retry loop around the migration is quite messy. This is addressed by patch 1 and patch 2. Patch 3 is targeting on the faultaround code which has been a hot candidate for the initial issue reported upstream [2] and that I am debugging internally. It turned out to be not the main contributor in the end but I believe we should address it regardless. See the patch description for more details. [1] http://lkml.kernel.org/r/20181120134323.13007-1-mhocko@kernel.org [2] http://lkml.kernel.org/r/20181114070909.GB2653@MiWiFi-R3L-srv This patch (of 3): do_migrate_range has been limiting the number of pages to migrate to 256 for some reason which is not documented. Even if the limit made some sense back then when it was introduced it doesn't really serve a good purpose these days. If the range contains huge pages then we break out of the loop too early and go through LRU and pcp caches draining and scan_movable_pages is quite suboptimal. The only reason to limit the number of pages I can think of is to reduce the potential time to react on the fatal signal. But even then the number of pages is a questionable metric because even a single page migration might block in a non-killable state (e.g. __unmap_and_move). Remove the limit and offline the full requested range (this is one memblock worth of pages with the current code). Should we ever get a report that offlining takes too long to react on fatal signal then we should rather fix the core migration to use killable waits and bailout on a signal. Link: http://lkml.kernel.org/r/20181211142741.2607-1-mhocko@kernel.org Link: http://lkml.kernel.org/r/20181211142741.2607-2-mhocko@kernel.org Signed-off-by: Michal Hocko Reviewed-by: David Hildenbrand Reviewed-by: Pavel Tatashin Reviewed-by: Oscar Salvador Cc: Hugh Dickins Cc: Jan Kara Cc: Kirill A. Shutemov Cc: William Kucharski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a1400af755631f5267f7cc3d0fda5ba72f58d7d3 Author: Michal Hocko Date: Fri Dec 28 00:38:25 2018 -0800 mm, proc: report PR_SET_THP_DISABLE in proc David Rientjes has reported that commit 1860033237d4 ("mm: make PR_SET_THP_DISABLE immediately active") has changed the way how we report THPable VMAs to the userspace. Their monitoring tool is triggering false alarms on PR_SET_THP_DISABLE tasks because it considers an insufficient THP usage as a memory fragmentation resp. memory pressure issue. Before the said commit each newly created VMA inherited VM_NOHUGEPAGE flag and that got exposed to the userspace via /proc//smaps file. This implementation had its downsides as explained in the commit message but it is true that the userspace doesn't have any means to query for the process wide THP enabled/disabled status. PR_SET_THP_DISABLE is a process wide flag so it makes a lot of sense to export in the process wide context rather than per-vma. Introduce a new field to /proc//status which export this status. If PR_SET_THP_DISABLE is used then it reports false same as when the THP is not compiled in. It doesn't consider the global THP status because we already export that information via sysfs Link: http://lkml.kernel.org/r/20181211143641.3503-4-mhocko@kernel.org Fixes: 1860033237d4 ("mm: make PR_SET_THP_DISABLE immediately active") Signed-off-by: Michal Hocko Acked-by: Vlastimil Babka Reported-by: David Rientjes Cc: Dan Williams Cc: Jan Kara Cc: Mike Rapoport Cc: Paul Oppenheimer Cc: William Kucharski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7635d9cbe8327e131a1d3d8517dc186c2796ce2e Author: Michal Hocko Date: Fri Dec 28 00:38:21 2018 -0800 mm, thp, proc: report THP eligibility for each vma Userspace falls short when trying to find out whether a specific memory range is eligible for THP. There are usecases that would like to know that http://lkml.kernel.org/r/alpine.DEB.2.21.1809251248450.50347@chino.kir.corp.google.com : This is used to identify heap mappings that should be able to fault thp : but do not, and they normally point to a low-on-memory or fragmentation : issue. The only way to deduce this now is to query for hg resp. nh flags and confronting the state with the global setting. Except that there is also PR_SET_THP_DISABLE that might change the picture. So the final logic is not trivial. Moreover the eligibility of the vma depends on the type of VMA as well. In the past we have supported only anononymous memory VMAs but things have changed and shmem based vmas are supported as well these days and the query logic gets even more complicated because the eligibility depends on the mount option and another global configuration knob. Simplify the current state and report the THP eligibility in /proc//smaps for each existing vma. Reuse transparent_hugepage_enabled for this purpose. The original implementation of this function assumes that the caller knows that the vma itself is supported for THP so make the core checks into __transparent_hugepage_enabled and use it for existing callers. __show_smap just use the new transparent_hugepage_enabled which also checks the vma support status (please note that this one has to be out of line due to include dependency issues). [mhocko@kernel.org: fix oops with NULL ->f_mapping] Link: http://lkml.kernel.org/r/20181224185106.GC16738@dhcp22.suse.cz Link: http://lkml.kernel.org/r/20181211143641.3503-3-mhocko@kernel.org Signed-off-by: Michal Hocko Acked-by: Vlastimil Babka Cc: Dan Williams Cc: David Rientjes Cc: Jan Kara Cc: Mike Rapoport Cc: Paul Oppenheimer Cc: William Kucharski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7550c6079846a24f30d15ac75a941c8515dbedfb Author: Michal Hocko Date: Fri Dec 28 00:38:17 2018 -0800 mm, proc: be more verbose about unstable VMA flags in /proc//smaps Patch series "THP eligibility reporting via proc". This series of three patches aims at making THP eligibility reporting much more robust and long term sustainable. The trigger for the change is a regression report [2] and the long follow up discussion. In short the specific application didn't have good API to query whether a particular mapping can be backed by THP so it has used VMA flags to workaround that. These flags represent a deep internal state of VMAs and as such they should be used by userspace with a great deal of caution. A similar has happened for [3] when users complained that VM_MIXEDMAP is no longer set on DAX mappings. Again a lack of a proper API led to an abuse. The first patch in the series tries to emphasise that that the semantic of flags might change and any application consuming those should be really careful. The remaining two patches provide a more suitable interface to address [2] and provide a consistent API to query the THP status both for each VMA and process wide as well. [1] http://lkml.kernel.org/r/20181120103515.25280-1-mhocko@kernel.org [2] http://lkml.kernel.org/r/http://lkml.kernel.org/r/alpine.DEB.2.21.1809241054050.224429@chino.kir.corp.google.com [3] http://lkml.kernel.org/r/20181002100531.GC4135@quack2.suse.cz This patch (of 3): Even though vma flags exported via /proc//smaps are explicitly documented to be not guaranteed for future compatibility the warning doesn't go far enough because it doesn't mention semantic changes to those flags. And they are important as well because these flags are a deep implementation internal to the MM code and the semantic might change at any time. Let's consider two recent examples: http://lkml.kernel.org/r/20181002100531.GC4135@quack2.suse.cz : commit e1fb4a086495 "dax: remove VM_MIXEDMAP for fsdax and device dax" has : removed VM_MIXEDMAP flag from DAX VMAs. Now our testing shows that in the : mean time certain customer of ours started poking into /proc//smaps : and looks at VMA flags there and if VM_MIXEDMAP is missing among the VMA : flags, the application just fails to start complaining that DAX support is : missing in the kernel. http://lkml.kernel.org/r/alpine.DEB.2.21.1809241054050.224429@chino.kir.corp.google.com : Commit 1860033237d4 ("mm: make PR_SET_THP_DISABLE immediately active") : introduced a regression in that userspace cannot always determine the set : of vmas where thp is ineligible. : Userspace relies on the "nh" flag being emitted as part of /proc/pid/smaps : to determine if a vma is eligible to be backed by hugepages. : Previous to this commit, prctl(PR_SET_THP_DISABLE, 1) would cause thp to : be disabled and emit "nh" as a flag for the corresponding vmas as part of : /proc/pid/smaps. After the commit, thp is disabled by means of an mm : flag and "nh" is not emitted. : This causes smaps parsing libraries to assume a vma is eligible for thp : and ends up puzzling the user on why its memory is not backed by thp. In both cases userspace was relying on a semantic of a specific VMA flag. The primary reason why that happened is a lack of a proper interface. While this has been worked on and it will be fixed properly, it seems that our wording could see some refinement and be more vocal about semantic aspect of these flags as well. Link: http://lkml.kernel.org/r/20181211143641.3503-2-mhocko@kernel.org Signed-off-by: Michal Hocko Acked-by: Jan Kara Acked-by: Dan Williams Acked-by: David Rientjes Acked-by: Mike Rapoport Acked-by: Vlastimil Babka Cc: Dan Williams Cc: David Rientjes Cc: Paul Oppenheimer Cc: William Kucharski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0614ce9776b037b6a08a9adcbfcc382c0053b178 Author: Wei Yang Date: Fri Dec 28 00:38:13 2018 -0800 include/linux/memory_hotplug.h: remove duplicate declaration of offline_pages() offline_pages() is already declared in this file. Just remove the duplicated one. Link: http://lkml.kernel.org/r/20181205031357.24769-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ac46d4f3c43241ffa23d5bf36153a0830c0e02cc Author: Jérôme Glisse Date: Fri Dec 28 00:38:09 2018 -0800 mm/mmu_notifier: use structure for invalidate_range_start/end calls v2 To avoid having to change many call sites everytime we want to add a parameter use a structure to group all parameters for the mmu_notifier invalidate_range_start/end cakks. No functional changes with this patch. [akpm@linux-foundation.org: coding style fixes] Link: http://lkml.kernel.org/r/20181205053628.3210-3-jglisse@redhat.com Signed-off-by: Jérôme Glisse Acked-by: Christian König Acked-by: Jan Kara Cc: Matthew Wilcox Cc: Ross Zwisler Cc: Dan Williams Cc: Paolo Bonzini Cc: Radim Krcmar Cc: Michal Hocko Cc: Felix Kuehling Cc: Ralph Campbell Cc: John Hubbard From: Jérôme Glisse Subject: mm/mmu_notifier: use structure for invalidate_range_start/end calls v3 fix build warning in migrate.c when CONFIG_MMU_NOTIFIER=n Link: http://lkml.kernel.org/r/20181213171330.8489-3-jglisse@redhat.com Signed-off-by: Jérôme Glisse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5d6527a784f7a6d247961e046e830de8d71b47d1 Author: Jérôme Glisse Date: Fri Dec 28 00:38:05 2018 -0800 mm/mmu_notifier: use structure for invalidate_range_start/end callback Patch series "mmu notifier contextual informations", v2. This patchset adds contextual information, why an invalidation is happening, to mmu notifier callback. This is necessary for user of mmu notifier that wish to maintains their own data structure without having to add new fields to struct vm_area_struct (vma). For instance device can have they own page table that mirror the process address space. When a vma is unmap (munmap() syscall) the device driver can free the device page table for the range. Today we do not have any information on why a mmu notifier call back is happening and thus device driver have to assume that it is always an munmap(). This is inefficient at it means that it needs to re-allocate device page table on next page fault and rebuild the whole device driver data structure for the range. Other use case beside munmap() also exist, for instance it is pointless for device driver to invalidate the device page table when the invalidation is for the soft dirtyness tracking. Or device driver can optimize away mprotect() that change the page table permission access for the range. This patchset enables all this optimizations for device drivers. I do not include any of those in this series but another patchset I am posting will leverage this. The patchset is pretty simple from a code point of view. The first two patches consolidate all mmu notifier arguments into a struct so that it is easier to add/change arguments. The last patch adds the contextual information (munmap, protection, soft dirty, clear, ...). This patch (of 3): To avoid having to change many callback definition everytime we want to add a parameter use a structure to group all parameters for the mmu_notifier invalidate_range_start/end callback. No functional changes with this patch. [akpm@linux-foundation.org: fix drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c kerneldoc] Link: http://lkml.kernel.org/r/20181205053628.3210-2-jglisse@redhat.com Signed-off-by: Jérôme Glisse Acked-by: Jan Kara Acked-by: Jason Gunthorpe [infiniband] Cc: Matthew Wilcox Cc: Ross Zwisler Cc: Dan Williams Cc: Paolo Bonzini Cc: Radim Krcmar Cc: Michal Hocko Cc: Christian Koenig Cc: Felix Kuehling Cc: Ralph Campbell Cc: John Hubbard Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b15c87263a69272423771118c653e9a1d0672caa Author: Michal Hocko Date: Fri Dec 28 00:38:01 2018 -0800 hwpoison, memory_hotplug: allow hwpoisoned pages to be offlined We have received a bug report that an injected MCE about faulty memory prevents memory offline to succeed on 4.4 base kernel. The underlying reason was that the HWPoison page has an elevated reference count and the migration keeps failing. There are two problems with that. First of all it is dubious to migrate the poisoned page because we know that accessing that memory is possible to fail. Secondly it doesn't make any sense to migrate a potentially broken content and preserve the memory corruption over to a new location. Oscar has found out that 4.4 and the current upstream kernels behave slightly differently with his simply testcase === int main(void) { int ret; int i; int fd; char *array = malloc(4096); char *array_locked = malloc(4096); fd = open("/tmp/data", O_RDONLY); read(fd, array, 4095); for (i = 0; i < 4096; i++) array_locked[i] = 'd'; ret = mlock((void *)PAGE_ALIGN((unsigned long)array_locked), sizeof(array_locked)); if (ret) perror("mlock"); sleep (20); ret = madvise((void *)PAGE_ALIGN((unsigned long)array_locked), 4096, MADV_HWPOISON); if (ret) perror("madvise"); for (i = 0; i < 4096; i++) array_locked[i] = 'd'; return 0; } === + offline this memory. In 4.4 kernels he saw the hwpoisoned page to be returned back to the LRU list kernel: [] dump_trace+0x59/0x340 kernel: [] show_stack_log_lvl+0xea/0x170 kernel: [] show_stack+0x21/0x40 kernel: [] dump_stack+0x5c/0x7c kernel: [] warn_slowpath_common+0x81/0xb0 kernel: [] __pagevec_lru_add_fn+0x14c/0x160 kernel: [] pagevec_lru_move_fn+0xad/0x100 kernel: [] __lru_cache_add+0x6c/0xb0 kernel: [] add_to_page_cache_lru+0x46/0x70 kernel: [] extent_readpages+0xc3/0x1a0 [btrfs] kernel: [] __do_page_cache_readahead+0x177/0x200 kernel: [] ondemand_readahead+0x168/0x2a0 kernel: [] generic_file_read_iter+0x41f/0x660 kernel: [] __vfs_read+0xcd/0x140 kernel: [] vfs_read+0x7a/0x120 kernel: [] kernel_read+0x3b/0x50 kernel: [] do_execveat_common.isra.29+0x490/0x6f0 kernel: [] do_execve+0x28/0x30 kernel: [] call_usermodehelper_exec_async+0xfb/0x130 kernel: [] ret_from_fork+0x55/0x80 And that latter confuses the hotremove path because an LRU page is attempted to be migrated and that fails due to an elevated reference count. It is quite possible that the reuse of the HWPoisoned page is some kind of fixed race condition but I am not really sure about that. With the upstream kernel the failure is slightly different. The page doesn't seem to have LRU bit set but isolate_movable_page simply fails and do_migrate_range simply puts all the isolated pages back to LRU and therefore no progress is made and scan_movable_pages finds same set of pages over and over again. Fix both cases by explicitly checking HWPoisoned pages before we even try to get reference on the page, try to unmap it if it is still mapped. As explained by Naoya: : Hwpoison code never unmapped those for no big reason because : Ksm pages never dominate memory, so we simply didn't have strong : motivation to save the pages. Also put WARN_ON(PageLRU) in case there is a race and we can hit LRU HWPoison pages which shouldn't happen but I couldn't convince myself about that. Naoya has noted the following: : Theoretically no such gurantee, because try_to_unmap() doesn't have a : guarantee of success and then memory_failure() returns immediately : when hwpoison_user_mappings fails. : Or the following code (comes after hwpoison_user_mappings block) also impli= : es : that the target page can still have PageLRU flag. : : /* : * Torn down by someone else? : */ : if (PageLRU(p) && !PageSwapCache(p) && p->mapping =3D=3D NULL) { : action_result(pfn, MF_MSG_TRUNCATED_LRU, MF_IGNORED); : res =3D -EBUSY; : goto out; : } : : So I think it's OK to keep "if (WARN_ON(PageLRU(page)))" block in : current version of your patch. Link: http://lkml.kernel.org/r/20181206120135.14079-1-mhocko@kernel.org Signed-off-by: Michal Hocko Reviewed-by: Oscar Salvador Debugged-by: Oscar Salvador Tested-by: Oscar Salvador Acked-by: David Hildenbrand Acked-by: Naoya Horiguchi Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9f1eb38e0e1131e75cc4ac684391b25d70282589 Author: Oscar Salvador Date: Fri Dec 28 00:37:57 2018 -0800 mm, kmemleak: little optimization while scanning kmemleak_scan() goes through all online nodes and tries to scan all used pages. We can do better and use pfn_to_online_page(), so in case we have CONFIG_MEMORY_HOTPLUG, offlined pages will be skiped automatically. For boxes where CONFIG_MEMORY_HOTPLUG is not present, pfn_to_online_page() will fallback to pfn_valid(). Another little optimization is to check if the page belongs to the node we are currently checking, so in case we have nodes interleaved we will not check the same pfn multiple times. I ran some tests: Add some memory to node1 and node2 making it interleaved: (qemu) object_add memory-backend-ram,id=ram0,size=1G (qemu) device_add pc-dimm,id=dimm0,memdev=ram0,node=1 (qemu) object_add memory-backend-ram,id=ram1,size=1G (qemu) device_add pc-dimm,id=dimm1,memdev=ram1,node=2 (qemu) object_add memory-backend-ram,id=ram2,size=1G (qemu) device_add pc-dimm,id=dimm2,memdev=ram2,node=1 Then, we offline that memory: # for i in {32..39} ; do echo "offline" > /sys/devices/system/node/node1/memory$i/state;done # for i in {48..55} ; do echo "offline" > /sys/devices/system/node/node1/memory$i/state;don # for i in {40..47} ; do echo "offline" > /sys/devices/system/node/node2/memory$i/state;done And we run kmemleak_scan: # echo "scan" > /sys/kernel/debug/kmemleak before the patch: kmemleak: time spend: 41596 us after the patch: kmemleak: time spend: 34899 us [akpm@linux-foundation.org: remove stray newline, per Oscar] Link: http://lkml.kernel.org/r/20181206131918.25099-1-osalvador@suse.de Signed-off-by: Oscar Salvador Reviewed-by: Wei Yang Suggested-by: Michal Hocko Acked-by: Catalin Marinas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8e2d43405b22e98cf5f3730c1829ec1fdbe17ae7 Author: Will Deacon Date: Fri Dec 28 00:37:53 2018 -0800 lib/ioremap: ensure break-before-make is used for huge p4d mappings Whilst no architectures actually enable support for huge p4d mappings in the vmap area, the code that is implemented should be using break-before-make, as we do for pud and pmd huge entries. Link: http://lkml.kernel.org/r/1544120495-17438-6-git-send-email-will.deacon@arm.com Signed-off-by: Will Deacon Reviewed-by: Toshi Kani Cc: Chintan Pandya Cc: Toshi Kani Cc: Thomas Gleixner Cc: Michal Hocko Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Sean Christopherson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 36ddc5a78c878e9b10c323d2fe88b0dae2f487eb Author: Will Deacon Date: Fri Dec 28 00:37:49 2018 -0800 lib/ioremap: ensure phys_addr actually corresponds to a physical address The current ioremap() code uses a phys_addr variable at each level of page table, which is confusingly offset by subtracting the base virtual address being mapped so that adding the current virtual address back on when iterating through the page table entries gives back the corresponding physical address. This is fairly confusing and results in all users of phys_addr having to add the current virtual address back on. Instead, this patch just updates phys_addr when iterating over the page table entries, ensuring that it's always up-to-date and doesn't require explicit offsetting. Link: http://lkml.kernel.org/r/1544120495-17438-5-git-send-email-will.deacon@arm.com Signed-off-by: Will Deacon Tested-by: Sean Christopherson Reviewed-by: Sean Christopherson Cc: Chintan Pandya Cc: Toshi Kani Cc: Thomas Gleixner Cc: Michal Hocko Cc: Sean Christopherson Cc: "H. Peter Anvin" Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 48e178ab0d630b8b60deca64b22b22e68818777e Author: Will Deacon Date: Fri Dec 28 00:37:45 2018 -0800 x86/pgtable: drop pXd_none() checks from pXd_free_pYd_table() The core code already has a check for pXd_none(), so remove it from the architecture implementation. Link: http://lkml.kernel.org/r/1544120495-17438-4-git-send-email-will.deacon@arm.com Signed-off-by: Will Deacon Acked-by: Thomas Gleixner Reviewed-by: Toshi Kani Cc: Chintan Pandya Cc: Toshi Kani Cc: Michal Hocko Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: Sean Christopherson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9c006972c3fedbea43fde9667686e5949eba9981 Author: Will Deacon Date: Fri Dec 28 00:37:42 2018 -0800 arm64: mmu: drop pXd_present() checks from pXd_free_pYd_table() The core code already has a check for pXd_none(), so remove it from the architecture implementation. Link: http://lkml.kernel.org/r/1544120495-17438-3-git-send-email-will.deacon@arm.com Signed-off-by: Will Deacon Cc: Chintan Pandya Cc: Toshi Kani Cc: Thomas Gleixner Cc: Michal Hocko Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Sean Christopherson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d239865ac804c91a621294ca7bece4241b006fae Author: Will Deacon Date: Fri Dec 28 00:37:38 2018 -0800 ioremap: rework pXd_free_pYd_page() API The recently merged API for ensuring break-before-make on page-table entries when installing huge mappings in the vmalloc/ioremap region is fairly counter-intuitive, resulting in the arch freeing functions (e.g. pmd_free_pte_page()) being called even on entries that aren't present. This resulted in a minor bug in the arm64 implementation, giving rise to spurious VM_WARN messages. This patch moves the pXd_present() checks out into the core code, refactoring the callsites at the same time so that we avoid the complex conjunctions when determining whether or not we can put down a huge mapping. Link: http://lkml.kernel.org/r/1544120495-17438-2-git-send-email-will.deacon@arm.com Signed-off-by: Will Deacon Reviewed-by: Toshi Kani Suggested-by: Linus Torvalds Cc: Chintan Pandya Cc: Toshi Kani Cc: Thomas Gleixner Cc: Michal Hocko Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Sean Christopherson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c16eb000ca03f8cdc2153bca6c977b6f898e6934 Author: Kirill Tkhai Date: Fri Dec 28 00:37:35 2018 -0800 mm/filemap.c: remove useless check in pagecache_get_page() page always is not NULL, so we may remove this useless check. Link: http://lkml.kernel.org/r/154419752044.18559.2452963074922917720.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Acked-by: Cyrill Gorcunov Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 144552ff8995dd34d049a203d636b259ab751137 Author: Anthony Yznaga Date: Fri Dec 28 00:37:31 2018 -0800 /proc/kpagecount: return 0 for special pages that are never mapped Certain pages that are never mapped to userspace have a type indicated in the page_type field of their struct pages (e.g. PG_buddy). page_type overlaps with _mapcount so set the count to 0 and avoid calling page_mapcount() for these pages. [anthony.yznaga@oracle.com: incorporate feedback from Matthew Wilcox] Link: http://lkml.kernel.org/r/1544481313-27318-1-git-send-email-anthony.yznaga@oracle.com Link: http://lkml.kernel.org/r/1543963526-27917-1-git-send-email-anthony.yznaga@oracle.com Signed-off-by: Anthony Yznaga Reviewed-by: Andrew Morton Acked-by: Matthew Wilcox Reviewed-by: Naoya Horiguchi Cc: Vlastimil Babka Cc: David Rientjes Cc: Alexey Dobriyan Cc: Kirill A. Shutemov Cc: Mike Rapoport Cc: Michal Hocko Cc: Alexander Duyck Cc: Johannes Weiner Cc: Miles Chen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b6fb87b8e3ff1ef6bcf68470f24a97c984554d5a Author: Anthony Yznaga Date: Fri Dec 28 00:37:27 2018 -0800 tools/vm/page-types.c: fix "kpagecount returned fewer pages than expected" failures Because kpagecount_read() fakes success if map counts are not being collected, clamp the page count passed to it by walk_pfn() to the pages value returned by the preceding call to kpageflags_read(). Link: http://lkml.kernel.org/r/1543962269-26116-1-git-send-email-anthony.yznaga@oracle.com Fixes: 7f1d23e60718 ("tools/vm/page-types.c: include shared map counts") Signed-off-by: Anthony Yznaga Reviewed-by: Naoya Horiguchi Cc: Vlastimil Babka Cc: Matthew Wilcox Cc: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bbe5d9939e81277bfbfb8fdba68374024b16d5fa Author: Oscar Salvador Date: Fri Dec 28 00:37:24 2018 -0800 mm/page_alloc.c: drop uneeded __meminit and __meminitdata Since commit 03e85f9d5f1 ("mm/page_alloc: Introduce free_area_init_core_hotplug"), some functions changed to only be called during system initialization. Concretly, free_area_init_node() and the functions that hang from it. Also, some variables are no longer used after the system has gone through initialization. So this could be considered as a late clean-up for that patch. This patch changes the functions from __meminit to __init, and the variables from __meminitdata to __initdata. In return, we get some KBs back: Before: Freeing unused kernel image memory: 2472K After: Freeing unused kernel image memory: 2480K Link: http://lkml.kernel.org/r/20181204111507.4808-1-osalvador@suse.de Signed-off-by: Oscar Salvador Reviewed-by: Wei Yang Cc: Michal Hocko Cc: Pavel Tatashin Cc: Vlastimil Babka Cc: Alexander Duyck Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3fa750dcf29e8606e3969d13d8e188cc1c0f511d Author: Brian Foster Date: Fri Dec 28 00:37:20 2018 -0800 mm/page-writeback.c: don't break integrity writeback on ->writepage() error write_cache_pages() is used in both background and integrity writeback scenarios by various filesystems. Background writeback is mostly concerned with cleaning a certain number of dirty pages based on various mm heuristics. It may not write the full set of dirty pages or wait for I/O to complete. Integrity writeback is responsible for persisting a set of dirty pages before the writeback job completes. For example, an fsync() call must perform integrity writeback to ensure data is on disk before the call returns. write_cache_pages() unconditionally breaks out of its processing loop in the event of a ->writepage() error. This is fine for background writeback, which had no strict requirements and will eventually come around again. This can cause problems for integrity writeback on filesystems that might need to clean up state associated with failed page writeouts. For example, XFS performs internal delayed allocation accounting before returning a ->writepage() error, where applicable. If the current writeback happens to be associated with an unmount and write_cache_pages() completes the writeback prematurely due to error, the filesystem is unmounted in an inconsistent state if dirty+delalloc pages still exist. To handle this problem, update write_cache_pages() to always process the full set of pages for integrity writeback regardless of ->writepage() errors. Save the first encountered error and return it to the caller once complete. This facilitates XFS (or any other fs that expects integrity writeback to process the entire set of dirty pages) to clean up its internal state completely in the event of persistent mapping errors. Background writeback continues to exit on the first error encountered. [akpm@linux-foundation.org: fix typo in comment] Link: http://lkml.kernel.org/r/20181116134304.32440-1-bfoster@redhat.com Signed-off-by: Brian Foster Reviewed-by: Jan Kara Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c3a5c77afefa697bf87f15272c7257e1574cad56 Author: Wei Yang Date: Fri Dec 28 00:37:16 2018 -0800 lib/show_mem.c: drop pgdat_resize_lock in show_mem() Function show_mem() is used to print system memory status when user requires or fail to allocate memory. Generally, this is a best effort information so any races with memory hotplug (or very theoretically an early initialization) should be tolerable and the worst that could happen is to print an imprecise node state. Drop the resize lock because this is the only place which might hold the lock from the interrupt context and so all other callers might use a simple spinlock. Even though this doesn't solve any real issue it makes the code easier to follow and tiny more effective. Link: http://lkml.kernel.org/r/20181129235532.9328-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Acked-by: Michal Hocko Reviewed-by: Oscar Salvador Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0ecea993d0100e7409f8840b463a34fae42c9c32 Author: YueHaibing Date: Fri Dec 28 00:37:13 2018 -0800 mm/hmm.c: remove set but not used variable 'devmem' Fixes gcc '-Wunused-but-set-variable' warning: mm/hmm.c: In function 'hmm_devmem_ref_kill': mm/hmm.c:995:21: warning: variable 'devmem' set but not used [-Wunused-but-set-variable] It not used any more since 35d39f953d4e ("mm, hmm: replace hmm_devmem_pages_create() with devm_memremap_pages()") Link: http://lkml.kernel.org/r/1543629971-128377-1-git-send-email-yuehaibing@huawei.com Signed-off-by: YueHaibing Reviewed-by: Reviewed-by: Jérôme Glisse Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fa004ab7365ffa1e17e6b267d64798afccb94946 Author: Wei Yang Date: Fri Dec 28 00:37:10 2018 -0800 mm, hotplug: move init_currently_empty_zone() under zone_span_lock protection During online_pages phase, pgdat->nr_zones will be updated in case this zone is empty. Currently the online_pages phase is protected by the global locks (device_device_hotplug_lock and mem_hotplug_lock), which ensures there is no contention during the update of nr_zones. These global locks introduces scalability issues (especially the second one), which slow down code relying on get_online_mems(). This is also a preparation for not having to rely on get_online_mems() but instead some more fine grained locks. The patch moves init_currently_empty_zone under both zone_span_writelock and pgdat_resize_lock because both the pgdat state is changed (nr_zones) and the zone's start_pfn. Also this patch changes the documentation of node_size_lock to include the protection of nr_zones. Link: http://lkml.kernel.org/r/20181203205016.14123-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Acked-by: Michal Hocko Reviewed-by: Oscar Salvador Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4e0d2e7ef14d9e1c900dac909db45263822b824f Author: Wei Yang Date: Fri Dec 28 00:37:06 2018 -0800 mm, sparse: pass nid instead of pgdat to sparse_add_one_section() Since the information needed in sparse_add_one_section() is node id to allocate proper memory, it is not necessary to pass its pgdat. This patch changes the prototype of sparse_add_one_section() to pass node id directly. This is intended to reduce misleading that sparse_add_one_section() would touch pgdat. Link: http://lkml.kernel.org/r/20181204085657.20472-2-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: David Hildenbrand Acked-by: Michal Hocko Cc: Dave Hansen Cc: Oscar Salvador Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 83af658898cb292a32d8b6cd9b51266d7cfc4b6a Author: Wei Yang Date: Fri Dec 28 00:37:02 2018 -0800 mm, sparse: drop pgdat_resize_lock in sparse_add/remove_one_section() pgdat_resize_lock is used to protect pgdat's memory region information like: node_start_pfn, node_present_pages, etc. While in function sparse_add/remove_one_section(), pgdat_resize_lock is used to protect initialization/release of one mem_section. This looks not proper. These code paths are currently protected by mem_hotplug_lock currently but should there ever be any reason for locking at the sparse layer a dedicated lock should be introduced. Following is the current call trace of sparse_add/remove_one_section() mem_hotplug_begin() arch_add_memory() add_pages() __add_pages() __add_section() sparse_add_one_section() mem_hotplug_done() mem_hotplug_begin() arch_remove_memory() __remove_pages() __remove_section() sparse_remove_one_section() mem_hotplug_done() The comment above the pgdat_resize_lock also mentions "Holding this will also guarantee that any pfn_valid() stays that way.", which is true with the current implementation and false after this patch. But current implementation doesn't meet this comment. There isn't any pfn walkers to take the lock so this looks like a relict from the past. This patch also removes this comment. [richard.weiyang@gmail.com: v4] Link: http://lkml.kernel.org/r/20181204085657.20472-1-richard.weiyang@gmail.com [mhocko@suse.com: changelog suggestion] Link: http://lkml.kernel.org/r/20181128091243.19249-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: David Hildenbrand Acked-by: Michal Hocko Cc: Dave Hansen Cc: Oscar Salvador Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9e247bab0668a5893b3efa131cec5b5859467834 Author: Yu Zhao Date: Fri Dec 28 00:36:58 2018 -0800 mm: remove pte_lock_deinit() Pagetable page doesn't touch page->mapping or have any used field that overlaps with it. No need to clear mapping in dtor. In fact, doing so might mask problems that otherwise would be detected by bad_page(). Link: http://lkml.kernel.org/r/20181128235525.58780-1-yuzhao@google.com Signed-off-by: Yu Zhao Reviewed-by: Matthew Wilcox Acked-by: Michal Hocko Cc: Hugh Dickins Cc: "Kirill A . Shutemov" Cc: Dan Williams Cc: Pavel Tatashin Cc: Souptick Joarder Cc: Logan Gunthorpe Cc: Keith Busch Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bb416d18b850faaa44bd3bb67c9728922c3cce98 Author: Minchan Kim Date: Fri Dec 28 00:36:54 2018 -0800 zram: writeback throttle If there are lots of write IO with flash device, it could have a wearout problem of storage. To overcome the problem, admin needs to design write limitation to guarantee flash health for entire product life. This patch creates a new knob "writeback_limit" for zram. writeback_limit's default value is 0 so that it doesn't limit any writeback. If admin want to measure writeback count in a certain period, he could know it via /sys/block/zram0/bd_stat's 3rd column. If admin want to limit writeback as per-day 400M, he could do it like below. MB_SHIFT=20 4K_SHIFT=12 echo $((400<>4K_SHIFT)) > \ /sys/block/zram0/writeback_limit. If admin want to allow further write again, he could do it like below echo 0 > /sys/block/zram0/writeback_limit If admin want to see remaining writeback budget, cat /sys/block/zram0/writeback_limit The writeback_limit count will reset whenever you reset zram (e.g., system reboot, echo 1 > /sys/block/zramX/reset) so keeping how many of writeback happened until you reset the zram to allocate extra writeback budget in next setting is user's job. [minchan@kernel.org: v4] Link: http://lkml.kernel.org/r/20181203024045.153534-8-minchan@kernel.org Link: http://lkml.kernel.org/r/20181127055429.251614-8-minchan@kernel.org Signed-off-by: Minchan Kim Reviewed-by: Sergey Senozhatsky Cc: Joey Pabalinas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 23eddf39b2c28c05cb8f8203d38e61807d701b38 Author: Minchan Kim Date: Fri Dec 28 00:36:51 2018 -0800 zram: add bd_stat statistics bd_stat represents things that happened in the backing device. Currently it supports bd_counts, bd_reads and bd_writes which are helpful to understand wearout of flash and memory saving. [minchan@kernel.org: v4] Link: http://lkml.kernel.org/r/20181203024045.153534-7-minchan@kernel.org Link: http://lkml.kernel.org/r/20181127055429.251614-7-minchan@kernel.org Signed-off-by: Minchan Kim Reviewed-by: Sergey Senozhatsky Cc: Joey Pabalinas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a939888ec38bf1f33e4a903056677e92a4844244 Author: Minchan Kim Date: Fri Dec 28 00:36:47 2018 -0800 zram: support idle/huge page writeback Add a new feature "zram idle/huge page writeback". In the zram-swap use case, zram usually has many idle/huge swap pages. It's pointless to keep them in memory (ie, zram). To solve this problem, this feature introduces idle/huge page writeback to the backing device so the goal is to save more memory space on embedded systems. Normal sequence to use idle/huge page writeback feature is as follows, while (1) { # mark allocated zram slot to idle echo all > /sys/block/zram0/idle # leave system working for several hours # Unless there is no access for some blocks on zram, # they are still IDLE marked pages. echo "idle" > /sys/block/zram0/writeback or/and echo "huge" > /sys/block/zram0/writeback # write the IDLE or/and huge marked slot into backing device # and free the memory. } Per the discussion at https://lore.kernel.org/lkml/20181122065926.GG3441@jagdpanzerIV/T/#u, This patch removes direct incommpressibe page writeback feature (d2afd25114f4 ("zram: write incompressible pages to backing device")). Below concerns from Sergey: == &< == "IDLE writeback" is superior to "incompressible writeback". "incompressible writeback" is completely unpredictable and uncontrollable; it depens on data patterns and compression algorithms. While "IDLE writeback" is predictable. I even suspect, that, *ideally*, we can remove "incompressible writeback". "IDLE pages" is a super set which also includes "incompressible" pages. So, technically, we still can do "incompressible writeback" from "IDLE writeback" path; but a much more reasonable one, based on a page idling period. I understand that you want to keep "direct incompressible writeback" around. ZRAM is especially popular on devices which do suffer from flash wearout, so I can see "incompressible writeback" path becoming a dead code, long term. == &< == Below concerns from Minchan: == &< == My concern is if we enable CONFIG_ZRAM_WRITEBACK in this implementation, both hugepage/idlepage writeck will turn on. However someuser want to enable only idlepage writeback so we need to introduce turn on/off knob for hugepage or new CONFIG_ZRAM_IDLEPAGE_WRITEBACK for those usecase. I don't want to make it complicated *if possible*. Long term, I imagine we need to make VM aware of new swap hierarchy a little bit different with as-is. For example, first high priority swap can return -EIO or -ENOCOMP, swap try to fallback to next lower priority swap device. With that, hugepage writeback will work tranparently. So we could regard it as regression because incompressible pages doesn't go to backing storage automatically. Instead, user should do it via "echo huge" > /sys/block/zram/writeback" manually. == &< == Link: http://lkml.kernel.org/r/20181127055429.251614-6-minchan@kernel.org Signed-off-by: Minchan Kim Reviewed-by: Joey Pabalinas Reviewed-by: Sergey Senozhatsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e82592c4fd7eafe8dec12a70436e93e3afb28556 Author: Minchan Kim Date: Fri Dec 28 00:36:44 2018 -0800 zram: introduce ZRAM_IDLE flag To support idle page writeback with upcoming patches, this patch introduces a new ZRAM_IDLE flag. Userspace can mark zram slots as "idle" via "echo all > /sys/block/zramX/idle" which marks every allocated zram slot as ZRAM_IDLE. User could see it by /sys/kernel/debug/zram/zram0/block_state. 300 75.033841 ...i 301 63.806904 s..i 302 63.806919 ..hi Once there is IO for the slot, the mark will be disappeared. 300 75.033841 ... 301 63.806904 s..i 302 63.806919 ..hi Therefore, 300th block is idle zpage. With this feature, user can how many zram has idle pages which are waste of memory. Link: http://lkml.kernel.org/r/20181127055429.251614-5-minchan@kernel.org Signed-off-by: Minchan Kim Reviewed-by: Sergey Senozhatsky Reviewed-by: Joey Pabalinas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7e5292831b346bacb05558ca385cae366187314c Author: Minchan Kim Date: Fri Dec 28 00:36:40 2018 -0800 zram: refactor flags and writeback stuff Rename some variables and restructure some code for better readability in writeback and zs_free_page. Link: http://lkml.kernel.org/r/20181127055429.251614-4-minchan@kernel.org Signed-off-by: Minchan Kim Reviewed-by: Sergey Senozhatsky Reviewed-by: Joey Pabalinas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5547932dc67a48713eece4fa4703bfdf0cfcb818 Author: Minchan Kim Date: Fri Dec 28 00:36:37 2018 -0800 zram: fix double free backing device If blkdev_get fails, we shouldn't do blkdev_put. Otherwise, kernel emits below log. This patch fixes it. WARNING: CPU: 0 PID: 1893 at fs/block_dev.c:1828 blkdev_put+0x105/0x120 Modules linked in: CPU: 0 PID: 1893 Comm: swapoff Not tainted 4.19.0+ #453 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014 RIP: 0010:blkdev_put+0x105/0x120 Call Trace: __x64_sys_swapoff+0x46d/0x490 do_syscall_64+0x5a/0x190 entry_SYSCALL_64_after_hwframe+0x49/0xbe irq event stamp: 4466 hardirqs last enabled at (4465): __free_pages_ok+0x1e3/0x490 hardirqs last disabled at (4466): trace_hardirqs_off_thunk+0x1a/0x1c softirqs last enabled at (3420): __do_softirq+0x333/0x446 softirqs last disabled at (3407): irq_exit+0xd1/0xe0 Link: http://lkml.kernel.org/r/20181127055429.251614-3-minchan@kernel.org Signed-off-by: Minchan Kim Reviewed-by: Sergey Senozhatsky Reviewed-by: Joey Pabalinas Cc: [4.14+] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3c9959e025472122a61faebb208525cf26b305d1 Author: Minchan Kim Date: Fri Dec 28 00:36:33 2018 -0800 zram: fix lockdep warning of free block handling Patch series "zram idle page writeback", v3. Inherently, swap device has many idle pages which are rare touched since it was allocated. It is never problem if we use storage device as swap. However, it's just waste for zram-swap. This patchset supports zram idle page writeback feature. * Admin can define what is idle page "no access since X time ago" * Admin can define when zram should writeback them * Admin can define when zram should stop writeback to prevent wearout Details are in each patch's description. This patch (of 7): ================================ WARNING: inconsistent lock state 4.19.0+ #390 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. zram_verify/2095 [HC0[0]:SC1[1]:HE1:SE0] takes: 00000000b1828693 (&(&zram->bitmap_lock)->rlock){+.?.}, at: put_entry_bdev+0x1e/0x50 {SOFTIRQ-ON-W} state was registered at: _raw_spin_lock+0x2c/0x40 zram_make_request+0x755/0xdc9 generic_make_request+0x373/0x6a0 submit_bio+0x6c/0x140 __swap_writepage+0x3a8/0x480 shrink_page_list+0x1102/0x1a60 shrink_inactive_list+0x21b/0x3f0 shrink_node_memcg.constprop.99+0x4f8/0x7e0 shrink_node+0x7d/0x2f0 do_try_to_free_pages+0xe0/0x300 try_to_free_pages+0x116/0x2b0 __alloc_pages_slowpath+0x3f4/0xf80 __alloc_pages_nodemask+0x2a2/0x2f0 __handle_mm_fault+0x42e/0xb50 handle_mm_fault+0x55/0xb0 __do_page_fault+0x235/0x4b0 page_fault+0x1e/0x30 irq event stamp: 228412 hardirqs last enabled at (228412): [] __slab_free+0x3e6/0x600 hardirqs last disabled at (228411): [] __slab_free+0x1c5/0x600 softirqs last enabled at (228396): [] __do_softirq+0x31e/0x427 softirqs last disabled at (228403): [] irq_exit+0xd1/0xe0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&(&zram->bitmap_lock)->rlock); lock(&(&zram->bitmap_lock)->rlock); *** DEADLOCK *** no locks held by zram_verify/2095. stack backtrace: CPU: 5 PID: 2095 Comm: zram_verify Not tainted 4.19.0+ #390 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014 Call Trace: dump_stack+0x67/0x9b print_usage_bug+0x1bd/0x1d3 mark_lock+0x4aa/0x540 __lock_acquire+0x51d/0x1300 lock_acquire+0x90/0x180 _raw_spin_lock+0x2c/0x40 put_entry_bdev+0x1e/0x50 zram_free_page+0xf6/0x110 zram_slot_free_notify+0x42/0xa0 end_swap_bio_read+0x5b/0x170 blk_update_request+0x8f/0x340 scsi_end_request+0x2c/0x1e0 scsi_io_completion+0x98/0x650 blk_done_softirq+0x9e/0xd0 __do_softirq+0xcc/0x427 irq_exit+0xd1/0xe0 do_IRQ+0x93/0x120 common_interrupt+0xf/0xf With writeback feature, zram_slot_free_notify could be called in softirq context by end_swap_bio_read. However, bitmap_lock is not aware of that so lockdep yell out: get_entry_bdev spin_lock(bitmap->lock); irq softirq end_swap_bio_read zram_slot_free_notify zram_slot_lock <-- deadlock prone zram_free_page put_entry_bdev spin_lock(bitmap->lock); <-- deadlock prone With akpm's suggestion (i.e. bitmap operation is already atomic), we could remove bitmap lock. It might fail to find a empty slot if serious contention happens. However, it's not severe problem because huge page writeback has already possiblity to fail if there is severe memory pressure. Worst case is just keeping the incompressible in memory, not storage. The other problem is zram_slot_lock in zram_slot_slot_free_notify. To make it safe is this patch introduces zram_slot_trylock where zram_slot_free_notify uses it. Although it's rare to be contented, this patch adds new debug stat "miss_free" to keep monitoring how often it happens. Link: http://lkml.kernel.org/r/20181127055429.251614-2-minchan@kernel.org Signed-off-by: Minchan Kim Reviewed-by: Sergey Senozhatsky Reviewed-by: Joey Pabalinas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fed84c78527009d4f799a3ed9a566502fa026d82 Author: Qian Cai Date: Fri Dec 28 00:36:29 2018 -0800 mm/memblock.c: skip kmemleak for kasan_init() Kmemleak does not play well with KASAN (tested on both HPE Apollo 70 and Huawei TaiShan 2280 aarch64 servers). After calling start_kernel()->setup_arch()->kasan_init(), kmemleak early log buffer went from something like 280 to 260000 which caused kmemleak disabled and crash dump memory reservation failed. The multitude of kmemleak_alloc() calls is from nested loops while KASAN is setting up full memory mappings, so let early kmemleak allocations skip those memblock_alloc_internal() calls came from kasan_init() given that those early KASAN memory mappings should not reference to other memory. Hence, no kmemleak false positives. kasan_init kasan_map_populate [1] kasan_pgd_populate [2] kasan_pud_populate [3] kasan_pmd_populate [4] kasan_pte_populate [5] kasan_alloc_zeroed_page memblock_alloc_try_nid memblock_alloc_internal kmemleak_alloc [1] for_each_memblock(memory, reg) [2] while (pgdp++, addr = next, addr != end) [3] while (pudp++, addr = next, addr != end && pud_none(READ_ONCE(*pudp))) [4] while (pmdp++, addr = next, addr != end && pmd_none(READ_ONCE(*pmdp))) [5] while (ptep++, addr = next, addr != end && pte_none(READ_ONCE(*ptep))) Link: http://lkml.kernel.org/r/1543442925-17794-1-git-send-email-cai@gmx.us Signed-off-by: Qian Cai Acked-by: Catalin Marinas Cc: Michal Hocko Cc: Mike Rapoport Cc: Alexander Potapenko Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 65c78784135f847e49eb98e6b976e453e71100c3 Author: Oscar Salvador Date: Fri Dec 28 00:36:26 2018 -0800 kernel, resource: check for IORESOURCE_SYSRAM in release_mem_region_adjustable This is a preparation for the next patch. Currently, we only call release_mem_region_adjustable() in __remove_pages if the zone is not ZONE_DEVICE, because resources that belong to HMM/devm are being released by themselves with devm_release_mem_region. Since we do not want to touch any zone/page stuff during the removing of the memory (but during the offlining), we do not want to check for the zone here. So we need another way to tell release_mem_region_adjustable() to not realease the resource in case it belongs to HMM/devm. HMM/devm acquires/releases a resource through devm_request_mem_region/devm_release_mem_region. These resources have the flag IORESOURCE_MEM, while resources acquired by hot-add memory path (register_memory_resource()) contain IORESOURCE_SYSTEM_RAM. So, we can check for this flag in release_mem_region_adjustable, and if the resource does not contain such flag, we know that we are dealing with a HMM/devm resource, so we can back off. Link: http://lkml.kernel.org/r/20181127162005.15833-3-osalvador@suse.de Signed-off-by: Oscar Salvador Reviewed-by: David Hildenbrand Reviewed-by: Pavel Tatashin Cc: Dan Williams Cc: Jerome Glisse Cc: Jonathan Cameron Cc: Michal Hocko Cc: Oscar Salvador Cc: "Rafael J. Wysocki" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2c2a5af6fed20cf74401c9d64319c76c5ff81309 Author: Oscar Salvador Date: Fri Dec 28 00:36:22 2018 -0800 mm, memory_hotplug: add nid parameter to arch_remove_memory Patch series "Do not touch pages in hot-remove path", v2. This patchset aims for two things: 1) A better definition about offline and hot-remove stage 2) Solving bugs where we can access non-initialized pages during hot-remove operations [2] [3]. This is achieved by moving all page/zone handling to the offline stage, so we do not need to access pages when hot-removing memory. [1] https://patchwork.kernel.org/cover/10691415/ [2] https://patchwork.kernel.org/patch/10547445/ [3] https://www.spinics.net/lists/linux-mm/msg161316.html This patch (of 5): This is a preparation for the following-up patches. The idea of passing the nid is that it will allow us to get rid of the zone parameter afterwards. Link: http://lkml.kernel.org/r/20181127162005.15833-2-osalvador@suse.de Signed-off-by: Oscar Salvador Reviewed-by: David Hildenbrand Reviewed-by: Pavel Tatashin Cc: Michal Hocko Cc: Dan Williams Cc: Jerome Glisse Cc: Jonathan Cameron Cc: "Rafael J. Wysocki" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 23b68cfaae0ea40a9509fad37b756a6916dec54e Author: Wei Yang Date: Fri Dec 28 00:36:18 2018 -0800 mm: check nr_initialised with PAGES_PER_SECTION directly in defer_init() When DEFERRED_STRUCT_PAGE_INIT is configured, only the first section of each node's highest zone is initialized before defer stage. static_init_pgcnt is used to store the number of pages like this: pgdat->static_init_pgcnt = min_t(unsigned long, PAGES_PER_SECTION, pgdat->node_spanned_pages); because we don't want to overflow zone's range. But this is not necessary, since defer_init() is called like this: memmap_init_zone() for pfn in [start_pfn, end_pfn) defer_init(pfn, end_pfn) In case (pgdat->node_spanned_pages < PAGES_PER_SECTION), the loop would stop before calling defer_init(). BTW, comparing PAGES_PER_SECTION with node_spanned_pages is not correct, since nr_initialised is zone based instead of node based. Even node_spanned_pages is bigger than PAGES_PER_SECTION, its highest zone would have pages less than PAGES_PER_SECTION. Link: http://lkml.kernel.org/r/20181122094807.6985-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: Alexander Duyck Cc: Pavel Tatashin Cc: Oscar Salvador Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9a1ea439b16b92002e0a6fceebc5d1794906e297 Author: Hugh Dickins Date: Fri Dec 28 00:36:14 2018 -0800 mm: put_and_wait_on_page_locked() while page is migrated Waiting on a page migration entry has used wait_on_page_locked() all along since 2006: but you cannot safely wait_on_page_locked() without holding a reference to the page, and that extra reference is enough to make migrate_page_move_mapping() fail with -EAGAIN, when a racing task faults on the entry before migrate_page_move_mapping() gets there. And that failure is retried nine times, amplifying the pain when trying to migrate a popular page. With a single persistent faulter, migration sometimes succeeds; with two or three concurrent faulters, success becomes much less likely (and the more the page was mapped, the worse the overhead of unmapping and remapping it on each try). This is especially a problem for memory offlining, where the outer level retries forever (or until terminated from userspace), because a heavy refault workload can trigger an endless loop of migration failures. wait_on_page_locked() is the wrong tool for the job. David Herrmann (but was he the first?) noticed this issue in 2014: https://marc.info/?l=linux-mm&m=140110465608116&w=2 Tim Chen started a thread in August 2017 which appears relevant: https://marc.info/?l=linux-mm&m=150275941014915&w=2 where Kan Liang went on to implicate __migration_entry_wait(): https://marc.info/?l=linux-mm&m=150300268411980&w=2 and the thread ended up with the v4.14 commits: 2554db916586 ("sched/wait: Break up long wake list walk") 11a19c7b099f ("sched/wait: Introduce wakeup boomark in wake_up_page_bit") Baoquan He reported "Memory hotplug softlock issue" 14 November 2018: https://marc.info/?l=linux-mm&m=154217936431300&w=2 We have all assumed that it is essential to hold a page reference while waiting on a page lock: partly to guarantee that there is still a struct page when MEMORY_HOTREMOVE is configured, but also to protect against reuse of the struct page going to someone who then holds the page locked indefinitely, when the waiter can reasonably expect timely unlocking. But in fact, so long as wait_on_page_bit_common() does the put_page(), and is careful not to rely on struct page contents thereafter, there is no need to hold a reference to the page while waiting on it. That does mean that this case cannot go back through the loop: but that's fine for the page migration case, and even if used more widely, is limited by the "Stop walking if it's locked" optimization in wake_page_function(). Add interface put_and_wait_on_page_locked() to do this, using "behavior" enum in place of "lock" arg to wait_on_page_bit_common() to implement it. No interruptible or killable variant needed yet, but they might follow: I have a vague notion that reporting -EINTR should take precedence over return from wait_on_page_bit_common() without knowing the page state, so arrange it accordingly - but that may be nothing but pedantic. __migration_entry_wait() still has to take a brief reference to the page, prior to calling put_and_wait_on_page_locked(): but now that it is dropped before waiting, the chance of impeding page migration is very much reduced. Should we perhaps disable preemption across this? shrink_page_list()'s __ClearPageLocked(): that was a surprise! This survived a lot of testing before that showed up. PageWaiters may have been set by wait_on_page_bit_common(), and the reference dropped, just before shrink_page_list() succeeds in freezing its last page reference: in such a case, unlock_page() must be used. Follow the suggestion from Michal Hocko, just revert a978d6f52106 ("mm: unlockless reclaim") now: that optimization predates PageWaiters, and won't buy much these days; but we can reinstate it for the !PageWaiters case if anyone notices. It does raise the question: should vmscan.c's is_page_cache_freeable() and __remove_mapping() now treat a PageWaiters page as if an extra reference were held? Perhaps, but I don't think it matters much, since shrink_page_list() already had to win its trylock_page(), so waiters are not very common there: I noticed no difference when trying the bigger change, and it's surely not needed while put_and_wait_on_page_locked() is only used for page migration. [willy@infradead.org: add put_and_wait_on_page_locked() kerneldoc] Link: http://lkml.kernel.org/r/alpine.LSU.2.11.1811261121330.1116@eggly.anvils Signed-off-by: Hugh Dickins Reported-by: Baoquan He Tested-by: Baoquan He Reviewed-by: Andrea Arcangeli Acked-by: Michal Hocko Acked-by: Linus Torvalds Acked-by: Vlastimil Babka Cc: Matthew Wilcox Cc: Baoquan He Cc: David Hildenbrand Cc: Mel Gorman Cc: David Herrmann Cc: Tim Chen Cc: Kan Liang Cc: Andi Kleen Cc: Davidlohr Bueso Cc: Peter Zijlstra Cc: Christoph Lameter Cc: Nick Piggin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f0c867d9588d9efc10d6a55009c9560336673369 Author: yuzhoujian Date: Fri Dec 28 00:36:10 2018 -0800 mm, oom: add oom victim's memcg to the oom context information The current oom report doesn't display victim's memcg context during the global OOM situation. While this information is not strictly needed, it can be really helpful for containerized environments to locate which container has lost a process. Now that we have a single line for the oom context, we can trivially add both the oom memcg (this can be either global_oom or a specific memcg which hits its hard limits) and task_memcg which is the victim's memcg. Below is the single line output in the oom report after this patch. - global oom context information: oom-kill:constraint=,nodemask=,cpuset=,mems_allowed=,global_oom,task_memcg=,task=,pid=,uid= - memcg oom context information: oom-kill:constraint=,nodemask=,cpuset=,mems_allowed=,oom_memcg=,task_memcg=,task=,pid=,uid= [penguin-kernel@I-love.SAKURA.ne.jp: use pr_cont() in mem_cgroup_print_oom_context()] Link: http://lkml.kernel.org/r/201812190723.wBJ7NdkN032628@www262.sakura.ne.jp Link: http://lkml.kernel.org/r/1542799799-36184-2-git-send-email-ufo19890607@gmail.com Signed-off-by: yuzhoujian Signed-off-by: Tetsuo Handa Acked-by: Michal Hocko Cc: David Rientjes Cc: "Kirill A . Shutemov" Cc: Andrea Arcangeli Cc: Tetsuo Handa Cc: Roman Gushchin Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ef8444ea01d7442652f8e1b8a8b94278cb57eafd Author: yuzhoujian Date: Fri Dec 28 00:36:07 2018 -0800 mm, oom: reorganize the oom report in dump_header OOM report contains several sections. The first one is the allocation context that has triggered the OOM. Then we have cpuset context followed by the stack trace of the OOM path. The tird one is the OOM memory information. Followed by the current memory state of all system tasks. At last, we will show oom eligible tasks and the information about the chosen oom victim. One thing that makes parsing more awkward than necessary is that we do not have a single and easily parsable line about the oom context. This patch is reorganizing the oom report to 1) who invoked oom and what was the allocation request [ 515.902945] tuned invoked oom-killer: gfp_mask=0x6200ca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0 2) OOM stack trace [ 515.904273] CPU: 24 PID: 1809 Comm: tuned Not tainted 4.20.0-rc3+ #3 [ 515.905518] Hardware name: Inspur SA5212M4/YZMB-00370-107, BIOS 4.1.10 11/14/2016 [ 515.906821] Call Trace: [ 515.908062] dump_stack+0x5a/0x73 [ 515.909311] dump_header+0x55/0x28c [ 515.914260] oom_kill_process+0x2d8/0x300 [ 515.916708] out_of_memory+0x145/0x4a0 [ 515.917932] __alloc_pages_slowpath+0x7d2/0xa16 [ 515.919157] __alloc_pages_nodemask+0x277/0x290 [ 515.920367] filemap_fault+0x3d0/0x6c0 [ 515.921529] ? filemap_map_pages+0x2b8/0x420 [ 515.922709] ext4_filemap_fault+0x2c/0x40 [ext4] [ 515.923884] __do_fault+0x20/0x80 [ 515.925032] __handle_mm_fault+0xbc0/0xe80 [ 515.926195] handle_mm_fault+0xfa/0x210 [ 515.927357] __do_page_fault+0x233/0x4c0 [ 515.928506] do_page_fault+0x32/0x140 [ 515.929646] ? page_fault+0x8/0x30 [ 515.930770] page_fault+0x1e/0x30 3) OOM memory information [ 515.958093] Mem-Info: [ 515.959647] active_anon:26501758 inactive_anon:1179809 isolated_anon:0 active_file:4402672 inactive_file:483963 isolated_file:1344 unevictable:0 dirty:4886753 writeback:0 unstable:0 slab_reclaimable:148442 slab_unreclaimable:18741 mapped:1347 shmem:1347 pagetables:58669 bounce:0 free:88663 free_pcp:0 free_cma:0 ... 4) current memory state of all system tasks [ 516.079544] [ 744] 0 744 9211 1345 114688 82 0 systemd-journal [ 516.082034] [ 787] 0 787 31764 0 143360 92 0 lvmetad [ 516.084465] [ 792] 0 792 10930 1 110592 208 -1000 systemd-udevd [ 516.086865] [ 1199] 0 1199 13866 0 131072 112 -1000 auditd [ 516.089190] [ 1222] 0 1222 31990 1 110592 157 0 smartd [ 516.091477] [ 1225] 0 1225 4864 85 81920 43 0 irqbalance [ 516.093712] [ 1226] 0 1226 52612 0 258048 426 0 abrtd [ 516.112128] [ 1280] 0 1280 109774 55 299008 400 0 NetworkManager [ 516.113998] [ 1295] 0 1295 28817 37 69632 24 0 ksmtuned [ 516.144596] [ 10718] 0 10718 2622484 1721372 15998976 267219 0 panic [ 516.145792] [ 10719] 0 10719 2622484 1164767 9818112 53576 0 panic [ 516.146977] [ 10720] 0 10720 2622484 1174361 9904128 53709 0 panic [ 516.148163] [ 10721] 0 10721 2622484 1209070 10194944 54824 0 panic [ 516.149329] [ 10722] 0 10722 2622484 1745799 14774272 91138 0 panic 5) oom context (contrains and the chosen victim). oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0-1,task=panic,pid=10737,uid=0 An admin can easily get the full oom context at a single line which makes parsing much easier. Link: http://lkml.kernel.org/r/1542799799-36184-1-git-send-email-ufo19890607@gmail.com Signed-off-by: yuzhoujian Acked-by: Michal Hocko Cc: Andrea Arcangeli Cc: David Rientjes Cc: "Kirill A . Shutemov" Cc: Roman Gushchin Cc: Tetsuo Handa Cc: Yang Shi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e5cb113f2dbc8125f31005faebab161a2a84ebe6 Author: Alexey Dobriyan Date: Fri Dec 28 00:36:03 2018 -0800 mm: make free_reserved_area() return "const char *" and propagate through down the call stack. Link: http://lkml.kernel.org/r/20181124091411.GC10969@avx2 Signed-off-by: Alexey Dobriyan Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9a2f45ff320287d49a3cd90ce68cb58a6da6f5e1 Author: Alexey Dobriyan Date: Fri Dec 28 00:35:59 2018 -0800 mm/debug.c: make "migrate_reason_names[]" const char * Those strings are immutable as well. Link: http://lkml.kernel.org/r/20181124090508.GB10877@avx2 Signed-off-by: Alexey Dobriyan Reviewed-by: Andrew Morton Reviewed-by: David Hildenbrand Acked-by: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c999fbd3dcc6535b1e298b016665ec23ac2b0a9a Author: Alexey Dobriyan Date: Fri Dec 28 00:35:55 2018 -0800 mm/mmzone.c: make "migratetype_names" const char * Those strings are immutable in fact. Link: http://lkml.kernel.org/r/20181124090327.GA10877@avx2 Signed-off-by: Alexey Dobriyan Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1c30844d2dfe272d58c8fc000960b835d13aa2ac Author: Mel Gorman Date: Fri Dec 28 00:35:52 2018 -0800 mm: reclaim small amounts of memory when an external fragmentation event occurs An external fragmentation event was previously described as When the page allocator fragments memory, it records the event using the mm_page_alloc_extfrag event. If the fallback_order is smaller than a pageblock order (order-9 on 64-bit x86) then it's considered an event that will cause external fragmentation issues in the future. The kernel reduces the probability of such events by increasing the watermark sizes by calling set_recommended_min_free_kbytes early in the lifetime of the system. This works reasonably well in general but if there are enough sparsely populated pageblocks then the problem can still occur as enough memory is free overall and kswapd stays asleep. This patch introduces a watermark_boost_factor sysctl that allows a zone watermark to be temporarily boosted when an external fragmentation causing events occurs. The boosting will stall allocations that would decrease free memory below the boosted low watermark and kswapd is woken if the calling context allows to reclaim an amount of memory relative to the size of the high watermark and the watermark_boost_factor until the boost is cleared. When kswapd finishes, it wakes kcompactd at the pageblock order to clean some of the pageblocks that may have been affected by the fragmentation event. kswapd avoids any writeback, slab shrinkage and swap from reclaim context during this operation to avoid excessive system disruption in the name of fragmentation avoidance. Care is taken so that kswapd will do normal reclaim work if the system is really low on memory. This was evaluated using the same workloads as "mm, page_alloc: Spread allocations across zones before introducing fragmentation". 1-socket Skylake machine config-global-dhp__workload_thpfioscale XFS (no special madvise) 4 fio threads, 1 THP allocating thread -------------------------------------- 4.20-rc3 extfrag events < order 9: 804694 4.20-rc3+patch: 408912 (49% reduction) 4.20-rc3+patch1-4: 18421 (98% reduction) 4.20.0-rc3 4.20.0-rc3 lowzone-v5r8 boost-v5r8 Amean fault-base-1 653.58 ( 0.00%) 652.71 ( 0.13%) Amean fault-huge-1 0.00 ( 0.00%) 178.93 * -99.00%* 4.20.0-rc3 4.20.0-rc3 lowzone-v5r8 boost-v5r8 Percentage huge-1 0.00 ( 0.00%) 5.12 ( 100.00%) Note that external fragmentation causing events are massively reduced by this path whether in comparison to the previous kernel or the vanilla kernel. The fault latency for huge pages appears to be increased but that is only because THP allocations were successful with the patch applied. 1-socket Skylake machine global-dhp__workload_thpfioscale-madvhugepage-xfs (MADV_HUGEPAGE) ----------------------------------------------------------------- 4.20-rc3 extfrag events < order 9: 291392 4.20-rc3+patch: 191187 (34% reduction) 4.20-rc3+patch1-4: 13464 (95% reduction) thpfioscale Fault Latencies 4.20.0-rc3 4.20.0-rc3 lowzone-v5r8 boost-v5r8 Min fault-base-1 912.00 ( 0.00%) 905.00 ( 0.77%) Min fault-huge-1 127.00 ( 0.00%) 135.00 ( -6.30%) Amean fault-base-1 1467.55 ( 0.00%) 1481.67 ( -0.96%) Amean fault-huge-1 1127.11 ( 0.00%) 1063.88 * 5.61%* 4.20.0-rc3 4.20.0-rc3 lowzone-v5r8 boost-v5r8 Percentage huge-1 77.64 ( 0.00%) 83.46 ( 7.49%) As before, massive reduction in external fragmentation events, some jitter on latencies and an increase in THP allocation success rates. 2-socket Haswell machine config-global-dhp__workload_thpfioscale XFS (no special madvise) 4 fio threads, 5 THP allocating threads ---------------------------------------------------------------- 4.20-rc3 extfrag events < order 9: 215698 4.20-rc3+patch: 200210 (7% reduction) 4.20-rc3+patch1-4: 14263 (93% reduction) 4.20.0-rc3 4.20.0-rc3 lowzone-v5r8 boost-v5r8 Amean fault-base-5 1346.45 ( 0.00%) 1306.87 ( 2.94%) Amean fault-huge-5 3418.60 ( 0.00%) 1348.94 ( 60.54%) 4.20.0-rc3 4.20.0-rc3 lowzone-v5r8 boost-v5r8 Percentage huge-5 0.78 ( 0.00%) 7.91 ( 910.64%) There is a 93% reduction in fragmentation causing events, there is a big reduction in the huge page fault latency and allocation success rate is higher. 2-socket Haswell machine global-dhp__workload_thpfioscale-madvhugepage-xfs (MADV_HUGEPAGE) ----------------------------------------------------------------- 4.20-rc3 extfrag events < order 9: 166352 4.20-rc3+patch: 147463 (11% reduction) 4.20-rc3+patch1-4: 11095 (93% reduction) thpfioscale Fault Latencies 4.20.0-rc3 4.20.0-rc3 lowzone-v5r8 boost-v5r8 Amean fault-base-5 6217.43 ( 0.00%) 7419.67 * -19.34%* Amean fault-huge-5 3163.33 ( 0.00%) 3263.80 ( -3.18%) 4.20.0-rc3 4.20.0-rc3 lowzone-v5r8 boost-v5r8 Percentage huge-5 95.14 ( 0.00%) 87.98 ( -7.53%) There is a large reduction in fragmentation events with some jitter around the latencies and success rates. As before, the high THP allocation success rate does mean the system is under a lot of pressure. However, as the fragmentation events are reduced, it would be expected that the long-term allocation success rate would be higher. Link: http://lkml.kernel.org/r/20181123114528.28802-5-mgorman@techsingularity.net Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: David Rientjes Cc: Michal Hocko Cc: Zi Yan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0a79cdad5eb213b3a629e624565b1b3bf9192b7c Author: Mel Gorman Date: Fri Dec 28 00:35:48 2018 -0800 mm: use alloc_flags to record if kswapd can wake This is a preparation patch that copies the GFP flag __GFP_KSWAPD_RECLAIM into alloc_flags. This is a preparation patch only that avoids having to pass gfp_mask through a long callchain in a future patch. Note that the setting in the fast path happens in alloc_flags_nofragment() and it may be claimed that this has nothing to do with ALLOC_NO_FRAGMENT. That's true in this patch but is not true later so it's done now for easier review to show where the flag needs to be recorded. No functional change. [mgorman@techsingularity.net: ALLOC_KSWAPD flag needs to be applied in the !CONFIG_ZONE_DMA32 case] Link: http://lkml.kernel.org/r/20181126143503.GO23260@techsingularity.net Link: http://lkml.kernel.org/r/20181123114528.28802-4-mgorman@techsingularity.net Signed-off-by: Mel Gorman Reviewed-by: Andrew Morton Cc: Andrea Arcangeli Cc: David Rientjes Cc: Michal Hocko Cc: Vlastimil Babka Cc: Zi Yan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a921444382b49cc7fdeca3fba3e278bc09484a27 Author: Mel Gorman Date: Fri Dec 28 00:35:44 2018 -0800 mm: move zone watermark accesses behind an accessor This is a preparation patch only, no functional change. Link: http://lkml.kernel.org/r/20181123114528.28802-3-mgorman@techsingularity.net Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka Cc: Andrea Arcangeli Cc: David Rientjes Cc: Michal Hocko Cc: Zi Yan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6bb154504f8b496780ec53ec81aba957a12981fa Author: Mel Gorman Date: Fri Dec 28 00:35:41 2018 -0800 mm, page_alloc: spread allocations across zones before introducing fragmentation Patch series "Fragmentation avoidance improvements", v5. It has been noted before that fragmentation avoidance (aka anti-fragmentation) is not perfect. Given sufficient time or an adverse workload, memory gets fragmented and the long-term success of high-order allocations degrades. This series defines an adverse workload, a definition of external fragmentation events (including serious) ones and a series that reduces the level of those fragmentation events. The details of the workload and the consequences are described in more detail in the changelogs. However, from patch 1, this is a high-level summary of the adverse workload. The exact details are found in the mmtests implementation. The broad details of the workload are as follows; 1. Create an XFS filesystem (not specified in the configuration but done as part of the testing for this patch) 2. Start 4 fio threads that write a number of 64K files inefficiently. Inefficiently means that files are created on first access and not created in advance (fio parameterr create_on_open=1) and fallocate is not used (fallocate=none). With multiple IO issuers this creates a mix of slab and page cache allocations over time. The total size of the files is 150% physical memory so that the slabs and page cache pages get mixed 3. Warm up a number of fio read-only threads accessing the same files created in step 2. This part runs for the same length of time it took to create the files. It'll fault back in old data and further interleave slab and page cache allocations. As it's now low on memory due to step 2, fragmentation occurs as pageblocks get stolen. 4. While step 3 is still running, start a process that tries to allocate 75% of memory as huge pages with a number of threads. The number of threads is based on a (NR_CPUS_SOCKET - NR_FIO_THREADS)/4 to avoid THP threads contending with fio, any other threads or forcing cross-NUMA scheduling. Note that the test has not been used on a machine with less than 8 cores. The benchmark records whether huge pages were allocated and what the fault latency was in microseconds 5. Measure the number of events potentially causing external fragmentation, the fault latency and the huge page allocation success rate. 6. Cleanup Overall the series reduces external fragmentation causing events by over 94% on 1 and 2 socket machines, which in turn impacts high-order allocation success rates over the long term. There are differences in latencies and high-order allocation success rates. Latencies are a mixed bag as they are vulnerable to exact system state and whether allocations succeeded so they are treated as a secondary metric. Patch 1 uses lower zones if they are populated and have free memory instead of fragmenting a higher zone. It's special cased to handle a Normal->DMA32 fallback with the reasons explained in the changelog. Patch 2-4 boosts watermarks temporarily when an external fragmentation event occurs. kswapd wakes to reclaim a small amount of old memory and then wakes kcompactd on completion to recover the system slightly. This introduces some overhead in the slowpath. The level of boosting can be tuned or disabled depending on the tolerance for fragmentation vs allocation latency. Patch 5 stalls some movable allocation requests to let kswapd from patch 4 make some progress. The duration of the stalls is very low but it is possible to tune the system to avoid fragmentation events if larger stalls can be tolerated. The bulk of the improvement in fragmentation avoidance is from patches 1-4 but patch 5 can deal with a rare corner case and provides the option of tuning a system for THP allocation success rates in exchange for some stalls to control fragmentation. This patch (of 5): The page allocator zone lists are iterated based on the watermarks of each zone which does not take anti-fragmentation into account. On x86, node 0 may have multiple zones while other nodes have one zone. A consequence is that tasks running on node 0 may fragment ZONE_NORMAL even though ZONE_DMA32 has plenty of free memory. This patch special cases the allocator fast path such that it'll try an allocation from a lower local zone before fragmenting a higher zone. In this case, stealing of pageblocks or orders larger than a pageblock are still allowed in the fast path as they are uninteresting from a fragmentation point of view. This was evaluated using a benchmark designed to fragment memory before attempting THP allocations. It's implemented in mmtests as the following configurations configs/config-global-dhp__workload_thpfioscale configs/config-global-dhp__workload_thpfioscale-defrag configs/config-global-dhp__workload_thpfioscale-madvhugepage e.g. from mmtests ./run-mmtests.sh --run-monitor --config configs/config-global-dhp__workload_thpfioscale test-run-1 The broad details of the workload are as follows; 1. Create an XFS filesystem (not specified in the configuration but done as part of the testing for this patch). 2. Start 4 fio threads that write a number of 64K files inefficiently. Inefficiently means that files are created on first access and not created in advance (fio parameter create_on_open=1) and fallocate is not used (fallocate=none). With multiple IO issuers this creates a mix of slab and page cache allocations over time. The total size of the files is 150% physical memory so that the slabs and page cache pages get mixed. 3. Warm up a number of fio read-only processes accessing the same files created in step 2. This part runs for the same length of time it took to create the files. It'll refault old data and further interleave slab and page cache allocations. As it's now low on memory due to step 2, fragmentation occurs as pageblocks get stolen. 4. While step 3 is still running, start a process that tries to allocate 75% of memory as huge pages with a number of threads. The number of threads is based on a (NR_CPUS_SOCKET - NR_FIO_THREADS)/4 to avoid THP threads contending with fio, any other threads or forcing cross-NUMA scheduling. Note that the test has not been used on a machine with less than 8 cores. The benchmark records whether huge pages were allocated and what the fault latency was in microseconds. 5. Measure the number of events potentially causing external fragmentation, the fault latency and the huge page allocation success rate. 6. Cleanup the test files. Note that due to the use of IO and page cache that this benchmark is not suitable for running on large machines where the time to fragment memory may be excessive. Also note that while this is one mix that generates fragmentation that it's not the only mix that generates fragmentation. Differences in workload that are more slab-intensive or whether SLUB is used with high-order pages may yield different results. When the page allocator fragments memory, it records the event using the mm_page_alloc_extfrag ftrace event. If the fallback_order is smaller than a pageblock order (order-9 on 64-bit x86) then it's considered to be an "external fragmentation event" that may cause issues in the future. Hence, the primary metric here is the number of external fragmentation events that occur with order < 9. The secondary metric is allocation latency and huge page allocation success rates but note that differences in latencies and what the success rate also can affect the number of external fragmentation event which is why it's a secondary metric. 1-socket Skylake machine config-global-dhp__workload_thpfioscale XFS (no special madvise) 4 fio threads, 1 THP allocating thread -------------------------------------- 4.20-rc3 extfrag events < order 9: 804694 4.20-rc3+patch: 408912 (49% reduction) thpfioscale Fault Latencies 4.20.0-rc3 4.20.0-rc3 vanilla lowzone-v5r8 Amean fault-base-1 662.92 ( 0.00%) 653.58 * 1.41%* Amean fault-huge-1 0.00 ( 0.00%) 0.00 ( 0.00%) 4.20.0-rc3 4.20.0-rc3 vanilla lowzone-v5r8 Percentage huge-1 0.00 ( 0.00%) 0.00 ( 0.00%) Fault latencies are slightly reduced while allocation success rates remain at zero as this configuration does not make any special effort to allocate THP and fio is heavily active at the time and either filling memory or keeping pages resident. However, a 49% reduction of serious fragmentation events reduces the changes of external fragmentation being a problem in the future. Vlastimil asked during review for a breakdown of the allocation types that are falling back. vanilla 3816 MIGRATE_UNMOVABLE 800845 MIGRATE_MOVABLE 33 MIGRATE_UNRECLAIMABLE patch 735 MIGRATE_UNMOVABLE 408135 MIGRATE_MOVABLE 42 MIGRATE_UNRECLAIMABLE The majority of the fallbacks are due to movable allocations and this is consistent for the workload throughout the series so will not be presented again as the primary source of fallbacks are movable allocations. Movable fallbacks are sometimes considered "ok" to fallback because they can be migrated. The problem is that they can fill an unmovable/reclaimable pageblock causing those allocations to fallback later and polluting pageblocks with pages that cannot move. If there is a movable fallback, it is pretty much guaranteed to affect an unmovable/reclaimable pageblock and while it might not be enough to actually cause a unmovable/reclaimable fallback in the future, we cannot know that in advance so the patch takes the only option available to it. Hence, it's important to control them. This point is also consistent throughout the series and will not be repeated. 1-socket Skylake machine global-dhp__workload_thpfioscale-madvhugepage-xfs (MADV_HUGEPAGE) ----------------------------------------------------------------- 4.20-rc3 extfrag events < order 9: 291392 4.20-rc3+patch: 191187 (34% reduction) thpfioscale Fault Latencies 4.20.0-rc3 4.20.0-rc3 vanilla lowzone-v5r8 Amean fault-base-1 1495.14 ( 0.00%) 1467.55 ( 1.85%) Amean fault-huge-1 1098.48 ( 0.00%) 1127.11 ( -2.61%) thpfioscale Percentage Faults Huge 4.20.0-rc3 4.20.0-rc3 vanilla lowzone-v5r8 Percentage huge-1 78.57 ( 0.00%) 77.64 ( -1.18%) Fragmentation events were reduced quite a bit although this is known to be a little variable. The latencies and allocation success rates are similar but they were already quite high. 2-socket Haswell machine config-global-dhp__workload_thpfioscale XFS (no special madvise) 4 fio threads, 5 THP allocating threads ---------------------------------------------------------------- 4.20-rc3 extfrag events < order 9: 215698 4.20-rc3+patch: 200210 (7% reduction) thpfioscale Fault Latencies 4.20.0-rc3 4.20.0-rc3 vanilla lowzone-v5r8 Amean fault-base-5 1350.05 ( 0.00%) 1346.45 ( 0.27%) Amean fault-huge-5 4181.01 ( 0.00%) 3418.60 ( 18.24%) 4.20.0-rc3 4.20.0-rc3 vanilla lowzone-v5r8 Percentage huge-5 1.15 ( 0.00%) 0.78 ( -31.88%) The reduction of external fragmentation events is slight and this is partially due to the removal of __GFP_THISNODE in commit ac5b2c18911f ("mm: thp: relax __GFP_THISNODE for MADV_HUGEPAGE mappings") as THP allocations can now spill over to remote nodes instead of fragmenting local memory. 2-socket Haswell machine global-dhp__workload_thpfioscale-madvhugepage-xfs (MADV_HUGEPAGE) ----------------------------------------------------------------- 4.20-rc3 extfrag events < order 9: 166352 4.20-rc3+patch: 147463 (11% reduction) thpfioscale Fault Latencies 4.20.0-rc3 4.20.0-rc3 vanilla lowzone-v5r8 Amean fault-base-5 6138.97 ( 0.00%) 6217.43 ( -1.28%) Amean fault-huge-5 2294.28 ( 0.00%) 3163.33 * -37.88%* thpfioscale Percentage Faults Huge 4.20.0-rc3 4.20.0-rc3 vanilla lowzone-v5r8 Percentage huge-5 96.82 ( 0.00%) 95.14 ( -1.74%) There was a slight reduction in external fragmentation events although the latencies were higher. The allocation success rate is high enough that the system is struggling and there is quite a lot of parallel reclaim and compaction activity. There is also a certain degree of luck on whether processes start on node 0 or not for this patch but the relevance is reduced later in the series. Overall, the patch reduces the number of external fragmentation causing events so the success of THP over long periods of time would be improved for this adverse workload. Link: http://lkml.kernel.org/r/20181123114528.28802-2-mgorman@techsingularity.net Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka Cc: David Rientjes Cc: Andrea Arcangeli Cc: Zi Yan Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f29d8e9c0191a2a02500945db505e5c89159c3f4 Author: David Hildenbrand Date: Fri Dec 28 00:35:36 2018 -0800 mm/memory_hotplug: drop "online" parameter from add_memory_resource() Userspace should always be in charge of how to online memory and if memory should be onlined automatically in the kernel. Let's drop the parameter to overwrite this - XEN passes memhp_auto_online, just like add_memory(), so we can directly use that instead internally. Link: http://lkml.kernel.org/r/20181123123740.27652-1-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Michal Hocko Reviewed-by: Oscar Salvador Acked-by: Juergen Gross Cc: Boris Ostrovsky Cc: Stefano Stabellini Cc: Dan Williams Cc: Pavel Tatashin Cc: David Hildenbrand Cc: Joonsoo Kim Cc: Arun KS Cc: Mathieu Malaterre Cc: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3b6fd6ffb27c2efa003c6d4d15ca72c054b71d7c Author: Wei Yang Date: Fri Dec 28 00:35:33 2018 -0800 drivers/base/memory.c: remove an unnecessary check on NR_MEM_SECTIONS In cb5e39b8038b ("drivers: base: refactor add_memory_section() to add_memory_block()"), add_memory_block() is introduced, which is only invoked in memory_dev_init(). When combining these two loops in memory_dev_init() and add_memory_block(), they looks like this: for (i = 0; i < NR_MEM_SECTIONS; i += sections_per_block) for (j = i; (j < i + sections_per_block) && j < NR_MEM_SECTIONS; j++) Since it is sure the (i < NR_MEM_SECTIONS) and j sits in its own memory block, the check of (j < NR_MEM_SECTIONS) is not necessary. This patch just removes this check. Link: http://lkml.kernel.org/r/20181123222811.18216-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: Andrew Morton Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Seth Jennings Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4d72868c8f7c293fc8408a54db4e0a12dc031152 Author: Mike Rapoport Date: Fri Dec 28 00:35:29 2018 -0800 memblock: replace usage of __memblock_free_early() with memblock_free() __memblock_free_early() is only used by the convenience wrappers, so essentially we wrap a call to memblock_free() twice. Replace calls of __memblock_free_early() with calls to memblock_free() and drop the former. Link: http://lkml.kernel.org/r/20181125102940.GE28634@rapoport-lnx Signed-off-by: Mike Rapoport Reviewed-by: Andrew Morton Cc: Wentao Wang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d31cfe7bff9109476da92c245b56083e9b48d60a Author: Wentao Wang Date: Fri Dec 28 00:35:26 2018 -0800 mm/page_alloc.c: deduplicate __memblock_free_early() and memblock_free() Link: http://lkml.kernel.org/r/C8ECE1B7A767434691FEEFA3A01765D72AFB8E78@MX203CL03.corp.emc.com Signed-off-by: Wentao Wang Reviewed-by: Andrew Morton Cc: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 742aa7fb52c56fb3b307e704f93e67b698959cc2 Author: Aaron Lu Date: Fri Dec 28 00:35:22 2018 -0800 mm/page_alloc.c: use a single function to free page There are multiple places of freeing a page, they all do the same things so a common function can be used to reduce code duplicate. It also avoids bug fixed in one function but left in another. Link: http://lkml.kernel.org/r/20181119134834.17765-3-aaron.lu@intel.com Signed-off-by: Aaron Lu Acked-by: Vlastimil Babka Cc: Alexander Duyck Cc: Ilias Apalodimas Cc: Jesper Dangaard Brouer Cc: Mel Gorman Cc: Pankaj gupta Cc: Pawel Staszewski Cc: Tariq Toukan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 65895b67ad27df0f62bfaf82dd5622f95ea29196 Author: Aaron Lu Date: Fri Dec 28 00:35:18 2018 -0800 mm/page_alloc.c: free order-0 pages through PCP in page_frag_free() page_frag_free() calls __free_pages_ok() to free the page back to Buddy. This is OK for high order page, but for order-0 pages, it misses the optimization opportunity of using Per-Cpu-Pages and can cause zone lock contention when called frequently. Pawel Staszewski recently shared his result of 'how Linux kernel handles normal traffic'[1] and from perf data, Jesper Dangaard Brouer found the lock contention comes from page allocator: mlx5e_poll_tx_cq | --16.34%--napi_consume_skb | |--12.65%--__free_pages_ok | | | --11.86%--free_one_page | | | |--10.10%--queued_spin_lock_slowpath | | | --0.65%--_raw_spin_lock | |--1.55%--page_frag_free | --1.44%--skb_release_data Jesper explained how it happened: mlx5 driver RX-page recycle mechanism is not effective in this workload and pages have to go through the page allocator. The lock contention happens during mlx5 DMA TX completion cycle. And the page allocator cannot keep up at these speeds.[2] I thought that __free_pages_ok() are mostly freeing high order pages and thought this is an lock contention for high order pages but Jesper explained in detail that __free_pages_ok() here are actually freeing order-0 pages because mlx5 is using order-0 pages to satisfy its page pool allocation request.[3] The free path as pointed out by Jesper is: skb_free_head() -> skb_free_frag() -> page_frag_free() And the pages being freed on this path are order-0 pages. Fix this by doing similar things as in __page_frag_cache_drain() - send the being freed page to PCP if it's an order-0 page, or directly to Buddy if it is a high order page. With this change, Paweł hasn't noticed lock contention yet in his workload and Jesper has noticed a 7% performance improvement using a micro benchmark and lock contention is gone. Ilias' test on a 'low' speed 1Gbit interface on an cortex-a53 shows ~11% performance boost testing with 64byte packets and __free_pages_ok() disappeared from perf top. [1]: https://www.spinics.net/lists/netdev/msg531362.html [2]: https://www.spinics.net/lists/netdev/msg531421.html [3]: https://www.spinics.net/lists/netdev/msg531556.html [akpm@linux-foundation.org: add comment] Link: http://lkml.kernel.org/r/20181120014544.GB10657@intel.com Signed-off-by: Aaron Lu Reported-by: Pawel Staszewski Analysed-by: Jesper Dangaard Brouer Acked-by: Vlastimil Babka Acked-by: Mel Gorman Acked-by: Jesper Dangaard Brouer Acked-by: Ilias Apalodimas Tested-by: Ilias Apalodimas Acked-by: Alexander Duyck Acked-by: Tariq Toukan Acked-by: Pankaj gupta Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 02917e9f8676207a4c577d4d94eae12bf348e9d7 Author: Dan Williams Date: Fri Dec 28 00:35:15 2018 -0800 mm, hmm: mark hmm_devmem_{add, add_resource} EXPORT_SYMBOL_GPL At Maintainer Summit, Greg brought up a topic I proposed around EXPORT_SYMBOL_GPL usage. The motivation was considerations for when EXPORT_SYMBOL_GPL is warranted and the criteria for taking the exceptional step of reclassifying an existing export. Specifically, I wanted to make the case that although the line is fuzzy and hard to specify in abstract terms, it is nonetheless clear that devm_memremap_pages() and HMM (Heterogeneous Memory Management) have crossed it. The devm_memremap_pages() facility should have been EXPORT_SYMBOL_GPL from the beginning, and HMM as a derivative of that functionality should have naturally picked up that designation as well. Contrary to typical rules, the HMM infrastructure was merged upstream with zero in-tree consumers. There was a promise at the time that those users would be merged "soon", but it has been over a year with no drivers arriving. While the Nouveau driver is about to belatedly make good on that promise it is clear that HMM was targeted first and foremost at an out-of-tree consumer. HMM is derived from devm_memremap_pages(), a facility Christoph and I spearheaded to support persistent memory. It combines a device lifetime model with a dynamically created 'struct page' / memmap array for any physical address range. It enables coordination and control of the many code paths in the kernel built to interact with memory via 'struct page' objects. With HMM the integration goes even deeper by allowing device drivers to hook and manipulate page fault and page free events. One interpretation of when EXPORT_SYMBOL is suitable is when it is exporting stable and generic leaf functionality. The devm_memremap_pages() facility continues to see expanding use cases, peer-to-peer DMA being the most recent, with no clear end date when it will stop attracting reworks and semantic changes. It is not suitable to export devm_memremap_pages() as a stable 3rd party driver API due to the fact that it is still changing and manipulates core behavior. Moreover, it is not in the best interest of the long term development of the core memory management subsystem to permit any external driver to effectively define its own system-wide memory management policies with no encouragement to engage with upstream. I am also concerned that HMM was designed in a way to minimize further engagement with the core-MM. That, with these hooks in place, device-drivers are free to implement their own policies without much consideration for whether and how the core-MM could grow to meet that need. Going forward not only should HMM be EXPORT_SYMBOL_GPL, but the core-MM should be allowed the opportunity and stimulus to change and address these new use cases as first class functionality. Original changelog: hmm_devmem_add(), and hmm_devmem_add_resource() duplicated devm_memremap_pages() and are now simple now wrappers around the core facility to inject a dev_pagemap instance into the global pgmap_radix and hook page-idle events. The devm_memremap_pages() interface is base infrastructure for HMM. HMM has more and deeper ties into the kernel memory management implementation than base ZONE_DEVICE which is itself a EXPORT_SYMBOL_GPL facility. Originally, the HMM page structure creation routines copied the devm_memremap_pages() code and reused ZONE_DEVICE. A cleanup to unify the implementations was discussed during the initial review: http://lkml.iu.edu/hypermail/linux/kernel/1701.2/00812.html Recent work to extend devm_memremap_pages() for the peer-to-peer-DMA facility enabled this cleanup to move forward. In addition to the integration with devm_memremap_pages() HMM depends on other GPL-only symbols: mmu_notifier_unregister_no_release percpu_ref region_intersects __class_create It goes further to consume / indirectly expose functionality that is not exported to any other driver: alloc_pages_vma walk_page_range HMM is derived from devm_memremap_pages(), and extends deep core-kernel fundamentals. Similar to devm_memremap_pages(), mark its entry points EXPORT_SYMBOL_GPL(). [logang@deltatee.com: PCI/P2PDMA: match interface changes to devm_memremap_pages()] Link: http://lkml.kernel.org/r/20181130225911.2900-1-logang@deltatee.com Link: http://lkml.kernel.org/r/154275560565.76910.15919297436557795278.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams Signed-off-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig Cc: Logan Gunthorpe Cc: "Jérôme Glisse" Cc: Balbir Singh , Cc: Michal Hocko Cc: Benjamin Herrenschmidt Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bbecd94e6c514a1559fc1a7749a62715958137b1 Author: Dan Williams Date: Fri Dec 28 00:35:11 2018 -0800 mm, hmm: replace hmm_devmem_pages_create() with devm_memremap_pages() Commit e8d513483300 ("memremap: change devm_memremap_pages interface to use struct dev_pagemap") refactored devm_memremap_pages() to allow a dev_pagemap instance to be supplied. Passing in a dev_pagemap interface simplifies the design of pgmap type drivers in that they can rely on container_of() to lookup any private data associated with the given dev_pagemap instance. In addition to the cleanups this also gives hmm users multi-order-radix improvements that arrived with commit ab1b597ee0e4 "mm, devm_memremap_pages: use multi-order radix for ZONE_DEVICE lookups" As part of the conversion to the devm_memremap_pages() method of handling the percpu_ref relative to when pages are put, the percpu_ref completion needs to move to hmm_devmem_ref_exit(). See 71389703839e ("mm, zone_device: Replace {get, put}_zone_device_page...") for details. Link: http://lkml.kernel.org/r/154275560053.76910.10870962637383152392.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams Reviewed-by: Christoph Hellwig Reviewed-by: Jérôme Glisse Acked-by: Balbir Singh Cc: Logan Gunthorpe Cc: Michal Hocko Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 58ef15b765af0d2cbe6799ec564f1dc485010ab8 Author: Dan Williams Date: Fri Dec 28 00:35:07 2018 -0800 mm, hmm: use devm semantics for hmm_devmem_{add, remove} devm semantics arrange for resources to be torn down when device-driver-probe fails or when device-driver-release completes. Similar to devm_memremap_pages() there is no need to support an explicit remove operation when the users properly adhere to devm semantics. Note that devm_kzalloc() automatically handles allocating node-local memory. Link: http://lkml.kernel.org/r/154275559545.76910.9186690723515469051.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams Reviewed-by: Christoph Hellwig Reviewed-by: Jérôme Glisse Cc: "Jérôme Glisse" Cc: Logan Gunthorpe Cc: Balbir Singh Cc: Michal Hocko Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 69324b8f48339de2f90fdf2f774687fc6c47629a Author: Dan Williams Date: Fri Dec 28 00:35:01 2018 -0800 mm, devm_memremap_pages: add MEMORY_DEVICE_PRIVATE support In preparation for consolidating all ZONE_DEVICE enabling via devm_memremap_pages(), teach it how to handle the constraints of MEMORY_DEVICE_PRIVATE ranges. [jglisse@redhat.com: call move_pfn_range_to_zone for MEMORY_DEVICE_PRIVATE] Link: http://lkml.kernel.org/r/154275559036.76910.12434636179931292607.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams Reviewed-by: Jérôme Glisse Acked-by: Christoph Hellwig Reported-by: Logan Gunthorpe Reviewed-by: Logan Gunthorpe Cc: Balbir Singh Cc: Michal Hocko Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a95c90f1e2c253b280385ecf3d4ebfe476926b28 Author: Dan Williams Date: Fri Dec 28 00:34:57 2018 -0800 mm, devm_memremap_pages: fix shutdown handling The last step before devm_memremap_pages() returns success is to allocate a release action, devm_memremap_pages_release(), to tear the entire setup down. However, the result from devm_add_action() is not checked. Checking the error from devm_add_action() is not enough. The api currently relies on the fact that the percpu_ref it is using is killed by the time the devm_memremap_pages_release() is run. Rather than continue this awkward situation, offload the responsibility of killing the percpu_ref to devm_memremap_pages_release() directly. This allows devm_memremap_pages() to do the right thing relative to init failures and shutdown. Without this change we could fail to register the teardown of devm_memremap_pages(). The likelihood of hitting this failure is tiny as small memory allocations almost always succeed. However, the impact of the failure is large given any future reconfiguration, or disable/enable, of an nvdimm namespace will fail forever as subsequent calls to devm_memremap_pages() will fail to setup the pgmap_radix since there will be stale entries for the physical address range. An argument could be made to require that the ->kill() operation be set in the @pgmap arg rather than passed in separately. However, it helps code readability, tracking the lifetime of a given instance, to be able to grep the kill routine directly at the devm_memremap_pages() call site. Link: http://lkml.kernel.org/r/154275558526.76910.7535251937849268605.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams Fixes: e8d513483300 ("memremap: change devm_memremap_pages interface...") Reviewed-by: "Jérôme Glisse" Reported-by: Logan Gunthorpe Reviewed-by: Logan Gunthorpe Reviewed-by: Christoph Hellwig Cc: Balbir Singh Cc: Michal Hocko Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 06489cfbd915ff36c8e36df27f1c2dc60f97ca56 Author: Dan Williams Date: Fri Dec 28 00:34:54 2018 -0800 mm, devm_memremap_pages: kill mapping "System RAM" support Given the fact that devm_memremap_pages() requires a percpu_ref that is torn down by devm_memremap_pages_release() the current support for mapping RAM is broken. Support for remapping "System RAM" has been broken since the beginning and there is no existing user of this this code path, so just kill the support and make it an explicit error. This cleanup also simplifies a follow-on patch to fix the error path when setting a devm release action for devm_memremap_pages_release() fails. Link: http://lkml.kernel.org/r/154275557997.76910.14689813630968180480.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams Reviewed-by: "Jérôme Glisse" Reviewed-by: Christoph Hellwig Reviewed-by: Logan Gunthorpe Cc: Balbir Singh Cc: Michal Hocko Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 808153e1187fa77ac7d7dad261ff476888dcf398 Author: Dan Williams Date: Fri Dec 28 00:34:50 2018 -0800 mm, devm_memremap_pages: mark devm_memremap_pages() EXPORT_SYMBOL_GPL devm_memremap_pages() is a facility that can create struct page entries for any arbitrary range and give drivers the ability to subvert core aspects of page management. Specifically the facility is tightly integrated with the kernel's memory hotplug functionality. It injects an altmap argument deep into the architecture specific vmemmap implementation to allow allocating from specific reserved pages, and it has Linux specific assumptions about page structure reference counting relative to get_user_pages() and get_user_pages_fast(). It was an oversight and a mistake that this was not marked EXPORT_SYMBOL_GPL from the outset. Again, devm_memremap_pagex() exposes and relies upon core kernel internal assumptions and will continue to evolve along with 'struct page', memory hotplug, and support for new memory types / topologies. Only an in-kernel GPL-only driver is expected to keep up with this ongoing evolution. This interface, and functionality derived from this interface, is not suitable for kernel-external drivers. Link: http://lkml.kernel.org/r/154275557457.76910.16923571232582744134.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams Reviewed-by: Christoph Hellwig Acked-by: Michal Hocko Cc: "Jérôme Glisse" Cc: Balbir Singh Cc: Logan Gunthorpe Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7ead3342150ef253b3635385b0f5721e80c87fce Author: Huang Shijie Date: Fri Dec 28 00:34:46 2018 -0800 mm/page_alloc.c: change the order of MIGRATE_RECLAIMABLE/MIGRATE_MOVABLE in fallbacks In the enum migratetype definition, MIGRATE_MOVABLE is before MIGRATE_RECLAIMABLE. Change the order of them to match the enumeration's order. Link: http://lkml.kernel.org/r/20181121085821.3442-1-sjhuang@iluvatar.ai Signed-off-by: Huang Shijie Reviewed-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ca880420665dbc8beec3693bee9f5eccb89de4a6 Author: Eric Biggers Date: Fri Dec 28 00:34:43 2018 -0800 userfaultfd: convert userfaultfd_ctx::refcount to refcount_t Reference counters should use refcount_t rather than atomic_t, since the refcount_t implementation can prevent overflows, reducing the exploitability of reference leak bugs. userfaultfd_ctx::refcount is a reference counter with the usual semantics, so convert it to refcount_t. Note: I replaced the BUG() on incrementing a 0 refcount with just refcount_inc(), since part of the semantics of refcount_t is that that incrementing a 0 refcount is not allowed; with CONFIG_REFCOUNT_FULL, refcount_inc() already checks for it and warns. Link: http://lkml.kernel.org/r/20181115003916.63381-1-ebiggers@kernel.org Signed-off-by: Eric Biggers Reviewed-by: Andrew Morton Cc: Andrea Arcangeli Reviewed-by: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 66f71da9dd38af17dc17209cdde7987d4679a699 Author: Aaron Lu Date: Fri Dec 28 00:34:39 2018 -0800 mm/swap: use nr_node_ids for avail_lists in swap_info_struct Since a2468cc9bfdf ("swap: choose swap device according to numa node"), avail_lists field of swap_info_struct is changed to an array with MAX_NUMNODES elements. This made swap_info_struct size increased to 40KiB and needs an order-4 page to hold it. This is not optimal in that: 1 Most systems have way less than MAX_NUMNODES(1024) nodes so it is a waste of memory; 2 It could cause swapon failure if the swap device is swapped on after system has been running for a while, due to no order-4 page is available as pointed out by Vasily Averin. Solve the above two issues by using nr_node_ids(which is the actual possible node number the running system has) for avail_lists instead of MAX_NUMNODES. nr_node_ids is unknown at compile time so can't be directly used when declaring this array. What I did here is to declare avail_lists as zero element array and allocate space for it when allocating space for swap_info_struct. The reason why keep using array but not pointer is plist_for_each_entry needs the field to be part of the struct, so pointer will not work. This patch is on top of Vasily Averin's fix commit. I think the use of kvzalloc for swap_info_struct is still needed in case nr_node_ids is really big on some systems. Link: http://lkml.kernel.org/r/20181115083847.GA11129@intel.com Signed-off-by: Aaron Lu Reviewed-by: Andrew Morton Acked-by: Michal Hocko Cc: Vasily Averin Cc: Huang Ying Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8b09549c2bfd9f3f8f4cdad74107ef4f4ff9cdd7 Author: Wei Yang Date: Fri Dec 28 00:34:36 2018 -0800 vmscan: return NODE_RECLAIM_NOSCAN in node_reclaim() when CONFIG_NUMA is n Commit fa5e084e43eb ("vmscan: do not unconditionally treat zones that fail zone_reclaim() as full") changed the return value of node_reclaim(). The original return value 0 means NODE_RECLAIM_SOME after this commit. While the return value of node_reclaim() when CONFIG_NUMA is n is not changed. This will leads to call zone_watermark_ok() again. This patch fixes the return value by adjusting to NODE_RECLAIM_NOSCAN. Since node_reclaim() is only called in page_alloc.c, move it to mm/internal.h. Link: http://lkml.kernel.org/r/20181113080436.22078-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Acked-by: Michal Hocko Reviewed-by: Matthew Wilcox Cc: Mel Gorman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 476567e8735a0d06225f3873a86dfa0efd95f3a5 Author: Arun KS Date: Fri Dec 28 00:34:32 2018 -0800 mm: remove managed_page_count_lock spinlock Now that totalram_pages and managed_pages are atomic varibles, no need of managed_page_count spinlock. The lock had really a weak consistency guarantee. It hasn't been used for anything but the update but no reader actually cares about all the values being updated to be in sync. Link: http://lkml.kernel.org/r/1542090790-21750-5-git-send-email-arunks@codeaurora.org Signed-off-by: Arun KS Reviewed-by: Konstantin Khlebnikov Acked-by: Michal Hocko Acked-by: Vlastimil Babka Cc: David Hildenbrand Reviewed-by: Pavel Tatashin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ca79b0c211af63fa3276f0e3fd7dd9ada2439839 Author: Arun KS Date: Fri Dec 28 00:34:29 2018 -0800 mm: convert totalram_pages and totalhigh_pages variables to atomic totalram_pages and totalhigh_pages are made static inline function. Main motivation was that managed_page_count_lock handling was complicating things. It was discussed in length here, https://lore.kernel.org/patchwork/patch/995739/#1181785 So it seemes better to remove the lock and convert variables to atomic, with preventing poteintial store-to-read tearing as a bonus. [akpm@linux-foundation.org: coding style fixes] Link: http://lkml.kernel.org/r/1542090790-21750-4-git-send-email-arunks@codeaurora.org Signed-off-by: Arun KS Suggested-by: Michal Hocko Suggested-by: Vlastimil Babka Reviewed-by: Konstantin Khlebnikov Reviewed-by: Pavel Tatashin Acked-by: Michal Hocko Acked-by: Vlastimil Babka Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9705bea5f833f4fc21d5bef5fce7348427f76ea4 Author: Arun KS Date: Fri Dec 28 00:34:24 2018 -0800 mm: convert zone->managed_pages to atomic variable totalram_pages, zone->managed_pages and totalhigh_pages updates are protected by managed_page_count_lock, but readers never care about it. Convert these variables to atomic to avoid readers potentially seeing a store tear. This patch converts zone->managed_pages. Subsequent patches will convert totalram_panges, totalhigh_pages and eventually managed_page_count_lock will be removed. Main motivation was that managed_page_count_lock handling was complicating things. It was discussed in length here, https://lore.kernel.org/patchwork/patch/995739/#1181785 So it seemes better to remove the lock and convert variables to atomic, with preventing poteintial store-to-read tearing as a bonus. Link: http://lkml.kernel.org/r/1542090790-21750-3-git-send-email-arunks@codeaurora.org Signed-off-by: Arun KS Suggested-by: Michal Hocko Suggested-by: Vlastimil Babka Reviewed-by: Konstantin Khlebnikov Reviewed-by: David Hildenbrand Acked-by: Michal Hocko Acked-by: Vlastimil Babka Reviewed-by: Pavel Tatashin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3d6357de8aa09e1966770dc1171c72679946464f Author: Arun KS Date: Fri Dec 28 00:34:20 2018 -0800 mm: reference totalram_pages and managed_pages once per function Patch series "mm: convert totalram_pages, totalhigh_pages and managed pages to atomic", v5. This series converts totalram_pages, totalhigh_pages and zone->managed_pages to atomic variables. totalram_pages, zone->managed_pages and totalhigh_pages updates are protected by managed_page_count_lock, but readers never care about it. Convert these variables to atomic to avoid readers potentially seeing a store tear. Main motivation was that managed_page_count_lock handling was complicating things. It was discussed in length here, https://lore.kernel.org/patchwork/patch/995739/#1181785 It seemes better to remove the lock and convert variables to atomic. With the change, preventing poteintial store-to-read tearing comes as a bonus. This patch (of 4): This is in preparation to a later patch which converts totalram_pages and zone->managed_pages to atomic variables. Please note that re-reading the value might lead to a different value and as such it could lead to unexpected behavior. There are no known bugs as a result of the current code but it is better to prevent from them in principle. Link: http://lkml.kernel.org/r/1542090790-21750-2-git-send-email-arunks@codeaurora.org Signed-off-by: Arun KS Reviewed-by: Konstantin Khlebnikov Reviewed-by: David Hildenbrand Acked-by: Michal Hocko Acked-by: Vlastimil Babka Reviewed-by: Pavel Tatashin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fecd4a50baaebf6bde7f9e0b88fef13ffe5d98a1 Author: Wei Yang Date: Fri Dec 28 00:34:16 2018 -0800 mm: remove reset of pcp->counter in pageset_init() per_cpu_pageset is cleared by memset, it is not necessary to reset it again. Link: http://lkml.kernel.org/r/20181021023920.5501-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: Andrew Morton Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 46a3679b8190101e4ebdfe252ef79e6150a4f2ac Author: Michal Hocko Date: Fri Dec 28 00:34:13 2018 -0800 mm, memory_hotplug: do not clear numa_node association after hot_remove Per-cpu numa_node provides a default node for each possible cpu. The association gets initialized during the boot when the architecture specific code explores cpu->NUMA affinity. When the whole NUMA node is removed though we are clearing this association try_offline_node check_and_unmap_cpu_on_node unmap_cpu_on_node numa_clear_node numa_set_node(cpu, NUMA_NO_NODE) This means that whoever calls cpu_to_node for a cpu associated with such a node will get NUMA_NO_NODE. This is problematic for two reasons. First it is fragile because __alloc_pages_node would simply blow up on an out-of-bound access. We have encountered this when loading kvm module BUG: unable to handle kernel paging request at 00000000000021c0 IP: __alloc_pages_nodemask+0x93/0xb70 PGD 800000ffe853e067 PUD 7336bbc067 PMD 0 Oops: 0000 [#1] SMP [...] CPU: 88 PID: 1223749 Comm: modprobe Tainted: G W 4.4.156-94.64-default #1 RIP: __alloc_pages_nodemask+0x93/0xb70 RSP: 0018:ffff887354493b40 EFLAGS: 00010202 RAX: 00000000000021c0 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 00000000014000c0 RBP: 00000000014000c0 R08: ffffffffffffffff R09: 0000000000000000 R10: ffff88fffc89e790 R11: 0000000000014000 R12: 0000000000000101 R13: ffffffffa0772cd4 R14: ffffffffa0769ac0 R15: 0000000000000000 FS: 00007fdf2f2f1700(0000) GS:ffff88fffc880000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000021c0 CR3: 00000077205ee000 CR4: 0000000000360670 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: alloc_vmcs_cpu+0x3d/0x90 [kvm_intel] hardware_setup+0x781/0x849 [kvm_intel] kvm_arch_hardware_setup+0x28/0x190 [kvm] kvm_init+0x7c/0x2d0 [kvm] vmx_init+0x1e/0x32c [kvm_intel] do_one_initcall+0xca/0x1f0 do_init_module+0x5a/0x1d7 load_module+0x1393/0x1c90 SYSC_finit_module+0x70/0xa0 entry_SYSCALL_64_fastpath+0x1e/0xb7 DWARF2 unwinder stuck at entry_SYSCALL_64_fastpath+0x1e/0xb7 on an older kernel but the code is basically the same in the current Linus tree as well. alloc_vmcs_cpu could use alloc_pages_nodemask which would recognize NUMA_NO_NODE and use alloc_pages_node which would translate it to numa_mem_id but that is wrong as well because it would use a cpu affinity of the local CPU which might be quite far from the original node. It is also reasonable to expect that cpu_to_node will provide a sane value and there might be many more callers like that. The second problem is that __register_one_node relies on cpu_to_node to properly associate cpus back to the node when it is onlined. We do not want to lose that link as there is no arch independent way to get it from the early boot time AFAICS. Drop the whole check_and_unmap_cpu_on_node machinery and keep the association to fix both issues. The NODE_DATA(nid) is not deallocated so it will stay in place and if anybody wants to allocate from that node then a fallback node will be used. Thanks to Vlastimil Babka for his live system debugging skills that helped debugging the issue. Link: http://lkml.kernel.org/r/20181108100413.966-1-mhocko@kernel.org Fixes: e13fe8695c57 ("cpu-hotplug,memory-hotplug: clear cpu_to_node() when offlining the node") Signed-off-by: Michal Hocko Debugged-by: Vlastimil Babka Reported-by: Miroslav Benes Acked-by: Anshuman Khandual Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9cabf929e7d92139a7d1ef3e517ad57dfece4739 Author: Yangtao Li Date: Fri Dec 28 00:34:09 2018 -0800 mm/mmap.c: remove verify_mm_writelocked() We should get rid of this function. It no longer serves its purpose. This is a historical artifact from 2005 where do_brk was called outside of the core mm. We do have a proper abstraction in vm_brk_flags and that one does the locking properly so there is no need to use this function. Link: http://lkml.kernel.org/r/20181108174856.10811-1-tiny.windzz@gmail.com Signed-off-by: Yangtao Li Acked-by: Michal Hocko Acked-by: David Rientjes Cc: Dan Williams Cc: Dominik Brodowski Cc: Dave Hansen Cc: David Woodhouse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 59e1a2f4bf83744e748636415fde7d1e9f557e05 Author: Timofey Titovets Date: Fri Dec 28 00:34:05 2018 -0800 ksm: replace jhash2 with xxhash Replace jhash2 with xxhash. Perf numbers: Intel(R) Xeon(R) CPU E5-2420 v2 @ 2.20GHz ksm: crc32c hash() 12081 MB/s ksm: xxh64 hash() 8770 MB/s ksm: xxh32 hash() 4529 MB/s ksm: jhash2 hash() 1569 MB/s Sioh Lee did some testing: crc32c_intel: 1084.10ns crc32c (no hardware acceleration): 7012.51ns xxhash32: 2227.75ns xxhash64: 1413.16ns jhash2: 5128.30ns As jhash2 always will be slower (for data size like PAGE_SIZE). Don't use it in ksm at all. Use only xxhash for now, because for using crc32c, cryptoapi must be initialized first - that requires some tricky solution to work well in all situations. Link: http://lkml.kernel.org/r/20181023182554.23464-3-nefelim4ag@gmail.com Signed-off-by: Timofey Titovets Signed-off-by: leesioh Reviewed-by: Pavel Tatashin Reviewed-by: Mike Rapoport Reviewed-by: Andrew Morton Cc: Andrea Arcangeli Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0b9df58b79fa283fbedc0fb6a8e248599444bacc Author: Timofey Titovets Date: Fri Dec 28 00:34:00 2018 -0800 xxHash: create arch dependent 32/64-bit xxhash() Patch series "Currently used jhash are slow enough and replace it allow as to make KSM", v8. Apeed (in kernel): ksm: crc32c hash() 12081 MB/s ksm: xxh64 hash() 8770 MB/s ksm: xxh32 hash() 4529 MB/s ksm: jhash2 hash() 1569 MB/s Sioh Lee's testing (copy from other mail): Test platform: openstack cloud platform (NEWTON version) Experiment node: openstack based cloud compute node (CPU: xeon E5-2620 v3, memory 64gb) VM: (2 VCPU, RAM 4GB, DISK 20GB) * 4 Linux kernel: 4.14 (latest version) KSM setup - sleep_millisecs: 200ms, pages_to_scan: 200 Experiment process: Firstly, we turn off KSM and launch 4 VMs. Then we turn on the KSM and measure the checksum computation time until full_scans become two. The experimental results (the experimental value is the average of the measured values) crc32c_intel: 1084.10ns crc32c (no hardware acceleration): 7012.51ns xxhash32: 2227.75ns xxhash64: 1413.16ns jhash2: 5128.30ns In summary, the result shows that crc32c_intel has advantages over all of the hash function used in the experiment. (decreased by 84.54% compared to crc32c, 78.86% compared to jhash2, 51.33% xxhash32, 23.28% compared to xxhash64) the results are similar to those of Timofey. But, use only xxhash for now, because for using crc32c, cryptoapi must be initialized first - that require some tricky solution to work good in all situations. So: - First patch implement compile time pickup of fastest implementation of xxhash for target platform. - The second patch replaces jhash2 with xxhash This patch (of 2): xxh32() - fast on both 32/64-bit platforms xxh64() - fast only on 64-bit platform Create xxhash() which will pick up the fastest version at compile time. Link: http://lkml.kernel.org/r/20181023182554.23464-2-nefelim4ag@gmail.com Signed-off-by: Timofey Titovets Reviewed-by: Pavel Tatashin Reviewed-by: Mike Rapoport Reviewed-by: Andrew Morton Cc: Andrea Arcangeli Cc: leesioh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d381c54760dcfad23743da40516e7e003d73952a Author: Michal Hocko Date: Fri Dec 28 00:33:56 2018 -0800 mm: only report isolation failures when offlining memory Heiko has complained that his log is swamped by warnings from has_unmovable_pages [ 20.536664] page dumped because: has_unmovable_pages [ 20.536792] page:000003d081ff4080 count:1 mapcount:0 mapping:000000008ff88600 index:0x0 compound_mapcount: 0 [ 20.536794] flags: 0x3fffe0000010200(slab|head) [ 20.536795] raw: 03fffe0000010200 0000000000000100 0000000000000200 000000008ff88600 [ 20.536796] raw: 0000000000000000 0020004100000000 ffffffff00000001 0000000000000000 [ 20.536797] page dumped because: has_unmovable_pages [ 20.536814] page:000003d0823b0000 count:1 mapcount:0 mapping:0000000000000000 index:0x0 [ 20.536815] flags: 0x7fffe0000000000() [ 20.536817] raw: 07fffe0000000000 0000000000000100 0000000000000200 0000000000000000 [ 20.536818] raw: 0000000000000000 0000000000000000 ffffffff00000001 0000000000000000 which are not triggered by the memory hotplug but rather CMA allocator. The original idea behind dumping the page state for all call paths was that these messages will be helpful debugging failures. From the above it seems that this is not the case for the CMA path because we are lacking much more context. E.g the second reported page might be a CMA allocated page. It is still interesting to see a slab page in the CMA area but it is hard to tell whether this is bug from the above output alone. Address this issue by dumping the page state only on request. Both start_isolate_page_range and has_unmovable_pages already have an argument to ignore hwpoison pages so make this argument more generic and turn it into flags and allow callers to combine non-default modes into a mask. While we are at it, has_unmovable_pages call from is_pageblock_removable_nolock (sysfs removable file) is questionable to report the failure so drop it from there as well. Link: http://lkml.kernel.org/r/20181218092802.31429-1-mhocko@kernel.org Signed-off-by: Michal Hocko Reported-by: Heiko Carstens Reviewed-by: Oscar Salvador Cc: Anshuman Khandual Cc: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2932c8b05056d4ba702f70f4deebe1c97600e62b Author: Michal Hocko Date: Fri Dec 28 00:33:53 2018 -0800 mm, memory_hotplug: be more verbose for memory offline failures There is only very limited information printed when the memory offlining fails: [ 1984.506184] rac1 kernel: memory offlining [mem 0x82600000000-0x8267fffffff] failed due to signal backoff This tells us that the failure is triggered by the userspace intervention but it doesn't tell us much more about the underlying reason. It might be that the page migration failes repeatedly and the userspace timeout expires and send a signal or it might be some of the earlier steps (isolation, memory notifier) takes too long. If the migration failes then it would be really helpful to see which page that and its state. The same applies to the isolation phase. If we fail to isolate a page from the allocator then knowing the state of the page would be helpful as well. Dump the page state that fails to get isolated or migrated. This will tell us more about the failure and what to focus on during debugging. [akpm@linux-foundation.org: add missing printk arg] [mhocko@suse.com: tweak dump_page() `reason' text] Link: http://lkml.kernel.org/r/20181116083020.20260-6-mhocko@kernel.org Link: http://lkml.kernel.org/r/20181107101830.17405-6-mhocko@kernel.org Signed-off-by: Michal Hocko Reviewed-by: Andrew Morton Reviewed-by: Oscar Salvador Reviewed-by: Anshuman Khandual Cc: Baoquan He Cc: Oscar Salvador Cc: William Kucharski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7960509329c24a2bf0bc4929636614a1b7bb4443 Author: Michal Hocko Date: Fri Dec 28 00:33:49 2018 -0800 mm, memory_hotplug: print reason for the offlining failure The memory offlining failure reporting is inconsistent and insufficient. Some error paths simply do not report the failure to the log at all. When we do report there are no details about the reason of the failure and there are several of them which makes memory offlining failures hard to debug. Make sure that the memory offlining [mem %#010llx-%#010llx] failed message is printed for all failures and also provide a short textual reason for the failure e.g. [ 1984.506184] rac1 kernel: memory offlining [mem 0x82600000000-0x8267fffffff] failed due to signal backoff this tells us that the offlining has failed because of a signal pending aka user intervention. [akpm@linux-foundation.org: tweak messages a bit] Link: http://lkml.kernel.org/r/20181107101830.17405-5-mhocko@kernel.org Signed-off-by: Michal Hocko Reviewed-by: Andrew Morton Reviewed-by: Oscar Salvador Reviewed-by: Anshuman Khandual Cc: Baoquan He Cc: Oscar Salvador Cc: William Kucharski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6cc2baf600eca841549e182b471d5c7b8c4143c3 Author: Michal Hocko Date: Fri Dec 28 00:33:45 2018 -0800 mm, memory_hotplug: drop pointless block alignment checks from __offline_pages This function is never called from a context which would provide misaligned pfn range so drop the pointless check. Link: http://lkml.kernel.org/r/20181107101830.17405-4-mhocko@kernel.org Signed-off-by: Michal Hocko Reviewed-by: Andrew Morton Reviewed-by: Oscar Salvador Reviewed-by: Anshuman Khandual Cc: Baoquan He Cc: Oscar Salvador Cc: William Kucharski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e0392cf7c53a2c03dbda93de4073c78609b88c51 Author: Michal Hocko Date: Fri Dec 28 00:33:42 2018 -0800 mm: lower the printk loglevel for __dump_page messages __dump_page messages use KERN_EMERG resp. KERN_ALERT loglevel (this is the case since 2004). Most callers of this function are really detecting a critical page state and BUG right after. On the other hand the function is called also from contexts which just want to inform about the page state and those would rather not disrupt logs that much (e.g. some systems route these messages to the normal console). Reduce the loglevel to KERN_WARNING to make dump_page easier to reuse for other contexts while those messages will still make it to the kernel log in most setups. Even if the loglevel setup filters warnings away those paths that are really critical already print the more targeted error or panic and that should make it to the kernel log. [mhocko@kernel.org: fix __dump_page()] Link: http://lkml.kernel.org/r/20181212142540.GA7378@dhcp22.suse.cz [akpm@linux-foundation.org: s/KERN_WARN/KERN_WARNING/, per Michal] Link: http://lkml.kernel.org/r/20181107101830.17405-3-mhocko@kernel.org Signed-off-by: Michal Hocko Reviewed-by: Andrew Morton Reviewed-by: Anshuman Khandual Cc: Baoquan He Cc: Oscar Salvador Cc: Oscar Salvador Cc: William Kucharski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1c6fb1d89e73cd3bbfae7c400f1c615272aa435f Author: Michal Hocko Date: Fri Dec 28 00:33:38 2018 -0800 mm: print more information about mapping in __dump_page I have been promissing to improve memory offlining failures debugging for quite some time. As things stand now we get only very limited information in the kernel log when the offlining fails. It is usually only [ 1984.506184] rac1 kernel: memory offlining [mem 0x82600000000-0x8267fffffff] failed with no further details. We do not know what exactly fails and for what reason. Whenever I was forced to debug such a failure I've always had to do a debugging patch to tell me more. We can enable some tracepoints but it would be much better to get a better picture without using them. This patch series does 2 things. The first one is to make dump_page more usable by printing more information about the mapping patch 1. Then it reduces the log level from emerg to warning so that this function is usable from less critical context patch 2. Then I have added more detailed information about the offlining failure patch 4 and finally add dump_page to isolation and offlining migration paths. Patch 3 is a trivial cleanup. This patch (of 6): __dump_page prints the mapping pointer but that is quite unhelpful for many reports because the pointer itself only helps to distinguish anon/ksm mappings from other ones (because of lowest bits set). Sometimes it would be much more helpful to know what kind of mapping that is actually and if we know this is a file mapping then also try to resolve the dentry name. [dan.carpenter@oracle.com: fix a width vs precision bug in printk] Link: http://lkml.kernel.org/r/20181123072135.gqvblm2vdujbvfjs@kili.mountain [mhocko@kernel.org: use %dp to print dentry] Link: http://lkml.kernel.org/r/20181125080834.GB12455@dhcp22.suse.cz Link: http://lkml.kernel.org/r/20181107101830.17405-2-mhocko@kernel.org Signed-off-by: Michal Hocko Reviewed-by: Andrew Morton Reviewed-by: Anshuman Khandual Reviewed-by: William Kucharski Cc: Oscar Salvador Cc: Baoquan He Cc: Oscar Salvador Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 20ff1c950500380c6f74ec1a0d6f4eafab673ef6 Author: Gao Xiang Date: Fri Dec 28 00:33:34 2018 -0800 mm/readahead.c: simplify get_next_ra_size() It's a trivial simplification for get_next_ra_size() and clear enough for humans to understand. It also fixes potential overflow if ra->size(< ra_pages) is too large. Link: http://lkml.kernel.org/r/1540707206-19649-1-git-send-email-hsiangkao@aol.com Signed-off-by: Gao Xiang Reviewed-by: Fengguang Wu Reviewed-by: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 368686a95e55fd66b88542b5b23d802a4886b1aa Author: Anders Roxell Date: Fri Dec 28 00:33:31 2018 -0800 writeback: don't decrement wb->refcnt if !wb->bdi This happened while running in qemu-system-aarch64, the AMBA PL011 UART driver when enabling CONFIG_DEBUG_TEST_DRIVER_REMOVE. arch_initcall(pl011_init) came before subsys_initcall(default_bdi_init), devtmpfs' handle_remove() crashes because the reference count is a NULL pointer only because wb->bdi hasn't been initialized yet. Rework so that wb_put have an extra check if wb->bdi before decrement wb->refcnt and also add a WARN_ON_ONCE to get a warning if it happens again in other drivers. Link: http://lkml.kernel.org/r/20181030113545.30999-2-anders.roxell@linaro.org Fixes: 52ebea749aae ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks") Signed-off-by: Arnd Bergmann Signed-off-by: Anders Roxell Co-developed-by: Arnd Bergmann Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6a90a83f1d1957647581ca48caa1f7cc4fa44f8d Author: Sean Christopherson Date: Fri Dec 28 00:33:28 2018 -0800 mm/mmu_notifier.c: remove mmu_notifier_synchronize() Contrary to its name, mmu_notifier_synchronize() does not synchronize the notifier's SRCU instance, but rather waits for RCU callbacks to finish. i.e. it invokes rcu_barrier(). The RCU documentation is quite clear on this matter, explicitly calling out that rcu_barrier() does not imply synchronize_rcu(). As there are no callers of mmu_notifier_synchronize() and it's unclear whether any user of mmu_notifier_call_srcu() will ever want to barrier on their callbacks, simply remove the function. Link: http://lkml.kernel.org/r/20181106134705.14197-1-sean.j.christopherson@intel.com Signed-off-by: Sean Christopherson Reviewed-by: Andrew Morton Cc: Peter Zijlstra Cc: Jérôme Glisse Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5eb570a8d9248e0c1358078a59916d0e337e695b Author: Balbir Singh Date: Fri Dec 28 00:33:24 2018 -0800 mm/hotplug: optimize clear_hwpoisoned_pages() In hot remove, we try to clear poisoned pages, but a small optimization to check if num_poisoned_pages is 0 helps remove the iteration through nr_pages. [akpm@linux-foundation.org: tweak comment text] Link: http://lkml.kernel.org/r/20181102120001.4526-1-bsingharora@gmail.com Signed-off-by: Balbir Singh Acked-by: Michal Hocko Acked-by: Naoya Horiguchi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c8f61cfc871fadfb73ad3eacd64fda457279e911 Author: Miles Chen Date: Fri Dec 28 00:33:21 2018 -0800 mm/page_owner: clamp read count to PAGE_SIZE The (root-only) page owner read might allocate a large size of memory with a large read count. Allocation fails can easily occur when doing high order allocations. Clamp buffer size to PAGE_SIZE to avoid arbitrary size allocation and avoid allocation fails due to high order allocation. [akpm@linux-foundation.org: use min_t()] Link: http://lkml.kernel.org/r/1541091607-27402-1-git-send-email-miles.chen@mediatek.com Signed-off-by: Miles Chen Acked-by: Michal Hocko Cc: Joe Perches Cc: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4e45f712d82c6b7a37e02faf388173ad12ab464d Author: Vlastimil Babka Date: Fri Dec 28 00:33:17 2018 -0800 include/linux/slab.h: fix sparse warning in kmalloc_type() Multiple people have reported the following sparse warning: ./include/linux/slab.h:332:43: warning: dubious: x & !y The minimal fix would be to change the logical & to boolean &&, which emits the same code, but Andrew has suggested that the branch-avoiding tricks are maybe not worthwile. David Laight provided a nice comparison of disassembly of multiple variants, which shows that the current version produces a 4 deep dependency chain, and fixing the sparse warning by changing logical and to multiplication emits an IMUL, making it even more expensive. The code as rewritten by this patch yielded the best disassembly, with a single predictable branch for the most common case, and a ternary operator for the rest, which gcc seems to compile without a branch or cmov by itself. The result should be more readable, without a sparse warning and probably also faster for the common case. Link: http://lkml.kernel.org/r/80340595-d7c5-97b9-4f6c-23fa893a91e9@suse.cz Fixes: 1291523f2c1d ("mm, slab/slub: introduce kmalloc-reclaimable caches") Reviewed-by: Andrew Morton Signed-off-by: Vlastimil Babka Reported-by: Bart Van Assche Reported-by: Darryl T. Agostinelli Reported-by: Masahiro Yamada Suggested-by: Andrew Morton Suggested-by: David Laight Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 88349a2837fbaef83862a011e1f53c4551d3e199 Author: Wei Yang Date: Fri Dec 28 00:33:13 2018 -0800 mm/slub.c: record final state of slub action in deactivate_slab() If __cmpxchg_double_slab() fails and (l != m), current code records transition states of slub action. Update the action after __cmpxchg_double_slab() success to record the final state. [akpm@linux-foundation.org: more whitespace cleanup] Link: http://lkml.kernel.org/r/20181107013119.3816-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: Andrew Morton Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6159d0f5c03e81daed29657e60383ee27f979b4a Author: Wei Yang Date: Fri Dec 28 00:33:09 2018 -0800 mm/slub.c: page is always non-NULL in node_match() node_match() is a static function and is only invoked in slub.c. In all three places, `page' is ensured to be valid. Link: http://lkml.kernel.org/r/20181106150245.1668-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Acked-by: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1265ef2de4cef44cec91ba47009958eec6162836 Author: Wei Yang Date: Fri Dec 28 00:33:06 2018 -0800 mm/slub.c: remove validation on cpu_slab in __flush_cpu_slab() cpu_slab is a per cpu variable which is allocated in all or none. If a cpu_slab failed to be allocated, the slub is not usable. We could use cpu_slab without validation in __flush_cpu_slab(). Link: http://lkml.kernel.org/r/20181103141218.22844-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: Andrew Morton Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 221d7da66cd3435b28a0404f62168d25f57aca4e Author: Yangtao Li Date: Fri Dec 28 00:33:01 2018 -0800 mm, slab: remove unnecessary unlikely() WARN_ON() already contains an unlikely(), so it's not necessary to use unlikely. Also change WARN_ON() back to WARN_ON_ONCE() to avoid potentially spamming dmesg with user-triggerable large allocations. [akpm@linux-foundation.org: s/WARN_ON/WARN_ON_ONCE/, per Vlastimil] Link: http://lkml.kernel.org/r/20181104125028.3572-1-tiny.windzz@gmail.com Signed-off-by: Yangtao Li Acked-by: Vlastimil Babka Reviewed-by: Andrew Morton Acked-by: David Rientjes Cc: Christoph Lameter Cc: Pekka Enberg Cc: Joonsoo Kim Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 70306d9dce75abde855cefaf32b3f71eed8602a3 Author: Junxiao Bi Date: Fri Dec 28 00:32:57 2018 -0800 ocfs2: don't clear bh uptodate for block read For sync io read in ocfs2_read_blocks_sync(), first clear bh uptodate flag and submit the io, second wait io done, last check whether bh uptodate, if not return io error. If two sync io for the same bh were issued, it could be the first io done and set uptodate flag, but just before check that flag, the second io came in and cleared uptodate, then ocfs2_read_blocks_sync() for the first io will return IO error. Indeed it's not necessary to clear uptodate flag, as the io end handler end_buffer_read_sync() will set or clear it based on io succeed or failed. The following message was found from a nfs server but the underlying storage returned no error. [4106438.567376] (nfsd,7146,3):ocfs2_get_suballoc_slot_bit:2780 ERROR: read block 1238823695 failed -5 [4106438.567569] (nfsd,7146,3):ocfs2_get_suballoc_slot_bit:2812 ERROR: status = -5 [4106438.567611] (nfsd,7146,3):ocfs2_test_inode_bit:2894 ERROR: get alloc slot and bit failed -5 [4106438.567643] (nfsd,7146,3):ocfs2_test_inode_bit:2932 ERROR: status = -5 [4106438.567675] (nfsd,7146,3):ocfs2_get_dentry:94 ERROR: test inode bit failed -5 Same issue in non sync read ocfs2_read_blocks(), fixed it as well. Link: http://lkml.kernel.org/r/20181121020023.3034-4-junxiao.bi@oracle.com Signed-off-by: Junxiao Bi Reviewed-by: Changwei Ge Reviewed-by: Yiwen Jiang Cc: Joel Becker Cc: Joseph Qi Cc: Jun Piao Cc: Mark Fasheh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d85400af790dba2aa294f0a77e712f166681f977 Author: Junxiao Bi Date: Fri Dec 28 00:32:53 2018 -0800 ocfs2: clear journal dirty flag after shutdown journal Dirty flag of the journal should be cleared at the last stage of umount, if do it before jbd2_journal_destroy(), then some metadata in uncommitted transaction could be lost due to io error, but as dirty flag of journal was already cleared, we can't find that until run a full fsck. This may cause system panic or other corruption. Link: http://lkml.kernel.org/r/20181121020023.3034-3-junxiao.bi@oracle.com Signed-off-by: Junxiao Bi Reviewed-by: Yiwen Jiang Reviewed-by: Joseph Qi Cc: Jun Piao Cc: Changwei Ge Cc: Joel Becker Cc: Mark Fasheh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 532e1e54c8140188e192348c790317921cb2dc1c Author: Junxiao Bi Date: Fri Dec 28 00:32:50 2018 -0800 ocfs2: fix panic due to unrecovered local alloc mount.ocfs2 ignore the inconsistent error that journal is clean but local alloc is unrecovered. After mount, local alloc not empty, then reserver cluster didn't alloc a new local alloc window, reserveration map is empty(ocfs2_reservation_map.m_bitmap_len = 0), that triggered the following panic. This issue was reported at https://oss.oracle.com/pipermail/ocfs2-devel/2015-May/010854.html and was advised to fixed during mount. But this is a very unusual inconsistent state, usually journal dirty flag should be cleared at the last stage of umount until every other things go right. We may need do further debug to check that. Any way to avoid possible futher corruption, mount should be abort and fsck should be run. (mount.ocfs2,1765,1):ocfs2_load_local_alloc:353 ERROR: Local alloc hasn't been recovered! found = 6518, set = 6518, taken = 8192, off = 15912372 ocfs2: Mounting device (202,64) on (node 0, slot 3) with ordered data mode. o2dlm: Joining domain 89CEAC63CC4F4D03AC185B44E0EE0F3F ( 0 1 2 3 4 5 6 8 ) 8 nodes ocfs2: Mounting device (202,80) on (node 0, slot 3) with ordered data mode. o2hb: Region 89CEAC63CC4F4D03AC185B44E0EE0F3F (xvdf) is now a quorum device o2net: Accepted connection from node yvwsoa17p (num 7) at 172.22.77.88:7777 o2dlm: Node 7 joins domain 64FE421C8C984E6D96ED12C55FEE2435 ( 0 1 2 3 4 5 6 7 8 ) 9 nodes o2dlm: Node 7 joins domain 89CEAC63CC4F4D03AC185B44E0EE0F3F ( 0 1 2 3 4 5 6 7 8 ) 9 nodes ------------[ cut here ]------------ kernel BUG at fs/ocfs2/reservations.c:507! invalid opcode: 0000 [#1] SMP Modules linked in: ocfs2 rpcsec_gss_krb5 auth_rpcgss nfsv4 nfs fscache lockd grace ocfs2_dlmfs ocfs2_stack_o2cb ocfs2_dlm ocfs2_nodemanager ocfs2_stackglue configfs sunrpc ipt_REJECT nf_reject_ipv4 nf_conntrack_ipv4 nf_defrag_ipv4 iptable_filter ip_tables ip6t_REJECT nf_reject_ipv6 nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter ip6_tables ib_ipoib rdma_ucm ib_ucm ib_uverbs ib_umad rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr ipv6 ovmapi ppdev parport_pc parport xen_netfront fb_sys_fops sysimgblt sysfillrect syscopyarea acpi_cpufreq pcspkr i2c_piix4 i2c_core sg ext4 jbd2 mbcache2 sr_mod cdrom xen_blkfront pata_acpi ata_generic ata_piix floppy dm_mirror dm_region_hash dm_log dm_mod CPU: 0 PID: 4349 Comm: startWebLogic.s Not tainted 4.1.12-124.19.2.el6uek.x86_64 #2 Hardware name: Xen HVM domU, BIOS 4.4.4OVM 09/06/2018 task: ffff8803fb04e200 ti: ffff8800ea4d8000 task.ti: ffff8800ea4d8000 RIP: 0010:[] [] __ocfs2_resv_find_window+0x498/0x760 [ocfs2] Call Trace: ocfs2_resmap_resv_bits+0x10d/0x400 [ocfs2] ocfs2_claim_local_alloc_bits+0xd0/0x640 [ocfs2] __ocfs2_claim_clusters+0x178/0x360 [ocfs2] ocfs2_claim_clusters+0x1f/0x30 [ocfs2] ocfs2_convert_inline_data_to_extents+0x634/0xa60 [ocfs2] ocfs2_write_begin_nolock+0x1c6/0x1da0 [ocfs2] ocfs2_write_begin+0x13e/0x230 [ocfs2] generic_perform_write+0xbf/0x1c0 __generic_file_write_iter+0x19c/0x1d0 ocfs2_file_write_iter+0x589/0x1360 [ocfs2] __vfs_write+0xb8/0x110 vfs_write+0xa9/0x1b0 SyS_write+0x46/0xb0 system_call_fastpath+0x18/0xd7 Code: ff ff 8b 75 b8 39 75 b0 8b 45 c8 89 45 98 0f 84 e5 fe ff ff 45 8b 74 24 18 41 8b 54 24 1c e9 56 fc ff ff 85 c0 0f 85 48 ff ff ff <0f> 0b 48 8b 05 cf c3 de ff 48 ba 00 00 00 00 00 00 00 10 48 85 RIP __ocfs2_resv_find_window+0x498/0x760 [ocfs2] RSP ---[ end trace 566f07529f2edf3c ]--- Kernel panic - not syncing: Fatal exception Kernel Offset: disabled Link: http://lkml.kernel.org/r/20181121020023.3034-2-junxiao.bi@oracle.com Signed-off-by: Junxiao Bi Reviewed-by: Yiwen Jiang Acked-by: Joseph Qi Cc: Jun Piao Cc: Mark Fasheh Cc: Joel Becker Cc: Changwei Ge Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9e6aea22802b5684c7e1d69822aeb0844dd01953 Author: Larry Chen Date: Fri Dec 28 00:32:46 2018 -0800 ocfs2: improve ocfs2 Makefile Included file path was hard-wired in the ocfs2 makefile, which might causes some confusion when compiling ocfs2 as an external module. Say if we compile ocfs2 module as following. cp -r /kernel/tree/fs/ocfs2 /other/dir/ocfs2 cd /other/dir/ocfs2 make -C /path/to/kernel_source M=`pwd` modules Acutally, the compiler wil try to find included file in /kernel/tree/fs/ocfs2, rather than the directory /other/dir/ocfs2. To fix this little bug, we introduce the var $(src) provided by kbuild. $(src) means the absolute path of the running kbuild file. Link: http://lkml.kernel.org/r/20181108085546.15149-1-lchen@suse.com Signed-off-by: Larry Chen Reviewed-by: Andrew Morton Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Joseph Qi Cc: Changwei Ge Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dec5b0d4a99f5d4be02461ac0c7f62904509b88b Author: zhong jiang Date: Fri Dec 28 00:32:43 2018 -0800 ocfs2: remove set but not used variable 'lastzero' lastzero is not used after setting its value. It is safe to remove the unused variable. Link: http://lkml.kernel.org/r/1540296942-24533-1-git-send-email-zhongjiang@huawei.com Signed-off-by: zhong jiang Reviewed-by: Andrew Morton Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Joseph Qi Cc: Changwei Ge Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cb6a8fd7a6bfa0999f726a9cdb506b3345d937b6 Author: zhong jiang Date: Fri Dec 28 00:32:39 2018 -0800 ocfs2: dlmfs: remove set but not used variable 'status' status is not used after setting its value. It is safe to remove the unused variable. Link: http://lkml.kernel.org/r/1540300179-26697-1-git-send-email-zhongjiang@huawei.com Signed-off-by: zhong jiang Reviewed-by: Jun Piao Acked-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 874b1ef0ef5117c071f431fdebbf388eccbcc1f2 Author: Jia Guo Date: Fri Dec 28 00:32:35 2018 -0800 ocfs2: optimize the reading of heartbeat data Reading heartbeat data from lowest node rather than from zero, in cases where the node is not defined from zero, can reduce the number of sectors read. Here is a simple test data obtained with 'iostat -dmx dm-5 2', with two nodes in the cluster, node number 10, 20, respectively. Before optimization: Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util dm-5 0.00 0.00 0.50 0.50 0.01 0.00 11.00 0.00 1.00 1.00 1.00 1.50 0.15 After the optimization: Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await svctm %util dm-5 0.00 0.00 0.50 0.50 0.00 0.00 6.00 0.00 0.50 1.00 0.00 0.50 0.05 Link: http://lkml.kernel.org/r/99fe4988-69ac-3615-a218-3042fe6fbe72@huawei.com Signed-off-by: Jia Guo Reviewed-by: Jun Piao Reviewed-by: Yiwen Jiang Acked-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a9ee3a63dbfff5237bc682b88c02d91a3c798e35 Author: Qian Cai Date: Fri Dec 28 00:32:32 2018 -0800 debugobjects: call debug_objects_mem_init eariler The current value of the early boot static pool size, 1024 is not big enough for systems with large number of CPUs with timer or/and workqueue objects selected. As the results, systems have 60+ CPUs with both timer and workqueue objects enabled could trigger "ODEBUG: Out of memory. ODEBUG disabled". Some debug objects are allocated during the early boot. Enabling some options like timers or workqueue objects may increase the size required significantly with large number of CPUs. For example, CONFIG_DEBUG_OBJECTS_TIMERS: No. CPUs x 2 (worker pool) objects: start_kernel workqueue_init_early init_worker_pool init_timer_key debug_object_init plus No. CPUs objects (CONFIG_HIGH_RES_TIMERS): sched_init hrtick_rq_init hrtimer_init CONFIG_DEBUG_OBJECTS_WORK: No. CPUs objects: vmalloc_init __init_work plus No. CPUs x 6 (workqueue) objects: workqueue_init_early alloc_workqueue __alloc_workqueue_key alloc_and_link_pwqs init_pwq Also, plus No. CPUs objects: perf_event_init __init_srcu_struct init_srcu_struct_fields init_srcu_struct_nodes __init_work However, none of the things are actually used or required before debug_objects_mem_init() is invoked, so just move the call right before vmalloc_init(). According to tglx, "the reason why the call is at this place in start_kernel() is historical. It's because back in the days when debugobjects were added the memory allocator was enabled way later than today." Link: http://lkml.kernel.org/r/20181126102407.1836-1-cai@gmx.us Signed-off-by: Qian Cai Suggested-by: Thomas Gleixner Cc: Waiman Long Cc: Yang Shi Cc: Arnd Bergmann Cc: Catalin Marinas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4494ce4fb4ff42946f48bbc8a5ac55ee18dca600 Author: Kuninori Morimoto Date: Fri Dec 28 00:32:28 2018 -0800 sh: lib: convert to SPDX identifiers Update license to use SPDX-License-Identifier instead of verbose license text. Link: http://lkml.kernel.org/r/871s6wcswb.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman Cc: Yoshinori Sato Cc: Rich Felker Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5933f6d220403b55772d2caf48a9a39d777fd630 Author: Kuninori Morimoto Date: Fri Dec 28 00:32:24 2018 -0800 sh: kernel: convert to SPDX identifiers Update license to use SPDX-License-Identifier instead of verbose license text. Link: http://lkml.kernel.org/r/8736rccswn.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b0a148f80c1526951d6d196ded1d0c93158c2e25 Author: Kuninori Morimoto Date: Fri Dec 28 00:32:21 2018 -0800 sh: cpu: convert to SPDX identifiers Update license to use SPDX-License-Identifier instead of verbose license text. Link: http://lkml.kernel.org/r/874lbscswy.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 176ce1b7b0f6469eac05677e6f2ae9624e7bf879 Author: Kuninori Morimoto Date: Fri Dec 28 00:32:18 2018 -0800 sh: shmobile: convert to SPDX identifiers Update license to use SPDX-License-Identifier instead of verbose license text. Link: http://lkml.kernel.org/r/875zw8csxa.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 82e1d03766a2b5d088f66a938ce8e1605a24d327 Author: Kuninori Morimoto Date: Fri Dec 28 00:32:14 2018 -0800 sh: sh5: convert to SPDX identifiers Update license to use SPDX-License-Identifier instead of verbose license text. Link: http://lkml.kernel.org/r/877egocsxl.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit add5ca2c48870cc6632179eccd0f0048a03fe43f Author: Kuninori Morimoto Date: Fri Dec 28 00:32:11 2018 -0800 sh: sh4a: convert to SPDX identifiers Update license to use SPDX-License-Identifier instead of verbose license text. Link: http://lkml.kernel.org/r/878t14csxy.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6ecc0a4dbb076ef658cb5e140a7560d6326c8240 Author: Kuninori Morimoto Date: Fri Dec 28 00:32:07 2018 -0800 sh: sh4: convert to SPDX identifiers Update license to use SPDX-License-Identifier instead of verbose license text, excepting ${LINUX}/arch/sh/kernel/cpu/sh4/softfloat.c which is not GPL license Link: http://lkml.kernel.org/r/87a7lkcsya.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5ab5d57cc0c6a4c36fcd52588734f8ab706516f0 Author: Kuninori Morimoto Date: Fri Dec 28 00:32:03 2018 -0800 sh: sh3: convert to SPDX identifiers Update license to use SPDX-License-Identifier instead of verbose license text. Link: http://lkml.kernel.org/r/87bm60csyl.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 234a0538240caa05f12ec4ef7a573b173ab7ea57 Author: Kuninori Morimoto Date: Fri Dec 28 00:32:00 2018 -0800 sh: sh2a: convert to SPDX identifiers Update license to use SPDX-License-Identifier instead of verbose license text. Link: http://lkml.kernel.org/r/87d0qgcsz8.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 47d11326259baaed7659b47e3a49d31715719793 Author: Kuninori Morimoto Date: Fri Dec 28 00:31:56 2018 -0800 sh: sh2: convert to SPDX identifiers Update license to use SPDX-License-Identifier instead of verbose license text. Link: http://lkml.kernel.org/r/87efawcszk.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6a0abce4c4cce0890e2c930b960b9a05c8c6e5da Author: Kuninori Morimoto Date: Fri Dec 28 00:31:53 2018 -0800 sh: include: convert to SPDX identifiers Update license to use SPDX-License-Identifier instead of verbose license text. Link: http://lkml.kernel.org/r/87ftvccszx.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ff4a7481c3898ffc3cc271d6aca431d190c37247 Author: Kuninori Morimoto Date: Fri Dec 28 00:31:49 2018 -0800 sh: drivers: convert to SPDX identifiers Update license to use SPDX-License-Identifier instead of verbose license text. As original license mentioned, it is GPL-2.0 in SPDX. Then, MODULE_LICENSE() should be "GPL v2" instead of "GPL". See ${LINUX}/include/linux/module.h "GPL" [GNU Public License v2 or later] "GPL v2" [GNU Public License v2] Link: http://lkml.kernel.org/r/87h8fsct0a.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit aaf9128abcb8314eb9756db3e32d667c5161156f Author: Kuninori Morimoto Date: Fri Dec 28 00:31:46 2018 -0800 sh: boards: convert to SPDX identifiers Update license to use SPDX-License-Identifier instead of verbose license text. Link: http://lkml.kernel.org/r/87in08ct0n.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman Cc: Rich Felker Cc: Yoshinori Sato Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ffa6daa9937a108faf9e6b9f9cdcedb36a9e0d63 Author: YueHaibing Date: Fri Dec 28 00:31:42 2018 -0800 arch/sh/boards/mach-kfr2r09/setup.c: drop pointless static qualifier in kfr2r09_usb0_gadget_setup() There is no need to have the 'struct clk *camera_clk' variable static since a new value is always assigned before use. Link: http://lkml.kernel.org/r/1543628631-99957-1-git-send-email-yuehaibing@huawei.com Signed-off-by: YueHaibing Reviewed-by: Andrew Morton Cc: Yoshinori Sato Cc: Rich Felker Cc: Jacopo Mondi Cc: "Miquel Raynal" Cc: Randy Dunlap Cc: Masahiro Yamada Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 440e7b379f91acd245d5c8de94d533f40f5dffb3 Author: Randy Dunlap Date: Fri Dec 28 00:31:39 2018 -0800 arch/sh/boards/mach-kfr2r09/setup.c: fix struct mtd_oob_ops build warning arch/sh/boards/mach-kfr2r09/setup.c does not need to #include , and doing so causes a build warning, so drop that header file. In file included from ../arch/sh/boards/mach-kfr2r09/setup.c:28: ../include/linux/mtd/onenand.h:225:12: warning: 'struct mtd_oob_ops' declared inside parameter list will not be visible outside of this definition or declaration struct mtd_oob_ops *ops); Link: http://lkml.kernel.org/r/702f0a25-c63e-6912-4640-6ab0f00afbc7@infradead.org Fixes: f3590dc32974 ("media: arch: sh: kfr2r09: Use new renesas-ceu camera driver") Signed-off-by: Randy Dunlap Reported-by: Geert Uytterhoeven Suggested-by: Miquel Raynal Reviewed-by: Miquel Raynal Cc: Yoshinori Sato Cc: Rich Felker Cc: Jacopo Mondi Cc: Magnus Damm Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cd68a52533380213beb95c5bc41d8f9d7e4aec1f Author: Kirill Tkhai Date: Fri Dec 28 00:31:35 2018 -0800 scripts/tags.sh: add more declarations New declarations and identifier (__always_inline). Link: http://lkml.kernel.org/r/154505048571.504.18330420599768007443.stgit@localhost.localdomain Signed-off-by: Kirill Tkhai Cc: Masahiro Yamada Cc: Constantine Shulyupin Cc: Kirill Tkhai Cc: Joey Pabalinas Cc: Matthew Wilcox Cc: Arend van Spriel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b72231eb708459ea9171eb21201a0701fb39adfb Author: Thierry Reding Date: Fri Dec 28 00:31:32 2018 -0800 scripts: add spdxcheck.py self test Add a script that will run spdxcheck.py through a couple of self tests to simplify validation in the future. The tests are run for both Python 2 and Python 3 to make sure all changes to the script remain compatible across both versions. The script tests a regular text file (Makefile) for basic sanity checks and then runs it on a binary file (Documentation/logo.gif) to make sure it works in both cases. It also tests opening files passed on the command line as well as piped files read from standard input. Finally a run on the complete tree will be performed to catch any other potential issues. Link: http://lkml.kernel.org/r/20181212131210.28024-2-thierry.reding@gmail.com Signed-off-by: Thierry Reding Thomas Gleixner Cc: Jonathan Corbet Cc: Joe Perches Cc: Jeremy Cline Cc: Uwe Kleine-König Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 919e9d39e722dc79d7d051e5bda503423fe6c953 Author: Qian Cai Date: Fri Dec 28 00:31:28 2018 -0800 scripts/checkstack.pl: dynamic stack growth for aarch64 This is to track dynamic amount of stack growth for aarch64, so it is possible to print out offensive functions that may consume too much stack. For example, 0xffff2000084d1270 try_to_unmap_one [vmlinux]: Dynamic (0xcf0) 0xffff200008538358 migrate_page_move_mapping [vmlinux]: Dynamic (0xc60) 0xffff2000081276c8 copy_process.isra.2 [vmlinux]: Dynamic (0xb20) 0xffff200008424958 show_free_areas [vmlinux]: Dynamic (0xb40) 0xffff200008545178 __split_huge_pmd_locked [vmlinux]: Dynamic (0xb30) 0xffff200008555120 collapse_shmem [vmlinux]: Dynamic (0xbc0) 0xffff20000862e0d0 do_direct_IO [vmlinux]: Dynamic (0xb70) 0xffff200008cc0aa0 md_do_sync [vmlinux]: Dynamic (0xb90) Link: http://lkml.kernel.org/r/20181208025143.39363-1-cai@lca.pw Signed-off-by: Qian Cai Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 67a28de47faa83585dd644bd4c31e5a1d9346c50 Author: Marc Zyngier Date: Fri Dec 28 00:31:25 2018 -0800 scripts/decode_stacktrace: only strip base path when a prefix of the path Running something like: decodecode vmlinux . leads to interested results where not only the leading "." gets stripped from the displayed paths, but also anywhere in the string, displaying something like: kvm_vcpu_check_block (arch/arm64/kvm/virt/kvm/kvm_mainc:2141) which doesn't help further processing. Fix it by only stripping the base path if it is a prefix of the path. Link: http://lkml.kernel.org/r/20181210174659.31054-3-marc.zyngier@arm.com Signed-off-by: Marc Zyngier Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c5cfb62f2bdf51c71ab4b8b33271beab34096c71 Author: Marc Zyngier Date: Fri Dec 28 00:31:21 2018 -0800 scripts/decodecode: set ARCH when running natively on arm/arm64 When running decodecode natively on arm64, ARCH is likely not to be set, and we end-up with .4byte instead of .inst when generating the disassembly. Similar effects would occur if running natively on a 32bit ARM platform, although that's even less popular. A simple workaround is to populate ARCH when it is not set and that we're running on an arm/arm64 system. Link: http://lkml.kernel.org/r/20181210174659.31054-2-marc.zyngier@arm.com Signed-off-by: Marc Zyngier Acked-by: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e0b2475a3f36a7a0a001fe552145055da1daf245 Author: Rasmus Villemoes Date: Fri Dec 28 00:31:18 2018 -0800 bloat-o-meter: ignore __addressable_ symbols Since __LINE__ is part of the symbol created by __ADDRESSABLE, almost any change causes those symbols to disappear and get reincarnated, e.g. add/remove: 4/4 grow/shrink: 0/3 up/down: 32/-171 (-139) Function old new delta __addressable_tracing_set_default_clock8649 - 8 +8 __addressable_tracer_init_tracefs8631 - 8 +8 __addressable_ftrace_dump8383 - 8 +8 __addressable_clear_boot_tracer8632 - 8 +8 __addressable_tracing_set_default_clock8650 8 - -8 __addressable_tracer_init_tracefs8632 8 - -8 __addressable_ftrace_dump8384 8 - -8 __addressable_clear_boot_tracer8633 8 - -8 trace_default_header 663 642 -21 tracing_mark_raw_write 406 355 -51 tracing_mark_write 624 557 -67 Total: Before=63889, After=63750, chg -0.22% They're small and in .discard, so ignore them, leading to more useful add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-139 (-139) Function old new delta trace_default_header 663 642 -21 tracing_mark_raw_write 406 355 -51 tracing_mark_write 624 557 -67 Total: Before=63721, After=63582, chg -0.22% Link: http://lkml.kernel.org/r/20181102210030.8383-1-linux@rasmusvillemoes.dk Signed-off-by: Rasmus Villemoes Reviewed-by: Andy Shevchenko Cc: Alexey Dobriyan Cc: Ingo Molnar Cc: Dominik Brodowski Cc: Maninder Singh Cc: Matteo Croce Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e886bf9d9abedf8236464bfd21bc5707748b4a02 Author: Andrey Konovalov Date: Fri Dec 28 00:31:14 2018 -0800 kasan: add SPDX-License-Identifier mark to source files This patch adds a "SPDX-License-Identifier: GPL-2.0" mark to all source files under mm/kasan. Link: http://lkml.kernel.org/r/bce2d1e618afa5142e81961ab8fa4b4165337380.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Cc: Christoph Lameter Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b3b0e6accb5b3d249760e071f2cf77f696961158 Author: Andrey Konovalov Date: Fri Dec 28 00:31:10 2018 -0800 kasan: update documentation This patch updates KASAN documentation to reflect the addition of the new tag-based mode. Link: http://lkml.kernel.org/r/aabef9de317c54b8a3919a4946ce534c6576726a.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Cc: Christoph Lameter Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2d4acb90878b076b8c735500121f73e32756ddce Author: Andrey Konovalov Date: Fri Dec 28 00:31:07 2018 -0800 kasan, arm64: select HAVE_ARCH_KASAN_SW_TAGS Now, that all the necessary infrastructure code has been introduced, select HAVE_ARCH_KASAN_SW_TAGS for arm64 to enable software tag-based KASAN mode. Link: http://lkml.kernel.org/r/25abce9a21d0c1df2d9d72488aced418c3465d7b.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Will Deacon Cc: Andrey Ryabinin Cc: Christoph Lameter Cc: Dmitry Vyukov Cc: Mark Rutland Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 66afc7f1e07a1db74453be9167ac0d1205653854 Author: Andrey Konovalov Date: Fri Dec 28 00:31:01 2018 -0800 kasan: add __must_check annotations to kasan hooks This patch adds __must_check annotations to kasan hooks that return a pointer to make sure that a tagged pointer always gets propagated. Link: http://lkml.kernel.org/r/03b269c5e453945f724bfca3159d4e1333a8fb1c.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Suggested-by: Andrey Ryabinin Cc: Christoph Lameter Cc: Dmitry Vyukov Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2813b9c0296259fb11e75c839bab2d958ba4f96c Author: Andrey Konovalov Date: Fri Dec 28 00:30:57 2018 -0800 kasan, mm, arm64: tag non slab memory allocated via pagealloc Tag-based KASAN doesn't check memory accesses through pointers tagged with 0xff. When page_address is used to get pointer to memory that corresponds to some page, the tag of the resulting pointer gets set to 0xff, even though the allocated memory might have been tagged differently. For slab pages it's impossible to recover the correct tag to return from page_address, since the page might contain multiple slab objects tagged with different values, and we can't know in advance which one of them is going to get accessed. For non slab pages however, we can recover the tag in page_address, since the whole page was marked with the same tag. This patch adds tagging to non slab memory allocated with pagealloc. To set the tag of the pointer returned from page_address, the tag gets stored to page->flags when the memory gets allocated. Link: http://lkml.kernel.org/r/d758ddcef46a5abc9970182b9137e2fbee202a2c.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Acked-by: Will Deacon Cc: Christoph Lameter Cc: Mark Rutland Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 41eea9cd239c5b3fff726894f85c97f60e5799a3 Author: Andrey Konovalov Date: Fri Dec 28 00:30:54 2018 -0800 kasan, arm64: add brk handler for inline instrumentation Tag-based KASAN inline instrumentation mode (which embeds checks of shadow memory into the generated code, instead of inserting a callback) generates a brk instruction when a tag mismatch is detected. This commit adds a tag-based KASAN specific brk handler, that decodes the immediate value passed to the brk instructions (to extract information about the memory access that triggered the mismatch), reads the register values (x0 contains the guilty address) and reports the bug. Link: http://lkml.kernel.org/r/c91fe7684070e34dc34b419e6b69498f4dcacc2d.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Acked-by: Will Deacon Cc: Christoph Lameter Cc: Mark Rutland Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7f94ffbc4c6a1bdb51d39965e4f2acaa19bd798f Author: Andrey Konovalov Date: Fri Dec 28 00:30:50 2018 -0800 kasan: add hooks implementation for tag-based mode This commit adds tag-based KASAN specific hooks implementation and adjusts common generic and tag-based KASAN ones. 1. When a new slab cache is created, tag-based KASAN rounds up the size of the objects in this cache to KASAN_SHADOW_SCALE_SIZE (== 16). 2. On each kmalloc tag-based KASAN generates a random tag, sets the shadow memory, that corresponds to this object to this tag, and embeds this tag value into the top byte of the returned pointer. 3. On each kfree tag-based KASAN poisons the shadow memory with a random tag to allow detection of use-after-free bugs. The rest of the logic of the hook implementation is very much similar to the one provided by generic KASAN. Tag-based KASAN saves allocation and free stack metadata to the slab object the same way generic KASAN does. Link: http://lkml.kernel.org/r/bda78069e3b8422039794050ddcb2d53d053ed41.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Cc: Christoph Lameter Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5b7c4148222d7acaa1612e5eec84fc66c88d54f3 Author: Andrey Konovalov Date: Fri Dec 28 00:30:46 2018 -0800 mm: move obj_to_index to include/linux/slab_def.h While with SLUB we can actually preassign tags for caches with contructors and store them in pointers in the freelist, SLAB doesn't allow that since the freelist is stored as an array of indexes, so there are no pointers to store the tags. Instead we compute the tag twice, once when a slab is created before calling the constructor and then again each time when an object is allocated with kmalloc. Tag is computed simply by taking the lowest byte of the index that corresponds to the object. However in kasan_kmalloc we only have access to the objects pointer, so we need a way to find out which index this object corresponds to. This patch moves obj_to_index from slab.c to include/linux/slab_def.h to be reused by KASAN. Link: http://lkml.kernel.org/r/c02cd9e574cfd93858e43ac94b05e38f891fef64.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Acked-by: Christoph Lameter Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 121e8f81d38cc43834195722d0768340dc130a33 Author: Andrey Konovalov Date: Fri Dec 28 00:30:42 2018 -0800 kasan: add bug reporting routines for tag-based mode This commit adds rountines, that print tag-based KASAN error reports. Those are quite similar to generic KASAN, the difference is: 1. The way tag-based KASAN finds the first bad shadow cell (with a mismatching tag). Tag-based KASAN compares memory tags from the shadow memory to the pointer tag. 2. Tag-based KASAN reports all bugs with the "KASAN: invalid-access" header. Also simplify generic KASAN find_first_bad_addr. Link: http://lkml.kernel.org/r/aee6897b1bd077732a315fd84c6b4f234dbfdfcb.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Cc: Christoph Lameter Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 11cd3cd69a256a353dd1a249b48ccd727d945952 Author: Andrey Konovalov Date: Fri Dec 28 00:30:38 2018 -0800 kasan: split out generic_report.c from report.c Move generic KASAN specific error reporting routines to generic_report.c without any functional changes, leaving common error reporting code in report.c to be later reused by tag-based KASAN. Link: http://lkml.kernel.org/r/ba48c32f8e5aefedee78998ccff0413bee9e0f5b.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Cc: Christoph Lameter Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 772a2fa50ffb2f4282be8436da6e70530a2ac63c Author: Andrey Konovalov Date: Fri Dec 28 00:30:35 2018 -0800 kasan, mm: perform untagged pointers comparison in krealloc The krealloc function checks where the same buffer was reused or a new one allocated by comparing kernel pointers. Tag-based KASAN changes memory tag on the krealloc'ed chunk of memory and therefore also changes the pointer tag of the returned pointer. Therefore we need to perform comparison on untagged (with tags reset) pointers to check whether it's the same memory region or not. Link: http://lkml.kernel.org/r/14f6190d7846186a3506cd66d82446646fe65090.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Cc: Christoph Lameter Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 21696c1613244f2ad4e9216c4f6e7804831a992c Author: Andrey Konovalov Date: Fri Dec 28 00:30:31 2018 -0800 kasan, arm64: enable top byte ignore for the kernel Tag-based KASAN uses the Top Byte Ignore feature of arm64 CPUs to store a pointer tag in the top byte of each pointer. This commit enables the TCR_TBI1 bit, which enables Top Byte Ignore for the kernel, when tag-based KASAN is used. Link: http://lkml.kernel.org/r/f51eca084c8cdb2f3a55195fe342dc8953b7aead.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Acked-by: Will Deacon Cc: Christoph Lameter Cc: Mark Rutland Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 356607f21e603523d4b0a4f918722845214fc6a8 Author: Andrey Konovalov Date: Fri Dec 28 00:30:27 2018 -0800 kasan, arm64: fix up fault handling logic Right now arm64 fault handling code removes pointer tags from addresses covered by TTBR0 in faults taken from both EL0 and EL1, but doesn't do that for pointers covered by TTBR1. This patch adds two helper functions is_ttbr0_addr() and is_ttbr1_addr(), where the latter one accounts for the fact that TTBR1 pointers might be tagged when tag-based KASAN is in use, and uses these helper functions to perform pointer checks in arch/arm64/mm/fault.c. Link: http://lkml.kernel.org/r/3f349b0e9e48b5df3298a6b4ae0634332274494a.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Suggested-by: Mark Rutland Acked-by: Will Deacon Cc: Andrey Ryabinin Cc: Christoph Lameter Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4d176711ea7a8d4873e7157ac6ab242ade3ba351 Author: Andrey Konovalov Date: Fri Dec 28 00:30:23 2018 -0800 kasan: preassign tags to objects with ctors or SLAB_TYPESAFE_BY_RCU An object constructor can initialize pointers within this objects based on the address of the object. Since the object address might be tagged, we need to assign a tag before calling constructor. The implemented approach is to assign tags to objects with constructors when a slab is allocated and call constructors once as usual. The downside is that such object would always have the same tag when it is reallocated, so we won't catch use-after-frees on it. Also pressign tags for objects from SLAB_TYPESAFE_BY_RCU caches, since they can be validy accessed after having been freed. Link: http://lkml.kernel.org/r/f158a8a74a031d66f0a9398a5b0ed453c37ba09a.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Cc: Christoph Lameter Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e71fe3f921aeb27f0c65ee7ebfdde7f8c7d60b74 Author: Andrey Konovalov Date: Fri Dec 28 00:30:20 2018 -0800 kasan, arm64: untag address in _virt_addr_is_linear virt_addr_is_linear (which is used by virt_addr_valid) assumes that the top byte of the address is 0xff, which isn't always the case with tag-based KASAN. This patch resets the tag in this macro. Link: http://lkml.kernel.org/r/df73a37dd5ed37f4deaf77bc718e9f2e590e69b1.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Acked-by: Will Deacon Cc: Christoph Lameter Cc: Mark Rutland Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3c9e3aa11094e821aff4a8f6812a6e032293dbc0 Author: Andrey Konovalov Date: Fri Dec 28 00:30:16 2018 -0800 kasan: add tag related helper functions This commit adds a few helper functions, that are meant to be used to work with tags embedded in the top byte of kernel pointers: to set, to get or to reset the top byte. Link: http://lkml.kernel.org/r/f6c6437bb8e143bc44f42c3c259c62e734be7935.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Andrey Ryabinin Cc: Christoph Lameter Cc: Dmitry Vyukov Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9c23f84723d2bb5611a973f56f0952fa74f048f3 Author: Andrey Konovalov Date: Fri Dec 28 00:30:12 2018 -0800 arm64: move untagged_addr macro from uaccess.h to memory.h Move the untagged_addr() macro from arch/arm64/include/asm/uaccess.h to arch/arm64/include/asm/memory.h to be later reused by KASAN. Also make the untagged_addr() macro accept all kinds of address types (void *, unsigned long, etc.). This allows not to specify type casts in each place where the macro is used. This is done by using __typeof__. Link: http://lkml.kernel.org/r/2e9ef8d2ed594106eca514b268365b5419113f6a.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Acked-by: Mark Rutland Acked-by: Will Deacon Cc: Andrey Ryabinin Cc: Christoph Lameter Cc: Dmitry Vyukov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 080eb83f54cf5b96ae5b6ce3c1896e35c341aff9 Author: Andrey Konovalov Date: Fri Dec 28 00:30:09 2018 -0800 kasan: initialize shadow to 0xff for tag-based mode A tag-based KASAN shadow memory cell contains a memory tag, that corresponds to the tag in the top byte of the pointer, that points to that memory. The native top byte value of kernel pointers is 0xff, so with tag-based KASAN we need to initialize shadow memory to 0xff. [cai@lca.pw: arm64: skip kmemleak for KASAN again\ Link: http://lkml.kernel.org/r/20181226020550.63712-1-cai@lca.pw Link: http://lkml.kernel.org/r/5cc1b789aad7c99cf4f3ec5b328b147ad53edb40.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Cc: Christoph Lameter Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9577dd7486487722ed8f0773243223f108e8089f Author: Andrey Konovalov Date: Fri Dec 28 00:30:01 2018 -0800 kasan: rename kasan_zero_page to kasan_early_shadow_page With tag based KASAN mode the early shadow value is 0xff and not 0x00, so this patch renames kasan_zero_(page|pte|pmd|pud|p4d) to kasan_early_shadow_(page|pte|pmd|pud|p4d) to avoid confusion. Link: http://lkml.kernel.org/r/3fed313280ebf4f88645f5b89ccbc066d320e177.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Suggested-by: Mark Rutland Cc: Andrey Ryabinin Cc: Christoph Lameter Cc: Dmitry Vyukov Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b2f557eae9ed0ab2b612ce9ce7e3f06174a83e76 Author: Andrey Konovalov Date: Fri Dec 28 00:29:57 2018 -0800 kasan, arm64: adjust shadow size for tag-based mode Tag-based KASAN uses 1 shadow byte for 16 bytes of kernel memory, so it requires 1/16th of the kernel virtual address space for the shadow memory. This commit sets KASAN_SHADOW_SCALE_SHIFT to 4 when the tag-based KASAN mode is enabled. Link: http://lkml.kernel.org/r/308b6bd49f756bb5e533be93c6f085ba99b30339.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Acked-by: Will Deacon Cc: Christoph Lameter Cc: Mark Rutland Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2bd926b439b4cb6b9ed240a9781cd01958b53d85 Author: Andrey Konovalov Date: Fri Dec 28 00:29:53 2018 -0800 kasan: add CONFIG_KASAN_GENERIC and CONFIG_KASAN_SW_TAGS This commit splits the current CONFIG_KASAN config option into two: 1. CONFIG_KASAN_GENERIC, that enables the generic KASAN mode (the one that exists now); 2. CONFIG_KASAN_SW_TAGS, that enables the software tag-based KASAN mode. The name CONFIG_KASAN_SW_TAGS is chosen as in the future we will have another hardware tag-based KASAN mode, that will rely on hardware memory tagging support in arm64. With CONFIG_KASAN_SW_TAGS enabled, compiler options are changed to instrument kernel files with -fsantize=kernel-hwaddress (except the ones for which KASAN_SANITIZE := n is set). Both CONFIG_KASAN_GENERIC and CONFIG_KASAN_SW_TAGS support both CONFIG_KASAN_INLINE and CONFIG_KASAN_OUTLINE instrumentation modes. This commit also adds empty placeholder (for now) implementation of tag-based KASAN specific hooks inserted by the compiler and adjusts common hooks implementation. While this commit adds the CONFIG_KASAN_SW_TAGS config option, this option is not selectable, as it depends on HAVE_ARCH_KASAN_SW_TAGS, which we will enable once all the infrastracture code has been added. Link: http://lkml.kernel.org/r/b2550106eb8a68b10fefbabce820910b115aa853.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Cc: Christoph Lameter Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b938fcf42739de8270e6ea41593722929c8a7dd0 Author: Andrey Konovalov Date: Fri Dec 28 00:29:49 2018 -0800 kasan: rename source files to reflect the new naming scheme We now have two KASAN modes: generic KASAN and tag-based KASAN. Rename kasan.c to generic.c to reflect that. Also rename kasan_init.c to init.c as it contains initialization code for both KASAN modes. Link: http://lkml.kernel.org/r/88c6fd2a883e459e6242030497230e5fb0d44d44.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Cc: Christoph Lameter Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bffa986c6f80e39d9903015fc7d0d99a66bbf559 Author: Andrey Konovalov Date: Fri Dec 28 00:29:45 2018 -0800 kasan: move common generic and tag-based code to common.c Tag-based KASAN reuses a significant part of the generic KASAN code, so move the common parts to common.c without any functional changes. Link: http://lkml.kernel.org/r/114064d002356e03bb8cc91f7835e20dc61b51d9.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Cc: Christoph Lameter Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 12b22386998ccf97497a49c88f9579cf9c0dee55 Author: Andrey Konovalov Date: Fri Dec 28 00:29:41 2018 -0800 kasan, slub: handle pointer tags in early_kmem_cache_node_alloc The previous patch updated KASAN hooks signatures and their usage in SLAB and SLUB code, except for the early_kmem_cache_node_alloc function. This patch handles that function separately, as it requires to reorder some of the initialization code to correctly propagate a tagged pointer in case a tag is assigned by kasan_kmalloc. Link: http://lkml.kernel.org/r/fc8d0fdcf733a7a52e8d0daaa650f4736a57de8c.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Cc: Andrey Ryabinin Cc: Christoph Lameter Cc: Dmitry Vyukov Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0116523cfffa62aeb5aa3b85ce7419f3dae0c1b8 Author: Andrey Konovalov Date: Fri Dec 28 00:29:37 2018 -0800 kasan, mm: change hooks signatures Patch series "kasan: add software tag-based mode for arm64", v13. This patchset adds a new software tag-based mode to KASAN [1]. (Initially this mode was called KHWASAN, but it got renamed, see the naming rationale at the end of this section). The plan is to implement HWASan [2] for the kernel with the incentive, that it's going to have comparable to KASAN performance, but in the same time consume much less memory, trading that off for somewhat imprecise bug detection and being supported only for arm64. The underlying ideas of the approach used by software tag-based KASAN are: 1. By using the Top Byte Ignore (TBI) arm64 CPU feature, we can store pointer tags in the top byte of each kernel pointer. 2. Using shadow memory, we can store memory tags for each chunk of kernel memory. 3. On each memory allocation, we can generate a random tag, embed it into the returned pointer and set the memory tags that correspond to this chunk of memory to the same value. 4. By using compiler instrumentation, before each memory access we can add a check that the pointer tag matches the tag of the memory that is being accessed. 5. On a tag mismatch we report an error. With this patchset the existing KASAN mode gets renamed to generic KASAN, with the word "generic" meaning that the implementation can be supported by any architecture as it is purely software. The new mode this patchset adds is called software tag-based KASAN. The word "tag-based" refers to the fact that this mode uses tags embedded into the top byte of kernel pointers and the TBI arm64 CPU feature that allows to dereference such pointers. The word "software" here means that shadow memory manipulation and tag checking on pointer dereference is done in software. As it is the only tag-based implementation right now, "software tag-based" KASAN is sometimes referred to as simply "tag-based" in this patchset. A potential expansion of this mode is a hardware tag-based mode, which would use hardware memory tagging support (announced by Arm [3]) instead of compiler instrumentation and manual shadow memory manipulation. Same as generic KASAN, software tag-based KASAN is strictly a debugging feature. [1] https://www.kernel.org/doc/html/latest/dev-tools/kasan.html [2] http://clang.llvm.org/docs/HardwareAssistedAddressSanitizerDesign.html [3] https://community.arm.com/processors/b/blog/posts/arm-a-profile-architecture-2018-developments-armv85a ====== Rationale On mobile devices generic KASAN's memory usage is significant problem. One of the main reasons to have tag-based KASAN is to be able to perform a similar set of checks as the generic one does, but with lower memory requirements. Comment from Vishwath Mohan : I don't have data on-hand, but anecdotally both ASAN and KASAN have proven problematic to enable for environments that don't tolerate the increased memory pressure well. This includes (a) Low-memory form factors - Wear, TV, Things, lower-tier phones like Go, (c) Connected components like Pixel's visual core [1]. These are both places I'd love to have a low(er) memory footprint option at my disposal. Comment from Evgenii Stepanov : Looking at a live Android device under load, slab (according to /proc/meminfo) + kernel stack take 8-10% available RAM (~350MB). KASAN's overhead of 2x - 3x on top of it is not insignificant. Not having this overhead enables near-production use - ex. running KASAN/KHWASAN kernel on a personal, daily-use device to catch bugs that do not reproduce in test configuration. These are the ones that often cost the most engineering time to track down. CPU overhead is bad, but generally tolerable. RAM is critical, in our experience. Once it gets low enough, OOM-killer makes your life miserable. [1] https://www.blog.google/products/pixel/pixel-visual-core-image-processing-and-machine-learning-pixel-2/ ====== Technical details Software tag-based KASAN mode is implemented in a very similar way to the generic one. This patchset essentially does the following: 1. TCR_TBI1 is set to enable Top Byte Ignore. 2. Shadow memory is used (with a different scale, 1:16, so each shadow byte corresponds to 16 bytes of kernel memory) to store memory tags. 3. All slab objects are aligned to shadow scale, which is 16 bytes. 4. All pointers returned from the slab allocator are tagged with a random tag and the corresponding shadow memory is poisoned with the same value. 5. Compiler instrumentation is used to insert tag checks. Either by calling callbacks or by inlining them (CONFIG_KASAN_OUTLINE and CONFIG_KASAN_INLINE flags are reused). 6. When a tag mismatch is detected in callback instrumentation mode KASAN simply prints a bug report. In case of inline instrumentation, clang inserts a brk instruction, and KASAN has it's own brk handler, which reports the bug. 7. The memory in between slab objects is marked with a reserved tag, and acts as a redzone. 8. When a slab object is freed it's marked with a reserved tag. Bug detection is imprecise for two reasons: 1. We won't catch some small out-of-bounds accesses, that fall into the same shadow cell, as the last byte of a slab object. 2. We only have 1 byte to store tags, which means we have a 1/256 probability of a tag match for an incorrect access (actually even slightly less due to reserved tag values). Despite that there's a particular type of bugs that tag-based KASAN can detect compared to generic KASAN: use-after-free after the object has been allocated by someone else. ====== Testing Some kernel developers voiced a concern that changing the top byte of kernel pointers may lead to subtle bugs that are difficult to discover. To address this concern deliberate testing has been performed. It doesn't seem feasible to do some kind of static checking to find potential issues with pointer tagging, so a dynamic approach was taken. All pointer comparisons/subtractions have been instrumented in an LLVM compiler pass and a kernel module that would print a bug report whenever two pointers with different tags are being compared/subtracted (ignoring comparisons with NULL pointers and with pointers obtained by casting an error code to a pointer type) has been used. Then the kernel has been booted in QEMU and on an Odroid C2 board and syzkaller has been run. This yielded the following results. The two places that look interesting are: is_vmalloc_addr in include/linux/mm.h is_kernel_rodata in mm/util.c Here we compare a pointer with some fixed untagged values to make sure that the pointer lies in a particular part of the kernel address space. Since tag-based KASAN doesn't add tags to pointers that belong to rodata or vmalloc regions, this should work as is. To make sure debug checks to those two functions that check that the result doesn't change whether we operate on pointers with or without untagging has been added. A few other cases that don't look that interesting: Comparing pointers to achieve unique sorting order of pointee objects (e.g. sorting locks addresses before performing a double lock): tty_ldisc_lock_pair_timeout in drivers/tty/tty_ldisc.c pipe_double_lock in fs/pipe.c unix_state_double_lock in net/unix/af_unix.c lock_two_nondirectories in fs/inode.c mutex_lock_double in kernel/events/core.c ep_cmp_ffd in fs/eventpoll.c fsnotify_compare_groups fs/notify/mark.c Nothing needs to be done here, since the tags embedded into pointers don't change, so the sorting order would still be unique. Checks that a pointer belongs to some particular allocation: is_sibling_entry in lib/radix-tree.c object_is_on_stack in include/linux/sched/task_stack.h Nothing needs to be done here either, since two pointers can only belong to the same allocation if they have the same tag. Overall, since the kernel boots and works, there are no critical bugs. As for the rest, the traditional kernel testing way (use until fails) is the only one that looks feasible. Another point here is that tag-based KASAN is available under a separate config option that needs to be deliberately enabled. Even though it might be used in a "near-production" environment to find bugs that are not found during fuzzing or running tests, it is still a debug tool. ====== Benchmarks The following numbers were collected on Odroid C2 board. Both generic and tag-based KASAN were used in inline instrumentation mode. Boot time [1]: * ~1.7 sec for clean kernel * ~5.0 sec for generic KASAN * ~5.0 sec for tag-based KASAN Network performance [2]: * 8.33 Gbits/sec for clean kernel * 3.17 Gbits/sec for generic KASAN * 2.85 Gbits/sec for tag-based KASAN Slab memory usage after boot [3]: * ~40 kb for clean kernel * ~105 kb (~260% overhead) for generic KASAN * ~47 kb (~20% overhead) for tag-based KASAN KASAN memory overhead consists of three main parts: 1. Increased slab memory usage due to redzones. 2. Shadow memory (the whole reserved once during boot). 3. Quaratine (grows gradually until some preset limit; the more the limit, the more the chance to detect a use-after-free). Comparing tag-based vs generic KASAN for each of these points: 1. 20% vs 260% overhead. 2. 1/16th vs 1/8th of physical memory. 3. Tag-based KASAN doesn't require quarantine. [1] Time before the ext4 driver is initialized. [2] Measured as `iperf -s & iperf -c 127.0.0.1 -t 30`. [3] Measured as `cat /proc/meminfo | grep Slab`. ====== Some notes A few notes: 1. The patchset can be found here: https://github.com/xairy/kasan-prototype/tree/khwasan 2. Building requires a recent Clang version (7.0.0 or later). 3. Stack instrumentation is not supported yet and will be added later. This patch (of 25): Tag-based KASAN changes the value of the top byte of pointers returned from the kernel allocation functions (such as kmalloc). This patch updates KASAN hooks signatures and their usage in SLAB and SLUB code to reflect that. Link: http://lkml.kernel.org/r/aec2b5e3973781ff8a6bb6760f8543643202c451.1544099024.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Cc: Christoph Lameter Cc: Mark Rutland Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4ccc98a48958da9f89beb71c66a4e05468727951 Author: Jiri Olsa Date: Wed Dec 12 11:25:37 2018 +0100 tools gpio: Allow overriding CFLAGS So that the user can specify outside CFLAGS values. Signed-off-by: Jiri Olsa Reviewed-by: Andy Shevchenko Cc: Hartmut Knaack Cc: Herton Krzesinski Cc: Jonathan Cameron Cc: Lars-Peter Clausen Link: http://lkml.kernel.org/r/20181212102537.25902-7-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 6b7f98a37ac63fe94e84a5289962457b4b504a8d Author: Jiri Olsa Date: Wed Dec 12 11:25:35 2018 +0100 tools power turbostat: Override CFLAGS assignments and add LDFLAGS to build command So that the user can specify outside CFLAGS/LDFLAGS values. Signed-off-by: Jiri Olsa Reviewed-by: Andy Shevchenko Cc: Herton Krzesinski Cc: Len Brown Link: http://lkml.kernel.org/r/20181212102537.25902-5-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit ad6b474f445e587e9b56ec44241b1639bccf6738 Author: Jiri Olsa Date: Wed Dec 12 11:25:33 2018 +0100 tools thermal tmon: Allow overriding CFLAGS assignments So that the user can provide, e.g. distro package alternative values. Signed-off-by: Jiri Olsa Cc: Brian Norris Cc: Herton Krzesinski Cc: Markus Mayer Cc: Zhang Rui Link: http://lkml.kernel.org/r/20181212102537.25902-3-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f1770e3ca4ec10ce43825de2f855a1831c711195 Author: Jiri Olsa Date: Fri Oct 12 07:20:16 2018 -0400 tools power x86_energy_perf_policy: Override CFLAGS assignments and add LDFLAGS to build command So user could specify outside CFLAGS/LDFLAGS values. Signed-off-by: Jiri Olsa Cc: Herton Krzesinski Cc: Len Brown Link: https://lkml.kernel.org/r/20181212102537.25902-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit c4a75bb9488a9f7b3c7e79017609529d1aa5deab Author: Jiri Olsa Date: Fri Dec 28 11:18:20 2018 +0100 perf c2c: Increase the HITM ratio limit for displayed cachelines The cachelines being reported are the ones with percentages all the way down to 0.05%. That makes for very long output files. Raising that to 0.1%. The user can always specify --show-all if they want all the cachelines with hits. Suggested-by: Joe Mario Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20181228101820.28010-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 423701a0c8d754d9a39547f6c48904347e4f1eca Author: Jiri Olsa Date: Fri Dec 28 11:18:19 2018 +0100 perf c2c: Change the default coalesce setup Joe suggested to have the coalesce default set just to 'iaddr', because it's easier to read on the default 'perf c2c report' output. By removing the "pid" field from the default -c/--coalesce option, the 'perf c2c' report will group all the relevant PIDs under the instruction address ('iaddr') bucket. User can always run "-c pid,iaddr" for a more fine grained output on particular PIDs. Suggested-by: Joe Mario Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20181228101820.28010-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 38fc9da69f3385667ba8c3d45bd43065491854a6 Author: Arnaldo Carvalho de Melo Date: Thu Dec 27 16:20:21 2018 -0300 perf trace beauty ioctl: Beautify USBDEVFS_ commands For instance, while debugging the 'galileo' python utility to synchronize fitbit trackers: # perf trace -e ioctl ./run --force ioctl(0, TCSETS, 0x7ffe28666420) = 0 ioctl(0, TCSETS, 0x7ffe28666290) = 0 ioctl(1, TCSETS, 0x7ffe28666290) = 0 ioctl(2, TCSETS, 0x7ffe28666290) = 0 ioctl(3, TCSETS, 0x7ffe286663f0) = -1 ENOTTY (Inappropriate ioctl for device) ioctl(1, TCSETS, 0x7ffe286655a0) = 0 ioctl(1, TCSETS, 0x7ffe28665470) = 0 ioctl(1, TCSETS, 0x7ffe28665470) = 0 ioctl(1, TCSETS, 0x7ffe286654a0) = 0 ioctl(1, TCSETS, 0x7ffe286654a0) = 0 ioctl(1, TCSETS, 0x7ffe28665400) = 0 ioctl(1, TIOCSWINSZ, 0x7ffe286654c0) = 0 ioctl(0, TIOCSWINSZ, 0x7ffe28665560) = 0 ioctl(0, TIOCSWINSZ, 0x7ffe28665560) = 0 ioctl(0, TIOCMGET, 0x7ffe28665560) = 0 ioctl(0, TCSETS, 0x7ffe28665530) = 0 ioctl(10, USBDEVFS_GET_CAPABILITIES, 0x561468dad048) = 0 ioctl(10, USBDEVFS_GETDRIVER, 0x7ffe28665500) = -1 ENODATA (No data available) ioctl(10, USBDEVFS_GETDRIVER, 0x7ffe28665500) = -1 ENODATA (No data available) ioctl(10, USBDEVFS_SETCONFIGURATION, 0x7ffe2866513c) = 0 ioctl(10, USBDEVFS_CLAIMINTERFACE, 0x7ffe286647bc) = 0 ioctl(10, USBDEVFS_SUBMITURB, 0x561468dace40) = 0 ioctl(10, USBDEVFS_REAPURBNDELAY, 0x7ffe28664c10) = 0 ioctl(10, USBDEVFS_REAPURBNDELAY, 0x7ffe28664c10) = -1 EAGAIN (Resource temporarily unavailable) ioctl(10, USBDEVFS_SUBMITURB, 0x561468dace40) = 0 ioctl(10, USBDEVFS_REAPURBNDELAY, 0x7ffe28664dd0) = 0 ioctl(10, USBDEVFS_REAPURBNDELAY, 0x7ffe28664dd0) = -1 EAGAIN (Resource temporarily unavailable) ioctl(10, USBDEVFS_SUBMITURB, 0x561468e72ec0) = 0 ioctl(10, USBDEVFS_REAPURBNDELAY, 0x7ffe28664cc0) = 0 ioctl(10, USBDEVFS_REAPURBNDELAY, 0x7ffe28664cc0) = -1 EAGAIN (Resource temporarily unavailable) ioctl(10, USBDEVFS_RELEASEINTERFACE, 0x7ffe2866463c) = 0 ioctl(10, USBDEVFS_RELEASEINTERFACE, 0x7ffe2866463c) = 0 Tracker: 813F4690C3D1: Synchronisation successful # Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-6x2cawak7jno3gpp5pagzj50@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2d473389f87ace284bda35a5254bc66e24d0caa9 Author: Arnaldo Carvalho de Melo Date: Thu Dec 27 16:19:33 2018 -0300 perf trace beauty: Export function to get the files for a thread So that beautifiers can access things like dev_maj. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-wm5o51f206c5pi063dsaeraq@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 86cf4c659c9ae1609262699caa4b2c3ab7fefa9b Author: Arnaldo Carvalho de Melo Date: Thu Dec 27 15:10:34 2018 -0300 perf trace: Wire up ioctl's USBDEBFS_ cmd table generator That ends up generating this: [acme@quaco perf]$ cat /tmp/build/perf/trace/beauty/generated/ioctl/usbdevfs_ioctl_array.c static const char *usbdevfs_ioctl_cmds[] = { [0] = "CONTROL", [10] = "SUBMITURB", [11] = "DISCARDURB", [12] = "REAPURB", [13] = "REAPURBNDELAY", [14] = "DISCSIGNAL", [15] = "CLAIMINTERFACE", [16] = "RELEASEINTERFACE", [17] = "CONNECTINFO", [18] = "IOCTL", [19] = "HUB_PORTINFO", [2] = "BULK", [20] = "RESET", [21] = "CLEAR_HALT", [22] = "DISCONNECT", [23] = "CONNECT", [24] = "CLAIM_PORT", [25] = "RELEASE_PORT", [26] = "GET_CAPABILITIES", [27] = "DISCONNECT_CLAIM", [28] = "ALLOC_STREAMS", [29] = "FREE_STREAMS", [3] = "RESETEP", [30] = "DROP_PRIVILEGES", [31] = "GET_SPEED", [4] = "SETINTERFACE", [5] = "SETCONFIGURATION", [8] = "GETDRIVER", }; #if 0 static const char *usbdevfs_ioctl_32_cmds[] = { [0] = "CONTROL32", [10] = "SUBMITURB32", [12] = "REAPURB32", [13] = "REAPURBNDELAY32", [14] = "DISCSIGNAL32", [18] = "IOCTL32", [2] = "BULK32", }; #endif $ Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-hkam6lt1g806l0p4b7buif3n@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 870c3f40dc78edec6437a2ced03976b66eeacf49 Author: Arnaldo Carvalho de Melo Date: Thu Dec 27 14:27:35 2018 -0300 perf beauty ioctl: Add generator for USBDEVFS_ ioctl commands Will be associated with fds with the right device major. $ tools/perf/trace/beauty/usbdevfs_ioctl.sh static const char *usbdevfs_ioctl_cmds[] = { [0] = "CONTROL", [10] = "SUBMITURB", [11] = "DISCARDURB", [12] = "REAPURB", [13] = "REAPURBNDELAY", [14] = "DISCSIGNAL", [15] = "CLAIMINTERFACE", [16] = "RELEASEINTERFACE", [17] = "CONNECTINFO", [18] = "IOCTL", [19] = "HUB_PORTINFO", [20] = "RESET", [21] = "CLEAR_HALT", [22] = "DISCONNECT", [23] = "CONNECT", [24] = "CLAIM_PORT", [25] = "RELEASE_PORT", [26] = "GET_CAPABILITIES", [27] = "DISCONNECT_CLAIM", [28] = "ALLOC_STREAMS", [29] = "FREE_STREAMS", [2] = "BULK", [30] = "DROP_PRIVILEGES", [31] = "GET_SPEED", [3] = "RESETEP", [4] = "SETINTERFACE", [5] = "SETCONFIGURATION", [8] = "GETDRIVER", }; #if 0 static const char *usbdevfs_ioctl_32_cmds[] = { [0] = "CONTROL32", [10] = "SUBMITURB32", [12] = "REAPURB32", [13] = "REAPURBNDELAY32", [14] = "DISCSIGNAL32", [18] = "IOCTL32", [2] = "BULK32", }; #endif $ Leaving the '32' variants commented, later we can try to support those as well, from some other hint (maybe something about the thread issuing the ioctls) and from the _IOC_SIZE(cmd). Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-neq1lrji5k4ku0rktn7ytnri@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2bd71d11a86e8419a33a131d194fd735a8f74400 Author: Arnaldo Carvalho de Melo Date: Thu Dec 27 14:18:13 2018 -0300 tools headers uapi: Grab a copy of usbdevice_fs.h Will be used to generate the string table for the USBDEVFS_ prefixed ioctl commands. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-3vrm9b55tdhzn8sw9qazh4z5@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4bcc4cff6a10e5287d4dd3e73b6b4689f9a0c570 Author: Arnaldo Carvalho de Melo Date: Thu Dec 27 13:32:59 2018 -0300 perf trace: Store the major number for a file when storing its pathname We keep a table for the fds to map them back to pathnames when showing 'fd' based APIs such as write(), store as well the major number for the device the path is in, to use in things like choosing the right ioctl 'cmd' beautifier. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-qjkds7bnk7v7fk2xhqsb0a4v@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d7e134845d6b19288dec5582ce91d6c6052fcdad Author: Arnaldo Carvalho de Melo Date: Thu Dec 27 11:05:18 2018 -0300 perf trace: Move the files table resizing to outside set_pathname() So that we can have that table expanded when setting other attributes. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-hzvpe3qwafe6sqcq3bhtbxds@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f4a74fcbfd943e128bbd464dc31b4405e1514d63 Author: Arnaldo Carvalho de Melo Date: Thu Dec 27 10:56:12 2018 -0300 perf trace: Rename thread_thread->paths to thread_trace->files So that we can add more per file attributes besides the pathname, such as which ioctl beautifier to use, for cases such as the sound and usbdeffs ioctls, that both use the 'U' command, so we have to differentiate at the major number for the device file. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-1895cmhrdz2dkl5prf2cj2yj@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 61f611593f2c90547cb09c0bf6977414454a27e6 Author: Andi Kleen Date: Mon Nov 19 21:06:17 2018 -0800 perf script: Fix LBR skid dump problems in brstackinsn This is a fix for another instance of the skid problem Milian recently found [1] The LBRs don't freeze at the exact same time as the PMI is triggered. The perf script brstackinsn code that dumps LBR assembler assumes that the last branch in the LBR leads to the sample point. But with skid it's possible that the CPU executes one or more branches before the sample, but which do not appear in the LBR. What happens then is either that the sample point is before the last LBR branch. In this case the dumper sees a negative length and ignores it. Or it the sample point is long after the last branch. Then the dumper sees a very long block and dumps it upto its block limit (16k bytes), which is noise in the output. On typical sample session this can happen regularly. This patch tries to detect and handle the situation. On the last block that is dumped by the LBR dumper we always stop on the first branch. If the block length is negative just scan forward to the first branch. Otherwise scan until a branch is found. The PT decoder already has a function that uses the instruction decoder to detect branches, so we can just reuse it here. Then when a terminating branch is found print an indication and stop dumping. This might miss a few instructions, but at least shows no runaway blocks. Signed-off-by: Andi Kleen Acked-by: Adrian Hunter Cc: Jiri Olsa Cc: Milian Wolff Link: http://lkml.kernel.org/r/20181120050617.4119-1-andi@firstfloor.org [ Resolved conflict with dd2e18e9ac20 ("perf tools: Support 'srccode' output") ] Signed-off-by: Arnaldo Carvalho de Melo commit a389aece97938966616ce0336466b98b0351ef10 Author: Jiri Olsa Date: Wed Dec 26 12:21:21 2018 +0100 perf python: Do not force closing original perf descriptor in evlist.get_pollfd() Ondřej reported that when compiled with python3, the python extension regresses in evlist.get_pollfd function behaviour. The evlist.get_pollfd function creates file objects from evlist's fds and returns them in a list. The python3 version also sets them to 'close the original descriptor' when the object dies (is closed), by passing True via the 'closefd' arg in the PyFile_FromFd call. The python's closefd doc says: If closefd is False, the underlying file descriptor will be kept open when the file is closed. That's why the following line in python3 closes all evlist fds: evlist.get_pollfd() the returned list is immediately destroyed and that takes down the original events fds. Passing closefd as False to PyFile_FromFd to fix this. Reported-by: Ondřej Lysoněk Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Jaroslav Škarvada Cc: Namhyung Kim Cc: Peter Zijlstra Fixes: 66dfdff03d19 ("perf tools: Add Python 3 support") Link: http://lkml.kernel.org/r/20181226112121.5285-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit fbe7e42515af6c2ecee04b1c851f78de1d190281 Author: Colin Ian King Date: Fri Dec 21 08:48:09 2018 +0000 perf trace: Use correct SECCOMP prefix spelling, "SECOMP_*" -> "SECCOMP_*" The spelling of the SECCOMP is incorrect, fix these. Signed-off-by: Colin King Cc: Alexander Shishkin Cc: Peter Zijlstra Cc: kernel-janitors@vger.kernel.org Fixes: c65c83ffe904 ("perf trace: Allow asking for not suppressing common string prefixes") Link: http://lkml.kernel.org/r/20181221084809.6108-1-colin.king@canonical.com Signed-off-by: Arnaldo Carvalho de Melo commit 08972760d366b83a87d366b0079747f8c409163c Author: Aisheng Dong Date: Sun Dec 23 16:20:02 2018 +0000 clk: imx8qxp: make the name of clock ID generic SCU clock can be used in a similar way by IMX8QXP and IMX8QM SoCs. Let's make the name of clock ID generic to allow other SoCs to reuse the common part. This patch only changes the clock id name and file name, so no functional change. Cc: Stephen Boyd Cc: Rob Herring Cc: Shawn Guo Cc: Sascha Hauer Cc: Fabio Estevam Cc: Michael Turquette Cc: devicetree@vger.kernel.org Signed-off-by: Dong Aisheng Reviewed-by: Fabio Estevam Reviewed-by: Rob Herring Signed-off-by: Stephen Boyd commit 3fc9c12d27b4ded4f1f761a800558dab2e6bbac5 Author: Tejun Heo Date: Fri Dec 28 10:31:07 2018 -0800 cgroup: Add named hierarchy disabling to cgroup_no_v1 boot param It can be useful to inhibit all cgroup1 hierarchies especially during transition and for debugging. cgroup_no_v1 can block hierarchies with controllers which leaves out the named hierarchies. Expand it to cover the named hierarchies so that "cgroup_no_v1=all,named" disables all cgroup1 hierarchies. Signed-off-by: Tejun Heo Suggested-by: Marcin Pawlowski Signed-off-by: Tejun Heo commit e250d91d65750a0c0c62483ac4f9f357e7317617 Author: Ondrej Mosnacek Date: Thu Dec 13 15:17:37 2018 +0100 cgroup: fix parsing empty mount option string This fixes the case where all mount options specified are consumed by an LSM and all that's left is an empty string. In this case cgroupfs should accept the string and not fail. How to reproduce (with SELinux enabled): # umount /sys/fs/cgroup/unified # mount -o context=system_u:object_r:cgroup_t:s0 -t cgroup2 cgroup2 /sys/fs/cgroup/unified mount: /sys/fs/cgroup/unified: wrong fs type, bad option, bad superblock on cgroup2, missing codepage or helper program, or other error. # dmesg | tail -n 1 [ 31.575952] cgroup: cgroup2: unknown option "" Fixes: 67e9c74b8a87 ("cgroup: replace __DEVEL__sane_behavior with cgroup2 fs type") [NOTE: should apply on top of commit 5136f6365ce3 ("cgroup: implement "nsdelegate" mount option"), older versions need manual rebase] Suggested-by: Stephen Smalley Signed-off-by: Ondrej Mosnacek Signed-off-by: Tejun Heo commit 14e92c5dc7a1a1d4a82fb7142b5642837fef962a Author: Steve French Date: Mon Dec 24 01:05:22 2018 -0600 cifs: Minor Kconfig clarification Clarify the use of the CONFIG_DFS_UPCALL for DNS name resolution when server ip addresses change (e.g. on long running mounts) Signed-off-by: Steve French commit 28eb24ff75c5ac130eb326b3b4d0dcecfc0f427d Author: Paulo Alcantara Date: Tue Nov 20 15:16:36 2018 -0200 cifs: Always resolve hostname before reconnecting In case a hostname resolves to a different IP address (e.g. long running mounts), make sure to resolve it every time prior to calling generic_ip_connect() in reconnect. Suggested-by: Steve French Signed-off-by: Paulo Alcantara Signed-off-by: Steve French commit 08744015492fec5a30ab8e2779601ae2b1a5e431 Author: Paulo Alcantara Date: Wed Nov 14 17:24:29 2018 -0200 cifs: Add support for failover in cifs_reconnect_tcon() After a successful failover, the cifs_reconnect_tcon() function will make sure to reconnect every tcon to new target server. Same as previous commit but for SMB1 codepath. Signed-off-by: Paulo Alcantara Reviewed-by: Aurelien Aptel Signed-off-by: Steve French commit a3a53b7603798fd875e2afbba7e2b9ba6b19c7c7 Author: Paulo Alcantara Date: Wed Nov 14 17:20:31 2018 -0200 cifs: Add support for failover in smb2_reconnect() After a successful failover in cifs_reconnect(), the smb2_reconnect() function will make sure to reconnect every tcon to new target server. For SMB2+. Signed-off-by: Paulo Alcantara Signed-off-by: Aurelien Aptel Signed-off-by: Steve French commit 23324407143dd923660378fd9b40b9a711972269 Author: Paulo Alcantara Date: Tue Nov 20 14:37:18 2018 -0200 cifs: Only free DFS target list if we actually got one Fix potential NULL ptr deref when DFS target list is empty. Signed-off-by: Paulo Alcantara Reviewed-by: Aurelien Aptel Signed-off-by: Steve French commit e511d31753e3f7c13bbd402399ffac676d451a7c Author: Paulo Alcantara Date: Wed Nov 14 17:16:44 2018 -0200 cifs: start DFS cache refresher in cifs_mount() Start the DFS cache refresh worker per volume during cifs mount. Signed-off-by: Paulo Alcantara Reviewed-by: Aurelien Aptel Signed-off-by: Steve French commit 2f0a617448945a2c63d68983212302e9f2f8ae2f Author: YueHaibing Date: Tue Dec 18 01:34:39 2018 +0000 cifs: Use GFP_ATOMIC when a lock is held in cifs_mount() A spin lock is held before kstrndup, it may sleep with holding the spinlock, so we should use GFP_ATOMIC instead. Fixes: e58c31d5e387 ("cifs: Add support for failover in cifs_reconnect()") Signed-off-by: YueHaibing Signed-off-by: Steve French Reviewed-by: Paulo Alcantara commit 93d5cb517db39e8af8d1292f9e785e4983b7f708 Author: Paulo Alcantara Date: Wed Nov 14 17:13:25 2018 -0200 cifs: Add support for failover in cifs_reconnect() After failing to reconnect to original target, it will retry any target available from DFS cache. Signed-off-by: Paulo Alcantara Reviewed-by: Aurelien Aptel Signed-off-by: Steve French commit 4a367dc0443566f87d73f2cdb94703b0e1374315 Author: Paulo Alcantara Date: Wed Nov 14 16:53:52 2018 -0200 cifs: Add support for failover in cifs_mount() This patch adds support for failover when failing to connect in cifs_mount(). Signed-off-by: Paulo Alcantara Reviewed-by: Aurelien Aptel Signed-off-by: Steve French commit 5a650501eb8cb785593155441c5b0b9900edfcdf Author: YueHaibing Date: Tue Dec 18 01:35:29 2018 +0000 cifs: remove set but not used variable 'sep' Fixes gcc '-Wunused-but-set-variable' warning: fs/cifs/cifs_dfs_ref.c: In function 'cifs_dfs_do_automount': fs/cifs/cifs_dfs_ref.c:309:7: warning: variable 'sep' set but not used [-Wunused-but-set-variable] It never used since introdution in commit 0f56b277073c ("cifs: Make use of DFS cache to get new DFS referrals") Signed-off-by: YueHaibing Reviewed-by: Paulo Alcantara Signed-off-by: Steve French commit 1c780228e9d47b966983a8bbf475dd45967bf0d5 Author: Paulo Alcantara Date: Wed Nov 14 16:24:03 2018 -0200 cifs: Make use of DFS cache to get new DFS referrals This patch will make use of DFS cache routines where appropriate and do not always request a new referral from server. Signed-off-by: Paulo Alcantara Reviewed-by: Aurelien Aptel Signed-off-by: Steve French commit e8bcdfdbf91bf979afe6642a99b41cbc0a4916d0 Author: Steve French Date: Fri Dec 21 00:44:32 2018 -0600 cifs: minor updates to documentation Update cifs "TODO" file. Signed-off-by: Steve French commit 0544b324e62c177c3a9e9c3bdce22e6db9f34588 Author: Joe Perches Date: Thu Dec 20 23:50:48 2018 -0600 cifs: check kzalloc return kzalloc can return NULL so an additional check is needed. While there is a check for ret_buf there is no check for the allocation of ret_buf->crfid.fid - this check is thus added. Both call-sites of tconInfoAlloc() check for NULL return of tconInfoAlloc() so returning NULL on failure of kzalloc() here seems appropriate. As the kzalloc() is the only thing here that can fail it is moved to the beginning so as not to initialize other resources on failure of kzalloc. Fixes: 3d4ef9a15343 ("smb3: fix redundant opens on root") Signed-off-by: Joe Perches Signed-off-by: Steve French commit 29cbfa1b2be2e51785f871351d321896861f2ce8 Author: YueHaibing Date: Tue Dec 18 02:51:51 2018 +0000 cifs: remove set but not used variable 'server' Fixes gcc '-Wunused-but-set-variable' warning: fs/cifs/smb2pdu.c: In function 'smb311_posix_mkdir': fs/cifs/smb2pdu.c:2040:26: warning: variable 'server' set but not used [-Wunused-but-set-variable] fs/cifs/smb2pdu.c: In function 'build_qfs_info_req': fs/cifs/smb2pdu.c:4067:26: warning: variable 'server' set but not used [-Wunused-but-set-variable] The first 'server' never used since commit bea851b8babe ("smb3: Fix mode on mkdir on smb311 mounts") And the second not used since commit 1fc6ad2f10ad ("cifs: remove header_preamble_size where it is always 0") Signed-off-by: YueHaibing Signed-off-by: Steve French commit 34bca9bbe7a81c4b53cacb20e996090ddf371c51 Author: Dan Carpenter Date: Thu Dec 20 14:32:43 2018 +0300 cifs: Use kzfree() to free password We should zero out the password before we free it. Fixes: 3d6cacbb5310 ("cifs: Add DFS cache routines") Signed-off-by: Dan Carpenter Signed-off-by: Steve French Reviewed-by: Paulo Alcantara commit 3e80be0158ac67d936e65935db5b07663822c66d Author: Wei Yongjun Date: Tue Dec 18 06:37:02 2018 +0000 cifs: Fix to use kmem_cache_free() instead of kfree() memory allocated by kmem_cache_alloc() in alloc_cache_entry() should be freed using kmem_cache_free(), not kfree(). Fixes: 34a44fb160f9 ("cifs: Add DFS cache routines") Signed-off-by: Wei Yongjun Signed-off-by: Steve French Reviewed-by: Aurelien Aptel commit 54e4f73cbe03dd0634548e40d12c442d377c36c4 Author: Stephen Rothwell Date: Mon Dec 17 20:11:46 2018 +1100 cifs: update for current_kernel_time64() removal Fixes cifs build failure after merge of the y2038 tree After merging the y2038 tree, today's linux-next build (x86_64 allmodconfig) failed like this: fs/cifs/dfs_cache.c: In function 'cache_entry_expired': fs/cifs/dfs_cache.c:106:7: error: implicit declaration of function 'current_kernel_time64'; did you mean 'core_kernel_text'? [-Werror=implicit-function-declaration] ts = current_kernel_time64(); ^~~~~~~~~~~~~~~~~~~~~ core_kernel_text fs/cifs/dfs_cache.c:106:5: error: incompatible types when assigning to type 'struct timespec64' from type 'int' ts = current_kernel_time64(); ^ fs/cifs/dfs_cache.c: In function 'get_expire_time': fs/cifs/dfs_cache.c:342:24: error: incompatible type for argument 1 of 'timespec64_add' return timespec64_add(current_kernel_time64(), ts); ^~~~~~~~~~~~~~~~~~~~~~~ In file included from include/linux/restart_block.h:10, from include/linux/thread_info.h:13, from arch/x86/include/asm/preempt.h:7, from include/linux/preempt.h:78, from include/linux/rcupdate.h:40, from fs/cifs/dfs_cache.c:8: include/linux/time64.h:66:66: note: expected 'struct timespec64' but argument is of type 'int' static inline struct timespec64 timespec64_add(struct timespec64 lhs, ~~~~~~~~~~~~~~~~~~^~~ fs/cifs/dfs_cache.c:343:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ Caused by: commit ccea641b6742 ("timekeeping: remove obsolete time accessors") interacting with: commit 34a44fb160f9 ("cifs: Add DFS cache routines") from the cifs tree. Signed-off-by: Stephen Rothwell Reviewed-by: Paulo Alcantara Acked-by: Arnd Bergmann Signed-off-by: Steve French commit 54be1f6c1c37498bba557049df646cc239fa37e3 Author: Paulo Alcantara Date: Wed Nov 14 16:01:21 2018 -0200 cifs: Add DFS cache routines * Add new dfs_cache.[ch] files * Add new /proc/fs/cifs/dfscache file - dump current cache when read - clear current cache when writing "0" to it * Add delayed_work to periodically refresh cache entries The new interface will be used for caching DFS referrals, as well as supporting client target failover. The DFS cache is a hashtable that maps UNC paths to cache entries. A cache entry contains: - the UNC path it is mapped on - how much the the UNC path the entry consumes - flags - a Time-To-Live after which the entry expires - a list of possible targets (linked lists of UNC paths) - a "hint target" pointing the last known working target or the first target if none were tried. This hint lets cifs.ko remember and try working targets first. * Looking for an entry in the cache is done with dfs_cache_find() - if no valid entries are found, a DFS query is made, stored in the cache and returned - the full target list can be copied and returned to avoid race conditions and looped on with the help with the dfs_cache_tgt_iterator * Updating the target hint to the next target is done with dfs_cache_update_tgthint() These functions have a dfs_cache_noreq_XXX() version that doesn't fetches referrals if no entries are found. These versions don't require the tcp/ses/tcon/cifs_sb parameters as a result. Expired entries cannot be used and since they have a pretty short TTL [1] in order for them to be useful for failover the DFS cache adds a delayed work called periodically to keep them fresh. Since we might not have available connections to issue the referral request when refreshing we need to store volume_info structs with credentials and other needed info to be able to connect to the right server. 1: Windows defaults: 5mn for domain-based referrals, 30mn for regular links Signed-off-by: Paulo Alcantara Signed-off-by: Aurelien Aptel Signed-off-by: Steve French commit 21c7acc439b55d0569d7c2fc2eea5194b3910406 Author: Guenter Roeck Date: Thu Dec 27 08:46:38 2018 -0800 h8300: pci: Remove local declaration of pcibios_penalize_isa_irq h8300 builds fail with: In file included from drivers/of/address.c:11: include/linux/pci.h:1966:20: error: redefinition of 'pcibios_penalize_isa_irq' This is because CONFIG_PCI is not enabled, and pcibios_penalize_isa_irq() is now declared as inline static function in generic code if this is the case. Since h8300 does not support PCI to start with, fix the problem by removing the architecture specific pci.h. Fixes: 5d32a66541c46 ("PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set") Cc: Sinan Kaya Cc: Bjorn Helgaas Signed-off-by: Guenter Roeck Signed-off-by: Yoshinori Sato commit f222b7f43661c3dddd44ee493c16e04e8f231542 Author: Masahiro Yamada Date: Fri Dec 21 17:33:08 2018 +0900 kconfig: surround dbg_sym_flags with #ifdef DEBUG to fix gconf warning Fix the following warning: no previous prototype for ‘dbg_sym_flags’ [-Wmissing-prototypes] Signed-off-by: Masahiro Yamada commit 3b541978562a0f553b0c0253d927d55612dd97b1 Author: Masahiro Yamada Date: Fri Dec 21 17:33:07 2018 +0900 kconfig: split images.c out of qconf.cc/gconf.c to fix gconf warnings Currently, images.c is included by qconf.cc and gconf.c. qconf.cc uses all of xpm_* arrays, but gconf.c only some of them. Hence, lots of "... defined but not used" warnings are displayed while compiling gconf.c Splitting out images.c fixes the warnings. Signed-off-by: Masahiro Yamada commit 9abe42371b44ef3e10e068d3e461c3a97192fb46 Author: Masahiro Yamada Date: Fri Dec 21 17:33:06 2018 +0900 kconfig: add static qualifiers to fix gconf warnings Add "static" to functions that are locally used in gconf.c This fixes some "no previous prototype for ..." warnings. Signed-off-by: Masahiro Yamada commit cbafbf7f551c3a03fb9440932f1ca13056ca40a6 Author: Masahiro Yamada Date: Fri Dec 21 17:33:05 2018 +0900 kconfig: split the lexer out of zconf.y Compile zconf.lex.c independently of the other files. Signed-off-by: Masahiro Yamada commit 558e78e3ce844c61ceffe32775dbefacf167b023 Author: Masahiro Yamada Date: Fri Dec 21 17:33:04 2018 +0900 kconfig: split some C files out of zconf.y I want to compile each C file independently instead of including all of them from zconf.y. Split out confdata.c, expr.c, symbol.c, and preprocess.c . These are low-hanging fruits. Signed-off-by: Masahiro Yamada commit 0c874100108f03401cb3154801d2671bbad40ad4 Author: Masahiro Yamada Date: Tue Dec 18 21:13:35 2018 +0900 kconfig: convert to SPDX License Identifier All files in lxdialog/ are licensed under GPL-2.0+, and the rest are under GPL-2.0. I added GPL-2.0 tags to test scripts in tests/. Documentation/process/license-rules.rst does not suggest anything about the flex/bison files. Because flex does not accept the C++ comment style at the very top of a file, I used the C style for zconf.l, and so for zconf.y for consistency. Signed-off-by: Masahiro Yamada commit 979f2b2f7936f4b71a3100baf2d16c8057f027eb Author: Masahiro Yamada Date: Tue Dec 11 20:01:10 2018 +0900 kconfig: remove keyword lookup table entirely Commit 7a88488bbc23 ("[PATCH] kconfig: use gperf for kconfig keywords") introduced gperf for the keyword lookup. Then, commit bb3290d91695 ("Remove gperf usage from toolchain") killed the gperf use. As a result, the linear keyword search was left behind. If we do not use gperf, there is no reason to have the separate table of the keywords. Move all keywords back to the lexer. I also refactored the lexer to remove the COMMAND and PARAM states. Signed-off-by: Masahiro Yamada commit 4bcd2ffd214c1dad269c8ec40ac935770d208534 Merge: 221b35fedee1b cb6f4c2c3478b Author: Dave Airlie Date: Fri Dec 28 14:05:35 2018 +1000 Merge tag 'drm-intel-next-fixes-2018-12-27' of git://anongit.freedesktop.org/drm/drm-intel into drm-next GVT fixes for v4.21-rc1 Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87imzfwh73.fsf@intel.com commit 4b5f747e82b12b6d8ab815fc259827a615c7f2c3 Merge: 37379cfc661e5 3d9cbe37c16ff Author: Dan Williams Date: Thu Dec 27 19:54:10 2018 -0800 Merge miscellaneous libnvdimm updates for 4.21 * Use common helpers, bitmap_zalloc() and kstrndup(), to replace open coded versions. * Clarify the comments around hotplug vs initial init case for the nfit driver. * Cleanup the libnvdimm init path. commit 4d71c6f8771a6bccb844244f09831fa4624b22c1 Merge: 1e7eacaf1db2f e9d81a1bc2c48 Author: Tejun Heo Date: Thu Dec 27 18:05:30 2018 -0800 Merge branch 'for-4.20-fixes' into for-4.21 commit 91bd2ffa9030191ad077e43be37c5bfc53640dc2 Author: Vasily Averin Date: Mon Dec 24 14:46:21 2018 +0300 nfs: minor typo in nfs4_callback_up_net() Closing ")" was lost in debug message. Signed-off-by: Vasily Averin Signed-off-by: J. Bruce Fields commit 9ac312888e8869481613a2c65bb8bf5ab6d15594 Author: Vasily Averin Date: Mon Dec 24 14:46:14 2018 +0300 sunrpc: fix debug message in svc_create_xprt() _svc_create_xprt() returns positive port number so its non-zero return value is not an error Reviewed-by: Jeff Layton Signed-off-by: Vasily Averin Signed-off-by: J. Bruce Fields commit 8f7766c805d27a56e37cf7e108c2208649b44569 Author: Vasily Averin Date: Mon Dec 24 14:46:08 2018 +0300 sunrpc: make visible processing error in bc_svc_process() Force bc_svc_process() to generate debug message after processing errors Signed-off-by: Vasily Averin Signed-off-by: J. Bruce Fields commit 64e20ba204df539a76004114e08abf1156302e35 Author: Vasily Averin Date: Mon Dec 24 14:46:00 2018 +0300 sunrpc: remove unused xpo_prep_reply_hdr callback xpo_prep_reply_hdr are not used now. It was defined for tcp transport only, however it cannot be called indirectly, so let's move it to its caller and remove unused callback. Signed-off-by: Vasily Averin Signed-off-by: J. Bruce Fields commit 7ef88ff85ff71dd167d29d47bdb91c63cedcd554 Author: Vasily Averin Date: Mon Dec 24 14:45:53 2018 +0300 sunrpc: remove svc_rdma_bc_class Remove svc_xprt_class svc_rdma_bc_class and related functions. Signed-off-by: Vasily Averin Signed-off-by: J. Bruce Fields commit 7f391546098702bf8160038d8512a2502a0343ca Author: Vasily Averin Date: Mon Dec 24 14:45:46 2018 +0300 sunrpc: remove svc_tcp_bc_class Remove svc_xprt_class svc_tcp_bc_class and related functions Signed-off-by: Vasily Averin Signed-off-by: J. Bruce Fields commit 4aa5cffefa6f8af8f16490df58b8f0d827911b58 Author: Vasily Averin Date: Mon Dec 24 14:45:25 2018 +0300 sunrpc: remove unused bc_up operation from rpc_xprt_ops Signed-off-by: Vasily Averin Signed-off-by: J. Bruce Fields commit a289ce5311f406bf846614591300a948ebc42062 Author: Vasily Averin Date: Mon Dec 24 14:45:04 2018 +0300 sunrpc: replace svc_serv->sv_bc_xprt by boolean flag svc_serv-> sv_bc_xprt is netns-unsafe and cannot be used as pointer. To prevent its misuse in future it is replaced by new boolean flag. Signed-off-by: Vasily Averin Signed-off-by: J. Bruce Fields commit d4b09acf924b84bae77cad090a9d108e70b43643 Author: Vasily Averin Date: Mon Dec 24 14:44:52 2018 +0300 sunrpc: use-after-free in svc_process_common() if node have NFSv41+ mounts inside several net namespaces it can lead to use-after-free in svc_process_common() svc_process_common() /* Setup reply header */ rqstp->rq_xprt->xpt_ops->xpo_prep_reply_hdr(rqstp); <<< HERE svc_process_common() can use incorrect rqstp->rq_xprt, its caller function bc_svc_process() takes it from serv->sv_bc_xprt. The problem is that serv is global structure but sv_bc_xprt is assigned per-netnamespace. According to Trond, the whole "let's set up rqstp->rq_xprt for the back channel" is nothing but a giant hack in order to work around the fact that svc_process_common() uses it to find the xpt_ops, and perform a couple of (meaningless for the back channel) tests of xpt_flags. All we really need in svc_process_common() is to be able to run rqstp->rq_xprt->xpt_ops->xpo_prep_reply_hdr() Bruce J Fields points that this xpo_prep_reply_hdr() call is an awfully roundabout way just to do "svc_putnl(resv, 0);" in the tcp case. This patch does not initialiuze rqstp->rq_xprt in bc_svc_process(), now it calls svc_process_common() with rqstp->rq_xprt = NULL. To adjust reply header svc_process_common() just check rqstp->rq_prot and calls svc_tcp_prep_reply_hdr() for tcp case. To handle rqstp->rq_xprt = NULL case in functions called from svc_process_common() patch intruduces net namespace pointer svc_rqst->rq_bc_net and adjust SVC_NET() definition. Some other function was also adopted to properly handle described case. Signed-off-by: Vasily Averin Cc: stable@vger.kernel.org Fixes: 23c20ecd4475 ("NFS: callback up - users counting cleanup") Signed-off-by: J. Bruce Fields commit b8be5674fa9a6f3677865ea93f7803c4212f3e10 Author: Vasily Averin Date: Mon Dec 24 14:44:42 2018 +0300 sunrpc: use SVC_NET() in svcauth_gss_* functions Signed-off-by: Vasily Averin Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields commit 8a68d3da50b952232bbb39f7582a9050c40a0d78 Author: Julia Lawall Date: Sun Dec 23 09:56:56 2018 +0100 nfsd: drop useless LIST_HEAD Drop LIST_HEAD where the variable it declares is never used. This was introduced in c5c707f96fc9a ("nfsd: implement pNFS layout recalls"), but was not used even in that commit. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; @@ - LIST_HEAD(x); ... when != x // Fixes: c5c707f96fc9a ("nfsd: implement pNFS layout recalls") Signed-off-by: Julia Lawall Signed-off-by: J. Bruce Fields commit 00c569b567c7f1f0da6162868fd02a9f29411805 Merge: f6b1495fba0b6 052b8cfa4070c Author: Linus Torvalds Date: Thu Dec 27 17:12:30 2018 -0800 Merge tag 'locks-v4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux Pull file locking updates from Jeff Layton: "The main change in this set is Neil Brown's work to reduce the thundering herd problem when a heavily-contended file lock is released. Previously we'd always wake up all waiters when this occurred. With this set, we'll now we only wake up waiters that were blocked on the range being released" * tag 'locks-v4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux: locks: Use inode_is_open_for_write fs/locks: remove unnecessary white space. fs/locks: merge posix_unblock_lock() and locks_delete_block() fs/locks: create a tree of dependent requests. fs/locks: change all *_conflict() functions to return bool. fs/locks: always delete_block after waiting. fs/locks: allow a lock request to block other requests. fs/locks: use properly initialized file_lock when unlocking. ocfs2: properly initial file_lock used for unlock. gfs2: properly initial file_lock used for unlock. NFS: use locks_copy_lock() to copy locks. fs/locks: split out __locks_wake_up_blocks(). fs/locks: rename some lists and pointers. commit f6b1495fba0b66cfa05efa0ca2370513b79b45b6 Merge: bc77789a491cd 18f2c4fcebf25 Author: Linus Torvalds Date: Thu Dec 27 17:09:41 2018 -0800 Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 updates from Ted Ts'o: "All cleanups and bug fixes; most notably, fix some problems discovered in ext4's NFS support, and fix an ioctl (EXT4_IOC_GROUP_ADD) used by old versions of e2fsprogs which we accidentally broke a while back. Also fixed some error paths in ext4's quota and inline data support. Finally, improve tail latency in jbd2's commit code" * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: check for shutdown and r/o file system in ext4_write_inode() ext4: force inode writes when nfsd calls commit_metadata() ext4: avoid declaring fs inconsistent due to invalid file handles ext4: include terminating u32 in size of xattr entries when expanding inodes ext4: compare old and new mode before setting update_mode flag ext4: fix EXT4_IOC_GROUP_ADD ioctl ext4: hard fail dax mount on unsupported devices jbd2: update locking documentation for transaction_t ext4: remove redundant condition check jbd2: clean up indentation issue, replace spaces with tab ext4: clean up indentation issues, remove extraneous tabs ext4: missing unlock/put_page() in ext4_try_to_write_inline_data() ext4: fix possible use after free in ext4_quota_enable jbd2: avoid long hold times of j_state_lock while committing a transaction ext4: add ext4_sb_bread() to disambiguate ENOMEM cases commit bc77789a491cdc6f47e5bbd1d04ddd283d64658b Merge: 47a43f2f0ce24 3cc31fa65d856 Author: Linus Torvalds Date: Thu Dec 27 17:07:35 2018 -0800 Merge tag 'iomap-4.21-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull iomap update from Darrick Wong: "Fix a memory overflow bug for blocksize < pagesize" * tag 'iomap-4.21-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: iomap: don't search past page end in iomap_is_partially_uptodate commit 47a43f2f0ce24bb75e3e4500118000585a3b496a Merge: e01799ac56306 65eed012d1f2d Author: Linus Torvalds Date: Thu Dec 27 17:04:23 2018 -0800 Merge tag 'xfs-4.21-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull XFS updates from Darrick Wong: - Fix CoW remapping of extremely fragmented file areas - Fix a zero-length symlink verifier error - Constify some of the rmap owner structures for per-AG metadata - Precalculate inode geometry for later use - Fix scrub counting problems - Don't crash when rtsummary inode is null - Fix x32 ioctl operation - Fix enum->string mappings for ftrace output - Cache realtime summary information in memory * tag 'xfs-4.21-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (24 commits) xfs: reallocate realtime summary cache on growfs xfs: stringify scrub types in ftrace output xfs: stringify btree cursor types in ftrace output xfs: move XFS_INODE_FORMAT_STR mappings to libxfs xfs: move XFS_AG_BTREE_CMP_FORMAT_STR mappings to libxfs xfs: fix symbolic enum printing in ftrace output xfs: fix function pointer type in ftrace format xfs: Fix x32 ioctls when cmd numbers differ from ia32. xfs: Fix bulkstat compat ioctls on x32 userspace. xfs: Align compat attrlist_by_handle with native implementation. xfs: require both realtime inodes to mount xfs: cache minimum realtime summary level xfs: count inode blocks correctly in inobt scrub xfs: precalculate cluster alignment in inodes and blocks xfs: precalculate inodes and blocks per inode cluster xfs: add a block to inode count converter xfs: remove xfs_rmap_ag_owner and friends xfs: const-ify xfs_owner_info arguments xfs: streamline defer op type handling xfs: idiotproof defer op type configuration ... commit e01799ac56306ab211f2edf1221a82dc57eab8f5 Merge: 4b0a383ad782d 41c4f85cdac28 Author: Linus Torvalds Date: Thu Dec 27 17:00:35 2018 -0800 Merge tag 'fs_for_4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull ext2, udf, and quota update from Jan Kara: "Some ext2 cleanups, a fix for UDF crash on corrupted media, and one quota locking fix" * tag 'fs_for_4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: quota: Lock s_umount in exclusive mode for Q_XQUOTA{ON,OFF} quotactls. udf: Fix BUG on corrupted inode ext2: change reusable parameter to true when calling mb_cache_entry_create() ext2: remove redundant condition check ext2: avoid unnecessary operation in ext2_error() commit 4b0a383ad782d6028becea7602968d49a83ff5fc Merge: 4de3aea385f5a ac9498d686449 Author: Linus Torvalds Date: Thu Dec 27 16:55:37 2018 -0800 Merge tag 'fsnotify_for_v4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fsnotify updates from Jan Kara: "Support for new FAN_OPEN_EXEC event and couple of cleanups around fsnotify" * tag 'fsnotify_for_v4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fanotify: Use inode_is_open_for_write fanotify: Make sure to check event_len when copying fsnotify/fdinfo: include fdinfo.h for inotify_show_fdinfo() fanotify: introduce new event mask FAN_OPEN_EXEC_PERM fsnotify: refactor fsnotify_parent()/fsnotify() paired calls when event is on path fanotify: introduce new event mask FAN_OPEN_EXEC fanotify: return only user requested event types in event mask commit 4de3aea385f5a054885bc96ffdb9c7d0ea0c9486 Merge: 32ee34eddad13 3595c559326d0 Author: Linus Torvalds Date: Thu Dec 27 16:49:24 2018 -0800 Merge tag 'dlm-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm Pull dlm updates from David Teigland: "This set is entirely trivial fixes, mainly around correct cleanup on error paths and improved error checks. One patch adds scheduling in a potentially long recovery loop" * tag 'dlm-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm: dlm: fix invalid cluster name warning dlm: NULL check before some freeing functions is not needed dlm: NULL check before kmem_cache_destroy is not needed dlm: fix missing idr_destroy for recover_idr dlm: memory leaks on error path in dlm_user_request() dlm: lost put_lkb on error path in receive_convert() and receive_unlock() dlm: possible memory leak on error path in create_lkb() dlm: fixed memory leaks after failed ls_remove_names allocation dlm: fix possible call to kfree() for non-initialized pointer dlm: Don't swamp the CPU with callbacks queued during recovery dlm: don't leak kernel pointer to userspace dlm: don't allow zero length names dlm: fix invalid free commit 32ee34eddad13cd44ad0cb3e659fe6fd49143b62 Merge: 7bbbf2c2fc84d 52042d8e82ff5 Author: Linus Torvalds Date: Thu Dec 27 16:44:40 2018 -0800 Merge tag 'for-4.21-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs updates from David Sterba: "New features: - swapfile support - after a long time it's here, with some limitations where COW design does not work well with the swap implementation (nodatacow file, no compression, cannot be snapshotted, not possible on multiple devices, ...), as this is the most restricted but working setup, we'll try to improve that in the future - metadata uuid - an optional incompat feature to assign a new filesystem UUID without overwriting all metadata blocks, stored only in superblock - more balance messages are printed to system log, initial is in the format of the command line that would be used to start it Fixes: - tag pages of a snapshot to better separate pages that are involved in the snapshot (and need to get synced) from newly dirtied pages that could slow down or even livelock the snapshot operation - improved check of filesystem id associated with a device during scan to detect duplicate devices that could be mixed up during mount - fix device replace state transitions, eg. when it ends up interrupted and reboot tries to restart balance too, or when start/cancel ioctls race - fix a crash due to a race when quotas are enabled during snapshot creation - GFP_NOFS/memalloc_nofs_* fixes due to GFP_KERNEL allocations in transaction context - fix fsync of files with multiple hard links in new directories - fix race of send with transaction commits that create snapshots Core changes: - cleanups: * further removals of now-dead fsync code * core function for finding free extent has been split and provides a base for further cleanups to make the logic more understandable * removed lot of indirect callbacks for data and metadata inodes * simplified refcounting and locking for cloned extent buffers * removed redundant function arguments * defines converted to enums where appropriate - separate reserve for delayed refs from global reserve, update logic to do less trickery and ad-hoc heuristics, move out some related expensive operations from transaction commit or file truncate - dev-replace switched from custom locking scheme to semaphore - remove first phase of balance that tried to make some space for the relocation by calling shrink and grow, this did not work as expected and only introduced more error states due to potential resize failures, slightly improves the runtime as the chunks on all devices are not needlessly enumerated - clone and deduplication now use generic helper that adds a few more checks that were missing from the original btrfs implementation of the ioctls" * tag 'for-4.21-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (125 commits) btrfs: Fix typos in comments and strings btrfs: improve error handling of btrfs_add_link Btrfs: use generic_remap_file_range_prep() for cloning and deduplication btrfs: Refactor main loop in extent_readpages btrfs: Remove 1st shrink/grow phase from balance Btrfs: send, fix race with transaction commits that create snapshots Btrfs: use nofs context when initializing security xattrs to avoid deadlock btrfs: run delayed items before dropping the snapshot btrfs: catch cow on deleting snapshots btrfs: extent-tree: cleanup one-shot usage of @blocksize in do_walk_down Btrfs: scrub, move setup of nofs contexts higher in the stack btrfs: scrub: move scrub_setup_ctx allocation out of device_list_mutex btrfs: scrub: pass fs_info to scrub_setup_ctx btrfs: fix truncate throttling btrfs: don't run delayed refs in the end transaction logic btrfs: rework btrfs_check_space_for_delayed_refs btrfs: add new flushing states for the delayed refs rsv btrfs: update may_commit_transaction to use the delayed refs rsv btrfs: introduce delayed_refs_rsv btrfs: only track ref_heads in delayed_ref_updates ... commit 7bbbf2c2fc84dd24cae8615b11a0c6cac12cbe94 Merge: b71acb0e37216 bc0205612bbd4 Author: Linus Torvalds Date: Thu Dec 27 16:42:39 2018 -0800 Merge tag 'gfs2-4.21.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 updates from Bob Peterson: - Enhancements and performance improvements to journal replay (Abhi Das) - Cleanup of gfs2_is_ordered and gfs2_is_writeback (Andreas Gruenbacher) - Fix a potential double-free in inode creation (Andreas Gruenbacher) - Fix the bitmap search loop that was searching too far (Andreas Gruenbacher) - Various cleanups (Andreas Gruenbacher, Bob Peterson) - Implement Steve Whitehouse's patch to dump nrpages for inodes (Bob Peterson) - Fix a withdraw bug where stuffed journaled data files didn't allocate enough journal space to be grown (Bob Peterson) * tag 'gfs2-4.21.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: take jdata unstuff into account in do_grow gfs2: Dump nrpages for inodes and their glocks gfs2: Fix loop in gfs2_rbm_find gfs2: Get rid of potential double-freeing in gfs2_create_inode gfs2: Remove vestigial bd_ops gfs2: read journal in large chunks to locate the head gfs2: add a helper function to get_log_header that can be used elsewhere gfs2: changes to gfs2_log_XXX_bio gfs2: add more timing info to journal recovery process gfs2: Fix the gfs2_invalidatepage description gfs2: Clean up gfs2_is_{ordered,writeback} commit a3c9311f62b4943228ae90f769775dd3bcbfa7c0 Author: Robert P. J. Day Date: Thu Dec 27 16:10:59 2018 -0500 include/linux/phy/phy.h: fix minor kerneldoc errors Correct two minor kerneldoc errors: 1) missing reference to @mode in struct phy_ops 2) obsolete reference to @init_data in struct_phy_attrs, removed in dbc98635e0d42f0e62ea92813df1e0e4c90f8375 Signed-off-by: Robert P. J. Day Signed-off-by: David S. Miller commit d8de01b763e0d8b3b418d3606d26f203983b6637 Author: Robert P. J. Day Date: Wed Dec 26 06:35:23 2018 -0600 phy.h: fix obvious errors in doc and kerneldoc content 1) note that gianfar_phy.c was removed years ago 2) fix obvious copy and paste error in regular doc 3) change regular doc into kerneldoc for phy_modes() Signed-off-by: Robert P. J. Day Signed-off-by: David S. Miller commit 40752b3eae29f8ca2378e978a02bd6dbeeb06d16 Author: Wen Yang Date: Wed Dec 26 16:28:30 2018 +0800 net/wan/fsl_ucc_hdlc: Avoid double free in ucc_hdlc_probe() This patch fixes potential double frees if register_hdlc_device() fails. Signed-off-by: Wen Yang Reviewed-by: Peng Hao CC: Zhao Qiang CC: "David S. Miller" CC: netdev@vger.kernel.org CC: linuxppc-dev@lists.ozlabs.org CC: linux-kernel@vger.kernel.org Signed-off-by: David S. Miller commit 92ee77d148bf06d8c52664be4d1b862583fd5c0e Author: Kangjie Lu Date: Wed Dec 26 00:31:08 2018 -0600 net: marvell: fix a missing check of acpi_match_device When acpi_match_device fails, its return value is NULL. Directly using the return value without a check may result in a NULL-pointer dereference. The fix checks if acpi_match_device fails, and if so, returns -EINVAL. Signed-off-by: Kangjie Lu Signed-off-by: David S. Miller commit 46273cf7e009231d2b6bc10a926e82b8928a9fb2 Author: Kangjie Lu Date: Wed Dec 26 00:09:04 2018 -0600 tipc: fix a missing check of genlmsg_put genlmsg_put could fail. The fix inserts a check of its return value, and if it fails, returns -EMSGSIZE. Signed-off-by: Kangjie Lu Signed-off-by: David S. Miller commit ff07d48d7bc0974d4f96a85a4df14564fb09f1ef Author: Kangjie Lu Date: Tue Dec 25 22:23:19 2018 -0600 atl1e: checking the status of atl1e_write_phy_reg atl1e_write_phy_reg() could fail. The fix issues an error message when it fails. Signed-off-by: Kangjie Lu Signed-off-by: David S. Miller commit e49505f7255be8ced695919c08a29bf2c3d79616 Author: Kangjie Lu Date: Tue Dec 25 22:08:18 2018 -0600 net: dsa: bcm_sf2: Propagate error value from mdio_write Both bcm_sf2_sw_indir_rw and mdiobus_write_nested could fail, so let's return their error codes upstream. Signed-off-by: Kangjie Lu Signed-off-by: David S. Miller commit f86a3b83833e7cfe558ca4d70b64ebc48903efec Author: Kangjie Lu Date: Tue Dec 25 20:57:14 2018 -0600 net: stmicro: fix a missing check of clk_prepare clk_prepare() could fail, so let's check its status, and if it fails, return its error code upstream. Signed-off-by: Kangjie Lu Signed-off-by: David S. Miller commit 2d822f2dbab7f4c820f72eb8570aacf3f35855bd Author: Kangjie Lu Date: Tue Dec 25 20:55:37 2018 -0600 net: (cpts) fix a missing check of clk_prepare clk_prepare() could fail, so let's check its status, and if it fails, return its error code upstream. Signed-off-by: Kangjie Lu Signed-off-by: David S. Miller commit 26fd962bde0b15e54234fe762d86bc0349df1de4 Author: Kangjie Lu Date: Tue Dec 25 01:56:14 2018 -0600 niu: fix missing checks of niu_pci_eeprom_read niu_pci_eeprom_read() may fail, so we should check its return value before using the read data. Signed-off-by: Kangjie Lu Acked-by: Shannon Nelson Signed-off-by: David S. Miller commit ca19fcb6285bfce1601c073bf4b9d2942e2df8d9 Author: Aditya Pakki Date: Mon Dec 24 15:21:21 2018 -0600 net: chelsio: Add a missing check on cudg_get_buffer cudbg_collect_hw_sched() could fail when the function cudg_get_buffer() returns an error. The fix adds a check to the latter function returning error on failure Signed-off-by: Aditya Pakki Signed-off-by: David S. Miller commit f0fb9b288d0a7e9cc324ae362e2dfd2cc2217ded Author: Aditya Pakki Date: Mon Dec 24 10:30:17 2018 -0600 ipv6/route: Add a missing check on proc_dointvec While flushing the cache via ipv6_sysctl_rtcache_flush(), the call to proc_dointvec() may fail. The fix adds a check that returns the error, on failure. Signed-off-by: Aditya Pakki Signed-off-by: David S. Miller commit dc4501ff287547dea7ca10f1c580c741291a8760 Author: Cong Wang Date: Sun Dec 23 21:45:56 2018 -0800 tipc: fix a double free in tipc_enable_bearer() bearer_disable() already calls kfree_rcu() to free struct tipc_bearer, we don't need to call kfree() again. Fixes: cb30a63384bc ("tipc: refactor function tipc_enable_bearer()") Reported-by: syzbot+b981acf1fb240c0c128b@syzkaller.appspotmail.com Cc: Ying Xue Cc: Jon Maloy Signed-off-by: Cong Wang Signed-off-by: David S. Miller commit b71acb0e372160167bf6d5500b88b30b52ccef6e Merge: e0c38a4d1f196 c79b411eaa725 Author: Linus Torvalds Date: Thu Dec 27 13:53:32 2018 -0800 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto updates from Herbert Xu: "API: - Add 1472-byte test to tcrypt for IPsec - Reintroduced crypto stats interface with numerous changes - Support incremental algorithm dumps Algorithms: - Add xchacha12/20 - Add nhpoly1305 - Add adiantum - Add streebog hash - Mark cts(cbc(aes)) as FIPS allowed Drivers: - Improve performance of arm64/chacha20 - Improve performance of x86/chacha20 - Add NEON-accelerated nhpoly1305 - Add SSE2 accelerated nhpoly1305 - Add AVX2 accelerated nhpoly1305 - Add support for 192/256-bit keys in gcmaes AVX - Add SG support in gcmaes AVX - ESN for inline IPsec tx in chcr - Add support for CryptoCell 703 in ccree - Add support for CryptoCell 713 in ccree - Add SM4 support in ccree - Add SM3 support in ccree - Add support for chacha20 in caam/qi2 - Add support for chacha20 + poly1305 in caam/jr - Add support for chacha20 + poly1305 in caam/qi2 - Add AEAD cipher support in cavium/nitrox" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (130 commits) crypto: skcipher - remove remnants of internal IV generators crypto: cavium/nitrox - Fix build with !CONFIG_DEBUG_FS crypto: salsa20-generic - don't unnecessarily use atomic walk crypto: skcipher - add might_sleep() to skcipher_walk_virt() crypto: x86/chacha - avoid sleeping under kernel_fpu_begin() crypto: cavium/nitrox - Added AEAD cipher support crypto: mxc-scc - fix build warnings on ARM64 crypto: api - document missing stats member crypto: user - remove unused dump functions crypto: chelsio - Fix wrong error counter increments crypto: chelsio - Reset counters on cxgb4 Detach crypto: chelsio - Handle PCI shutdown event crypto: chelsio - cleanup:send addr as value in function argument crypto: chelsio - Use same value for both channel in single WR crypto: chelsio - Swap location of AAD and IV sent in WR crypto: chelsio - remove set but not used variable 'kctx_len' crypto: ux500 - Use proper enum in hash_set_dma_transfer crypto: ux500 - Use proper enum in cryp_set_dma_transfer crypto: aesni - Add scatter/gather avx stubs, and use them in C crypto: aesni - Introduce partial block macro .. commit 940b241d9050fc354f68c182e99fc3da1ff36bc0 Author: Anton Ivanov Date: Tue Nov 13 15:08:02 2018 +0000 um: Remove obsolete reenable_XX calls reenable_fd has been a NOP since the introduction of the EPOLL based interrupt controller. reenable_channel() is no longer needed as the flow control is now handled via the write IRQs on the channel. Signed-off-by: Anton Ivanov Signed-off-by: Richard Weinberger commit b9794231737ab8c8a3a225b50aa168c4c7f9b9ec Author: Christoph Hellwig Date: Thu Dec 27 08:33:24 2018 +0100 um: writev needs vector_user.c doesn't compile without this for me. Signed-off-by: Christoph Hellwig Signed-off-by: Richard Weinberger commit 9de74842ee20b425d227ab66d865d5ec908fbc2c Author: Anton Ivanov Date: Tue Dec 18 14:01:44 2018 +0000 Add Anton Ivanov to UML maintainers Signed-off-by: Anton Ivanov Acked-by: Richard Weinberger Signed-off-by: Richard Weinberger commit efe5f5be1e40be76d25da69f76f0b68dc6bafb8e Author: Masahiro Yamada Date: Sun Dec 16 23:37:06 2018 +0900 um: remove redundant generic-y This commit removes redundant generic-y defines in arch/um/include/asm/Kbuild. It is redundant to define generic-y when arch-specific implementation exists in arch/$(ARCH)/include/asm/*.h Remove the following generic-y: hardirq.h io.h Signed-off-by: Masahiro Yamada Signed-off-by: Richard Weinberger commit 742f3c8193a3cb3e444887211214ef0721e3ef8d Author: Anton Ivanov Date: Fri Dec 7 09:05:53 2018 +0000 um: Optimize Flush TLB for force/fork case When UML handles a fork the page tables need to be brought up to date. That was done using brute force - full tlb flush. This is actually unnecessary, because the mapped-in mappings are all correct and the only mappings which need to be updated after a flush are any unmaps (so that paging works) as well as any pending protection changes. This optimization squeezes out up to 3% from a full kernel rebuild time under memory pressure. Signed-off-by: Anton Ivanov Signed-off-by: Richard Weinberger commit 8892d8545f2d0342b9c550defbfb165db237044b Author: Anton Ivanov Date: Wed Dec 5 12:37:41 2018 +0000 um: Avoid marking pages with "changed protection" Changing protection is a very high cost operation in UML because in addition to an extra syscall it also interrupts mmap merge sequences generated by the tlb. While the condition is not particularly common it is worth avoiding. Signed-off-by: Anton Ivanov Signed-off-by: Richard Weinberger commit 38e3cbd9b82c815006c505ad2995013a61af143e Author: Anton Ivanov Date: Wed Dec 5 12:37:40 2018 +0000 um: Skip TLB flushing where not needed Skip TLB flushing for all cases where it is not needed, not just flush_tlb_mm_range Signed-off-by: Anton Ivanov Signed-off-by: Richard Weinberger commit a9c52c2a2881ec69343a49ee32b2f3965e74ca98 Author: Anton Ivanov Date: Wed Dec 5 12:37:39 2018 +0000 um: Optimize TLB operations v2 Make the code to merge mmap/munmap/mprotect operations in tlb.c common for userspace and kernel. Kernel tlb operations can now be merged as well. Signed-off-by: Anton Ivanov Signed-off-by: Richard Weinberger commit 747b254ca2649d0c206385c7902fb8ac97a2b0b4 Author: Anton Ivanov Date: Thu Nov 22 14:45:13 2018 +0000 um: Remove unnecessary faulted check in uaccess.c It is not necessary to check if a fault has occured or not after disabling pagefaults. kmap_atomic does that in all cases and we can disable it for 64 bit where kmap is not needed and a simple page_address would suffice. dd if=/dev/zero of=/dev/null bs=1M count=1M Before: 3.1GB/s. After: 3.5GB/s There is a noticeable difference for file disk read and write as well as less noticeable difference for network IO. Signed-off-by: Anton Ivanov Signed-off-by: Richard Weinberger commit 50109b5a03b4024eb6b8df3ab8f427625f54fe92 Author: Anton Ivanov Date: Wed Nov 14 18:41:09 2018 +0000 um: Add support for DISCARD in the UBD Driver Support for DISCARD and WRITE_ZEROES in the ubd driver using fallocate. DISCARD is enabled by default and can be disabled using a new UBD command line flag. If the underlying fs on which the UBD image is stored does not support DISCARD the support for both DISCARD and WRITE_ZEROES is turned off. Signed-off-by: Anton Ivanov Signed-off-by: Richard Weinberger commit a41421edb926fcc8f212742b2e7a1f21c9047853 Author: Anton Ivanov Date: Wed Nov 14 18:41:08 2018 +0000 um: Remove unsafe printks from the io thread Printk out of the io thread has been proven to be unsafe. This is not surprising as the thread is part of the UML hypervisor code. It is not supposed to invoke any kernel code/resources. It is necesssary to pass the error to the block IO layer and let it Signed-off-by: Anton Ivanov Signed-off-by: Richard Weinberger commit 53766defb8c860a47e2a965f5b4b05ed2848e2d0 Author: Anton Ivanov Date: Wed Nov 14 18:41:07 2018 +0000 um: Clean-up command processing in UML UBD driver Clean-up command processing and return BLK_STS_NOTSUP for uknown commands. Signed-off-by: Anton Ivanov Signed-off-by: Richard Weinberger commit a43c83161a5ec1631a54338dd9b734b3cdce8d9a Author: Anton Ivanov Date: Wed Nov 14 18:41:06 2018 +0000 um: Switch to block-mq constants in the UML UBD driver Switch to block mq-constants for both commands, error codes and various computations. Signed-off-by: Anton Ivanov Signed-off-by: Richard Weinberger commit 550ed0e2036663b35cec12374b835444f9c60454 Author: Richard Weinberger Date: Tue Oct 30 12:58:12 2018 +0100 um: Make GCOV depend on !KCOV Both do more or less the same thing and are mutually exclusive. If both are enabled the build will fail. Sooner or later we can kill UML's GCOV. Signed-off-by: Richard Weinberger commit 0053102a869f1b909904b1b85ac282e2744deaab Author: Richard Weinberger Date: Tue Oct 30 12:58:11 2018 +0100 um: Include sys/uio.h to have writev() sys/uio.h gives us writev(), otherwise the build might fail on some systems. Fixes: 49da7e64f33e ("High Performance UML Vector Network Driver") Signed-off-by: Richard Weinberger commit 0d76433c220391672848f2c0607f86f79d5e1a38 Author: Hernán Gonzalez Date: Tue Oct 30 12:58:10 2018 +0100 um: Add HAVE_DEBUG_BUGVERBOSE This option restores the DEBUG_BUGVERBOSE functionality as it was previous to commit 9a93848fe787 ("x86/debug: Implement __WARN() using UD0"). Signed-off-by: Hernán Gonzalez Signed-off-by: Richard Weinberger commit dbd0be61fb5a03db59450b42fbb689faece8b0ad Author: Richard Weinberger Date: Thu Nov 1 22:27:01 2018 +0100 um: Update maintainers file entry - Remove stale fs/hppfs/ reference - Point to our patchwork queue Signed-off-by: Richard Weinberger commit e0c38a4d1f196a4b17d2eba36afff8f656a4f1de Merge: 7f9f852c75e7d 90cadbbf341dd Author: Linus Torvalds Date: Thu Dec 27 13:04:52 2018 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next Pull networking updates from David Miller: 1) New ipset extensions for matching on destination MAC addresses, from Stefano Brivio. 2) Add ipv4 ttl and tos, plus ipv6 flow label and hop limit offloads to nfp driver. From Stefano Brivio. 3) Implement GRO for plain UDP sockets, from Paolo Abeni. 4) Lots of work from Michał Mirosław to eliminate the VLAN_TAG_PRESENT bit so that we could support the entire vlan_tci value. 5) Rework the IPSEC policy lookups to better optimize more usecases, from Florian Westphal. 6) Infrastructure changes eliminating direct manipulation of SKB lists wherever possible, and to always use the appropriate SKB list helpers. This work is still ongoing... 7) Lots of PHY driver and state machine improvements and simplifications, from Heiner Kallweit. 8) Various TSO deferral refinements, from Eric Dumazet. 9) Add ntuple filter support to aquantia driver, from Dmitry Bogdanov. 10) Batch dropping of XDP packets in tuntap, from Jason Wang. 11) Lots of cleanups and improvements to the r8169 driver from Heiner Kallweit, including support for ->xmit_more. This driver has been getting some much needed love since he started working on it. 12) Lots of new forwarding selftests from Petr Machata. 13) Enable VXLAN learning in mlxsw driver, from Ido Schimmel. 14) Packed ring support for virtio, from Tiwei Bie. 15) Add new Aquantia AQtion USB driver, from Dmitry Bezrukov. 16) Add XDP support to dpaa2-eth driver, from Ioana Ciocoi Radulescu. 17) Implement coalescing on TCP backlog queue, from Eric Dumazet. 18) Implement carrier change in tun driver, from Nicolas Dichtel. 19) Support msg_zerocopy in UDP, from Willem de Bruijn. 20) Significantly improve garbage collection of neighbor objects when the table has many PERMANENT entries, from David Ahern. 21) Remove egdev usage from nfp and mlx5, and remove the facility completely from the tree as it no longer has any users. From Oz Shlomo and others. 22) Add a NETDEV_PRE_CHANGEADDR so that drivers can veto the change and therefore abort the operation before the commit phase (which is the NETDEV_CHANGEADDR event). From Petr Machata. 23) Add indirect call wrappers to avoid retpoline overhead, and use them in the GRO code paths. From Paolo Abeni. 24) Add support for netlink FDB get operations, from Roopa Prabhu. 25) Support bloom filter in mlxsw driver, from Nir Dotan. 26) Add SKB extension infrastructure. This consolidates the handling of the auxiliary SKB data used by IPSEC and bridge netfilter, and is designed to support the needs to MPTCP which could be integrated in the future. 27) Lots of XDP TX optimizations in mlx5 from Tariq Toukan. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1845 commits) net: dccp: fix kernel crash on module load drivers/net: appletalk/cops: remove redundant if statement and mask bnx2x: Fix NULL pointer dereference in bnx2x_del_all_vlans() on some hw net/net_namespace: Check the return value of register_pernet_subsys() net/netlink_compat: Fix a missing check of nla_parse_nested ieee802154: lowpan_header_create check must check daddr net/mlx4_core: drop useless LIST_HEAD mlxsw: spectrum: drop useless LIST_HEAD net/mlx5e: drop useless LIST_HEAD iptunnel: Set tun_flags in the iptunnel_metadata_reply from src net/mlx5e: fix semicolon.cocci warnings staging: octeon: fix build failure with XFRM enabled net: Revert recent Spectre-v1 patches. can: af_can: Fix Spectre v1 vulnerability packet: validate address length if non-zero nfc: af_nfc: Fix Spectre v1 vulnerability phonet: af_phonet: Fix Spectre v1 vulnerability net: core: Fix Spectre v1 vulnerability net: minor cleanup in skb_ext_add() net: drop the unused helper skb_ext_get() ... commit 7f9f852c75e7d776b078813586c76a2bc7dca993 Merge: 3f03bf93947fa 93d77e7f1410c Author: Linus Torvalds Date: Thu Dec 27 12:08:33 2018 -0800 Merge tag 'modules-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux Pull modules updates from Jessica Yu: - Some modules-related kallsyms cleanups and a kallsyms fix for ARM. - Include keys from the secondary keyring in module signature verification. * tag 'modules-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux: ARM: module: Fix function kallsyms on Thumb-2 module: Overwrite st_size instead of st_info module: make it clearer when we're handling kallsyms symbols vs exported symbols modsign: use all trusted keys to verify module signature commit 3f03bf93947fa2a2b84fac56e93c65d4fffed7f1 Merge: fb2a624d5fe8b b49d564344f77 Author: Linus Torvalds Date: Thu Dec 27 12:04:52 2018 -0800 Merge branch 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security Pull general security subsystem updates from James Morris: "The main changes here are Paul Gortmaker's removal of unneccesary module.h infrastructure" * 'next-general' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: security: integrity: partial revert of make ima_main explicitly non-modular security: fs: make inode explicitly non-modular security: audit and remove any unnecessary uses of module.h security: integrity: make evm_main explicitly non-modular keys: remove needless modular infrastructure from ecryptfs_format security: integrity: make ima_main explicitly non-modular tomoyo: fix small typo commit fb2a624d5fe8b9206d14bff52da7a368a3a8374c Merge: 047ce6d380e8e ee1a84fdfeedf Author: Linus Torvalds Date: Thu Dec 27 12:01:58 2018 -0800 Merge tag 'selinux-pr-20181224' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull selinux patches from Paul Moore: "I already used my best holiday pull request lines in the audit pull request, so this one is going to be a bit more boring, sorry about that. To make up for this, we do have a birthday of sorts to celebrate: SELinux turns 18 years old this December. Perhaps not the most exciting thing in the world for most people, but I think it's safe to say that anyone reading this email doesn't exactly fall into the "most people" category. Back to business and the pull request itself: Ondrej has five patches in this pull request and I lump them into three categories: one patch to always allow submounts (using similar logic to elsewhere in the kernel), one to fix some issues with the SELinux policydb, and the others to cleanup and improve the SELinux sidtab. The other patches from Alexey and Petr and trivial fixes that are adequately described in their respective subject lines. With this last pull request of the year, I want to thank everyone who has contributed patches, testing, and reviews to the SELinux project this year, and the past 18 years. Like any good open source effort, SELinux is only as good as the community which supports it, and I'm very happy that we have the community we do - thank you all!" * tag 'selinux-pr-20181224' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: overhaul sidtab to fix bug and improve performance selinux: use separate table for initial SID lookup selinux: make "selinux_policycap_names[]" const char * selinux: always allow mounting submounts selinux: refactor sidtab conversion Documentation: Update SELinux reference policy URL selinux: policydb - fix byte order and alignment issues commit 047ce6d380e8e66cfb6cbc22e873af89dd0c216c Merge: a3b5c1065f3fb d406db524c32c Author: Linus Torvalds Date: Thu Dec 27 11:58:50 2018 -0800 Merge tag 'audit-pr-20181224' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit updates from Paul Moore: "In the finest of holiday of traditions, I have a number of gifts to share today. While most of them are re-gifts from others, unlike the typical re-gift, these are things you will want in and around your tree; I promise. This pull request is perhaps a bit larger than our typical PR, but most of it comes from Jan's rework of audit's fanotify code; a very welcome improvement. We ran this through our normal regression tests, as well as some newly created stress tests and everything looks good. Richard added a few patches, mostly cleaning up a few things and and shortening some of the audit records that we send to userspace; a change the userspace folks are quite happy about. Finally YueHaibing and I kick in a few patches to simplify things a bit and make the code less prone to errors. Lastly, I want to say thanks one more time to everyone who has contributed patches, testing, and code reviews for the audit subsystem over the past year. The project is what it is due to your help and contributions - thank you" * tag 'audit-pr-20181224' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: (22 commits) audit: remove duplicated include from audit.c audit: shorten PATH cap values when zero audit: use current whenever possible audit: minimize our use of audit_log_format() audit: remove WATCH and TREE config options audit: use session_info helper audit: localize audit_log_session_info prototype audit: Use 'mark' name for fsnotify_mark variables audit: Replace chunk attached to mark instead of replacing mark audit: Simplify locking around untag_chunk() audit: Drop all unused chunk nodes during deletion audit: Guarantee forward progress of chunk untagging audit: Allocate fsnotify mark independently of chunk audit: Provide helper for dropping mark's chunk reference audit: Remove pointless check in insert_hash() audit: Factor out chunk replacement code audit: Make hash table insertion safe against concurrent lookups audit: Embed key into chunk audit: Fix possible tagging failures audit: Fix possible spurious -ENOSPC error ... commit a3b5c1065f3fb934a87dd07d23def99916023d6f Merge: c6f1b355d4516 07c17732bd687 Author: Linus Torvalds Date: Thu Dec 27 11:24:43 2018 -0800 Merge tag 'printk-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk Pull printk updates from Petr Mladek: - Keep spinlocks busted until the end of panic() - Fix races between calculating number of messages that would fit into user space buffers, filling the buffers, and switching printk.time parameter - Some code clean up * tag 'printk-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk: printk: Remove print_prefix() calls with NULL buffer. printk: fix printk_time race. printk: Make printk_emit() local function. panic: avoid deadlocks in re-entrant console drivers commit c6f1b355d451680a45d63ce66cea67057c938a87 Merge: c06e9ef6918b1 189af4657186d Author: Linus Torvalds Date: Thu Dec 27 11:19:07 2018 -0800 Merge tag 'gcc-plugins-v4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull gcc-plugins update from Kees Cook: "Both arm and arm64 are gaining per-task stack canaries (to match x86), but arm is being done with a gcc plugin, hence it going through the gcc-plugins tree. New gcc-plugin: - Enable per-task stack protector for ARM (Ard Biesheuvel)" * tag 'gcc-plugins-v4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: ARM: smp: add support for per-task stack canaries commit c06e9ef6918b1a6d183f1fef78ebc66f054a7b5a Merge: 8d6973327ee84 8665569e97dd5 Author: Linus Torvalds Date: Thu Dec 27 11:15:21 2018 -0800 Merge tag 'pstore-v4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull pstore updates from Kees Cook: "Improvements and refactorings: - Improve compression handling - Refactor argument handling during initialization - Avoid needless locking for saner EFI backend handling - Add more kern-doc and improve debugging output" * tag 'pstore-v4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: pstore/ram: Avoid NULL deref in ftrace merging failure path pstore: Convert buf_lock to semaphore pstore: Fix bool initialization/comparison pstore/ram: Do not treat empty buffers as valid pstore/ram: Simplify ramoops_get_next_prz() arguments pstore: Map PSTORE_TYPE_* to strings pstore: Replace open-coded << with BIT() pstore: Improve and update some comments and status output pstore/ram: Add kern-doc for struct persistent_ram_zone pstore/ram: Report backend assignments with finer granularity pstore/ram: Standardize module name in ramoops pstore: Avoid duplicate call of persistent_ram_zap() pstore: Remove needless lock during console writes pstore: Do not use crash buffer for decompression commit 8d6973327ee84c2f40dd9efd8928d4a1186c96e2 Merge: 6d101ba6be2a2 12526b0d6c580 Author: Linus Torvalds Date: Thu Dec 27 10:43:24 2018 -0800 Merge tag 'powerpc-4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc updates from Michael Ellerman: "Notable changes: - Mitigations for Spectre v2 on some Freescale (NXP) CPUs. - A large series adding support for pass-through of Nvidia V100 GPUs to guests on Power9. - Another large series to enable hardware assistance for TLB table walk on MPC8xx CPUs. - Some preparatory changes to our DMA code, to make way for further cleanups from Christoph. - Several fixes for our Transactional Memory handling discovered by fuzzing the signal return path. - Support for generating our system call table(s) from a text file like other architectures. - A fix to our page fault handler so that instead of generating a WARN_ON_ONCE, user accesses of kernel addresses instead print a ratelimited and appropriately scary warning. - A cosmetic change to make our unhandled page fault messages more similar to other arches and also more compact and informative. - Freescale updates from Scott: "Highlights include elimination of legacy clock bindings use from dts files, an 83xx watchdog handler, fixes to old dts interrupt errors, and some minor cleanup." And many clean-ups, reworks and minor fixes etc. Thanks to: Alexandre Belloni, Alexey Kardashevskiy, Andrew Donnellan, Aneesh Kumar K.V, Arnd Bergmann, Benjamin Herrenschmidt, Breno Leitao, Christian Lamparter, Christophe Leroy, Christoph Hellwig, Daniel Axtens, Darren Stevens, David Gibson, Diana Craciun, Dmitry V. Levin, Firoz Khan, Geert Uytterhoeven, Greg Kurz, Gustavo Romero, Hari Bathini, Joel Stanley, Kees Cook, Madhavan Srinivasan, Mahesh Salgaonkar, Markus Elfring, Mathieu Malaterre, Michal Suchánek, Naveen N. Rao, Nick Desaulniers, Oliver O'Halloran, Paul Mackerras, Ram Pai, Ravi Bangoria, Rob Herring, Russell Currey, Sabyasachi Gupta, Sam Bobroff, Satheesh Rajendran, Scott Wood, Segher Boessenkool, Stephen Rothwell, Tang Yuantian, Thiago Jung Bauermann, Yangtao Li, Yuantian Tang, Yue Haibing" * tag 'powerpc-4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (201 commits) Revert "powerpc/fsl_pci: simplify fsl_pci_dma_set_mask" powerpc/zImage: Also check for stdout-path powerpc: Fix HMIs on big-endian with CONFIG_RELOCATABLE=y macintosh: Use of_node_name_{eq, prefix} for node name comparisons ide: Use of_node_name_eq for node name comparisons powerpc: Use of_node_name_eq for node name comparisons powerpc/pseries/pmem: Convert to %pOFn instead of device_node.name powerpc/mm: Remove very old comment in hash-4k.h powerpc/pseries: Fix node leak in update_lmb_associativity_index() powerpc/configs/85xx: Enable CONFIG_DEBUG_KERNEL powerpc/dts/fsl: Fix dtc-flagged interrupt errors clk: qoriq: add more compatibles strings powerpc/fsl: Use new clockgen binding powerpc/83xx: handle machine check caused by watchdog timer powerpc/fsl-rio: fix spelling mistake "reserverd" -> "reserved" powerpc/fsl_pci: simplify fsl_pci_dma_set_mask arch/powerpc/fsl_rmu: Use dma_zalloc_coherent vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] subdriver vfio_pci: Allow regions to add own capabilities vfio_pci: Allow mapping extra regions ... commit 6d101ba6be2a26a3e1f513b5e293f0fd2b79ec5c Author: Olof Johansson Date: Sun Nov 25 14:41:05 2018 -0800 sched/fair: Fix warning on non-SMP build Caused by making the variable static: kernel/sched/fair.c:119:21: warning: 'capacity_margin' defined but not used [-Wunused-variable] Seems easiest to just move it up under the existing ifdef CONFIG_SMP that's a few lines above. Fixes: ed8885a14433a ('sched/fair: Make some variables static') Signed-off-by: Olof Johansson Signed-off-by: Linus Torvalds commit d025bff1b6b923ce9c2f744d8278e0f2d6609eaf Author: Dengcheng Zhu Date: Wed Dec 26 22:08:52 2018 +0000 mailmap: Update name spelling and email for Dengcheng Zhu Change my first name spelling from Deng-Cheng to Dengcheng. Update email addresses. Signed-off-by: Dengcheng Zhu Signed-off-by: Paul Burton Cc: linux-mips@linux-mips.org commit 88cc9fc41c7318565bcf28a843b1e4e3f2acf894 Author: Aisheng Dong Date: Tue Dec 18 15:22:54 2018 +0000 dt-bindings: arm: fsl-scu: add imx8qm pinctrl support Update binding doc to support imx8qm pinctrl. Cc: Rob Herring Cc: Stefan Agner Cc: Shawn Guo Cc: Sascha Hauer Cc: Fabio Estevam Cc: Mark Rutland Cc: devicetree@vger.kernel.org Cc: Pengutronix Kernel Team Signed-off-by: Dong Aisheng Signed-off-by: Linus Walleij commit b09f629ce36d94381f96a03ea1507861d1d5de3b Author: Abel Vesa Date: Sun Dec 23 07:08:31 2018 +0000 pinctrl: freescale: Break dependency on SOC_IMX8MQ for i.MX8MQ The CONFIG_SOC_IMX8MQ will go away, so the dependency can be based on ARCH_MXC && ARM64. Signed-off-by: Abel Vesa Acked-by: Dong Aisheng Reviewed-by: Fabio Estevam Signed-off-by: Linus Walleij commit df50fcf5462cec45618bdb6013c84c469b73f3e5 Author: Guido Günther Date: Wed Dec 26 14:54:34 2018 +0100 pinctrl: imx-scu: Depend on IMX_SCU Otherwise building fails with only PINCTRL_IMX_SCU selected: aarch64-linux-gnu-ld: drivers/pinctrl/freescale/pinctrl-scu.o: in function `imx_pinctrl_sc_ipc_init': pinctrl-scu.c:(.text+0x10): undefined reference to `imx_scu_get_handle' aarch64-linux-gnu-ld: pinctrl-scu.c:(.text+0x10): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `imx_scu_get_handle' aarch64-linux-gnu-ld: drivers/pinctrl/freescale/pinctrl-scu.o: in function `imx_pinconf_get_scu': pinctrl-scu.c:(.text+0x64): undefined reference to `imx_scu_call_rpc' aarch64-linux-gnu-ld: pinctrl-scu.c:(.text+0x64): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `imx_scu_call_rpc' aarch64-linux-gnu-ld: drivers/pinctrl/freescale/pinctrl-scu.o: in function `imx_pinconf_set_scu': pinctrl-scu.c:(.text+0x104): undefined reference to `imx_scu_call_rpc' aarch64-linux-gnu-ld: pinctrl-scu.c:(.text+0x104): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `imx_scu_call_rpc' make: *** [Makefile:1038: vmlinux] Error 1 Signed-off-by: Guido Günther Reviewed-by: Fabio Estevam Signed-off-by: Linus Walleij commit 64beba0558fce7b59e9a8a7afd77290e82a22163 Author: Jaegeuk Kim Date: Wed Dec 26 19:54:07 2018 -0800 f2fs: sanity check of xattr entry size There is a security report where f2fs_getxattr() has a hole to expose wrong memory region when the image is malformed like this. f2fs_getxattr: entry->e_name_len: 4, size: 12288, buffer_size: 16384, len: 4 Cc: Signed-off-by: Jaegeuk Kim commit fc2fd5f0f1aa85925be2322275ee2dc5ac3acdf4 Merge: e57d9f638af96 c04e55388a4f2 Author: Linus Torvalds Date: Wed Dec 26 18:42:51 2018 -0800 Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 platform update from Ingo Molnar: "An OLPC platform support simplification patch" * 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/platform/olpc: Do not call of_platform_bus_probe() commit e57d9f638af9673f38d9f09de66fa0a28303127d Merge: d6e867a6ae13b 6848ac7ca39a2 Author: Linus Torvalds Date: Wed Dec 26 18:08:18 2018 -0800 Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 mm updates from Ingo Molnar: "The main changes in this cycle were: - Update and clean up x86 fault handling, by Andy Lutomirski. - Drop usage of __flush_tlb_all() in kernel_physical_mapping_init() and related fallout, by Dan Williams. - CPA cleanups and reorganization by Peter Zijlstra: simplify the flow and remove a few warts. - Other misc cleanups" * 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (29 commits) x86/mm/dump_pagetables: Use DEFINE_SHOW_ATTRIBUTE() x86/mm/cpa: Rename @addrinarray to @numpages x86/mm/cpa: Better use CLFLUSHOPT x86/mm/cpa: Fold cpa_flush_range() and cpa_flush_array() into a single cpa_flush() function x86/mm/cpa: Make cpa_data::numpages invariant x86/mm/cpa: Optimize cpa_flush_array() TLB invalidation x86/mm/cpa: Simplify the code after making cpa->vaddr invariant x86/mm/cpa: Make cpa_data::vaddr invariant x86/mm/cpa: Add __cpa_addr() helper x86/mm/cpa: Add ARRAY and PAGES_ARRAY selftests x86/mm: Drop usage of __flush_tlb_all() in kernel_physical_mapping_init() x86/mm: Validate kernel_physical_mapping_init() PTE population generic/pgtable: Introduce set_pte_safe() generic/pgtable: Introduce {p4d,pgd}_same() generic/pgtable: Make {pmd, pud}_same() unconditionally available x86/fault: Clean up the page fault oops decoder a bit x86/fault: Decode page fault OOPSes better x86/vsyscall/64: Use X86_PF constants in the simulated #PF error code x86/oops: Show the correct CS value in show_regs() x86/fault: Don't try to recover from an implicit supervisor access ... commit d6e867a6ae13bc02cd01c535764e5b051d26cf28 Merge: db2ab474c4a43 12209993e98c5 Author: Linus Torvalds Date: Wed Dec 26 17:37:51 2018 -0800 Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fpu updates from Ingo Molnar: "Misc preparatory changes for an upcoming FPU optimization that will delay the loading of FPU registers to return-to-userspace" * 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/fpu: Don't export __kernel_fpu_{begin,end}() x86/fpu: Update comment for __raw_xsave_addr() x86/fpu: Add might_fault() to user_insn() x86/pkeys: Make init_pkru_value static x86/thread_info: Remove _TIF_ALLWORK_MASK x86/process/32: Remove asm/math_emu.h include x86/fpu: Use unsigned long long shift in xfeature_uncompacted_offset() commit db2ab474c4a434872e1794c2af8b2e561caa756e Merge: 312a466155108 aa02ef099cff0 Author: Linus Torvalds Date: Wed Dec 26 17:35:41 2018 -0800 Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cpu updates from Ingo Molnar: "Misc changes: - Fix nr_cpus= boot option interaction bug with logical package management - Clean up UMIP detection messages - Add WBNOINVD instruction detection - Remove the unused get_scattered_cpuid_leaf() function" * 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/topology: Use total_cpus for max logical packages calculation x86/umip: Make the UMIP activated message generic x86/umip: Print UMIP line only once x86/cpufeatures: Add WBNOINVD feature definition x86/cpufeatures: Remove get_scattered_cpuid_leaf() commit 312a466155108329c458049dc76a21ad56106960 Merge: 6e54df001ac92 4b1bacab61aa2 Author: Linus Torvalds Date: Wed Dec 26 17:03:51 2018 -0800 Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cleanups from Ingo Molnar: "Misc cleanups" * 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/kprobes: Remove trampoline_handler() prototype x86/kernel: Fix more -Wmissing-prototypes warnings x86: Fix various typos in comments x86/headers: Fix -Wmissing-prototypes warning x86/process: Avoid unnecessary NULL check in get_wchan() x86/traps: Complete prototype declarations x86/mce: Fix -Wmissing-prototypes warnings x86/gart: Rewrite early_gart_iommu_check() comment commit 6e54df001ac9262e3b78b34b87390fcb54677a0d Merge: 9a126e788af8e e4f752dda0de3 Author: Linus Torvalds Date: Wed Dec 26 16:57:27 2018 -0800 Merge branch 'x86-build-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 build updates from Ingo Molnar: - Resolve LLVM build bug by removing redundant GNU specific flag - Remove obsolete -funit-at-a-time and -fno-unit-at-a-time use from x86 PowerPC and UM. The UML change was seen and acked by UML maintainer Richard Weinberger. * 'x86-build-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/um/vdso: Drop implicit common-page-size linker flag x86, powerpc: Remove -funit-at-a-time compiler option entirely x86/um: Remove -fno-unit-at-a-time workaround for pre-4.0 GCC commit 9a126e788af8e0754d5d19cd98b3a2bc1711ff46 Merge: 38fabca18fc4c 69be4efeb9591 Author: Linus Torvalds Date: Wed Dec 26 16:56:00 2018 -0800 Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 boot updates from Ingo Molnar: "Two cleanups" * 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot: Add missing va_end() to die() x86/boot: Simplify the detect_memory*() control flow commit 38fabca18fc4c832ea95e2d14fb1ecde8b7dcc56 Merge: 8465625ab4700 29434801e7e9c Author: Linus Torvalds Date: Wed Dec 26 16:25:06 2018 -0800 Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 asm updates from Ingo Molnar: "Two changes: - Remove (some) remnants of the vDSO's fake section table mechanism that were left behind when the vDSO build process reverted to using "objdump -S" to strip the userspace image. - Remove hardcoded POPCNT mnemonics now that the minimum binutils version supports the symbolic form" * 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/vdso: Remove a stale/misleading comment from the linker script x86/vdso: Remove obsolete "fake section table" reservation x86: Use POPCNT mnemonics in arch_hweight.h commit 8465625ab4700e3e1db506ed8a541f7796356d63 Merge: 17bf423a1f2d1 210ba1201ff95 Author: Linus Torvalds Date: Wed Dec 26 16:12:50 2018 -0800 Merge branch 'x86-amd-nb-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 AMD northbridge updates from Ingo Molnar: "Update DF/SMN access and k10temp for AMD F17h M30h, by Brian Woods: 'Updates the data fabric/system management network code needed to get k10temp working for M30h. Since there are now processors which have multiple roots per DF/SMN interface, there needs to some logic which skips N-1 root complexes per DF/SMN interface. This is because the root complexes per interface are redundant (as far as DF/SMN goes). These changes shouldn't effect past processors and, for F17h M0Xh, the mappings stay the same.' The hwmon changes were seen and acked by hwmon maintainer Guenter Roeck" * 'x86-amd-nb-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: hwmon/k10temp: Add support for AMD family 17h, model 30h CPUs x86/amd_nb: Add PCI device IDs for family 17h, model 30h x86/amd_nb: Add support for newer PCI topologies hwmon/k10temp, x86/amd_nb: Consolidate shared device IDs commit 60aa4d5536ab7fe32433ca1173bd9d6633851f27 Author: Sahitya Tummala Date: Wed Dec 26 11:20:29 2018 +0530 f2fs: fix use-after-free issue when accessing sbi->stat_info iput() on sbi->node_inode can update sbi->stat_info in the below context, if the f2fs_write_checkpoint() has failed with error. f2fs_balance_fs_bg+0x1ac/0x1ec f2fs_write_node_pages+0x4c/0x260 do_writepages+0x80/0xbc __writeback_single_inode+0xdc/0x4ac writeback_single_inode+0x9c/0x144 write_inode_now+0xc4/0xec iput+0x194/0x22c f2fs_put_super+0x11c/0x1e8 generic_shutdown_super+0x70/0xf4 kill_block_super+0x2c/0x5c kill_f2fs_super+0x44/0x50 deactivate_locked_super+0x60/0x8c deactivate_super+0x68/0x74 cleanup_mnt+0x40/0x78 Fix this by moving f2fs_destroy_stats() further below iput() in both f2fs_put_super() and f2fs_fill_super() paths. Signed-off-by: Sahitya Tummala Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit bae0ee7a767ceeea6d8e170da3f228fbc7480331 Author: Chao Yu Date: Tue Dec 25 17:43:42 2018 +0800 f2fs: check PageWriteback flag for ordered case For all ordered cases in f2fs_wait_on_page_writeback(), we need to check PageWriteback status, so let's clean up to relocate the check into f2fs_wait_on_page_writeback(). Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 88960068f25fcc3759455d85460234dcc9d43fef Author: Martin Blumenstingl Date: Sat Dec 22 11:22:26 2018 +0100 f2fs: fix validation of the block count in sanity_check_raw_super Treat "block_count" from struct f2fs_super_block as 64-bit little endian value in sanity_check_raw_super() because struct f2fs_super_block declares "block_count" as "__le64". This fixes a bug where the superblock validation fails on big endian devices with the following error: F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0) F2FS-fs (sda1): Can't find valid F2FS filesystem in 1th superblock F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0) F2FS-fs (sda1): Can't find valid F2FS filesystem in 2th superblock As result of this the partition cannot be mounted. With this patch applied the superblock validation works fine and the partition can be mounted again: F2FS-fs (sda1): Mounted with checkpoint version = 7c84 My little endian x86-64 hardware was able to mount the partition without this fix. To confirm that mounting f2fs filesystems works on big endian machines again I tested this on a 32-bit MIPS big endian (lantiq) device. Fixes: 0cfe75c5b01199 ("f2fs: enhance sanity_check_raw_super() to avoid potential overflows") Cc: stable@vger.kernel.org Signed-off-by: Martin Blumenstingl Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 8f31b4665c14fe19593601a250275e58c7ad0ef1 Author: Jaegeuk Kim Date: Mon Dec 17 17:08:26 2018 -0800 f2fs: fix missing unlock(sbi->gc_mutex) This fixes missing unlock call. Cc: Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit b32e019049e959ee10ec359893c9dd5d057dad55 Author: Chao Yu Date: Tue Dec 18 19:20:17 2018 +0800 f2fs: fix to dirty inode synchronously If user change inode's i_flags via ioctl, let's add it into global dirty list, so that checkpoint can guarantee its persistence before fsync, it can make checkpoint keeping strong consistency. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit c0362117c3b87322366865e8db000449e5ec2caf Author: Chao Yu Date: Tue Dec 18 19:20:16 2018 +0800 f2fs: clean up structure extent_node The union in struct extent_node wass only to indicate below fields struct rb_node rb_node; union { struct { unsigned int fofs; unsigned int len; ... ... can be parsed as fields in struct rb_entry, but they were never be used explicitly before, so let's remove them for cleanup. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 9249dded7b5cb539a8c8698b25d08a3c15261470 Author: Qiuyang Sun Date: Tue Dec 18 17:32:23 2018 +0800 f2fs: fix block address for __check_sit_bitmap Should use lstart (logical start address) instead of start (in dev) here. This fixes a bug in multi-device scenarios. Signed-off-by: Qiuyang Sun Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit e4589fa545e0020dbbc3c9bde35f35f949901392 Author: Sahitya Tummala Date: Tue Dec 18 16:39:24 2018 +0530 f2fs: fix sbi->extent_list corruption issue When there is a failure in f2fs_fill_super() after/during the recovery of fsync'd nodes, it frees the current sbi and retries again. This time the mount is successful, but the files that got recovered before retry, still holds the extent tree, whose extent nodes list is corrupted since sbi and sbi->extent_list is freed up. The list_del corruption issue is observed when the file system is getting unmounted and when those recoverd files extent node is being freed up in the below context. list_del corruption. prev->next should be fffffff1e1ef5480, but was (null) <...> kernel BUG at kernel/msm-4.14/lib/list_debug.c:53! lr : __list_del_entry_valid+0x94/0xb4 pc : __list_del_entry_valid+0x94/0xb4 <...> Call trace: __list_del_entry_valid+0x94/0xb4 __release_extent_node+0xb0/0x114 __free_extent_tree+0x58/0x7c f2fs_shrink_extent_tree+0xdc/0x3b0 f2fs_leave_shrinker+0x28/0x7c f2fs_put_super+0xfc/0x1e0 generic_shutdown_super+0x70/0xf4 kill_block_super+0x2c/0x5c kill_f2fs_super+0x44/0x50 deactivate_locked_super+0x60/0x8c deactivate_super+0x68/0x74 cleanup_mnt+0x40/0x78 __cleanup_mnt+0x1c/0x28 task_work_run+0x48/0xd0 do_notify_resume+0x678/0xe98 work_pending+0x8/0x14 Fix this by not creating extents for those recovered files if shrinker is not registered yet. Once mount is successful and shrinker is registered, those files can have extents again. Signed-off-by: Sahitya Tummala Signed-off-by: Jaegeuk Kim commit 8ec18bff7b90b56eba5986555c174721ebd5670b Author: Chao Yu Date: Wed Dec 12 18:12:32 2018 +0800 f2fs: clean up checkpoint flow This patch cleans up checkpoint flow a bit: - remove unneeded circulation of flushing meta pages. - don't flush nat_bits pages in prior to other checkpoint pages. - add bug_on to check remained meta pages after flushing. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 76c7bfb3a89371aa87bda99c8ee2611ff5150434 Author: Jaegeuk Kim Date: Thu Dec 13 20:50:51 2018 -0800 f2fs: flush stale issued discard candidates Sometimes, I could observe # of issuing_discard to be 1 which blocks background jobs due to is_idle()=false. The only way to get out of it was to trigger gc_urgent. This patch avoids that by checking any candidates as done in the list. Signed-off-by: Jaegeuk Kim commit 72691af6dbd719349c559117652a70bfd4309ad2 Author: Jaegeuk Kim Date: Thu Dec 13 16:53:57 2018 -0800 f2fs: correct wrong spelling, issing_* Let's use "queued" instead of "issuing". Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 5222595d093ebe80329d38d255d14316257afb3e Author: Jaegeuk Kim Date: Thu Dec 13 18:38:33 2018 -0800 f2fs: use kvmalloc, if kmalloc is failed One report says memalloc failure during mount. (unwind_backtrace) from [] (show_stack+0x10/0x14) (show_stack) from [] (dump_stack+0x8c/0xa0) (dump_stack) from [] (warn_alloc+0xc4/0x160) (warn_alloc) from [] (__alloc_pages_nodemask+0x3f4/0x10d0) (__alloc_pages_nodemask) from [] (kmalloc_order_trace+0x2c/0x120) (kmalloc_order_trace) from [] (build_node_manager+0x35c/0x688) (build_node_manager) from [] (f2fs_fill_super+0xf0c/0x16cc) (f2fs_fill_super) from [] (mount_bdev+0x15c/0x188) (mount_bdev) from [] (f2fs_mount+0x18/0x20) (f2fs_mount) from [] (mount_fs+0x158/0x19c) (mount_fs) from [] (vfs_kern_mount+0x78/0x134) (vfs_kern_mount) from [] (do_mount+0x474/0xca4) (do_mount) from [] (SyS_mount+0x94/0xbc) (SyS_mount) from [] (ret_fast_syscall+0x0/0x48) Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit af56b4870865654dc9aca2c757b95dfe3e715603 Author: Yunlong Song Date: Thu Dec 13 17:43:11 2018 +0800 f2fs: remove redundant comment of unused wio_mutex Commit 089842de ("f2fs: remove codes of unused wio_mutex") removes codes of unused wio_mutex, but missing the comment, so delete it. Signed-off-by: Yunlong Song Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 17bf423a1f2d134187191f0ceb4b395173cc98a7 Merge: 116b081c285d8 732cd75b8c920 Author: Linus Torvalds Date: Wed Dec 26 14:56:10 2018 -0800 Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler updates from Ingo Molnar: "The main changes in this cycle were: - Introduce "Energy Aware Scheduling" - by Quentin Perret. This is a coherent topology description of CPUs in cooperation with the PM subsystem, with the goal to schedule more energy-efficiently on asymetric SMP platform - such as waking up tasks to the more energy-efficient CPUs first, as long as the system isn't oversubscribed. For details of the design, see: https://lore.kernel.org/lkml/20180724122521.22109-1-quentin.perret@arm.com/ - Misc cleanups and smaller enhancements" * 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits) sched/fair: Select an energy-efficient CPU on task wake-up sched/fair: Introduce an energy estimation helper function sched/fair: Add over-utilization/tipping point indicator sched/fair: Clean-up update_sg_lb_stats parameters sched/toplogy: Introduce the 'sched_energy_present' static key sched/topology: Make Energy Aware Scheduling depend on schedutil sched/topology: Disable EAS on inappropriate platforms sched/topology: Add lowest CPU asymmetry sched_domain level pointer sched/topology: Reference the Energy Model of CPUs when available PM: Introduce an Energy Model management framework sched/cpufreq: Prepare schedutil for Energy Aware Scheduling sched/topology: Relocate arch_scale_cpu_capacity() to the internal header sched/core: Remove unnecessary unlikely() in push_*_task() sched/topology: Remove the ::smt_gain field from 'struct sched_domain' sched: Fix various typos in comments sched/core: Clean up the #ifdef block in add_nr_running() sched/fair: Make some variables static sched/core: Create task_has_idle_policy() helper sched/fair: Add lsub_positive() and use it consistently sched/fair: Mask UTIL_AVG_UNCHANGED usages ... commit 116b081c285d89dc6ece72eeecc6aa3979e8b54e Merge: 1eefdec18eded 883f4def8b77e Author: Linus Torvalds Date: Wed Dec 26 14:45:18 2018 -0800 Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf updates from Ingo Molnar: "The main changes in this cycle on the kernel side: - rework kprobes blacklist handling (Masami Hiramatsu) - misc cleanups on the tooling side these areas were the main focus: - 'perf trace' enhancements (Arnaldo Carvalho de Melo) - 'perf bench' enhancements (Davidlohr Bueso) - 'perf record' enhancements (Alexey Budankov) - 'perf annotate' enhancements (Jin Yao) - 'perf top' enhancements (Jiri Olsa) - Intel hw tracing enhancements (Adrian Hunter) - ARM hw tracing enhancements (Leo Yan, Mathieu Poirier) - ... plus lots of other enhancements, cleanups and fixes" * 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (171 commits) tools uapi asm: Update asm-generic/unistd.h copy perf symbols: Relax checks on perf-PID.map ownership perf trace: Wire up the fadvise 'advice' table generator perf beauty: Add generator for fadvise64's 'advice' arg constants tools headers uapi: Grab a copy of fadvise.h perf beauty mmap: Print mmap's 'offset' arg in hexadecimal perf beauty mmap: Print PROT_READ before PROT_EXEC to match strace output perf trace beauty: Beautify arch_prctl()'s arguments perf trace: When showing string prefixes show prefix + ??? for unknown entries perf trace: Move strarrays to beauty.h for further reuse perf beauty: Wire up the x86_arch prctl code table generator perf beauty: Add a string table generator for x86's 'arch_prctl' codes tools include arch: Grab a copy of x86's prctl.h perf trace: Show NULL when syscall pointer args are 0 perf trace: Enclose the errno strings with () perf augmented_raw_syscalls: Copy 'access' arg as well perf trace: Add alignment spaces after the closing parens perf trace beauty: Print O_RDONLY when (flags & O_ACCMODE) == 0 perf trace: Allow asking for not suppressing common string prefixes perf trace: Add a prefix member to the strarray class ... commit 1eefdec18eded41833401cfd64749643ff72e7da Merge: 684019dd1f009 80eb865768703 Author: Linus Torvalds Date: Wed Dec 26 14:25:52 2018 -0800 Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking updates from Ingo Molnar: "The main change in this cycle are initial preparatory bits of dynamic lockdep keys support from Bart Van Assche. There are also misc changes, a comment cleanup and a data structure cleanup" * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: Clean up comment in nohz_idle_balance() locking/lockdep: Stop using RCU primitives to access 'all_lock_classes' locking/lockdep: Make concurrent lockdep_reset_lock() calls safe locking/lockdep: Remove a superfluous INIT_LIST_HEAD() statement locking/lockdep: Introduce lock_class_cache_is_registered() locking/lockdep: Inline __lockdep_init_map() locking/lockdep: Declare local symbols static tools/lib/lockdep/tests: Test the lockdep_reset_lock() implementation tools/lib/lockdep: Add dummy print_irqtrace_events() implementation tools/lib/lockdep: Rename "trywlock" into "trywrlock" tools/lib/lockdep/tests: Run lockdep tests a second time under Valgrind tools/lib/lockdep/tests: Improve testing accuracy tools/lib/lockdep/tests: Fix shellcheck warnings tools/lib/lockdep/tests: Display compiler warning and error messages locking/lockdep: Remove ::version from lock_class structure commit 684019dd1f0092b4ffce4958c84aff0891deac83 Merge: 792bf4d871dea 1debf0958fa27 Author: Linus Torvalds Date: Wed Dec 26 13:38:38 2018 -0800 Merge branch 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull EFI updates from Ingo Molnar: "The main changes in this cycle were: - Allocate the E820 buffer before doing the GetMemoryMap/ExitBootServices dance so we don't run out of space - Clear EFI boot services mappings when freeing the memory - Harden efivars against callers that invoke it on non-EFI boots - Reduce the number of memblock reservations resulting from extensive use of the new efi_mem_reserve_persistent() API - Other assorted fixes and cleanups" * 'efi-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/efi: Don't unmap EFI boot services code/data regions for EFI_OLD_MEMMAP and EFI_MIXED_MODE efi: Reduce the amount of memblock reservations for persistent allocations efi: Permit multiple entries in persistent memreserve data structure efi/libstub: Disable some warnings for x86{,_64} x86/efi: Move efi__boot_services() to arch/x86 x86/efi: Unmap EFI boot services code/data regions from efi_pgd x86/mm/pageattr: Introduce helper function to unmap EFI boot services efi/fdt: Simplify the get_fdt() flow efi/fdt: Indentation fix firmware/efi: Add NULL pointer checks in efivars API functions commit 792bf4d871dea8b69be2aaabdd320d7c6ed15985 Merge: eed9688f85131 4bbfd7467cfc7 Author: Linus Torvalds Date: Wed Dec 26 13:07:19 2018 -0800 Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull RCU updates from Ingo Molnar: "The biggest RCU changes in this cycle were: - Convert RCU's BUG_ON() and similar calls to WARN_ON() and similar. - Replace calls of RCU-bh and RCU-sched update-side functions to their vanilla RCU counterparts. This series is a step towards complete removal of the RCU-bh and RCU-sched update-side functions. ( Note that some of these conversions are going upstream via their respective maintainers. ) - Documentation updates, including a number of flavor-consolidation updates from Joel Fernandes. - Miscellaneous fixes. - Automate generation of the initrd filesystem used for rcutorture testing. - Convert spin_is_locked() assertions to instead use lockdep. ( Note that some of these conversions are going upstream via their respective maintainers. ) - SRCU updates, especially including a fix from Dennis Krein for a bag-on-head-class bug. - RCU torture-test updates" * 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (112 commits) rcutorture: Don't do busted forward-progress testing rcutorture: Use 100ms buckets for forward-progress callback histograms rcutorture: Recover from OOM during forward-progress tests rcutorture: Print forward-progress test age upon failure rcutorture: Print time since GP end upon forward-progress failure rcutorture: Print histogram of CB invocation at OOM time rcutorture: Print GP age upon forward-progress failure rcu: Print per-CPU callback counts for forward-progress failures rcu: Account for nocb-CPU callback counts in RCU CPU stall warnings rcutorture: Dump grace-period diagnostics upon forward-progress OOM rcutorture: Prepare for asynchronous access to rcu_fwd_startat torture: Remove unnecessary "ret" variables rcutorture: Affinity forward-progress test to avoid housekeeping CPUs rcutorture: Break up too-long rcu_torture_fwd_prog() function rcutorture: Remove cbflood facility torture: Bring any extra CPUs online during kernel startup rcutorture: Add call_rcu() flooding forward-progress tests rcutorture/formal: Replace synchronize_sched() with synchronize_rcu() tools/kernel.h: Replace synchronize_sched() with synchronize_rcu() net/decnet: Replace rcu_barrier_bh() with rcu_barrier() ... commit eed9688f8513189295887e5a27ec7f576754b60e Merge: 72af84151fa7e 72a8f089c382c Author: Linus Torvalds Date: Wed Dec 26 13:03:47 2018 -0800 Merge branch 'ras-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 RAS updates from Borislav Petkov: "This time around we have a subsystem reorganization to offer, with the new directory being arch/x86/kernel/cpu/mce/ and all compilation units' names streamlined under it" * 'ras-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce: Restore MCE injector's module name x86/mce: Unify pr_* prefix x86/mce: Streamline MCE subsystem's naming commit 72af84151fa7e98720a0482b59de2d90ec7f10a7 Merge: a52fb43a5faa4 2ffcbce39ea1e Author: Linus Torvalds Date: Wed Dec 26 12:55:57 2018 -0800 Merge branch 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 microcode loading updates from Borislav Petkov: "This update contains work started by Maciej to make the microcode container verification more robust against all kinds of corruption and also unify verification paths between early and late loading. The result is a set of verification routines which validate the microcode blobs before loading it on the CPU. In addition, the code is a lot more streamlined and unified. In the process, some of the aspects of patch handling and loading were simplified. All provided by Maciej S. Szmigiero and Borislav Petkov" * 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/microcode/AMD: Update copyright x86/microcode/AMD: Check the equivalence table size when scanning it x86/microcode/AMD: Convert CPU equivalence table variable into a struct x86/microcode/AMD: Check microcode container data in the late loader x86/microcode/AMD: Fix container size's type x86/microcode/AMD: Convert early parser to the new verification routines x86/microcode/AMD: Change verify_patch()'s return value x86/microcode/AMD: Move chipset-specific check into verify_patch() x86/microcode/AMD: Move patch family check to verify_patch() x86/microcode/AMD: Simplify patch family detection x86/microcode/AMD: Concentrate patch verification x86/microcode/AMD: Cleanup verify_patch_size() more x86/microcode/AMD: Clean up per-family patch size checks x86/microcode/AMD: Move verify_patch_size() up in the file x86/microcode/AMD: Add microcode container verification x86/microcode/AMD: Subtract SECTION_HDR_SIZE from file leftover length commit a52fb43a5faa40507cb164a793a7fa08da863ac7 Merge: 42b00f122cfbf 52eb74339a623 Author: Linus Torvalds Date: Wed Dec 26 12:17:43 2018 -0800 Merge branch 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cache control updates from Borislav Petkov: - The generalization of the RDT code to accommodate the addition of AMD's very similar implementation of the cache monitoring feature. This entails a subsystem move into a separate and generic arch/x86/kernel/cpu/resctrl/ directory along with adding vendor-specific initialization and feature detection helpers. Ontop of that is the unification of user-visible strings, both in the resctrl filesystem error handling and Kconfig. Provided by Babu Moger and Sherry Hurwitz. - Code simplifications and error handling improvements by Reinette Chatre. * 'x86-cache-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/resctrl: Fix rdt_find_domain() return value and checks x86/resctrl: Remove unnecessary check for cbm_validate() x86/resctrl: Use rdt_last_cmd_puts() where possible MAINTAINERS: Update resctrl filename patterns Documentation: Rename and update intel_rdt_ui.txt to resctrl_ui.txt x86/resctrl: Introduce AMD QOS feature x86/resctrl: Fixup the user-visible strings x86/resctrl: Add AMD's X86_FEATURE_MBA to the scattered CPUID features x86/resctrl: Rename the config option INTEL_RDT to RESCTRL x86/resctrl: Add vendor check for the MBA software controller x86/resctrl: Bring cbm_validate() into the resource structure x86/resctrl: Initialize the vendor-specific resource functions x86/resctrl: Move all the macros to resctrl/internal.h x86/resctrl: Re-arrange the RDT init code x86/resctrl: Rename the RDT functions and definitions x86/resctrl: Rename and move rdt files to a separate directory commit 42b00f122cfbfed79fc29b0b3610f3abbb1e3864 Merge: 460023a5d1d2a a0aea130afebc Author: Linus Torvalds Date: Wed Dec 26 11:46:28 2018 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull KVM updates from Paolo Bonzini: "ARM: - selftests improvements - large PUD support for HugeTLB - single-stepping fixes - improved tracing - various timer and vGIC fixes x86: - Processor Tracing virtualization - STIBP support - some correctness fixes - refactorings and splitting of vmx.c - use the Hyper-V range TLB flush hypercall - reduce order of vcpu struct - WBNOINVD support - do not use -ftrace for __noclone functions - nested guest support for PAUSE filtering on AMD - more Hyper-V enlightenments (direct mode for synthetic timers) PPC: - nested VFIO s390: - bugfixes only this time" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (171 commits) KVM: x86: Add CPUID support for new instruction WBNOINVD kvm: selftests: ucall: fix exit mmio address guessing Revert "compiler-gcc: disable -ftracer for __noclone functions" KVM: VMX: Move VM-Enter + VM-Exit handling to non-inline sub-routines KVM: VMX: Explicitly reference RCX as the vmx_vcpu pointer in asm blobs KVM: x86: Use jmp to invoke kvm_spurious_fault() from .fixup MAINTAINERS: Add arch/x86/kvm sub-directories to existing KVM/x86 entry KVM/x86: Use SVM assembly instruction mnemonics instead of .byte streams KVM/MMU: Flush tlb directly in the kvm_zap_gfn_range() KVM/MMU: Flush tlb directly in kvm_set_pte_rmapp() KVM/MMU: Move tlb flush in kvm_set_pte_rmapp() to kvm_mmu_notifier_change_pte() KVM: Make kvm_set_spte_hva() return int KVM: Replace old tlb flush function with new one to flush a specified range. KVM/MMU: Add tlb flush with range helper function KVM/VMX: Add hv tlb range flush support x86/hyper-v: Add HvFlushGuestAddressList hypercall support KVM: Add tlb_remote_flush_with_range callback in kvm_x86_ops KVM: x86: Disable Intel PT when VMXON in L1 guest KVM: x86: Set intercept for Intel PT MSRs read/write KVM: x86: Implement Intel PT MSRs read/write emulation ... commit 460023a5d1d2aa0f733b6708b2fae5ea9f9dfec0 Merge: a5f2bd479f58f 58f9d806d16a3 Author: Linus Torvalds Date: Wed Dec 26 11:35:07 2018 -0800 Merge tag 'for-linus-4.21-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen updates from Juergen Gross: "Xen features and fixes: - a series to enable KVM guests to be booted by qemu via the Xen PVH boot entry for speeding up KVM guest tests - a series for a common driver to be used by Xen PV frontends (right now drm and sound) - two other fixes in Xen related code" * tag 'for-linus-4.21-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: ALSA: xen-front: Use Xen common shared buffer implementation drm/xen-front: Use Xen common shared buffer implementation xen: Introduce shared buffer helpers for page directory... xen/pciback: Check dev_data before using it kprobes/x86/xen: blacklist non-attachable xen interrupt functions KVM: x86: Allow Qemu/KVM to use PVH entry point xen/pvh: Add memory map pointer to hvm_start_info struct xen/pvh: Move Xen code for getting mem map via hcall out of common file xen/pvh: Move Xen specific PVH VM initialization out of common file xen/pvh: Create a new file for Xen specific PVH code xen/pvh: Move PVH entry code out of Xen specific tree xen/pvh: Split CONFIG_XEN_PVH into CONFIG_PVH and CONFIG_XEN_PVH commit a5f2bd479f58f171a16a9a4f3b4e748ab3057c0f Merge: 89261c5702135 930e12992ed32 Author: Linus Torvalds Date: Wed Dec 26 11:14:52 2018 -0800 Merge branch 'parisc-4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc updates from Helge Deller: "The major change in this patchset is the new system call table generation support from Firoz Khan" * 'parisc-4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: syscalls: ignore nfsservctl for other architectures parisc: generate uapi header and system call table files parisc: add system call table generation support parisc: remove __NR_Linux from uapi header file. parisc: add __NR_syscalls along with __NR_Linux_syscalls parisc: move __IGNORE* entries to non uapi header parisc: Fix HP SDC hpa address output parisc: Fix serio address output parisc: Split out alternative live patching code commit 89261c57021352045c4af24522c6854c9ee90139 Merge: c2f1f3e0e17d9 adcc81f148d73 Author: Linus Torvalds Date: Wed Dec 26 10:45:33 2018 -0800 Merge tag 'mips_4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS updates from Paul Burton: "Here's the main MIPS pull for Linux 4.21. Core architecture changes include: - Syscall tables & definitions for unistd.h are now generated by scripts, providing greater consistency with other architectures & making it easier to add new syscalls. - Support for building kernels with no floating point support, upon which any userland attempting to use floating point instructions will receive a SIGILL. Mostly useful to shrink the kernel & as preparation for nanoMIPS support which does not yet include FP. - MIPS SIMD Architecture (MSA) vector register context is now exposed by ptrace via a new NT_MIPS_MSA regset. - ASIDs are now stored as 64b values even for MIPS32 kernels, expanding the ASID version field sufficiently that we don't need to worry about overflow & avoiding rare issues with reused ASIDs that have been observed in the wild. - The branch delay slot "emulation" page is now mapped without write permission for the user, preventing its use as a nice location for attacks to execute malicious code from. - Support for ioremap_prot(), primarily to allow gdb or other ptrace users the ability to view their tracee's memory using the same cache coherency attribute. - Optimizations to more cpu_has_* macros, allowing more to be compile-time constant where possible. - Enable building the whole kernel with UBSAN instrumentation. - Enable building the kernel with link-time dead code & data elimination. Platform specific changes include: - The Boston board gains a workaround for DMA prefetching issues with the EG20T Platform Controller Hub that it uses. - Cleanups to Cavium Octeon code removing about 20k lines of redundant code, mostly unused or duplicate register definitions in headers. - defconfig updates for the DECstation machines, including new defconfigs for r4k & 64b machines. - Further work on Loongson 3 support. - DMA fixes for SiByte machines" * tag 'mips_4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (95 commits) MIPS: math-emu: Write-protect delay slot emulation pages MIPS: Remove struct mm_context_t fp_mode_switching field mips: generate uapi header and system call table files mips: add system call table generation support mips: remove syscall table entries mips: add +1 to __NR_syscalls in uapi header mips: rename scall64-64.S to scall64-n64.S mips: remove unused macros mips: add __NR_syscalls along with __NR_Linux_syscalls MIPS: Expand MIPS32 ASIDs to 64 bits MIPS: OCTEON: delete redundant register definitions MIPS: OCTEON: cvmx_gmxx_inf_mode: use oldest forward compatible definition MIPS: OCTEON: cvmx_mio_fus_dat3: use oldest forward compatible definition MIPS: OCTEON: cvmx_pko_mem_debug8: use oldest forward compatible definition MIPS: OCTEON: octeon-usb: use common gpio_bit definition MIPS: OCTEON: enable all OCTEON drivers in defconfig mips: annotate implicit fall throughs MIPS: Hardcode cpu_has_mips* where target ISA allows MIPS: MT: Remove norps command line parameter MIPS: Only include mmzone.h when CONFIG_NEED_MULTIPLE_NODES=y ... commit c2f1f3e0e17d94ab0c66d83e669492cb9e9a3698 Merge: 9830afca92737 c23b8e7acea3d Author: Linus Torvalds Date: Wed Dec 26 10:32:18 2018 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next Pull sparc updates from David Miller: - Automatic system call table generation, from Firoz Khan. - Clean up accesses to the OF device names by using full_name instead of path_component_name. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next: ALSA: sparc: Use of_node_name_eq for node name comparisons sbus: Use of_node_name_eq for node name comparisons sparc: generate uapi header and system call table files sparc: add system call table generation support sparc: add __NR_syscalls along with NR_syscalls sparc: move __IGNORE* entries to non uapi header sparc: Use DT node full_name instead of name for resources sparc: Remove unused leon_trans_init sparc: Use device_type helpers to access the node type sparc: Use of_node_name_eq for node name comparisons sparc: Convert to using %pOFn instead of device_node.name sparc: prom: use property "name" directly to construct node names of: Drop full path from full_name for PDT systems sparc: Convert to using %pOF instead of full_name fs/openpromfs: Use of_node_name_eq for node name comparisons fs/openpromfs: use full_name instead of path_component_name commit 9830afca9273787f32e236ae5d0e4d3a378ae842 Merge: 30807ef2b76e0 9b9afe4a0ef14 Author: Linus Torvalds Date: Wed Dec 26 10:29:47 2018 -0800 Merge tag 'riscv-for-linus-4.21-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux Pull RISC-V updates from Palmer Dabbelt: "We don't have many patches for this merge window, probably because everything has been a bit busy with the holidays and conferences. The only big user-visible change is to move over to an SBI-based earlycon instead of our arch-specific early printk support. The only outstanding patch set I know of is the audit patch set, which I've managed to make a mess of and will attempt to clean up" * tag 'riscv-for-linus-4.21-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux: RISC-V: Select GENERIC_SCHED_CLOCK for clocksource drivers RISC-V: lib: minor asm cleanup RISC-V: Update Kconfig to better handle CMDLINE riscv: remove unused variable in ftrace RISC-V: add of_node_put() RISC-V: Fix of_node_* refcount riscv, atomic: Add #define's for the atomic_{cmp,}xchg_*() variants RISC-V: Remove EARLY_PRINTK support RISC-V: defconfig: Enable RISC-V SBI earlycon support commit 30807ef2b76e01ea209fcad66a87e534ed1edb40 Merge: 507413a5f88a2 19d111ccce9f4 Author: Linus Torvalds Date: Wed Dec 26 10:28:09 2018 -0800 Merge tag 'microblaze-v5.0-rc1' of git://git.monstr.eu/linux-2.6-microblaze Pull arch/microblaze updates from Michal Simek: - Fix multiple Kbuild/Makefile issues - Start to use system call table generation * tag 'microblaze-v5.0-rc1' of git://git.monstr.eu/linux-2.6-microblaze: microblaze: remove the explicit removal of system.dtb microblaze: fix race condition in building boot images microblaze: add linux.bin* and simpleImage.* to PHONY microblaze: fix multiple bugs in arch/microblaze/boot/Makefile microblaze: move "... is ready" messages to arch/microblaze/Makefile microblaze: adjust the help to the real behavior microblaze: generate uapi header and system call table files microblaze: add system call table generation support microblaze: move __NR_syscalls macro from asm/unistd.h microblaze: Typo s/use use/use/ commit 507413a5f88a2240b2c19cb4318166614e2349d9 Merge: 9947ab7bc3f5f 2b3c5a99d5f31 Author: Linus Torvalds Date: Wed Dec 26 10:23:12 2018 -0800 Merge tag 'asm-generic-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic Pull arch/sh syscall table scripting from Arnd Bergmann: "I worked with Firoz Khan to change all architectures to have their system call tables (syscall.S and asm/unistd.h) generated by a script from a more readable input file the same way that we already had on x86, s390 and arm. I offered to take those conversions through the asm-generic tree that did not get picked up by the architecture maintainers, and fortunately all but one have now been accepted into arch maintainer trees, so this branch only contains the conversion for arch/sh/, with permission from Rich. The conversion does not include the old 64-bit sh5 architecture, which has never shipped and not even compiled in a long time. The table in include/uapi/asm/unistd.h is also not included here, as Firoz is still working on that one, it will have to wait for the next following merge window, hopefully together with the addition of the 64-bit time_t system calls for the y2038 work that led to the system call table rework" * tag 'asm-generic-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: sh: generate uapi header and syscall table header files sh: add system call table generation support sh: add __NR_syscalls along with NR_syscalls commit 9947ab7bc3f5facb4e62c72d9db448f7ad52bc28 Merge: e0783bb42448a c51836246f977 Author: Linus Torvalds Date: Wed Dec 26 10:21:11 2018 -0800 Merge tag 'please-pull-y2038prep' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux Pull ia64 updates from Tony Luck: "Change ia64 to make it easier to update system call tables (in line with some other architectures). This is in preparation for y2038 changes which are forecasted to add several new system calls" * tag 'please-pull-y2038prep' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux: ia64: generate uapi header and system call table files ia64: add system call table generation support ia64: add an offset for system call number ia64: add __NR_syscalls along with NR_syscalls ia64: add __NR_old_getpagesize in uapi header file commit e0783bb42448a4f2a6bd405c890010a3950feada Merge: 5694cecdb0926 005e13a96c0ed Author: Linus Torvalds Date: Wed Dec 26 10:16:55 2018 -0800 Merge tag 'm68k-for-v4.21-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k Pull m68k updates from Geert Uytterhoeven: - Generate syscall headers - Small improvements and cleanups - defconfig updates * tag 'm68k-for-v4.21-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: Generate uapi header and syscall table header files m68k: Add system call table generation support m68k: Add __NR_syscalls along with NR_syscalls m68k/defconfig: Update defconfigs for v4.20-rc1 m68k: Remove redundant 'default n' from Kconfig m68k: Unroll raw_outsb() loop commit 5ccedf1ccd710ba32f36986b49eeb764e53e7ef1 Author: Yan, Zheng Date: Thu Dec 13 16:34:11 2018 +0800 ceph: don't encode inode pathes into reconnect message mds hasn't used inode pathes since introducing inode backtrace. Signed-off-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit d2f8bb27c87945ab696bdaea25b0465dee94fb6d Author: Yan, Zheng Date: Mon Dec 10 16:35:09 2018 +0800 ceph: update wanted caps after resuming stale session mds contains an optimization, it does not re-issue stale caps if client does not want any cap. A special case of the optimization is that client wants some caps, but skipped updating 'wanted'. For this case, client needs to update 'wanted' when stale session get renewed. Signed-off-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit fdac94fab7995ebc52ff9c5b6247133c67a7564a Author: Yan, Zheng Date: Thu Nov 22 15:26:01 2018 +0800 ceph: skip updating 'wanted' caps if caps are already issued When reading cached inode that already has Fscr caps, this can avoid two cap messages (one updats 'wanted' caps, one clears 'wanted' caps). Signed-off-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 8a2ac3a8e9c04018e2bbff9d6ff038507e443e75 Author: Yan, Zheng Date: Wed Dec 5 11:29:35 2018 +0800 ceph: don't request excl caps when mount is readonly Signed-off-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 3c1392d4c49962a31874af14ae9ff289cb2b3851 Author: Yan, Zheng Date: Thu Nov 29 11:22:50 2018 +0800 ceph: don't update importing cap's mseq when handing cap export Updating mseq makes client think importer mds has accepted all prior cap messages and importer mds knows what caps client wants. Actually some cap messages may have been dropped because of mseq mismatch. If mseq is left untouched, importing cap's mds_wanted later will get reset by cap import message. Cc: stable@vger.kernel.org Signed-off-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit 87349cdad963163b55cf7d327f5d47a647339838 Author: Ilya Dryomov Date: Wed Nov 21 18:56:40 2018 +0100 libceph: switch more to bool in ceph_tcp_sendmsg() Unlike in ceph_tcp_sendpage(), it's a bool. Signed-off-by: Ilya Dryomov commit 433b0a12953bc1dfcb52febb186136395a65aad0 Author: Ilya Dryomov Date: Tue Nov 20 15:44:00 2018 +0100 libceph: use MSG_SENDPAGE_NOTLAST with ceph_tcp_sendpage() Prevent do_tcp_sendpages() from calling tcp_push() (at least) once per page. Instead, arrange for tcp_push() to be called (at least) once per data payload. This results in more MSS-sized packets and fewer packets overall (5-10% reduction in my tests with typical OSD request sizes). See commits 2f5338442425 ("tcp: allow splice() to build full TSO packets"), 35f9c09fe9c7 ("tcp: tcp_sendpages() should call tcp_push() once") and ae62ca7b0321 ("tcp: fix MSG_SENDPAGE_NOTLAST logic") for details. Here is an example of a packet size histogram for 128K OSD requests (MSS = 1448, top 5): Before: SIZE COUNT 1448 777700 952 127915 1200 39238 1219 9806 21 5675 After: SIZE COUNT 1448 897280 21 6201 1019 2797 643 2739 376 2479 We could do slightly better by explicitly corking the socket but it's not clear it's worth it. Signed-off-by: Ilya Dryomov commit 3239eb5215ebdef593a79316c9dbbdf8849166ec Author: Ilya Dryomov Date: Fri Nov 16 11:58:19 2018 +0100 libceph: use sock_no_sendpage() as a fallback in ceph_tcp_sendpage() sock_no_sendpage() makes the code cleaner. Also, don't set MSG_EOR. sendpage doesn't act on MSG_EOR on its own, it just honors the setting from the preceding sendmsg call by looking at ->eor in tcp_skb_can_collapse_to(). Signed-off-by: Ilya Dryomov commit 1f6b821aef78e3d79e8d598ae59fc7e23fb6c563 Author: Ilya Dryomov Date: Wed Nov 14 12:24:01 2018 +0100 libceph: drop last_piece logic from write_partial_message_data() last_piece is for the last piece in the current data item, not in the entire data payload of the message. This is harmful for messages with multiple data items. On top of that, we don't need to signal the end of a data payload either because it is always followed by a footer. We used to signal "more" unconditionally, until commit fe38a2b67bc6 ("libceph: start defining message data cursor"). Part of a large series, it introduced cursor->last_piece and also mistakenly inverted the hint by passing last_piece for "more". This was corrected with commit c2cfa1940097 ("libceph: Fix ceph_tcp_sendpage()'s more boolean usage"). As it is, last_piece is not helping at all: because Nagle algorithm is disabled, for a simple message with two 512-byte data items we end up emitting three packets: front + first data item, second data item and footer. Go back to the original pre-fe38a2b67bc6 behavior -- a single packet in most cases. Signed-off-by: Ilya Dryomov commit 0cab9f33d9c33f5ea94e5438fbc91bc8b7f48057 Author: Chengguang Xu Date: Thu Nov 15 22:27:01 2018 +0800 ceph: remove redundant assignment There is redundant assighment of variable i in ceph_mdsmap_get_random_mds(), just remvoe it. Signed-off-by: Chengguang Xu Signed-off-by: Ilya Dryomov commit 2bf996ac48326645ffe5985edfca307838f8eafe Author: Yan, Zheng Date: Thu Oct 25 17:30:30 2018 +0800 ceph: cleanup splice_dentry() splice_dentry() may drop the original dentry and return other dentry. It relies on its caller to update pointer that points to the dropped dentry. This is error-prone. Signed-off-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov commit f4747b9c68b8864cac32cddc45fdcfdfafb3397c Author: Colin Ian King Date: Sat Dec 22 12:43:33 2018 +0000 drivers: base: swnode: check if swnode is NULL before dereferencing it The to_software_mode() macro can potentially return NULL, so also add a NULL check on swnode before dereferencing it to avoid any NULL pointer dereferences. Detected by CoverityScan, CID#1476052 ("Explicit null dereferenced") Fixes: 59abd83672f7 (drivers: base: Introducing software nodes to the firmware node framework) Signed-off-by: Colin Ian King Signed-off-by: Rafael J. Wysocki commit 1d8f062ebc972053318c3a0e0470c7e0ddc1ebee Author: Colin Ian King Date: Sat Dec 22 12:49:39 2018 +0000 drivers: base: swnode: check if pointer p is NULL before dereferencing it The pointer p can be potentially NULL as macro to_software_node can return NULL. Add null check on p before dereferencing it to avoid any NULL pointer dereferences. Detected by CoverityScan, CID#1476039 ("Explicit null dereferenced") Fixes: 59abd83672f7 (drivers: base: Introducing software nodes to the firmware node framework) Signed-off-by: Colin Ian King Signed-off-by: Rafael J. Wysocki commit 5694cecdb092656a822287a6691aa7ce668c8160 Merge: 13e1ad2be3a85 12f799c8c7395 Author: Linus Torvalds Date: Tue Dec 25 17:41:56 2018 -0800 Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 festive updates from Will Deacon: "In the end, we ended up with quite a lot more than I expected: - Support for ARMv8.3 Pointer Authentication in userspace (CRIU and kernel-side support to come later) - Support for per-thread stack canaries, pending an update to GCC that is currently undergoing review - Support for kexec_file_load(), which permits secure boot of a kexec payload but also happens to improve the performance of kexec dramatically because we can avoid the sucky purgatory code from userspace. Kdump will come later (requires updates to libfdt). - Optimisation of our dynamic CPU feature framework, so that all detected features are enabled via a single stop_machine() invocation - KPTI whitelisting of Cortex-A CPUs unaffected by Meltdown, so that they can benefit from global TLB entries when KASLR is not in use - 52-bit virtual addressing for userspace (kernel remains 48-bit) - Patch in LSE atomics for per-cpu atomic operations - Custom preempt.h implementation to avoid unconditional calls to preempt_schedule() from preempt_enable() - Support for the new 'SB' Speculation Barrier instruction - Vectorised implementation of XOR checksumming and CRC32 optimisations - Workaround for Cortex-A76 erratum #1165522 - Improved compatibility with Clang/LLD - Support for TX2 system PMUS for profiling the L3 cache and DMC - Reflect read-only permissions in the linear map by default - Ensure MMIO reads are ordered with subsequent calls to Xdelay() - Initial support for memory hotplug - Tweak the threshold when we invalidate the TLB by-ASID, so that mremap() performance is improved for ranges spanning multiple PMDs. - Minor refactoring and cleanups" * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (125 commits) arm64: kaslr: print PHYS_OFFSET in dump_kernel_offset() arm64: sysreg: Use _BITUL() when defining register bits arm64: cpufeature: Rework ptr auth hwcaps using multi_entry_cap_matches arm64: cpufeature: Reduce number of pointer auth CPU caps from 6 to 4 arm64: docs: document pointer authentication arm64: ptr auth: Move per-thread keys from thread_info to thread_struct arm64: enable pointer authentication arm64: add prctl control for resetting ptrauth keys arm64: perf: strip PAC when unwinding userspace arm64: expose user PAC bit positions via ptrace arm64: add basic pointer authentication support arm64/cpufeature: detect pointer authentication arm64: Don't trap host pointer auth use to EL2 arm64/kvm: hide ptrauth from guests arm64/kvm: consistently handle host HCR_EL2 flags arm64: add pointer authentication register bits arm64: add comments about EC exception levels arm64: perf: Treat EXCLUDE_EL* bit definitions as unsigned arm64: kpti: Whitelist Cortex-A CPUs that don't implement the CSV3 field arm64: enable per-task stack canaries ... commit 13e1ad2be3a85f5c0f76e82af9806b3d12a574d0 Merge: 9f687dddc4e1a 20c3a2c33e9fd Author: Linus Torvalds Date: Tue Dec 25 16:26:42 2018 -0800 Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 pti updates from Thomas Gleixner: "No point in speculating what's in this parcel: - Drop the swap storage limit when L1TF is disabled so the full space is available - Add support for the new AMD STIBP always on mitigation mode - Fix a bunch of STIPB typos" * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/speculation: Add support for STIBP always-on preferred mode x86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off x86/speculation: Change misspelled STIPB to STIBP commit 9f687dddc4e1a3101f1ceb7fbaddbf93f93a7788 Merge: e4b99d415c390 bd2bcaa565a2c Author: Linus Torvalds Date: Tue Dec 25 15:44:08 2018 -0800 Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer updates from Thomas Gleixner: "The timer department delivers the following christmas presents: Core code: - Use proper seqcount initializer to make lockdep happy - SPDX annotations and cleanup of license boilerplates - Use DEFINE_SHOW_ATTRIBUTE() instead of open coding it - Minor cleanups Driver code: - Add the sched_clock for the arc timer (Alexey Brodkin) - Change the file timer names for riscv, rockchip, tegra20, sun4i and meson6 (Daniel Lezcano) - Add the DT bindings for r8a7796, r8a77470 and r8a774a1 (Biju Das) - Remove the early platform driver registration for timer-ti-dm (Bartosz Golaszewski) - Provide the sched_clock for the riscv timer (Anup Patel) - Add support for ARM64 for the imx-gpt and convert the imx-tpm to the timer-of API (Anson Huang) - Remove useless irq protection for the imx-gpt (Clément Péron) - Remove a duplicate function name for the vt8500 (Dan Carpenter) - Remove obsolete inclusion of for the tegra20 (Geert Uytterhoeven) - Demote the prcmu and the custom sched_clock for the dbx500 and the ux500 (Linus Walleij) - Add a new timer clock for the RDA8810PL (Manivannan Sadhasivam) - Rename the macro to stick to the register name and add the delay timer (Martin Blumenstingl) - Switch the bcm2835 to the SPDX identifier (Stefan Wahren) - Fix the interrupt register access on the fttmr010 (Tao Ren) - Add missing of_node_put in the initialization path on the integrator-ap (Yangtao Li)" * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (39 commits) dt-bindings: timer: Document RDA8810PL SoC timer clocksource/drivers/rda: Add clock driver for RDA8810PL SoC clocksource/drivers/meson6: Change name meson6_timer timer-meson6 clocksource/drivers/sun4i: Change name sun4i_timer to timer-sun4i clocksource/drivers/tegra20: Change name tegra20_timer to timer-tegra20 clocksource/drivers/rockchip: Change name rockchip_timer to timer-rockchip clocksource/drivers/riscv: Change name riscv_timer to timer-riscv clocksource/drivers/riscv_timer: Provide the sched_clock clocksource/drivers/timer-imx-tpm: Specify clock name for timer-of clocksource/drivers/fttmr010: Fix invalid interrupt register access clocksource/drivers/integrator-ap: Add missing of_node_put() clocksource/drivers/bcm2835: Switch to SPDX identifier dt-bindings: timer: renesas, cmt: Document r8a774a1 CMT support clocksource/drivers/timer-imx-tpm: Convert the driver to timer-of clocksource/drivers/arc_timer: Utilize generic sched_clock dt-bindings: timer: renesas, cmt: Document r8a77470 CMT support dt-bindings: timer: renesas, cmt: Document r8a7796 CMT support clocksource/drivers/imx-gpt: Remove unnecessary irq protection clocksource/drivers/imx-gpt: Add support for ARM64 clocksource/drivers/meson6_timer: Implement the ARM delay timer ... commit e4b99d415c3908581d4703203e1e805f043a3e71 Merge: d8924c0d76aaa c410abbbacb9b Author: Linus Torvalds Date: Tue Dec 25 15:17:51 2018 -0800 Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq updates from Thomas Gleixner: "The interrupt department provides: Core updates: - Better spreading to NUMA nodes in the affinity management - Support for more than one set of interrupts to spread out to allow separate queues for separate functionality of a single device. - Decouple the non queue interrupts from being managed. Those are usually general interrupts for error handling etc. and those should never be shut down. This also a preparation to utilize the spreading mechanism for initial spreading of non-managed interrupts later. - Make the single CPU target selection in the matrix allocator more balanced so interrupts won't accumulate on single CPUs in certain situations. - A large spell checking patch so we don't end up fixing single typos over and over. Driver updates: - A bunch of new irqchip drivers (RDA8810PL, Madera, imx-irqsteer) - Updates for the 8MQ, F1C100s platform drivers - A number of SPDX cleanups - A workaround for a very broken GICv3 implementation on msm8996 which sports a botched register set. - A platform-msi fix to prevent memory leakage - Various cleanups" * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (37 commits) genirq/affinity: Add is_managed to struct irq_affinity_desc genirq/core: Introduce struct irq_affinity_desc genirq/affinity: Remove excess indentation irqchip/stm32: protect configuration registers with hwspinlock dt-bindings: interrupt-controller: stm32: Document hwlock properties irqchip: Add driver for imx-irqsteer controller dt-bindings/irq: Add binding for Freescale IRQSTEER multiplexer irqchip: Add driver for Cirrus Logic Madera codecs genirq: Fix various typos in comments irqchip/irq-imx-gpcv2: Add IRQCHIP_DECLARE for i.MX8MQ compatible irqchip/irq-rda-intc: Fix return value check in rda8810_intc_init() irqchip/irq-imx-gpcv2: Silence "fall through" warning irqchip/gic-v3: Add quirk for msm8996 broken registers irqchip/gic: Add support to device tree based quirks dt-bindings/gic-v3: Add msm8996 compatible string irqchip/sun4i: Add support for Allwinner ARMv5 F1C100s irqchip/sun4i: Move IC specific register offsets to struct irqchip/sun4i: Add a struct to hold global variables dt-bindings: interrupt-controller: Add suniv interrupt-controller irqchip: Add RDA8810PL interrupt driver ... commit d8924c0d76aaa52e4811b5c64115d9a7f36cc73a Merge: 1fbb2dc6f0ce9 f569da8c994c2 Author: Linus Torvalds Date: Tue Dec 25 15:01:46 2018 -0800 Merge tag 'devprop-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull device properties framework updates from Rafael Wysocki: "This introduces 'software nodes' that are analogous to the DT and ACPI firmware nodes except that they can be created by drivers themselves and do a couple of assorted cleanups. Specifics: - Introduce "software nodes", analogous to the DT and ACPI firmware nodes except that they can be created by kernel code, in order to complement fwnodes representing real firmware nodes when they are incomplete (for example missing device properties) and to supply the primary fwnode when the firmware lacks hardware description for a device completely, and replace the "property_set" struct fwnode_handle type with software nodes (Heikki Krogerus). - Clean up the just introduced software nodes support and fix a commet in the graph-handling code (Colin Ian King, Marco Felsch)" * tag 'devprop-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: device property: fix fwnode_graph_get_next_endpoint() documentation drivers: base: swnode: remove need for a temporary string for the node name device property: Remove struct property_set device property: Move device_add_properties() to swnode.c drivers: base: Introducing software nodes to the firmware node framework ACPI / glue: Add acpi_platform_notify() function drivers core: Prepare support for multiple platform notifications driver core: platform: Remove duplicated device_remove_properties() call commit 1fbb2dc6f0ce95e73b9bd7e8e899089f5cebc99a Merge: 4e4390ad067a6 b677574bdf292 Author: Linus Torvalds Date: Tue Dec 25 14:57:37 2018 -0800 Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk updates from Stephen Boyd: "This round is dominated by NXP's i.MX clk drivers. We gained support for two or three i.MX SoCs in here and that mostly means a lot of driver code and data. Beyond that platform, there are some new Mediatek, Amlogic, and Qualcomm clk drivers added in here, and then we get to the long tail of driver updates and non-critical fixes all around, including code for vendors such as Renesas, Rockchip, Nvidia, and Allwinner. Overall, the driver updates look normal. Apart from the usual driver updates we have an update to make registering OF based clk providers a little simpler when they're devices created as a child of a device backed by a node in DT. Drivers don't have to jump through hoops to unregister the provider upon driver removal anymore because the API does the right thing and uses the parent device DT node. Summary: Core: - Make devm_of_clk_add_hw_provider() use parent dt node if necessary - Various SPDX taggings - Mark clk_ops const when possible New Drivers: - NXP i.MX7ULP SoC clock support - NXP i.MX8QXP SoC clock support - NXP i.MX8MQ SoC clock support - NXP QorIQ T1023 SoC support - Qualcomm SDM845 audio subsystem clks - Qualcomm SDM845 GPU clck controllers - Qualcomm QCS404 RPM clk support - Mediatek MT7629 SoC clk controllers - Allwinner F1c100s SoC clocks - Allwinner H6 display engine clocks - Amlogic GX video clocks - Support for Amlogic meson8b CPU frequency scaling - Amlogic Meson8b CPU post-divider clocks Updates: - Proper suspend/resume on VersaClock5 - Shrink code some with DEFINE_SHOW_ATTRIBUTE() - Register fixes for Rockchip rk3188 and rk3328 - One new critical clock for Rockchip rk3188 and a fixed clock id (double used number) - New clock id for Rockchip rk3328 - Amlogic Meson8/Meson8b video clock support - Amlogic got a clk-input helper and used it for the axg-audio clock driver - Sigma Delta modulation for the Allwinner A33 audio clocks - Support for CPEX (timer) clocks on various Renesas R-Car Gen3 and RZ/G2 SoCs - Support for SDHI HS400 clocks on early revisions of Renesas R-Car H3 and M3-W - Support for SDHI and USB clocks on Renesas RZ/A2 - Support for RPC (SPI Multi I/O Bus Controller) clocks on Renesas R-Car V3M - Qualcomm MSM8998 GCC driver improvements (resets, drop unused clks, etc)" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (172 commits) clk: imx: imx7ulp: add arm hsrun mode clocks support dt-bindings: clock: imx7ulp: add HSRUN mode related clocks clk: Use of_node_name_eq for node name comparisons clk: vc5: Add suspend/resume support clk: qcom: Drop unused 8998 clock clk: qcom: Leave mmss noc on for 8998 clk: tegra: Return the exact clock rate from clk_round_rate clk: tegra30: Use Tegra CPU powergate helper function soc/tegra: pmc: Drop SMP dependency from CPU APIs clk: tegra: Fix maximum audio sync clock for Tegra124/210 clk: tegra: get rid of duplicate defines clk: imx: add imx8qxp lpcg driver clk: imx: add lpcg clock support clk: imx: add imx8qxp clk driver clk: imx: Make the i.MX8MQ CCM clock driver CLK_IMX8MQ dependant clk: imx: add scu clock common part clk: imx: add configuration option for mmio clks dt-bindings: clock: add imx8qxp lpcg clock binding dt-bindings: clock: imx8qxp: add SCU clock IDs clk: qcom: Add missing msm8998 resets ... commit 4e4390ad067a61ce4e7607bd0df31f19a4caa36a Merge: b1669432b3555 8146aace60c74 Author: Linus Torvalds Date: Tue Dec 25 14:52:50 2018 -0800 Merge tag 'leds-for-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds Pull LED updates from Jacek Anaszewski: "There are several few-liners, where most of them are fixes and improvments. One thing standing out is ground preparation for inititializing trigger parameters via Device Tree. We introduce LED_INIT_DEFAULT_TRIGGER flag for that purpose and set it when default trigger is matched. It indicates that trigger should parse DT properties to retrieve the initialization data when set as default one" * tag 'leds-for-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds: led: triggers: Initialize LED_INIT_DEFAULT_TRIGGER if trigger is brought after class led: triggers: Add LED_INIT_DEFAULT_TRIGGER flag led: triggers: Break the for loop after default trigger is found leds: pwm: Use OF variant of LED registering function leds: pwm: Simplify with resource-managed devm_led_classdev_register() leds: gpio: Drop unneeded manual of_node assignment leds: 88pm860x: Use of_node_name_eq for node name comparisons leds: powernv: add of_node_put() commit b1669432b3555954124ffd987a6ff2308344c88f Merge: 0051db82182bf 58331d618bd9c Author: Linus Torvalds Date: Tue Dec 25 14:48:06 2018 -0800 Merge tag 'regmap-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap updates from Mark Brown: "This has been a busy release for the regmap-irq code, there's several new features been added, including an API cleanup for how we specify types that affected one existing driver (gpio-max77620): - Support for hardware that flags rising and falling edges on separate status bits from Bartosz Golaszewski. - Support for explicitly clearing interrupts before unmasking from Bartosz Golaszewski. - Support for level triggered IRQs from Matti Vaittinen" * tag 'regmap-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: irq: add an option to clear status registers on unmask regmap: regmap-irq/gpio-max77620: add level-irq support regmap: regmap-irq: Remove default irq type setting from core regmap: debugfs: convert to DEFINE_SHOW_ATTRIBUTE regmap: rbtree: convert to DEFINE_SHOW_ATTRIBUTE regmap: irq: handle HW using separate rising/falling edge interrupts regmap: add a new macro:REGMAP_IRQ_REG_LINE(_id, _reg_bits) commit 0051db82182bfd80d6c76982bcb36b09eb338a89 Merge: 79f20778fb228 74ff666bd7ba2 Author: Linus Torvalds Date: Tue Dec 25 14:43:54 2018 -0800 Merge tag 'spi-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi updates from Mark Brown: "The main thing this release has been a lot of work on the integration with SPI NOR flashes, there's been some specific support for a while for controller features designed to make them perform better but it's not worked out as well as hoped so the interface has been redesigned in a way that will hopefully do better - it's already been adopted by a number of additional controllers so things are looking good. Otherwise most of the work has been driver specific: - Support for better integration with NOR flashes from Boris Brezillon and Yogesh Narayan Gaur plus usage of it in several drivers. - A big cleanup of the Rockchip driver from Emil Renner Berthing. - Lots of performance improvements for bcm2835 from Lukas Wunner. - Slave mode support for pxa2xx from Lubomir Rintel. - Support for Macronix MXIC, Mediatek MT7629 and MT8183, NPCM PSPI, and Renesas r8a77470" * tag 'spi-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (90 commits) spi: sh-msiof: Reduce the number of times write to and perform the transmission from FIFO spi: sh-msiof: Add r8a774c0 support doc: lpspi: Document DT bindings for LPSPI slave mode spi: lpspi: Let watermark change with send data length spi: lpspi: Add slave mode support spi: lpspi: Replace all "master" with "controller" spi: imx: drop useless member speed_hz from driver data struct spi: imx: rename config callback and add useful parameters spi: imx: style fixes spi: imx: mx51-ecspi: Move some initialisation to prepare_message hook. spi: imx: add a device specific prepare_message callback mtd: atmel-quadspi: disallow building on ebsa110 spi: Update NPCM PSPI controller documentation spi: npcm: Modify pspi send function spi: Use of_node_name_eq for node name comparisons spi: dw-mmio: add ACPI support spi: bcm2835: Synchronize with callback on DMA termination spi: bcm2835: Speed up FIFO access if fill level is known spi: bcm2835: Polish transfer of DMA prologue spi: spi-mem: add support for octal mode I/O data transfer ... commit 79f20778fb228ae372cd7602745382fd4543ef31 Merge: d923fd6dc133e c3b5725965228 Author: Linus Torvalds Date: Tue Dec 25 14:38:31 2018 -0800 Merge tag 'regulator-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator updates from Mark Brown: "This has been a very busy release for the core, some fixes, one large new feature and a big bit of refactoring to update the GPIO API: - Support for coupled regulators from Dmitry Osipenko based on a prior attempt by Maciej Purski, allowing us to handle situations where the voltages on two regulators can't be too far apart from each other. - Conversion of the GPIO support in both drivers and the core to use GPIO descriptors rather than numbers, part of the overall project to remove GPIO numbers. - Support for standby mode suspend states from Andrei Stefanescu. - New drivers for Allwinner AXP209, Cirrus Logic Lochnagar and Microchip MPC16502" * tag 'regulator-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (90 commits) regulator: tps65910: fix a missing check of return value regulator: mcp16502: Select REGMAP_I2C to fix build error regulator: convert to DEFINE_SHOW_ATTRIBUTE regulator: mcp16502: Fix missing n_voltages setting regulator: mcp16502: Use #ifdef CONFIG_PM_SLEEP around mcp16502_suspend/resume_noirq regulator: mcp16502: code cleanup regulator: act8945a-regulator: make symbol act8945a_pm static drivers/regulator: fix a missing check of return value regulator: act8945a-regulator: fix 'defined but not used' compiler warning regulator: axp20x: fix set_ramp_delay for AXP209/dcdc2 regulator: mcp16502: add support for suspend mfd: axp20x: use explicit bit defines mfd: axp20x: Clean up included headers regulator: dts: enable soft-start and ramp delay for the OLinuXino Lime2 dt-bindings: mfd: axp20x: Add software based soft_start for AXP209 LDO3 regulator: axp20x: add software based soft_start for AXP209 LDO3 dt-bindings: mfd: axp20x: add support for regulator-ramp-delay for AXP209 regulator: axp20x: add support for set_ramp_delay for AXP209 mfd: axp20x: name voltage ramping define properly regulator: mcp16502: add regulator driver for MCP16502 ... commit d923fd6dc133ee8d8fe800e4e4beb9175368b21b Merge: e6d1315006383 e94b815524f83 Author: Linus Torvalds Date: Tue Dec 25 14:34:48 2018 -0800 Merge tag 'pwm/for-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm Pull pwm updates from Thierry Reding: "Not a lot going on this cycle. There's some more cleanup going on and new driver support that was not quite ready in time for v4.21-rc1, but here are a few fixes and improvements that are good to go. The Kona PWM driver can now be built on the Cygnus architecture and the i.MX driver gained support for hardware readback. Some small fixes are provided for the clks711x and lpc18xx-sct drivers. Finally, to round things off some drivers are switched to SPDX license identifiers" * tag 'pwm/for-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: dt-bindings: pwm: rcar: Add r8a774c0 support pwm: imx: Add ipg clock operation pwm: clps711x: Switch to SPDX identifier pwm: clps711x: Fix period calculation pwm: bcm2835: Switch to SPDX identifier pwm: Enable Kona PWM to be built for the Cygnus architecture pwm: Drop legacy wrapper for changing polarity pwm: imx: Implement get_state() function for hardware readout pwm: imx: Use bitops and bitfield macros to define register values pwm: imx: Sort include files pwm: lpc18xx-sct: Don't reconfigure PWM in .request and .free commit e6d1315006383e525595bb3337d08bccec373ccc Merge: 1e2af254ef130 3eb85368460d9 Author: Linus Torvalds Date: Tue Dec 25 14:21:18 2018 -0800 Merge tag 'acpi-4.21-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 the 20181213 upstream revision, make it possible to build the ACPI subsystem without PCI support, and a new OEM _OSI string, add a new device support to the ACPI driver for AMD SoCs and fix PM handling in the ACPI driver for Intel SoCs, fix the SPCR table handling and do some assorted fixes and cleanups. Specifics: - Update the ACPICA code in the kernel to the 20181213 upstream revision including: * New Windows _OSI strings (Bob Moore, Jung-uk Kim). * Buffers-to-string conversions update (Bob Moore). * Removal of support for expressions in package elements (Bob Moore). * New option to display method/object evaluation in debug output (Bob Moore). * Compiler improvements (Bob Moore, Erik Schmauss). * Minor debugger fix (Erik Schmauss). * Disassembler improvement (Erik Schmauss). * Assorted cleanups (Bob Moore, Colin Ian King, Erik Schmauss). - Add support for a new OEM _OSI string to indicate special handling of secondary graphics adapters on some systems (Alex Hung). - Make it possible to build the ACPI subystem without PCI support (Sinan Kaya). - Make the SPCR table handling regard baud rate 0 in accordance with the specification of it and make the DSDT override code support DSDT code names generated by recent ACPICA (Andy Shevchenko, Wang Dongsheng, Nathan Chancellor). - Add clock frequency for Hisilicon Hip08 SPI controller to the ACPI driver for AMD SoCs (APD) (Jay Fang). - Fix the PM handling during device init in the ACPI driver for Intel SoCs (LPSS) (Hans de Goede). - Avoid double panic()s by clearing the APEI GHES block_status before panic() (Lenny Szubowicz). - Clean up a function invocation in the ACPI core and get rid of some code duplication by using the DEFINE_SHOW_ATTRIBUTE macro in the APEI support code (Alexey Dobriyan, Yangtao Li)" * tag 'acpi-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (31 commits) ACPI / tables: Add an ifdef around amlcode and dsdt_amlcode ACPI/APEI: Clear GHES block_status before panic() ACPI: Make PCI slot detection driver depend on PCI ACPI/IORT: Stub out ACS functions when CONFIG_PCI is not set arm64: select ACPI PCI code only when both features are enabled PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set ACPICA: Remove PCI bits from ACPICA when CONFIG_PCI is unset ACPI: Allow CONFIG_PCI to be unset for reboot ACPI: Move PCI reset to a separate function ACPI / OSI: Add OEM _OSI string to enable dGPU direct output ACPI / tables: add DSDT AmlCode new declaration name support ACPICA: Update version to 20181213 ACPICA: change coding style to match ACPICA, no functional change ACPICA: Debug output: Add option to display method/object evaluation ACPICA: disassembler: disassemble OEMx tables as AML ACPICA: Add "Windows 2018.2" string in the _OSI support ACPICA: Expressions in package elements are not supported ACPICA: Update buffer-to-string conversions ACPICA: add comments, no functional change ACPICA: Remove defines that use deprecated flag ... commit 1e2af254ef130e37d9fb3cb1bc9bfbf6ea184b4a Merge: b271b2127e665 a465d38fa3dce Author: Linus Torvalds Date: Tue Dec 25 13:47:41 2018 -0800 Merge tag 'pm-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management updates from Rafael Wysocki: "These add sysadmin documentation for cpuidle, extend the cpuidle subsystem somewhat, improve the handling of performance states in the generic power domains (genpd) and operating performance points (OPP) frameworks, add a new cpufreq driver for Qualcomm SoCs, update some other cpufreq drivers, switch over the runtime PM framework to using high-res timers for device autosuspend, fix a problem with suspend-to-idle on ACPI-based platforms, add system-wide suspend and resume handling to the devfreq framework, do some janitorial cleanups all over and update some utilities. Specifics: - Add sysadmin documentation for cpuidle (Rafael Wysocki). - Make it possible to specify a cpuidle governor from kernel command line, add new cpuidle state sysfs attributes for governor evaluation, and improve the "polling" idle state handling (Rafael Wysocki). - Fix the handling of the "required-opps" DT property in the operating performance points (OPP) framework, improve the integration of it with the generic power domains (genpd) framework, improve the handling of performance states in them and clean up the idle states vs performance states separation in genpd (Viresh Kumar, Ulf Hansson). - Add a cpufreq driver called "qcom-hw" for Qualcomm SoCs using a hardware engine to control CPU frequency transitions along with DT bindings for it (Taniya Das). - Fix an intel_pstate driver issue related to CPU offline and update the documentation of it (Srinivas Pandruvada). - Clean up the imx6q cpufreq driver (Anson Huang). - Add SPDX license IDs to cpufreq schedutil governor files (Daniel Lezcano). - Switch over the runtime PM framework to using high-res timers for device autosuspend to allow the control of it to be more precise (Vincent Guittot). - Disable non-wakeup ACPI GPEs during suspend-to-idle so that they don't prevent the system from reaching the target low-power state and simplify the suspend-to-idle handling on ACPI platforms without full Low-Power S0 Idle (LPS0) support (Rafael Wysocki). - Add system-wide suspend and resume support to the devfreq framework (Lukasz Luba). - Clean up the SmartReflex adaptive voltage scaling (AVS) driver and add an SPDX license ID to it (Nishanth Menon, Uwe Kleine-König, Thomas Meyer). - Get rid of code duplication by using the DEFINE_SHOW_ATTRIBUTE macro in some places, fix some DT node refcount leaks, and do some other janitorial cleanups (Yangtao Li). - Update the cpupower, intel_pstate_tracer and turbosat utilities (Abhishek Goel, Doug Smythies, Len Brown)" * tag 'pm-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (54 commits) PM / Domains: remove define_genpd_open_function() and define_genpd_debugfs_fops() PM-runtime: Switch autosuspend over to using hrtimers cpufreq: qcom-hw: Add support for QCOM cpufreq HW driver dt-bindings: cpufreq: Introduce QCOM cpufreq firmware bindings ACPI: PM: Loop in full LPS0 mode only ACPI: EC / PM: Disable non-wakeup GPEs for suspend-to-idle tools/power/x86/intel_pstate_tracer: Fix non root execution for post processing a trace file tools/power turbostat: consolidate duplicate model numbers tools/power turbostat: fix goldmont C-state limit decoding PM / Domains: Propagate performance state updates PM / Domains: Factorize dev_pm_genpd_set_performance_state() PM / Domains: Save OPP table pointer in genpd OPP: Don't return 0 on error from of_get_required_opp_performance_state() OPP: Add dev_pm_opp_xlate_performance_state() helper OPP: Improve _find_table_of_opp_np() PM / Domains: Make genpd performance states orthogonal to the idlestates PM / sleep: convert to DEFINE_SHOW_ATTRIBUTE cpuidle: Add 'above' and 'below' idle state metrics PM / AVS: SmartReflex: Switch to SPDX Licence ID PM / AVS: SmartReflex: NULL check before some freeing functions is not needed ... commit b271b2127e6654a72dc1685f0825fe1cc2f36939 Merge: 8e61e7b5c4de2 75dfa87035f9a Author: Linus Torvalds Date: Tue Dec 25 13:28:00 2018 -0800 Merge tag 'edac_for_4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp Pull EDAC updates from Borislav Petkov: - Support for ZynqMP DDR controller support to synopsys_edac along with a driver cleanup and generalization for the addition of support for the new IP. (Manish Narani) - Removal of the /sys/bus/edac devices hierarchy. This enabled us to get rid of the silly memory controllers maximum number notion. (Tony Luck and Borislav Petkov) - skx_edac improvements and fixes. (Qiuxu Zhuo and Tony Luck) - The usual garden variety of small cleanups and fixes. * tag 'edac_for_4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: (25 commits) EDAC, fsl_ddr: Add LS1021A to the list of supported hardware EDAC, i5000: Remove set but not used local variables MAINTAINERS, EDAC: Drop bouncing email EDAC, i82975x: Fix spelling mistake "reserverd" -> "reserved" EDAC, fsl: Move error injection under CONFIG_EDAC_DEBUG EDAC, skx: Let EDAC core show the decoded result for debugfs EDAC, skx: Move debugfs node under EDAC's hierarchy EDAC, skx: Prepend hex formatting with '0x' EDAC, skx: Fix function calling order in skx_exit() EDAC: Drop per-memory controller buses EDAC: Don't add devices under /sys/bus/edac EDAC: Fix indentation issues in several EDAC drivers EDAC, skx: Fix randconfig builds in a better way EDAC, i82975x: Remove set but not used variable dtype EDAC, qcom_edac: Remove irq_handled local variable EDAC, synopsys: Add Error Injection support for ZynqMP DDR controller EDAC, synopsys: Add ECC support for ZynqMP DDR controller EDAC, synopsys: Add macro defines for ZynqMP DDRC dt: bindings: Document ZynqMP DDRC in Synopsys documentation EDAC, synopsys: Add error handling for the of_device_get_match_data() result ... commit 8e61e7b5c4de2bea534438bd7a008accd85492b0 Merge: 996680d461f8f d82b51c855a20 Author: Linus Torvalds Date: Tue Dec 25 13:19:10 2018 -0800 Merge tag 'sound-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "There are no intensive changes in both ALSA and ASoC core parts while rather most of changes are a bunch of driver fixes and updates. A large diff pattern appears in ASoC TI part which now merges both OMAP and DaVinci stuff, but the rest spreads allover the places. Note that this pull request includes also some updates for LED trigger and platform drivers for mute LEDs, appearing in the diffstat as well. Some highlights: ASoC: - Preparatory work for merging the audio-graph and audio-graph-scu cards - A merge of TI OMAP and DaVinci directories, as both product lines get merged together. Also including a few architecture changes as well. - Major cleanups of the Maxim MAX9867 driver - Small fixes for tablets & co with Intel BYT/CHT chips - Lots of rsnd updates as usual - Support for Asahi Kaesi AKM4118, AMD ACP3x, Intel platforms with RT5660, Meson AXG S/PDIF inputs, several Qualcomm IPs and Xilinx I2S controllers HD-audio: - Introduce audio-mute LED trigger for replacing the former hackish dynamic binding - Huawei WMI hotkey and mute LED support - Refactoring of PM code and display power controls - Headset button support in the generic jack code - A few updates for Tegra - Fixups for HP EliteBook and ASUS UX391UA - Lots of updates for Intel ASoC HD-audio, including the improved DSP detection and the fallback binding from ASoC SST to legacy HD-audio controller drivers Others: - Updates for FireWire TASCAM and Fireface devices, some other fixes - A few potential Spectre v1 fixes that are all trivial" * tag 'sound-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (280 commits) ALSA: HD-Audio: SKL+: force HDaudio legacy or SKL+ driver selection ALSA: HD-Audio: SKL+: abort probe if DSP is present and Skylake driver selected ALSA: HDA: export process_unsol_events() ALSA: hda/realtek: Enable audio jacks of ASUS UX391UA with ALC294 ALSA: bebob: fix model-id of unit for Apogee Ensemble ALSA: emu10k1: Fix potential Spectre v1 vulnerabilities ALSA: rme9652: Fix potential Spectre v1 vulnerability ASoC: ti: Kconfig: Remove the deprecated options ARM: davinci_all_defconfig: Update the audio options ARM: omap1_defconfig: Do not select ASoC by default ARM: omap2plus_defconfig: Update the audio options ARM: davinci: dm365-evm: Update for the new ASoC Kcofnig options ARM: OMAP2: Update for new MCBSP Kconfig option ARM: OMAP1: Makefile: Update for new MCBSP Kconfig option MAINTAINERS: Add entry for sound/soc/ti and update the OMAP audio support ASoC: ti: Merge davinci and omap directories ALSA: hda: add mute LED support for HP EliteBook 840 G4 ALSA: fireface: code refactoring to handle model-specific registers ALSA: fireface: add support for packet streaming on Fireface 800 ALSA: fireface: allocate isochronous resources in mode-specific implementation ... commit 996680d461f8f759082e64f2395c1f7c25d9d549 Merge: 5813540b584c3 38b11beb73c52 Author: Linus Torvalds Date: Tue Dec 25 13:11:30 2018 -0800 Merge tag 'media/v4.20-7' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull more media updates from Mauro Carvalho Chehab: "The Intel IPU3 camera driver" * tag 'media/v4.20-7' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (23 commits) media: staging/ipu3-imgu: Add MAINTAINERS entry media: staging/ipu3-imgu: Address documentation comments media: v4l: Add Intel IPU3 meta buffer formats media: doc-rst: Add Intel IPU3 documentation media: ipu3-imgu: Fix firmware binary location media: ipu3-imgu: Fix compiler warnings media: staging/intel-ipu3: Add dual pipe support media: staging/intel-ipu3: Add Intel IPU3 meta data uAPI media: staging/intel-ipu3: Add imgu top level pci device driver media: staging/intel-ipu3: Add v4l2 driver based on media framework media: staging/intel-ipu3: Add css pipeline programming media: staging/intel-ipu3: css: Initialize css hardware media: staging/intel-ipu3: css: Compute and program ccs media: staging/intel-ipu3: css: Add static settings for image pipeline media: staging/intel-ipu3: css: Add support for firmware management media: staging/intel-ipu3: css: Add dma buff pool utility functions media: staging/intel-ipu3: Implement DMA mapping functions media: staging/intel-ipu3: mmu: Implement driver media: staging/intel-ipu3: abi: Add structs media: staging/intel-ipu3: abi: Add register definitions and enum ... commit 5813540b584c3b1a507d1c61896bec164cad0905 Merge: eaa7649971153 4bd46aa0353e0 Author: Linus Torvalds Date: Tue Dec 25 13:00:14 2018 -0800 Merge tag 'media/v4.20-6' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: "First set of media patches contains: - Three new platform drivers: aspeed-video seco-sed and sun5i-csi; - One new sensor driver: imx214; - Support for Xbox DVD Movie Playback kit remote controller; - Removal of the legacy friio driver. The functionalities were ported to another driver, already merged; - New staging driver: Rockchip VPU; - Added license text or SPDX tags to all media documentation files; - Usual set of cleanup, fixes and enhancements" * tag 'media/v4.20-6' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (263 commits) media: cx23885: only reset DMA on problematic CPUs media: ddbridge: Move asm includes after linux ones media: drxk_hard: check if parameter is not NULL media: docs: fix some GPL licensing ambiguity at the text media: platform: Add Aspeed Video Engine driver media: dt-bindings: media: Add Aspeed Video Engine binding documentation media: vimc: fix start stream when link is disabled media: v4l2-device: Link subdevices to their parent devices if available media: siano: Use kmemdup instead of duplicating its function media: rockchip vpu: remove some unused vars media: cedrus: don't initialize pointers with zero media: cetrus: return an error if alloc fails media: cedrus: Add device-tree compatible and variant for A64 support media: cedrus: Add device-tree compatible and variant for H5 support media: dt-bindings: media: cedrus: Add compatibles for the A64 and H5 media: video-i2c: check if chip struct has set_power function media: video-i2c: support runtime PM media: staging: media: imx: Use of_node_name_eq for node name comparisons media: v4l2-subdev: document controls need _FL_HAS_DEVNODE media: vivid: Improve timestamping ... commit eaa76499711535fd64d747cc4ef0d78ab0fd41c6 Merge: b3cc2bfe7244e f366d3854ec0f Author: Linus Torvalds Date: Tue Dec 25 12:49:46 2018 -0800 Merge tag 'mtd/for-4.21' of git://git.infradead.org/linux-mtd Pull mtd updates from Boris Brezillon: "SPI NOR Core changes: - Parse the 4BAIT SFDP section - Add a bunch of SPI NOR entries to the flash_info table - Add the concept of SFDP fixups and use it to fix a bug on MX25L25635F - A bunch of minor cleanups/comestic changes NAND core changes: - kernel-doc miscellaneous fixes. - Third batch of fixes/cleanup to the raw NAND core impacting various controller drivers (ams-delta, marvell, fsmc, denali, tegra, vf610): * Stop to pass mtd_info objects to internal functions * Reorganize code to avoid forward declarations * Drop useless test in nand_legacy_set_defaults() * Move nand_exec_op() to internal.h * Add nand_[de]select_target() helpers * Pass the CS line to be selected in struct nand_operation * Make ->select_chip() optional when ->exec_op() is implemented * Deprecate the ->select_chip() hook * Move the ->exec_op() method to nand_controller_ops * Move ->setup_data_interface() to nand_controller_ops * Deprecate the dummy_controller field * Fix JEDEC detection * Provide a helper for polling GPIO R/B pin Raw NAND chip drivers changes: - Macronix: * Flag 1.8V AC chips with a broken GET_FEATURES(TIMINGS) Raw NAND controllers drivers changes: - Ams-delta: * Fix the error path * SPDX tag added * May be compiled with COMPILE_TEST=y * Conversion to ->exec_op() interface * Drop .IOADDR_R/W use * Use GPIO API for data I/O - Denali: * Remove denali_reset_banks() * Remove ->dev_ready() hook * Include instead of * Changes to comply with the above fixes/cleanup done in the core. - FSMC: * Add an SPDX tag to replace the license text * Make conversion from chip to fsmc consistent * Fix unchecked return value in fsmc_read_page_hwecc * Changes to comply with the above fixes/cleanup done in the core. - Marvell: * Prevent timeouts on a loaded machine (fix) * Changes to comply with the above fixes/cleanup done in the core. - OMAP2: * Pass the parent of pdev to dma_request_chan() (fix) - R852: * Use generic DMA API - sh_flctl: * Convert to SPDX identifiers - Sunxi: * Write pageprog related opcodes to the right register: WCMD_SET (fix) - Tegra: * Stop implementing ->select_chip() - VF610: * Add an SPDX tag to replace the license text * Changes to comply with the above fixes/cleanup done in the core. - Various trivial/spelling/coding style fixes. SPI-NAND drivers changes: - Remove the depreacated mt29f_spinand driver from staging. - Add support for: * Toshiba TC58CVG2S0H * GigaDevice GD5FxGQ4xA * Winbond W25N01GV JFFS2 changes: - Fix a lockdep issue MTD changes: - Rework the physmap driver to merge gpio-addr-flash and physmap_of in it - Add a new compatible for RedBoot partitions - Make sub-partitions RW if the parent partition was RO because of a mis-alignment - Add pinctrl support to the - Addition of /* fall-through */ comments where appropriate - Various minor fixes and cleanups Other changes: - Update my email address" * tag 'mtd/for-4.21' of git://git.infradead.org/linux-mtd: (108 commits) mtd: rawnand: sunxi: Write pageprog related opcodes to WCMD_SET MAINTAINERS: Update my email address mtd: rawnand: marvell: prevent timeouts on a loaded machine mtd: rawnand: omap2: Pass the parent of pdev to dma_request_chan() mtd: rawnand: Fix JEDEC detection mtd: spi-nor: Add support for is25lp016d mtd: spi-nor: parse SFDP 4-byte Address Instruction Table mtd: spi-nor: Add 4B_OPCODES flag to is25lp256 mtd: spi-nor: Add an SPDX tag to spi-nor.{c,h} mtd: spi-nor: Make the enable argument passed to set_byte() a bool mtd: spi-nor: Stop passing flash_info around mtd: spi-nor: Avoid forward declaration of internal functions mtd: spi-nor: Drop inline on all internal helpers mtd: spi-nor: Add a post BFPT fixup for MX25L25635E mtd: spi-nor: Add a post BFPT parsing fixup hook mtd: spi-nor: Add the SNOR_F_4B_OPCODES flag mtd: spi-nor: cast to u64 to avoid uint overflows mtd: spi-nor: Add support for IS25LP032/064 mtd: spi-nor: add entry for mt35xu512aba flash mtd: spi-nor: add macros related to MICRON flash ... commit b3cc2bfe7244e848f5e8caa77bbdc72c04abd17c Merge: 4971f090aa7f6 25ac3da61ba14 Author: Linus Torvalds Date: Tue Dec 25 12:26:34 2018 -0800 Merge tag 'i3c/for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux Pull initial i3c support from Boris Brezillon: "Add initial support for I3C along with two I3C master controller drivers" * tag 'i3c/for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: i3c: master: cdns: fix I2C transfers in Cadence I3C master driver ic3: off by one in mode_show() i3c: fix an error code in i3c_master_add_i3c_dev_locked() i3c: master: dw: fix mask operation by using the correct operator MAINTAINERS: Add myself as the dw-i3c-master module maintainer dt-binding: i3c: Document Synopsys DesignWare I3C i3c: master: Add driver for Synopsys DesignWare IP i3c: master: Remove set but not used variable 'old_i3c_scl_lim' dt-bindings: i3c: Document Cadence I3C master bindings i3c: master: Add driver for Cadence IP MAINTAINERS: Add myself as the I3C subsystem maintainer dt-bindings: i3c: Document core bindings i3c: Add sysfs ABI spec docs: driver-api: Add I3C documentation i3c: Add core I3C infrastructure commit 4971f090aa7f6ce5daa094ce4334f6618f93a7eb Merge: c76cd634eb5bf 2a3c83f5fe077 Author: Linus Torvalds Date: Tue Dec 25 11:48:26 2018 -0800 Merge tag 'drm-next-2018-12-14' of git://anongit.freedesktop.org/drm/drm Pull drm updates from Dave Airlie: "Core: - shared fencing staging removal - drop transactional atomic helpers and move helpers to new location - DP/MST atomic cleanup - Leasing cleanups and drop EXPORT_SYMBOL - Convert drivers to atomic helpers and generic fbdev. - removed deprecated obj_ref/unref in favour of get/put - Improve dumb callback documentation - MODESET_LOCK_BEGIN/END helpers panels: - CDTech panels, Banana Pi Panel, DLC1010GIG, - Olimex LCD-O-LinuXino, Samsung S6D16D0, Truly NT35597 WQXGA, - Himax HX8357D, simulated RTSM AEMv8. - GPD Win2 panel - AUO G101EVN010 vgem: - render node support ttm: - move global init out of drivers - fix LRU handling for ghost objects - Support for simultaneous submissions to multiple engines scheduler: - timeout/fault handling changes to help GPU recovery - helpers for hw with preemption support i915: - Scaler/Watermark fixes - DP MST + powerwell fixes - PSR fixes - Break long get/put shmemfs pages - Icelake fixes - Icelake DSI video mode enablement - Engine workaround improvements amdgpu: - freesync support - GPU reset enabled on CI, VI, SOC15 dGPUs - ABM support in DC - KFD support for vega12/polaris12 - SDMA paging queue on vega - More amdkfd code sharing - DCC scanout on GFX9 - DC kerneldoc - Updated SMU firmware for GFX8 chips - XGMI PSP + hive reset support - GPU reset - DC trace support - Powerplay updates for newer Polaris - Cursor plane update fast path - kfd dma-buf support virtio-gpu: - add EDID support vmwgfx: - pageflip with damage support nouveau: - Initial Turing TU104/TU106 modesetting support msm: - a2xx gpu support for apq8060 and imx5 - a2xx gpummu support - mdp4 display support for apq8060 - DPU fixes and cleanups - enhanced profiling support - debug object naming interface - get_iova/page pinning decoupling tegra: - Tegra194 host1x, VIC and display support enabled - Audio over HDMI for Tegra186 and Tegra194 exynos: - DMA/IOMMU refactoring - plane alpha + blend mode support - Color format fixes for mixer driver rcar-du: - R8A7744 and R8A77470 support - R8A77965 LVDS support imx: - fbdev emulation fix - multi-tiled scalling fixes - SPDX identifiers rockchip - dw_hdmi support - dw-mipi-dsi + dual dsi support - mailbox read size fix qxl: - fix cursor pinning vc4: - YUV support (scaling + cursor) v3d: - enable TFU (Texture Formatting Unit) mali-dp: - add support for linear tiled formats sun4i: - Display Engine 3 support - H6 DE3 mixer 0 support - H6 display engine support - dw-hdmi support - H6 HDMI phy support - implicit fence waiting - BGRX8888 support meson: - Overlay plane support - implicit fence waiting - HDMI 1.4 4k modes bridge: - i2c fixes for sii902x" * tag 'drm-next-2018-12-14' of git://anongit.freedesktop.org/drm/drm: (1403 commits) drm/amd/display: Add fast path for cursor plane updates drm/amdgpu: Enable GPU recovery by default for CI drm/amd/display: Fix duplicating scaling/underscan connector state drm/amd/display: Fix unintialized max_bpc state values Revert "drm/amd/display: Set RMX_ASPECT as default" drm/amdgpu: Fix stub function name drm/msm/dpu: Fix clock issue after bind failure drm/msm/dpu: Clean up dpu_media_info.h static inline functions drm/msm/dpu: Further cleanups for static inline functions drm/msm/dpu: Cleanup the debugfs functions drm/msm/dpu: Remove dpu_irq and unused functions drm/msm: Make irq_postinstall optional drm/msm/dpu: Cleanup callers of dpu_hw_blk_init drm/msm/dpu: Remove unused functions drm/msm/dpu: Remove dpu_crtc_is_enabled() drm/msm/dpu: Remove dpu_crtc_get_mixer_height drm/msm/dpu: Remove dpu_dbg drm/msm: dpu: Remove crtc_lock drm/msm: dpu: Remove vblank_requested flag from dpu_crtc drm/msm: dpu: Separate crtc assignment from vblank enable ... commit c76cd634eb5bfd497617ea224a54a03b545c8c4d Merge: 8fe28cb58bcb2 fb7255a923115 Author: Linus Torvalds Date: Tue Dec 25 11:04:17 2018 -0800 Merge tag 'platform-drivers-x86-v4.21-1' of git://git.infradead.org/linux-platform-drivers-x86 Pull x86 platform driver updates from Andy Shevchenko: - The USB Power Delivery discrete components now can be enumerated by i2c-multi-instantiate driver via several resources under single ACPI device node (ACPI ID is INT3515). - Touchscreen support is added for the Mediacom Flexbook Edge 11. - Mellanox driver got fixed due to updates in their firmware. - The power management stub driver for AtomISP v2 is fixed in order to support Intel Baytrail SoCs where same quirk is needed for S0ix to work. - Special key handling has been fixed for Favorites hotkey on Thinkpad, and Screen LOCK on ASUS. - Ideapad Yoga 2 13 has no HW rfkill switch, thus, driver has been updated to support this. - Few cleanups related to debugfs have been made in Intel IPS and Intel PMC drivers. Besides that Intel PMC has been extended to show more detailed information about Latency Tolerance * tag 'platform-drivers-x86-v4.21-1' of git://git.infradead.org/linux-platform-drivers-x86: (41 commits) platform/x86: mlx-platform: Convert to use SPDX identifier Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces platform/x86: mlx-platform: Allow mlxreg-io driver activation for new systems platform/x86: mlx-platform: Fix LED configuration platform/x86: mlx-platform: Fix tachometer registers platform/x86: mlx-platform: Rename new systems product names platform/x86: mlx-platform: Add definitions for new registers platform/x86: intel_telemetry: convert to DEFINE_SHOW_ATTRIBUTE platform/x86: intel_pmc_core: convert to DEFINE_SHOW_ATTRIBUTE platform/x86: thinkpad_acpi: Cleanup quirks macros platform/x86: touchscreen_dmi: Add info for the Mediacom Flexbook Edge 11 platform/x86: Fix config space access for intel_atomisp2_pm platform/x86: Add the VLV ISP PCI ID to atomisp2_pm platform/x86: intel_ips: Convert to use DEFINE_SHOW_ATTRIBUTE macro platform/x86: intel_ips: Remove never happen condition platform/x86: intel_ips: NULL check before some freeing functions is not needed platform/x86: intel_ips: remove unnecessary checks in ips_debugfs_init iio: inv_mpu6050: Use i2c_acpi_get_i2c_resource() helper ACPI / scan: Create platform device for INT3515 ACPI nodes platform/x86: i2c-multi-instantiate: Allow to have same slaves ... commit 574d356b7a02c7e1b01a1d9cba8a26b3c2888f45 Author: Dominique Martinet Date: Mon Nov 5 09:52:48 2018 +0100 9p/net: put a lower bound on msize If the requested msize is too small (either from command line argument or from the server version reply), we won't get any work done. If it's *really* too small, nothing will work, and this got caught by syzbot recently (on a new kmem_cache_create_usercopy() call) Just set a minimum msize to 4k in both code paths, until someone complains they have a use-case for a smaller msize. We need to check in both mount option and server reply individually because the msize for the first version request would be unchecked with just a global check on clnt->msize. Link: http://lkml.kernel.org/r/1541407968-31350-1-git-send-email-asmadeus@codewreck.org Reported-by: syzbot+0c1d61e4db7db94102ca@syzkaller.appspotmail.com Signed-off-by: Dominique Martinet Cc: Eric Van Hensbergen Cc: Latchesar Ionkov Cc: stable@vger.kernel.org commit 2b08b1f12cd664dc7d5c84ead9ff25ae97ad5491 Author: Theodore Ts'o Date: Tue Dec 25 00:56:33 2018 -0500 ext4: fix a potential fiemap/page fault deadlock w/ inline_data The ext4_inline_data_fiemap() function calls fiemap_fill_next_extent() while still holding the xattr semaphore. This is not necessary and it triggers a circular lockdep warning. This is because fiemap_fill_next_extent() could trigger a page fault when it writes into page which triggers a page fault. If that page is mmaped from the inline file in question, this could very well result in a deadlock. This problem can be reproduced using generic/519 with a file system configuration which has the inline_data feature enabled. Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 812c0cab2c0dfad977605dbadf9148490ca5d93f Author: Theodore Ts'o Date: Mon Dec 24 20:27:08 2018 -0500 ext4: make sure enough credits are reserved for dioread_nolock writes There are enough credits reserved for most dioread_nolock writes; however, if the extent tree is sufficiently deep, and/or quota is enabled, the code was not allowing for all eventualities when reserving journal credits for the unwritten extent conversion. This problem can be seen using xfstests ext4/034: WARNING: CPU: 1 PID: 257 at fs/ext4/ext4_jbd2.c:271 __ext4_handle_dirty_metadata+0x10c/0x180 Workqueue: ext4-rsv-conversion ext4_end_io_rsv_work RIP: 0010:__ext4_handle_dirty_metadata+0x10c/0x180 ... EXT4-fs: ext4_free_blocks:4938: aborting transaction: error 28 in __ext4_handle_dirty_metadata EXT4: jbd2_journal_dirty_metadata failed: handle type 11 started at line 4921, credits 4/0, errcode -28 EXT4-fs error (device dm-1) in ext4_free_blocks:4950: error 28 Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 90cadbbf341dd5b2df991c33a6bd6341f3a53788 Merge: c92c81df93df9 38355a5f9a22b Author: David S. Miller Date: Mon Dec 24 16:19:56 2018 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net Pull in bug fixes before respinning my net-next pull request. Signed-off-by: David S. Miller commit c92c81df93df95dafbf6926613ce0b436227b007 Author: Peter Oskolkov Date: Mon Dec 24 12:57:17 2018 -0800 net: dccp: fix kernel crash on module load Patch eedbbb0d98b2 "net: dccp: initialize (addr,port) ..." added calling to inet_hashinfo2_init() from dccp_init(). However, inet_hashinfo2_init() is marked as __init(), and thus the kernel panics when dccp is loaded as module. Removing __init() tag from inet_hashinfo2_init() is not feasible because it calls into __init functions in mm. This patch adds inet_hashinfo2_init_mod() function that can be called after the init phase is done; changes dccp_init() to call the new function; un-marks inet_hashinfo2_init() as exported. Fixes: eedbbb0d98b2 ("net: dccp: initialize (addr,port) ...") Reported-by: kernel test robot Signed-off-by: Peter Oskolkov Signed-off-by: David S. Miller commit bd437c99cf63b8adaea51156db383f9dfdd57503 Author: Colin Ian King Date: Mon Dec 24 19:41:46 2018 +0000 drivers/net: appletalk/cops: remove redundant if statement and mask The two different assignments for pkt_len are actually the same and so the if statement is redundant and can be removed. Masking a u8 return value from inb() with 0xFF is also redundant and can also be emoved. Similarly, the two different outb calls are identical as the mask of 0xff on the second outb is redundant since a u8 is being written, so the if statement is also redundant and can be also removed. Detected by CoverityScan, CID#1475639 ("Identical code for different branches") V2: Remove the if statement for the outb calls, thanks to David Miller for spotting this. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 38355a5f9a22bfa5bd5b1bb79805aca39fa53729 Author: Ivan Mironov Date: Mon Dec 24 20:13:05 2018 +0500 bnx2x: Fix NULL pointer dereference in bnx2x_del_all_vlans() on some hw This happened when I tried to boot normal Fedora 29 system with latest available kernel (from fedora rawhide, plus some unrelated custom patches): BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 PGD 0 P4D 0 Oops: 0010 [#1] SMP PTI CPU: 6 PID: 1422 Comm: libvirtd Tainted: G I 4.20.0-0.rc7.git3.hpsa2.1.fc29.x86_64 #1 Hardware name: HP ProLiant BL460c G6, BIOS I24 05/21/2018 RIP: 0010: (null) Code: Bad RIP value. RSP: 0018:ffffa47ccdc9fbe0 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 00000000000003e8 RCX: ffffa47ccdc9fbf8 RDX: ffffa47ccdc9fc00 RSI: ffff97d9ee7b01f8 RDI: ffff97d9f0150b80 RBP: ffff97d9f0150b80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000003 R13: ffff97d9ef1e53e8 R14: 0000000000000009 R15: ffff97d9f0ac6730 FS: 00007f4d224ef700(0000) GS:ffff97d9fa200000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 00000011ece52006 CR4: 00000000000206e0 Call Trace: ? bnx2x_chip_cleanup+0x195/0x610 [bnx2x] ? bnx2x_nic_unload+0x1e2/0x8f0 [bnx2x] ? bnx2x_reload_if_running+0x24/0x40 [bnx2x] ? bnx2x_set_features+0x79/0xa0 [bnx2x] ? __netdev_update_features+0x244/0x9e0 ? netlink_broadcast_filtered+0x136/0x4b0 ? netdev_update_features+0x22/0x60 ? dev_disable_lro+0x1c/0xe0 ? devinet_sysctl_forward+0x1c6/0x211 ? proc_sys_call_handler+0xab/0x100 ? __vfs_write+0x36/0x1a0 ? rcu_read_lock_sched_held+0x79/0x80 ? rcu_sync_lockdep_assert+0x2e/0x60 ? __sb_start_write+0x14c/0x1b0 ? vfs_write+0x159/0x1c0 ? vfs_write+0xba/0x1c0 ? ksys_write+0x52/0xc0 ? do_syscall_64+0x60/0x1f0 ? entry_SYSCALL_64_after_hwframe+0x49/0xbe After some investigation I figured out that recently added cleanup code tries to call VLAN filtering de-initialization function which exist only for newer hardware. Corresponding function pointer is not set (== 0) for older hardware, namely these chips: #define CHIP_NUM_57710 0x164e #define CHIP_NUM_57711 0x164f #define CHIP_NUM_57711E 0x1650 And I have one of those in my test system: Broadcom Inc. and subsidiaries NetXtreme II BCM57711E 10-Gigabit PCIe [14e4:1650] Function bnx2x_init_vlan_mac_fp_objs() from drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h decides whether to initialize relevant pointers in bnx2x_sp_objs.vlan_obj or not. This regression was introduced after v4.20-rc7, and still exists in v4.20 release. Fixes: 04f05230c5c13 ("bnx2x: Remove configured vlans as part of unload sequence.") Signed-off-by: Ivan Mironov Signed-off-by: Ivan Mironov Acked-by: Sudarsana Kalluru Signed-off-by: David S. Miller commit 0eb987c874dc93f9c9d85a6465dbde20fdd3884c Author: Aditya Pakki Date: Sun Dec 23 19:42:38 2018 -0600 net/net_namespace: Check the return value of register_pernet_subsys() In net_ns_init(), register_pernet_subsys() could fail while registering network namespace subsystems. The fix checks the return value and sends a panic() on failure. Signed-off-by: Aditya Pakki Reviewed-by: Kirill Tkhai Signed-off-by: David S. Miller commit 89dfd0083751d00d5d7ead36f6d8b045bf89c5e1 Author: Aditya Pakki Date: Sun Dec 23 18:54:53 2018 -0600 net/netlink_compat: Fix a missing check of nla_parse_nested In tipc_nl_compat_sk_dump(), if nla_parse_nested() fails, it could return an error. To be consistent with other invocations of the function call, on error, the fix passes the return value upstream. Signed-off-by: Aditya Pakki Signed-off-by: David S. Miller commit 40c3ff6d5e0809505a067dd423c110c5658c478c Author: Willem de Bruijn Date: Sun Dec 23 12:52:18 2018 -0500 ieee802154: lowpan_header_create check must check daddr Packet sockets may call dev_header_parse with NULL daddr. Make lowpan_header_ops.create fail. Fixes: 87a93e4eceb4 ("ieee802154: change needed headroom/tailroom") Signed-off-by: Willem de Bruijn Acked-by: Alexander Aring Signed-off-by: David S. Miller commit 61988bd281c9b08e0cc084f0b2da3b109c4c39c8 Author: Julia Lawall Date: Sun Dec 23 09:57:14 2018 +0100 net/mlx4_core: drop useless LIST_HEAD Drop LIST_HEAD where the variable it declares has never been used. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; @@ - LIST_HEAD(x); ... when != x // Fixes: c82e9aa0a8bc ("mlx4_core: resource tracking for HCA resources used by guests") Signed-off-by: Julia Lawall Signed-off-by: David S. Miller commit d0863792f805ffad7d98fb6bd484bc2fad59c8ea Author: Julia Lawall Date: Sun Dec 23 09:57:11 2018 +0100 mlxsw: spectrum: drop useless LIST_HEAD Drop LIST_HEAD where the variable it declares is never used. The uses were removed in 244cd96adb5f ("net_sched: remove list_head from tc_action"), but not the declaration. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; @@ - LIST_HEAD(x); ... when != x // Fixes: 244cd96adb5f ("net_sched: remove list_head from tc_action") Signed-off-by: Julia Lawall Signed-off-by: David S. Miller commit 2534f14a94c1fe48928a4b00a0e241fa7132d00b Author: Julia Lawall Date: Sun Dec 23 09:56:57 2018 +0100 net/mlx5e: drop useless LIST_HEAD Drop LIST_HEAD where the variable it declares is never used. These became useless in 244cd96adb5f ("net_sched: remove list_head from tc_action") The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ identifier x; @@ - LIST_HEAD(x); ... when != x // Fixes: 244cd96adb5f ("net_sched: remove list_head from tc_action") Signed-off-by: Julia Lawall Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 7bdca378b2301b1fc6a95c60d6d428408ae4e39e Author: wenxu Date: Sun Dec 23 16:18:39 2018 +0800 iptunnel: Set tun_flags in the iptunnel_metadata_reply from src ip l add tun type gretap external ip r a 10.0.0.2 encap ip id 1000 dst 172.168.0.2 key dev tun ip a a 10.0.0.1/24 dev tun The peer arp request to 10.0.0.1 with tunnel_id, but the arp reply only set the tun_id but not the tun_flags with TUNNEL_KEY. The arp reply packet don't contain tun_id field. Signed-off-by: wenxu Signed-off-by: David S. Miller commit 5d1f7354faad4b6210fac9192d0ca4c16b00ae7e Author: kbuild test robot Date: Sat Dec 22 20:02:16 2018 +0800 net/mlx5e: fix semicolon.cocci warnings drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:1339:57-58: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Fixes: 4c8fb2986d44 ("net/mlx5e: Increase VF representors' SQ size to 128") CC: Gavi Teitz Signed-off-by: kbuild test robot Reviewed-by: Leon Romanovsky Signed-off-by: David S. Miller commit 8762cdcd1d5055017770a54e2755bed30dd4f8b6 Author: Florian Westphal Date: Fri Dec 21 21:57:26 2018 +0100 staging: octeon: fix build failure with XFRM enabled skb->sp doesn't exist anymore in the next-next tree, so mips defconfig no longer builds. Use helper instead to reset the secpath. Not even compile tested. Cc: Greg Kroah-Hartman Reported-by: Guenter Roeck Fixes: 4165079ba328d ("net: switch secpath to use skb extension infrastructure") Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit dec28d8ea2f731b7ec68a2c9421e99a165d47b57 Author: Masahiro Yamada Date: Mon Dec 24 23:11:09 2018 +0900 kbuild: remove unused cmd_gentimeconst filechk_gentimeconst is always used instead of cmd_gentimeconst. Signed-off-by: Masahiro Yamada commit e3c21e088f8936a004a3d9f2f4e14b3f2bdd6ea9 Author: Andrew Lunn Date: Wed Dec 19 16:18:20 2018 +0100 watchdog: tqmx86: Add watchdog driver for the IO controller Some TQ-Systems ComExpress modules have an IO controller with a watchdog timer. Signed-off-by: Andrew Lunn Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 6797f292e4f59211c1763de87a69c9a55fd9caef Author: Fabrizio Castro Date: Thu Dec 13 20:18:53 2018 +0000 dt-bindings: watchdog: renesas-wdt: Document r8a774c0 support RZ/G2E (R8A774C0) watchdog implementation is compatible with R-Car Gen3, therefore add relevant documentation. Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Reviewed-by: Guenter Roeck Reviewed-by: Rob Herring Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 2b6d86a73ec07f1ba95a274d8756fa1e67ef29c4 Author: Wolfram Sang Date: Mon Dec 17 20:14:11 2018 +0100 watchdog: docs: kernel-api: don't reference removed functions Those functions are not only deprecated, but gone for good. Fixes: 62cd1c40ce1c ("watchdog: kill unref/ref ops") Signed-off-by: Wolfram Sang Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit e536f7304badbf15e2099f08b5d47fbbf111a624 Author: Wolfram Sang Date: Mon Dec 17 20:33:14 2018 +0100 watchdog: add documentation for PM usage Add the first rule we recently agreed on. Signed-off-by: Wolfram Sang Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit e94b815524f83536415d7d59cc1833ad05934d97 Author: Fabrizio Castro Date: Thu Dec 13 20:20:15 2018 +0000 dt-bindings: pwm: rcar: Add r8a774c0 support Document RZ/G2E (R8A774C0) SoC bindings. Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Thierry Reding commit 9f4c8f9607c3147d291b70c13dd01c738ed41faf Author: Anson Huang Date: Wed Dec 19 05:24:58 2018 +0000 pwm: imx: Add ipg clock operation i.MX PWM module's ipg_clk_s is for PWM register access, on most of i.MX SoCs, this ipg_clk_s is from system ipg clock or perclk which is always enabled, but on i.MX7D, the ipg_clk_s is from PWM1_CLK_ROOT which is controlled by CCGR132, that means the CCGR132 MUST be enabled first before accessing PWM registers on i.MX7D. This patch adds ipg clock operation to make sure register access successfully on i.MX7D and it fixes Linux kernel boot up hang during PWM driver probe. Fixes: 4a23e6ee9f69 ("ARM: dts: imx7d-sdb: Restore pwm backlight support") Signed-off-by: Anson Huang Signed-off-by: Thierry Reding commit f236d188683667274824de662d124720198730b7 Author: Alexander Shiyan Date: Wed Dec 19 13:39:25 2018 +0300 pwm: clps711x: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Alexander Shiyan Signed-off-by: Thierry Reding commit b0f17570b8203c22f139459c86cfbaa0311313ed Author: Alexander Shiyan Date: Wed Dec 19 13:39:24 2018 +0300 pwm: clps711x: Fix period calculation Commit e39c0df1be5a ("pwm: Introduce the pwm_args concept") has changed the variable for the period for clps711x-pwm driver, so now pwm_get/set_period() works with pwm->state.period variable instead of pwm->args.period. This patch changes the period variable in other places where it is used. Signed-off-by: Alexander Shiyan Signed-off-by: Thierry Reding commit e747cbe257fdc08f1a8b19b4c9f75a377b6f783d Author: Stefan Wahren Date: Sat Nov 10 17:22:58 2018 +0100 pwm: bcm2835: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Cc: Bart Tanghe Signed-off-by: Stefan Wahren Reviewed-by: Eric Anholt Signed-off-by: Thierry Reding commit 88a053d2923479658e82621c4c642dc8a494392d Author: Clément Péron Date: Fri Nov 23 10:35:59 2018 +0100 pwm: Enable Kona PWM to be built for the Cygnus architecture The Cygnus architecture uses a Kona PWM. This is already present in the device tree but can't be built actually. Hence, allow the Kona PWM to be built for the Cygnus architecture. Signed-off-by: Clément Péron Reviewed-by: Florian Fainelli Reviewed-by: Scott Branden Acked-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit c75ff001f4fe21a8c9f15aad799a8949aea109f7 Author: Deepak Rawat Date: Fri Dec 21 11:35:59 2018 -0800 drm: Put damage blob when destroy plane state Somehow the code to put the damage blob on destroy plane state and set the blob to NULL when duplicate plane state was not merged. May be because the files are refactored since the patch was written. With this fix add those. Cc: Daniel Vetter Signed-off-by: Deepak Rawat Reviewed-by: Thomas Hellstrom Fixes: d3b21767821e ("drm: Add a new plane property to send damage during plane update") Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20181221193559.4346-1-drawat@vmware.com commit cbdd2663f4c801ad93f7111f93d9846589a0d530 Author: Colin Ian King Date: Sat Dec 22 13:00:46 2018 +0000 drm: fix null pointer dereference on null state pointer In the case where state cannot be allocated, the current exit path via label 'out' will dereference the null state pointer when calling drm_atomic_state_put. Fix this by adding a new error exit label and jumping to this to avoid the drm_atomic_state_put. Detected by CoverityScan, CID#1476034 ("Dereference after null check") Fixes: b9fc5e01d1ce ("drm: Add helper to implement legacy dirtyfb") Signed-off-by: Colin Ian King Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20181222130046.14083-1-colin.king@canonical.com commit 598134ffcab5bfb1d342458732394487063e1b9e Author: Greg Kroah-Hartman Date: Mon Dec 24 09:18:00 2018 +0100 Revert "serial: 8250: Default SERIAL_OF_PLATFORM to SERIAL_8250" This reverts commit 6d11023c345e369bcb9d5a68b271764e362c1f6e. It causes issues with Guenter's test systems and since there seems to not be any agreement about _why_ this is a problem, but reverting it fixes things, let's revert until the root cause is found. Reported-by: Guenter Roeck Cc: Florian Fainelli Signed-off-by: Greg Kroah-Hartman commit d2b911db8b73bc6bfa163515b4ff142fb0dda66d Author: Linus Walleij Date: Sat Dec 22 11:12:31 2018 +0100 watchdog: mtx-1: Convert to use GPIO descriptor This converts the MTX-1 driver to grab a GPIO descriptor associated with the device instead of using a resource with a global GPIO number. Augment the driver and the boardfile. Cc: Ralf Baechle Cc: Paul Burton Cc: James Hogan Cc: linux-mips@linux-mips.org Cc: Florian Fainelli Reviewed-by: Florian Fainelli Signed-off-by: Linus Walleij Acked-by: Paul Burton Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit e7b602f43719fc6173ae86d2de8f6f07c6858ddd Author: Paulo Alcantara Date: Wed Nov 14 15:38:51 2018 -0200 cifs: Save TTL value when parsing DFS referrals This will be needed by DFS cache. Signed-off-by: Paulo Alcantara Reviewed-by: Aurelien Aptel Signed-off-by: Steve French commit 5fc7fcd054adcf0f264446cbf778d33e30a45455 Author: Aurelien Aptel Date: Fri Nov 16 16:13:25 2018 +0100 cifs: auto disable 'serverino' in dfs mounts Different servers have different set of file ids. After failover, unique IDs will be different so we can't validate them. Signed-off-by: Aurelien Aptel Reviewed-by: Paulo Alcantara Signed-off-by: Steve French commit d9345e0ae7cff25e9aed39d21f092dbb482dffec Author: Paulo Alcantara Date: Wed Nov 14 14:18:22 2018 -0200 cifs: Make devname param optional in cifs_compose_mount_options() If we only want to get the mount options strings, do not return the devname. For DFS failover, we'll be passing the DFS full path down to cifs_mount() rather than the devname. Signed-off-by: Paulo Alcantara Reviewed-by: Aurelien Aptel Signed-off-by: Steve French commit c34fea5a636d98607ee6e41c78acc9d5ca8fb756 Author: Paulo Alcantara Date: Wed Nov 14 14:03:40 2018 -0200 cifs: Skip any trailing backslashes from UNC When extracting hostname from UNC, check for leading backslashes before trying to remove them. Signed-off-by: Paulo Alcantara Reviewed-by: Aurelien Aptel Signed-off-by: Steve French commit 56c762eb9bee330bb4e6d11c589434f2904d3ab6 Author: Paulo Alcantara Date: Wed Nov 14 13:03:14 2018 -0200 cifs: Refactor out cifs_mount() * Split and refactor the very large function cifs_mount() in multiple functions: - tcp, ses and tcon setup to mount_get_conns() - tcp, ses and tcon cleanup in mount_put_conns() - tcon tlink setup to mount_setup_tlink() - remote path checking to is_path_remote() * Implement 2 version of cifs_mount() for DFS-enabled builds and non-DFS-enabled builds (CONFIG_CIFS_DFS_UPCALL). In preparation for DFS failover support. Signed-off-by: Paulo Alcantara Reviewed-by: Aurelien Aptel Signed-off-by: Steve French commit 9a596f5b39593414c0ec80f71b94a226286f084e Author: Georgy A Bystrenin Date: Fri Dec 21 00:11:42 2018 -0600 CIFS: Fix error mapping for SMB2_LOCK command which caused OFD lock problem While resolving a bug with locks on samba shares found a strange behavior. When a file locked by one node and we trying to lock it from another node it fail with errno 5 (EIO) but in that case errno must be set to (EACCES | EAGAIN). This isn't happening when we try to lock file second time on same node. In this case it returns EACCES as expected. Also this issue not reproduces when we use SMB1 protocol (vers=1.0 in mount options). Further investigation showed that the mapping from status_to_posix_error is different for SMB1 and SMB2+ implementations. For SMB1 mapping is [NT_STATUS_LOCK_NOT_GRANTED to ERRlock] (See fs/cifs/netmisc.c line 66) but for SMB2+ mapping is [STATUS_LOCK_NOT_GRANTED to -EIO] (see fs/cifs/smb2maperror.c line 383) Quick changes in SMB2+ mapping from EIO to EACCES has fixed issue. BUG: https://bugzilla.kernel.org/show_bug.cgi?id=201971 Signed-off-by: Georgy A Bystrenin Reviewed-by: Pavel Shilovsky CC: Stable Signed-off-by: Steve French commit 54e94ff94eac887ddb59cfd46b18896da5695e35 Author: Long Li Date: Sun Dec 16 22:41:07 2018 +0000 CIFS: return correct errors when pinning memory failed for direct I/O When pinning memory failed, we should return the correct error code and rewind the SMB credits. Reported-by: Murphy Zhou Signed-off-by: Long Li Cc: stable@vger.kernel.org Cc: Murphy Zhou Signed-off-by: Steve French commit b6bc8a7b993e62f82415a5e3e4a6469e80fea19c Author: Long Li Date: Sun Dec 16 23:17:04 2018 +0000 CIFS: use the correct length when pinning memory for direct I/O for write The current code attempts to pin memory using the largest possible wsize based on the currect SMB credits. This doesn't cause kernel oops but this is not optimal as we may pin more pages then actually needed. Fix this by only pinning what are needed for doing this write I/O. Signed-off-by: Long Li Cc: stable@vger.kernel.org Signed-off-by: Steve French Reviewed-by: Joey Pabalinas commit 59a63e479ce36a3f24444c3a36efe82b78e4a8e0 Author: Ronnie Sahlberg Date: Thu Dec 13 08:06:16 2018 +1000 cifs: check ntwrk_buf_start for NULL before dereferencing it RHBZ: 1021460 There is an issue where when multiple threads open/close the same directory ntwrk_buf_start might end up being NULL, causing the call to smbCalcSize later to oops with a NULL deref. The real bug is why this happens and why this can become NULL for an open cfile, which should not be allowed. This patch tries to avoid a oops until the time when we fix the underlying issue. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 52baa51d30573273341b78a3e3ed0d9a845d3e55 Author: Ronnie Sahlberg Date: Wed Dec 12 11:50:00 2018 +1000 cifs: remove coverity warning in calc_lanman_hash password_with_pad is a fixed size buffer of 16 bytes, it contains a password string, to be padded with \0 if shorter than 16 bytes but is just truncated if longer. It is not, and we do not depend on it to be, nul terminated. As such, do not use strncpy() to populate this buffer since the str* prefix suggests that this is a string, which it is not, and it also confuses coverity causing a false warning. Detected by CoverityScan CID#113743 ("Buffer not null terminated") Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 0f57451eebf1945790785df106497bf62812f62a Author: YueHaibing Date: Fri Dec 7 07:05:38 2018 +0000 cifs: remove set but not used variable 'smb_buf' Fixes gcc '-Wunused-but-set-variable' warning: fs/cifs/sess.c: In function '_sess_auth_rawntlmssp_assemble_req': fs/cifs/sess.c:1157:18: warning: variable 'smb_buf' set but not used [-Wunused-but-set-variable] It never used since commit cc87c47d9d7a ("cifs: Separate rawntlmssp auth from CIFS_SessSetup()") Signed-off-by: YueHaibing Signed-off-by: Steve French commit 07fa6010ff939ef6c5a9ae0d230fdfd3bad82722 Author: Gustavo A. R. Silva Date: Tue Nov 27 10:01:51 2018 +1100 cifs: suppress some implicit-fallthrough warnings To avoid the warning: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Gustavo A. R. Silva Reviewed-by: Stephen Rothwell Signed-off-by: Steve French commit f9793b6fcc8ede4c2eb5f2d5816b1c8b4f927032 Author: Ronnie Sahlberg Date: Tue Nov 27 09:52:04 2018 +1000 cifs: change smb2_query_eas to use the compound query-info helper Reducing the number of network roundtrips improves the performance of query xattrs Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 4a3b38aec5778f8eb37b2eb4701baffb1da4ccd5 Author: Kenneth D'souza Date: Sat Nov 17 10:33:30 2018 +0530 Add vers=3.0.2 as a valid option for SMBv3.0.2 Technically 3.02 is not the dialect name although that is more familiar to many, so we should also accept the official dialect name (3.0.2 vs. 3.02) in vers= Signed-off-by: Kenneth D'souza Signed-off-by: Steve French commit 07d3b2e4264fb32bf82074311abc20c6de224d61 Author: Ronnie Sahlberg Date: Thu Dec 20 22:03:04 2018 -0600 cifs: create a helper function for compound query_info and convert statfs to use it. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 97aa495a89a631822431b789b8553b81e3460255 Author: Steve French Date: Thu Nov 15 00:33:05 2018 -0600 cifs: address trivial coverity warning This is not actually a bug but as Coverity points out we shouldn't be doing an "|=" on a value which hasn't been set (although technically it was memset to zero so isn't a bug) and so might as well change "|=" to "=" in this line Detected by CoverityScan, CID#728535 ("Unitialized scalar variable") Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg commit f5942db5ef25531d53f2aa2ff84a46e1763b4196 Author: Steve French Date: Wed Nov 14 01:37:39 2018 -0600 cifs: smb2 commands can not be negative, remove confusing check As Coverity points out le16_to_cpu(midEntry->Command) can not be less than zero. Detected by CoverityScan, CID#1438650 ("Macro compares unsigned to 0") Signed-off-by: Steve French Reviewed-by: Ronnie Sahlberg commit 0967e5457954370cc4e9902bd47b142e9655365f Author: Ronnie Sahlberg Date: Tue Nov 6 22:52:43 2018 +1000 cifs: use a compound for setting an xattr Improve performance by reducing number of network round trips for set xattr. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 5890255b83f3ce9ef9202804dfab744033c0e603 Author: Colin Ian King Date: Sat Nov 3 15:59:44 2018 +0000 cifs: clean up indentation, replace spaces with tab Trivial fix to clean up indentation, replace spaces with tab Signed-off-by: Colin Ian King Signed-off-by: Steve French commit 12526b0d6c580df860b31e59d68e5696e16c6e5b Merge: 9bbc7e4ce47ec 63d86876f3244 Author: Michael Ellerman Date: Mon Dec 24 14:14:45 2018 +1100 Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux into next Freescale updates from Scott: "Highlights include elimination of legacy clock bindings use from dts files, an 83xx watchdog handler, fixes to old dts interrupt errors, and some minor cleanup." commit 63d86876f32440a45b6f9d42ab2fb7f68b3a8bf7 Author: Scott Wood Date: Sun Dec 23 20:09:39 2018 -0600 Revert "powerpc/fsl_pci: simplify fsl_pci_dma_set_mask" This reverts commit c6e5485e0cb509292a14e880e1944143f99758c7 due to failures such as: e1000e 2000:01:00.0: Tx DMA map failed Signed-off-by: Scott Wood commit f2ab95814103314af3239d322e382c61c69a788d Author: David S. Miller Date: Sun Dec 23 16:01:35 2018 -0800 net: Revert recent Spectre-v1 patches. This reverts: 50d5258634ae ("net: core: Fix Spectre v1 vulnerability") d686026b1e6e ("phonet: af_phonet: Fix Spectre v1 vulnerability") a95386f0390a ("nfc: af_nfc: Fix Spectre v1 vulnerability") a3ac5817ffe8 ("can: af_can: Fix Spectre v1 vulnerability") After some discussion with Alexei Starovoitov these all seem to be completely unnecessary. Signed-off-by: David S. Miller commit 0b15394475e3bcaf35ca4bf22fc55d56df67224e Author: Stefan Roese Date: Mon Dec 17 10:47:48 2018 +0100 MIPS: ralink: Select CONFIG_CPU_MIPSR2_IRQ_VI on MT7620/8 Testing has shown, that when using mainline U-Boot on MT7688 based boards, the system may hang or crash while mounting the root-fs. The main issue here is that mainline U-Boot configures EBase to a value near the end of system memory. And with CONFIG_CPU_MIPSR2_IRQ_VI disabled, trap_init() will not allocate a new area to place the exception handler. The original value will be used and the handler will be copied to this location, which might already be used by some userspace application. The MT7688 supports VI - its config3 register is 0x00002420, so VInt (Bit 5) is set. But without setting CONFIG_CPU_MIPSR2_IRQ_VI this bit will not be evaluated to result in "cpu_has_vi" being set. This patch now selects CONFIG_CPU_MIPSR2_IRQ_VI on MT7620/8 which results trap_init() to allocate some memory for the exception handler. Please note that this issue was not seen with the Mediatek U-Boot version, as it does not touch EBase (stays at default of 0x8000.0000). This is strictly also not correct as the kernel (_text) resides here. Signed-off-by: Stefan Roese [paul.burton@mips.com: s/beeing/being/] Signed-off-by: Paul Burton Cc: John Crispin Cc: Daniel Schwierzeck Cc: Ralf Baechle Cc: linux-mips@linux-mips.org commit 9bd2f7eeaed129627a609b5c98098f0fd7805d24 Author: Alexandre Belloni Date: Tue Dec 18 15:26:36 2018 +0100 MAINTAINERS: Add a maintainer for MSCC MIPS SoCs Microsemi has been bought by Microchip and Microchip is supporting those SoCs. Signed-off-by: Alexandre Belloni Acked-by: Woojung Huh Signed-off-by: Paul Burton Cc: James Hogan Cc: Ralf Baechle Cc: linux-kernel@vger.kernel.org commit 994bc7fae916f8783ea7d357f1ccd6b3a67919f7 Author: Manuel Lauss Date: Wed Dec 19 08:08:03 2018 +0100 MIPS: Alchemy: update dma masks for devboard devices Fix the DMA masks for sound and mmc devices. Verified on DB1300 and DB1500. Signed-off-by: Manuel Lauss Signed-off-by: Paul Burton Cc: Linux-MIPS commit 7a3097be955efd979e96ced5edab651a4c09d42f Author: Manuel Lauss Date: Wed Dec 19 08:08:02 2018 +0100 MIPS: Alchemy: update cpu-feature-overrides No shiny new stuff for Alchemy. Tested on DB1300 and DB1500. Signed-off-by: Manuel Lauss Signed-off-by: Paul Burton Cc: Linux-MIPS commit e898d084eae086762406d487b3e81185c47de35d Author: Manuel Lauss Date: Wed Dec 19 08:08:01 2018 +0100 MIPS: Alchemy: drop DB1000 IrDA support bits The IrDA drivers are gone, drop the now unused DB1000 board support for it. Signed-off-by: Manuel Lauss Signed-off-by: Paul Burton Cc: Linux-MIPS commit bbb8a75208937beee3bba746da7addb194588619 Author: Manuel Lauss Date: Wed Dec 19 08:07:59 2018 +0100 MIPS: alchemy: cpu_all_mask is forbidden for clock event devices change alchemy clock event device cpu_all_mask to cpu_possible_mask. Gets rid of a warning, which then does the same substitution: WARNING: CPU: 0 PID: 0 at kernel/time/clockevents.c:468 clockevents_register_device+0x130/0x140 rtcmatch2 cpumask == cpu_all_mask, using cpu_possible_mask instead Signed-off-by: Manuel Lauss Signed-off-by: Paul Burton Cc: Linux-MIPS commit 8a38dacf87180738d42b058334c951eba15d2d47 Author: Jonas Gorski Date: Mon Dec 10 12:40:38 2018 +0100 MIPS: BCM63XX: fix switch core reset on BCM6368 The Ethernet Switch core mask was set to 0, causing the switch core to be not reset on BCM6368 on boot. Provide the proper mask so the switch core gets reset to a known good state. Fixes: 799faa626c71 ("MIPS: BCM63XX: add core reset helper") Signed-off-by: Jonas Gorski Signed-off-by: Paul Burton Cc: linux-mips@vger.kernel.org Cc: Ralf Baechle Cc: James Hogan Cc: Florian Fainelli commit c79b411eaa7257204f89c30651c45cea22278769 Author: Eric Biggers Date: Sun Dec 16 15:55:06 2018 -0800 crypto: skcipher - remove remnants of internal IV generators Remove dead code related to internal IV generators, which are no longer used since they've been replaced with the "seqiv" and "echainiv" templates. The removed code includes: - The "givcipher" (GIVCIPHER) algorithm type. No algorithms are registered with this type anymore, so it's unneeded. - The "const char *geniv" member of aead_alg, ablkcipher_alg, and blkcipher_alg. A few algorithms still set this, but it isn't used anymore except to show via /proc/crypto and CRYPTO_MSG_GETALG. Just hardcode "" or "" in those cases. - The 'skcipher_givcrypt_request' structure, which is never used. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit dec5d0db0de7271c7616d713f6c434c6366c9bfb Author: Eric Biggers Date: Sun Dec 16 15:00:30 2018 -0800 crypto: cavium/nitrox - Fix build with !CONFIG_DEBUG_FS Fixes: cf718eaa8f9b ("crypto: cavium/nitrox - Enabled Mailbox support") Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 101b53d91d57ebcc13cb5fbd437b1230457ba9e2 Author: Eric Biggers Date: Sat Dec 15 12:42:52 2018 -0800 crypto: salsa20-generic - don't unnecessarily use atomic walk salsa20-generic doesn't use SIMD instructions or otherwise disable preemption, so passing atomic=true to skcipher_walk_virt() is unnecessary. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit bb648291fc04c49197561939b8bfea0ada42bce3 Author: Eric Biggers Date: Sat Dec 15 12:41:53 2018 -0800 crypto: skcipher - add might_sleep() to skcipher_walk_virt() skcipher_walk_virt() can still sleep even with atomic=true, since that only affects the later calls to skcipher_walk_done(). But, skcipher_walk_virt() only has to allocate memory for some input data layouts, so incorrectly calling it with preemption disabled can go undetected. Use might_sleep() so that it's detected reliably. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit f9c9bdb5131eee60dc3b92e5126d4c0e291703e2 Author: Eric Biggers Date: Sat Dec 15 12:40:17 2018 -0800 crypto: x86/chacha - avoid sleeping under kernel_fpu_begin() Passing atomic=true to skcipher_walk_virt() only makes the later skcipher_walk_done() calls use atomic memory allocations, not skcipher_walk_virt() itself. Thus, we have to move it outside of the preemption-disabled region (kernel_fpu_begin()/kernel_fpu_end()). (skcipher_walk_virt() only allocates memory for certain layouts of the input scatterlist, hence why I didn't notice this earlier...) Reported-by: syzbot+9bf843c33f782d73ae7d@syzkaller.appspotmail.com Fixes: 4af78261870a ("crypto: x86/chacha20 - add XChaCha20 support") Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit c9613335bf4fe259a654aa0e9701f0c4cddc12ba Author: Nagadheeraj Rottela Date: Fri Dec 14 11:19:51 2018 +0000 crypto: cavium/nitrox - Added AEAD cipher support Added support to offload AEAD ciphers to NITROX. Currently supported AEAD cipher is 'gcm(aes)'. Signed-off-by: Nagadheeraj Rottela Reviewed-by: Srikanth Jampala Signed-off-by: Herbert Xu commit 2326828ee40357b3d2b1359b8ca7526af201495b Author: Fabio Estevam Date: Thu Dec 13 07:52:32 2018 -0200 crypto: mxc-scc - fix build warnings on ARM64 The following build warnings are seen when building for ARM64 allmodconfig: drivers/crypto/mxc-scc.c:181:20: warning: format '%d' expects argument of type 'int', but argument 5 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] drivers/crypto/mxc-scc.c:186:21: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] drivers/crypto/mxc-scc.c:277:21: warning: format '%d' expects argument of type 'int', but argument 4 has type 'size_t' {aka 'long unsigned int'} [-Wformat=] drivers/crypto/mxc-scc.c:339:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] drivers/crypto/mxc-scc.c:340:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Fix them by using the %zu specifier to print a size_t variable and using a plain %x to print the result of a readl(). Signed-off-by: Fabio Estevam Signed-off-by: Herbert Xu commit bfad6cb3f8295559216690e1eb9c99003a79b3a0 Author: Corentin Labbe Date: Thu Dec 13 08:36:38 2018 +0000 crypto: api - document missing stats member This patchs adds missing member of stats documentation. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 0c99c2a087c60b71e1fc90d070e2e16ca52defbe Author: Corentin Labbe Date: Thu Dec 13 08:36:37 2018 +0000 crypto: user - remove unused dump functions This patch removes unused dump functions for crypto_user_stats. There are remains of the copy/paste of crypto_user_base to crypto_user_stat and I forgot to remove them. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit f31ba0f95f1998118098978dbfb25ecbec6b0891 Author: Harsh Jain Date: Tue Dec 11 16:21:42 2018 +0530 crypto: chelsio - Fix wrong error counter increments Fix error counter increment in AEAD decrypt operation when validation of tag is done in Driver instead of H/W. Signed-off-by: Harsh Jain Signed-off-by: Herbert Xu commit 6501ab5ed4d925cce4c2a1c49b63583c42e65bd8 Author: Harsh Jain Date: Tue Dec 11 16:21:41 2018 +0530 crypto: chelsio - Reset counters on cxgb4 Detach Reset the counters on receiving detach from Cxgb4. Signed-off-by: Atul Gupta Signed-off-by: Herbert Xu commit fef4912b66d6246d958d97382d20d0dd23bcf0bc Author: Harsh Jain Date: Tue Dec 11 16:21:40 2018 +0530 crypto: chelsio - Handle PCI shutdown event chcr receives "CXGB4_STATE_DETACH" event on PCI Shutdown. Wait for processing of inflight request and Mark the device unavailable. Signed-off-by: Harsh Jain Signed-off-by: Herbert Xu commit c4f6d44d774eff382b6fc79a9fe1ff376b5ac6d7 Author: Harsh Jain Date: Tue Dec 11 16:21:39 2018 +0530 crypto: chelsio - cleanup:send addr as value in function argument Send dma address as value to function arguments instead of pointer. Signed-off-by: Harsh Jain Signed-off-by: Herbert Xu commit d5a4dfbdaf54cbd845755a5415cff57688bb983c Author: Harsh Jain Date: Tue Dec 11 16:21:38 2018 +0530 crypto: chelsio - Use same value for both channel in single WR Use tx_channel_id instead of rx_channel_id. Signed-off-by: Harsh Jain Signed-off-by: Herbert Xu commit 1f479e4cfd08f20e48dfde07b27e3180e0901252 Author: Harsh Jain Date: Tue Dec 11 16:21:37 2018 +0530 crypto: chelsio - Swap location of AAD and IV sent in WR Send input as IV | AAD | Data. It will allow sending IV as Immediate Data and Creates space in Work request to add more dma mapped entries. Signed-off-by: Harsh Jain Signed-off-by: Herbert Xu commit 3cc04c160208ec55940db652343d236515d88af5 Author: YueHaibing Date: Tue Dec 11 08:11:59 2018 +0000 crypto: chelsio - remove set but not used variable 'kctx_len' Fixes gcc '-Wunused-but-set-variable' warning: drivers/crypto/chelsio/chcr_ipsec.c: In function 'chcr_ipsec_xmit': drivers/crypto/chelsio/chcr_ipsec.c:674:33: warning: variable 'kctx_len' set but not used [-Wunused-but-set-variable] unsigned int flits = 0, ndesc, kctx_len; It not used since commit 8362ea16f69f ("crypto: chcr - ESN for Inline IPSec Tx") Signed-off-by: YueHaibing Signed-off-by: Herbert Xu commit 5ac93f808338f4dd465402e91869702eb87db241 Author: Nathan Chancellor Date: Mon Dec 10 16:49:54 2018 -0700 crypto: ux500 - Use proper enum in hash_set_dma_transfer Clang warns when one enumerated type is implicitly converted to another: drivers/crypto/ux500/hash/hash_core.c:169:4: warning: implicit conversion from enumeration type 'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion] direction, DMA_CTRL_ACK | DMA_PREP_INTERRUPT); ^~~~~~~~~ 1 warning generated. dmaengine_prep_slave_sg expects an enum from dma_transfer_direction. We know that the only direction supported by this function is DMA_TO_DEVICE because of the check at the top of this function so we can just use the equivalent value from dma_transfer_direction. DMA_TO_DEVICE = DMA_MEM_TO_DEV = 1 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Herbert Xu commit 9d880c5945c748d8edcac30965f3349a602158c4 Author: Nathan Chancellor Date: Mon Dec 10 16:49:29 2018 -0700 crypto: ux500 - Use proper enum in cryp_set_dma_transfer Clang warns when one enumerated type is implicitly converted to another: drivers/crypto/ux500/cryp/cryp_core.c:559:5: warning: implicit conversion from enumeration type 'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion] direction, DMA_CTRL_ACK); ^~~~~~~~~ drivers/crypto/ux500/cryp/cryp_core.c:583:5: warning: implicit conversion from enumeration type 'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion] direction, ^~~~~~~~~ 2 warnings generated. dmaengine_prep_slave_sg expects an enum from dma_transfer_direction. Because we know the value of the dma_data_direction enum from the switch statement, we can just use the proper value from dma_transfer_direction so there is no more conversion. DMA_TO_DEVICE = DMA_MEM_TO_DEV = 1 DMA_FROM_DEVICE = DMA_DEV_TO_MEM = 2 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Herbert Xu commit 603f8c3b0dbbe21fabb7e005f57883b21aaadd82 Author: Dave Watson Date: Mon Dec 10 19:59:59 2018 +0000 crypto: aesni - Add scatter/gather avx stubs, and use them in C Add the appropriate scatter/gather stubs to the avx asm. In the C code, we can now always use crypt_by_sg, since both sse and asm code now support scatter/gather. Introduce a new struct, aesni_gcm_tfm, that is initialized on startup to point to either the SSE, AVX, or AVX2 versions of the four necessary encryption/decryption routines. GENX_OPTSIZE is still checked at the start of crypt_by_sg. The total size of the data is checked, since the additional overhead is in the init function, calculating additional HashKeys. Signed-off-by: Dave Watson Signed-off-by: Herbert Xu commit e044d5056396029cc12ed5354aa2a073b747195a Author: Dave Watson Date: Mon Dec 10 19:59:38 2018 +0000 crypto: aesni - Introduce partial block macro Before this diff, multiple calls to GCM_ENC_DEC will succeed, but only if all calls are a multiple of 16 bytes. Handle partial blocks at the start of GCM_ENC_DEC, and update aadhash as appropriate. The data offset %r11 is also updated after the partial block. Signed-off-by: Dave Watson Signed-off-by: Herbert Xu commit ec8c02d9a30b8324d7aae9e4e7a08973a8eaa8b4 Author: Dave Watson Date: Mon Dec 10 19:59:26 2018 +0000 crypto: aesni - Introduce READ_PARTIAL_BLOCK macro Introduce READ_PARTIAL_BLOCK macro, and use it in the two existing partial block cases: AAD and the end of ENC_DEC. In particular, the ENC_DEC case should be faster, since we read by 8/4 bytes if possible. This macro will also be used to read partial blocks between enc_update and dec_update calls. Signed-off-by: Dave Watson Signed-off-by: Herbert Xu commit 517a448e09846732d46e983a2195002d05857919 Author: Dave Watson Date: Mon Dec 10 19:59:11 2018 +0000 crypto: aesni - Move ghash_mul to GCM_COMPLETE Prepare to handle partial blocks between scatter/gather calls. For the last partial block, we only want to calculate the aadhash in GCM_COMPLETE, and a new partial block macro will handle both aadhash update and encrypting partial blocks between calls. Signed-off-by: Dave Watson Signed-off-by: Herbert Xu commit a44b419fe5aee3bfe12c88698a023cb5c6067985 Author: Dave Watson Date: Mon Dec 10 19:58:56 2018 +0000 crypto: aesni - Fill in new context data structures Fill in aadhash, aadlen, pblocklen, curcount with appropriate values. pblocklen, aadhash, and pblockenckey are also updated at the end of each scatter/gather operation, to be carried over to the next operation. Signed-off-by: Dave Watson Signed-off-by: Herbert Xu commit 1cb1bcbb567d10bdd9de9d03964c5e2958f0d111 Author: Dave Watson Date: Mon Dec 10 19:58:38 2018 +0000 crypto: aesni - Merge avx precompute functions The precompute functions differ only by the sub-macros they call, merge them to a single macro. Later diffs add more code to fill in the gcm_context_data structure, this allows changes in a single place. Signed-off-by: Dave Watson Signed-off-by: Herbert Xu commit 38003cd26c9f59da77d98927fb9af58732da207a Author: Dave Watson Date: Mon Dec 10 19:58:19 2018 +0000 crypto: aesni - Split AAD hash calculation to separate macro AAD hash only needs to be calculated once for each scatter/gather operation. Move it to its own macro, and call it from GCM_INIT instead of INITIAL_BLOCKS. Signed-off-by: Dave Watson Signed-off-by: Herbert Xu commit e377bedb09d6970ad27d7714b0a6365ee7e4d732 Author: Dave Watson Date: Mon Dec 10 19:57:49 2018 +0000 crypto: aesni - Add GCM_COMPLETE macro Merge encode and decode tag calculations in GCM_COMPLETE macro. Scatter/gather routines will call this once at the end of encryption or decryption. Signed-off-by: Dave Watson Signed-off-by: Herbert Xu commit 5350b0f563433dacc134214a452fd316b36251d6 Author: Dave Watson Date: Mon Dec 10 19:57:36 2018 +0000 crypto: aesni - support 256 byte keys in avx asm Add support for 192/256-bit keys using the avx gcm/aes routines. The sse routines were previously updated in e31ac32d3b (Add support for 192 & 256 bit keys to AESNI RFC4106). Instead of adding an additional loop in the hotpath as in e31ac32d3b, this diff instead generates separate versions of the code using macros, and the entry routines choose which version once. This results in a 5% performance improvement vs. adding a loop to the hot path. This is the same strategy chosen by the intel isa-l_crypto library. The key size checks are removed from the c code where appropriate. Note that this diff depends on using gcm_context_data - 256 bit keys require 16 HashKeys + 15 expanded keys, which is larger than struct crypto_aes_ctx, so they are stored in struct gcm_context_data. Signed-off-by: Dave Watson Signed-off-by: Herbert Xu commit 2426f64bc51fc86951b735d2247d6eb89259d580 Author: Dave Watson Date: Mon Dec 10 19:57:12 2018 +0000 crypto: aesni - Macro-ify func save/restore Macro-ify function save and restore. These will be used in new functions added for scatter/gather update operations. Signed-off-by: Dave Watson Signed-off-by: Herbert Xu commit de85fc46b1037099c78d2fec08a662079e568d62 Author: Dave Watson Date: Mon Dec 10 19:57:00 2018 +0000 crypto: aesni - Introduce gcm_context_data Add the gcm_context_data structure to the avx asm routines. This will be necessary to support both 256 bit keys and scatter/gather. The pre-computed HashKeys are now stored in the gcm_context_data struct, which is expanded to hold the greater number of hashkeys necessary for avx. Loads and stores to the new struct are always done unlaligned to avoid compiler issues, see e5b954e8 "Use unaligned loads from gcm_context_data" Signed-off-by: Dave Watson Signed-off-by: Herbert Xu commit f9b1d64678607e132051d232c7a2127f32947d64 Author: Dave Watson Date: Mon Dec 10 19:56:45 2018 +0000 crypto: aesni - Merge GCM_ENC_DEC The GCM_ENC_DEC routines for AVX and AVX2 are identical, except they call separate sub-macros. Pass the macros as arguments, and merge them. This facilitates additional refactoring, by requiring changes in only one place. The GCM_ENC_DEC macro was moved above the CONFIG_AS_AVX* ifdefs, since it will be used by both AVX and AVX2. Signed-off-by: Dave Watson Signed-off-by: Herbert Xu commit 3d739c1f6156c70eb0548aa288dcfbac9e0bd162 Author: Steven Rostedt (VMware) Date: Fri Dec 21 23:10:26 2018 -0500 tracing: Use the return of str_has_prefix() to remove open coded numbers There are several locations that compare constants to the beginning of string variables to determine what commands should be done, then the constant length is used to index into the string. This is error prone as the hard coded numbers have to match the size of the constants. Instead, use the len returned from str_has_prefix() and remove the open coded string length sizes. Cc: Joe Perches Acked-by: Masami Hiramatsu (for trace_probe part) Acked-by: Namhyung Kim Signed-off-by: Steven Rostedt (VMware) commit 036876fa56204ae0fa59045bd6bbb2691a060633 Author: Steven Rostedt (VMware) Date: Fri Dec 21 18:40:46 2018 -0500 tracing: Have the historgram use the result of str_has_prefix() for len of prefix As str_has_prefix() returns the length on match, we can use that for the updating of the string pointer instead of recalculating the prefix size. Cc: Tom Zanussi Acked-by: Namhyung Kim Signed-off-by: Steven Rostedt (VMware) commit b6b2735514bcd70ad1556a33892a636b20ece671 Author: Steven Rostedt (VMware) Date: Thu Dec 20 13:20:07 2018 -0500 tracing: Use str_has_prefix() instead of using fixed sizes There are several instances of strncmp(str, "const", 123), where 123 is the strlen of the const string to check if "const" is the prefix of str. But this can be error prone. Use str_has_prefix() instead. Acked-by: Namhyung Kim Signed-off-by: Steven Rostedt (VMware) commit 754481e6954cbef53f8bc4412ad48dde611e21d3 Author: Steven Rostedt (VMware) Date: Wed Dec 19 22:38:21 2018 -0500 tracing: Use str_has_prefix() helper for histogram code The tracing histogram code contains a lot of instances of the construct: strncmp(str, "const", sizeof("const") - 1) This can be prone to bugs due to typos or bad cut and paste. Use the str_has_prefix() helper macro instead that removes the need for having two copies of the constant string. Cc: Tom Zanussi Acked-by: Namhyung Kim Signed-off-by: Steven Rostedt (VMware) commit 72921427d46bf9731a1ab7864adc64c43dfae29f Author: Steven Rostedt (VMware) Date: Fri Dec 21 18:10:14 2018 -0500 string.h: Add str_has_prefix() helper function A discussion came up in the trace triggers thread about converting a bunch of: strncmp(str, "const", sizeof("const") - 1) use cases into a helper macro. It started with: strncmp(str, const, sizeof(const) - 1) But then Joe Perches mentioned that if a const is not used, the sizeof() will be the size of a pointer, which can be bad. And that gcc will optimize strlen("const") into "sizeof("const") - 1". Thinking about this more, a quick grep in the kernel tree found several (thousands!) of cases that use this construct. A quick grep also revealed that there's probably several bugs in that use case. Some are that people forgot the "- 1" (which I found) and others could be that the constant for the sizeof is different than the constant (although, I haven't found any of those, but I also didn't look hard). I figured the best thing to do is to create a helper macro and place it into include/linux/string.h. And go around and fix all the open coded versions of it later. Note, gcc appears to optimize this when we make it into an always_inline static function, which removes a lot of issues that a macro produces. Link: http://lkml.kernel.org/r/e3e754f2bd18e56eaa8baf79bee619316ebf4cfc.1545161087.git.tom.zanussi@linux.intel.com Link: http://lkml.kernel.org/r/20181219211615.2298e781@gandalf.local.home Link: http://lkml.kernel.org/r/CAHk-=wg_sR-UEC1ggmkZpypOUYanL5CMX4R7ceuaV4QMf5jBtg@mail.gmail.com Cc: Tom Zanussi Cc: Greg Kroah-Hartman Acked-by: Namhyung Kim Suggestions-by: Linus Torvalds Suggestions-by: Joe Perches Suggestions-by: Andreas Schwab Signed-off-by: Steven Rostedt (VMware) commit a3ac5817ffe8f81dbe6be1522b499b48bc322e3a Author: Gustavo A. R. Silva Date: Fri Dec 21 15:22:29 2018 -0600 can: af_can: Fix Spectre v1 vulnerability protocol is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: net/can/af_can.c:115 can_get_proto() warn: potential spectre issue 'proto_tab' [w] Fix this by sanitizing protocol before using it to index proto_tab. Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit 11fda148040bb987949f9b957aceb483407e32cb Author: Masahiro Yamada Date: Sat Dec 22 18:50:35 2018 +0900 kbuild: remove $(obj)/ prefixes in ./Kbuild Adding $(obj)/ to file paths relative from the top objtree looks a bit redundant to me. This commit has no functional change since $(obj) is '.' in this file. Signed-off-by: Masahiro Yamada commit 2c667d77fc02dd453c49b9c29d08a8bb55d60ebe Author: Masahiro Yamada Date: Sat Dec 22 18:50:34 2018 +0900 treewide: add intermediate .s files to targets Avoid unneeded recreation of these in the incremental build. Signed-off-by: Masahiro Yamada commit 4d4b5c2e3b6e6137c36cc13fe0d03404205afbd0 Author: Masahiro Yamada Date: Sat Dec 22 18:50:33 2018 +0900 treewide: remove explicit rules for *offsets.s These explicit rules are unneeded because scripts/Makefile.build provides a pattern rule to create %.s from %.c Signed-off-by: Masahiro Yamada commit 3470d9eb638722212ac44787eaf13486823fa011 Author: Masahiro Yamada Date: Fri Dec 21 12:12:41 2018 +0900 firmware: refactor firmware/Makefile Clean up the Makefile. Equivalent *.gen.S files are still produced. - Use filechk to remove ugly wordsize_deps - Get FWNAME, FWSTR, ASM_WORD, ASM_ALIGN, and PROGBITS out of the recipe for readability - Remove 'mkdir' because filechk takes care of it Signed-off-by: Masahiro Yamada commit 6b8d95f1795c42161dc0984b6863e95d6acf24ed Author: Willem de Bruijn Date: Sat Dec 22 16:53:45 2018 -0500 packet: validate address length if non-zero Validate packet socket address length if a length is given. Zero length is equivalent to not setting an address. Fixes: 99137b7888f4 ("packet: validate address length") Reported-by: Ido Schimmel Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit a95386f0390ab602904d11fe6bd7ea5ef9b136f8 Author: Gustavo A. R. Silva Date: Fri Dec 21 15:47:53 2018 -0600 nfc: af_nfc: Fix Spectre v1 vulnerability proto is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: net/nfc/af_nfc.c:42 nfc_sock_create() warn: potential spectre issue 'proto_tab' [w] (local cap) Fix this by sanitizing proto before using it to index proto_tab. Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit d686026b1e6ed4ea27d630d8f54f9a694db088b2 Author: Gustavo A. R. Silva Date: Fri Dec 21 15:41:17 2018 -0600 phonet: af_phonet: Fix Spectre v1 vulnerability protocol is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: net/phonet/af_phonet.c:48 phonet_proto_get() warn: potential spectre issue 'proto_tab' [w] (local cap) Fix this by sanitizing protocol before using it to index proto_tab. Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit f617e5ffe04fd46010b618c9eeadaa04588704c9 Author: Wei Yongjun Date: Sat Dec 22 10:30:30 2018 +0000 RDMA/srpt: Use kmem_cache_free() instead of kfree() memory allocated by kmem_cache_alloc() should be freed using kmem_cache_free(), not kfree(). Fixes: 5dabcd0456d7 ("RDMA/srpt: Add support for immediate data") Signed-off-by: Wei Yongjun Signed-off-by: Jason Gunthorpe commit 58f7c0bfb4e111006ba376df7ab266a6d42d64ba Author: Dan Carpenter Date: Sat Dec 22 10:43:32 2018 +0300 RDMA/mlx5: Signedness bug in UVERBS_HANDLER() The "num_actions" variable needs to be signed for the error handling to work. The maximum number of actions is less than 256 so int type is large enough for that. Fixes: cbfdd442c43e ("IB/uverbs: Add helper to get array size from ptr attribute") Signed-off-by: Dan Carpenter Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 573671a5f6509c4139770452d4516720a84d5b61 Author: Dan Carpenter Date: Sat Dec 22 10:42:59 2018 +0300 IB/uverbs: Signedness bug in UVERBS_HANDLER() The "num_sge" variable needs to be signed for the error handling to work. The uverbs_attr_ptr_get_array_size() returns int so this change is safe. Fixes: ad8a4496757f ("IB/uverbs: Add support to advise_mr") Signed-off-by: Dan Carpenter Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 50d5258634aee2e62832aa086d2fb0de00e72b91 Author: Gustavo A. R. Silva Date: Fri Dec 21 14:49:01 2018 -0600 net: core: Fix Spectre v1 vulnerability flen is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: net/core/filter.c:1101 bpf_check_classic() warn: potential spectre issue 'filter' [w] Fix this by sanitizing flen before using it to index filter at line 1101: switch (filter[flen - 1].code) { and through pc at line 1040: const struct sock_filter *ftest = &filter[pc]; Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Signed-off-by: Gustavo A. R. Silva Signed-off-by: David S. Miller commit d52c499b476b2f82eebecdd5fc4be8318a4e8ef7 Author: Gustavo A. R. Silva Date: Sat Dec 22 01:39:52 2018 -0600 lightnvm: pblk: fix use-after-free bug Remove one of the calls to function bio_put(), so *bio* is only freed once. Notice that bio is being dereferenced in bio_put(), hence leading to a use-after-free bug once *bio* has already been freed. Addresses-Coverity-ID: 1475952 ("Use after free") Fixes: 55d8ec35398e ("lightnvm: pblk: support packed metadata") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Jens Axboe commit 93f87a74fde682e0b53c90ea25e744003d294ae2 Author: Chengguang Xu Date: Sat Dec 22 20:47:56 2018 +0800 block: sunvdc: remove redundant code Code cleanup for removing redundant break in switch case. Signed-off-by: Chengguang Xu Signed-off-by: Jens Axboe commit c41103691b7fc4fda11f74a90a4fbd9d265c8cc9 Author: Chengguang Xu Date: Sat Dec 22 20:47:15 2018 +0800 block: loop: remove redundant code Code cleanup for removing redundant break in switch case. Signed-off-by: Chengguang Xu Signed-off-by: Jens Axboe commit 1debf0958fa27b7c469dbf22754929ec59a7c0e7 Author: Sai Praneeth Prakhya Date: Fri Dec 21 18:22:34 2018 -0800 x86/efi: Don't unmap EFI boot services code/data regions for EFI_OLD_MEMMAP and EFI_MIXED_MODE The following commit: d5052a7130a6 ("x86/efi: Unmap EFI boot services code/data regions from efi_pgd") forgets to take two EFI modes into consideration, namely EFI_OLD_MEMMAP and EFI_MIXED_MODE: - EFI_OLD_MEMMAP is a legacy way of mapping EFI regions into swapper_pg_dir using ioremap() and init_memory_mapping(). This feature can be enabled by passing "efi=old_map" as kernel command line argument. But, efi_unmap_pages() unmaps EFI boot services code/data regions *only* from efi_pgd and hence cannot be used for unmapping EFI boot services code/data regions from swapper_pg_dir. Introduce a temporary fix to not unmap EFI boot services code/data regions when EFI_OLD_MEMMAP is enabled while working on a real fix. - EFI_MIXED_MODE is another feature where a 64-bit kernel runs on a 64-bit platform crippled by a 32-bit firmware. To support EFI_MIXED_MODE, all RAM (i.e. namely EFI regions like EFI_CONVENTIONAL_MEMORY, EFI_LOADER_, EFI_BOOT_SERVICES_ and EFI_RUNTIME_CODE/DATA regions) is mapped into efi_pgd all the time to facilitate EFI runtime calls access it's arguments in 1:1 mode. Hence, don't unmap EFI boot services code/data regions when booted in mixed mode. Signed-off-by: Sai Praneeth Prakhya Acked-by: Ard Biesheuvel Cc: Andy Lutomirski Cc: Bhupesh Sharma Cc: Borislav Petkov Cc: Dave Hansen Cc: Dave Hansen Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20181222022234.7573-1-sai.praneeth.prakhya@intel.com Signed-off-by: Ingo Molnar commit 37379cfc661e51607733f266d9f407b4f8aee16b Author: Dan Williams Date: Sat Dec 22 11:35:41 2018 -0800 libnvdimm/security: Quiet security operations The security implementation is too chatty. For example, the common case is that security is not enabled / setup, and booting a qemu configuration currently yields: nvdimm nmem0: request_key() found no key nvdimm nmem0: failed to unlock dimm: -126 nvdimm nmem1: request_key() found no key nvdimm nmem1: failed to unlock dimm: -126 Convert all security related log messages to debug level. Cc: Dave Jiang Signed-off-by: Dan Williams commit 1cce377df1800154301525a8ee04100dd83c9633 Author: Mathieu Malaterre Date: Wed May 16 21:30:12 2018 +0200 tracing: Make function ‘ftrace_exports’ static In commit 478409dd683d ("tracing: Add hook to function tracing for other subsystems to use"), a new function ‘ftrace_exports’ was added. Since this function can be made static, make it so. Silence the following warning triggered using W=1: kernel/trace/trace.c:2451:6: warning: no previous prototype for ‘ftrace_exports’ [-Wmissing-prototypes] Link: http://lkml.kernel.org/r/20180516193012.25390-1-malat@debian.org Signed-off-by: Mathieu Malaterre Signed-off-by: Steven Rostedt (VMware) commit bea6957d5cd7cbb327083d3bcf080133ee63ef65 Author: Rasmus Villemoes Date: Mon Oct 29 23:35:42 2018 +0100 tracing: Simplify printf'ing in seq_print_sym trace_seq_printf(..., "%s", ...) can be done with trace_seq_puts() instead, avoiding printf overhead. In the second instance, the string we're copying was just created from an snprintf() to a stack buffer, so we might as well do that printf directly. This naturally leads to moving the declaration of the str buffer inside the CONFIG_KALLSYMS guard, which in turn will make gcc inline the function for !CONFIG_KALLSYMS (it only has a single caller, but the huge stack frame seems to make gcc not inline it for CONFIG_KALLSYMS). Link: http://lkml.kernel.org/r/20181029223542.26175-4-linux@rasmusvillemoes.dk Signed-off-by: Rasmus Villemoes Signed-off-by: Steven Rostedt (VMware) commit cc9f59fb3bc455984404dbab8be16f156a47d023 Author: Rasmus Villemoes Date: Mon Oct 29 23:35:41 2018 +0100 tracing: Avoid -Wformat-nonliteral warning Building with -Wformat-nonliteral, gcc complains kernel/trace/trace_output.c: In function ‘seq_print_sym’: kernel/trace/trace_output.c:356:3: warning: format not a string literal, argument types not checked [-Wformat-nonliteral] trace_seq_printf(s, fmt, name); But seq_print_sym only has a single caller which passes "%s" as fmt, so we might as well just use that directly. That also paves the way for further cleanups that will actually make that format string go away entirely. Link: http://lkml.kernel.org/r/20181029223542.26175-3-linux@rasmusvillemoes.dk Signed-off-by: Rasmus Villemoes Signed-off-by: Steven Rostedt (VMware) commit 59dd974bc079079c23b5429cba841696fa7fae41 Author: Rasmus Villemoes Date: Mon Oct 29 23:35:40 2018 +0100 tracing: Merge seq_print_sym_short() and seq_print_sym_offset() These two functions are nearly identical, so we can avoid some code duplication by moving the conditional into a common implementation. Link: http://lkml.kernel.org/r/20181029223542.26175-2-linux@rasmusvillemoes.dk Signed-off-by: Rasmus Villemoes Signed-off-by: Steven Rostedt (VMware) commit 05ddb25cb31491b0901d057c40ad50d01b3db783 Author: Tom Zanussi Date: Tue Dec 18 14:33:26 2018 -0600 tracing: Add hist trigger comments for variable-related fields Add a few comments to help clarify how variable and variable reference fields are used in the code. Link: http://lkml.kernel.org/r/ea857ce948531d7bec712bbb0f38360aa1d378ec.1545161087.git.tom.zanussi@linux.intel.com Acked-by: Namhyung Kim Reviewed-by: Masami Hiramatsu Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) commit 912201345f7c39e6b0ac283207be2b6641fa47b9 Author: Tom Zanussi Date: Tue Dec 18 14:33:25 2018 -0600 tracing: Remove hist trigger synth_var_refs All var_refs are now handled uniformly and there's no reason to treat the synth_refs in a special way now, so remove them and associated functions. Link: http://lkml.kernel.org/r/b4d3470526b8f0426dcec125399dad9ad9b8589d.1545161087.git.tom.zanussi@linux.intel.com Acked-by: Namhyung Kim Reviewed-by: Masami Hiramatsu Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) commit 656fe2ba85e81d00e4447bf77b8da2be3c47acb2 Author: Tom Zanussi Date: Tue Dec 18 14:33:24 2018 -0600 tracing: Use hist trigger's var_ref array to destroy var_refs Since every var ref for a trigger has an entry in the var_ref[] array, use that to destroy the var_refs, instead of piecemeal via the field expressions. This allows us to avoid having to keep and treat differently separate lists for the action-related references, which future patches will remove. Link: http://lkml.kernel.org/r/fad1a164f0e257c158e70d6eadbf6c586e04b2a2.1545161087.git.tom.zanussi@linux.intel.com Acked-by: Namhyung Kim Reviewed-by: Masami Hiramatsu Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) commit de40f033d4e84e843d6a12266e3869015ea9097c Author: Tom Zanussi Date: Tue Dec 18 14:33:23 2018 -0600 tracing: Remove open-coding of hist trigger var_ref management Have create_var_ref() manage the hist trigger's var_ref list, rather than having similar code doing it in multiple places. This cleans up the code and makes sure var_refs are always accounted properly. Also, document the var_ref-related functions to make what their purpose clearer. Link: http://lkml.kernel.org/r/05ddae93ff514e66fc03897d6665231892939913.1545161087.git.tom.zanussi@linux.intel.com Acked-by: Namhyung Kim Reviewed-by: Masami Hiramatsu Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) commit e4f6d245031e04bdd12db390298acec0474a1a46 Author: Tom Zanussi Date: Wed Dec 19 13:09:16 2018 -0600 tracing: Use var_refs[] for hist trigger reference checking Since all the variable reference hist_fields are collected into hist_data->var_refs[] array, there's no need to go through all the fields looking for them, or in separate arrays like synth_var_refs[], which will be going away soon anyway. This also allows us to get rid of some unnecessary code and functions currently used for the same purpose. Link: http://lkml.kernel.org/r/1545246556.4239.7.camel@gmail.com Acked-by: Namhyung Kim Reviewed-by: Masami Hiramatsu Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) commit 2f31ed9308cc9e95c149078b276a47360ab507bb Author: Tom Zanussi Date: Tue Dec 18 14:33:21 2018 -0600 tracing: Change strlen to sizeof for hist trigger static strings There's no need to use strlen() for static strings when the length is already known, so update trace_events_hist.c with sizeof() for those cases. Link: http://lkml.kernel.org/r/e3e754f2bd18e56eaa8baf79bee619316ebf4cfc.1545161087.git.tom.zanussi@linux.intel.com Acked-by: Namhyung Kim Reviewed-by: Masami Hiramatsu Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) commit 6801f0d5ca00bed159c7f87870cc6f5411837544 Author: Tom Zanussi Date: Tue Dec 18 14:33:20 2018 -0600 tracing: Remove unnecessary hist trigger struct field hist_field.var_idx is completely unused, so remove it. Link: http://lkml.kernel.org/r/d4e066c0f509f5f13ad3babc8c33ca6e7ddc439a.1545161087.git.tom.zanussi@linux.intel.com Acked-by: Namhyung Kim Reviewed-by: Masami Hiramatsu Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) commit e8d086ddb5339d72c60e6c7b8d28810f26960f9a Author: Steven Rostedt (VMware) Date: Tue Dec 18 15:50:02 2018 -0500 tracing: Fix ftrace_graph_get_ret_stack() to use task and not current The function ftrace_graph_get_ret_stack() takes a task struct descriptor but uses current as the task to perform the operations on. In pretty much all cases the task decriptor is the same as current, so this wasn't an issue. But there is a case in the ARM architecture that passes in a task that is not current, and expects a result from that task, and this code breaks it. Fixes: 51584396cff5 ("arm64: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack") Reported-by: James Morse Tested-by: James Morse Signed-off-by: Steven Rostedt (VMware) commit 29924e5030969c55dbe68074215be5a1f14f1ff1 Author: Michael Ellerman Date: Fri Oct 19 15:21:09 2018 +1100 seq_buf: Use size_t for len in seq_buf_puts() Jann Horn points out that we're using unsigned int for len in seq_buf_puts(), which could potentially overflow if we're passed a UINT_MAX sized string. The rest of the code already uses size_t, so we should also use that in seq_buf_puts() to avoid any issues. Link: http://lkml.kernel.org/r/20181019042109.8064-2-mpe@ellerman.id.au Suggested-by: Jann Horn Signed-off-by: Michael Ellerman Signed-off-by: Steven Rostedt (VMware) commit 0464ed24380905d640030d368cd84a4e4d1e15e2 Author: Michael Ellerman Date: Fri Oct 19 15:21:08 2018 +1100 seq_buf: Make seq_buf_puts() null-terminate the buffer Currently seq_buf_puts() will happily create a non null-terminated string for you in the buffer. This is particularly dangerous if the buffer is on the stack. For example: char buf[8]; char secret = "secret"; struct seq_buf s; seq_buf_init(&s, buf, sizeof(buf)); seq_buf_puts(&s, "foo"); printk("Message is %s\n", buf); Can result in: Message is fooªªªªªsecret We could require all users to memset() their buffer to zero before use. But that seems likely to be forgotten and lead to bugs. Instead we can change seq_buf_puts() to always leave the buffer in a null-terminated state. The only downside is that this makes the buffer 1 character smaller for seq_buf_puts(), but that seems like a good trade off. Link: http://lkml.kernel.org/r/20181019042109.8064-1-mpe@ellerman.id.au Acked-by: Kees Cook Signed-off-by: Michael Ellerman Signed-off-by: Steven Rostedt (VMware) commit a448276ce515c91cde4675be497364b91c764d95 Author: Steven Rostedt (VMware) Date: Fri Dec 7 13:13:28 2018 -0500 arm64: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack The structure of the ret_stack array on the task struct is going to change, and accessing it directly via the curr_ret_stack index will no longer give the ret_stack entry that holds the return address. To access that, architectures must now use ftrace_graph_get_ret_stack() to get the associated ret_stack that matches the saved return address. Cc: linux-arm-kernel@lists.infradead.org Cc: Will Deacon Cc: Mark Rutland Cc: Catalin Marinas Signed-off-by: Steven Rostedt (VMware) commit cec8d0e7f06e08b981e9d61bef267c8c36d536f5 Author: Steven Rostedt (VMware) Date: Fri Dec 7 13:06:04 2018 -0500 sh: ftrace: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack The structure of the ret_stack array on the task struct is going to change, and accessing it directly via the curr_ret_stack index will no longer give the ret_stack entry that holds the return address. To access that, architectures must now use ftrace_graph_get_ret_stack() to get the associated ret_stack that matches the saved return address. Cc: linux-sh@vger.kernel.org Cc: Yoshinori Sato Cc: Rich Felker Signed-off-by: Steven Rostedt (VMware) commit 945626db0961d8388543b2c96b6f16df57947392 Author: Steven Rostedt (VMware) Date: Fri Dec 7 12:51:27 2018 -0500 sparc64: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack The structure of the ret_stack array on the task struct is going to change, and accessing it directly via the curr_ret_stack index will no longer give the ret_stack entry that holds the return address. To access that, architectures must now use ftrace_graph_get_ret_stack() to get the associated ret_stack that matches the saved return address. Cc: sparclinux@vger.kernel.org Acked-by: David S. Miller Signed-off-by: Steven Rostedt (VMware) commit 0fad8bfef7b08a68507178f8e278d013b60ff966 Author: Steven Rostedt (VMware) Date: Fri Dec 7 12:35:47 2018 -0500 powerpc/frace: Use ftrace_graph_get_ret_stack() instead of curr_ret_stack The structure of the ret_stack array on the task struct is going to change, and accessing it directly via the curr_ret_stack index will no longer give the ret_stack entry that holds the return address. To access that, architectures must now use ftrace_graph_get_ret_stack() to get the associated ret_stack that matches the saved return address. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: linuxppc-dev@lists.ozlabs.org Acked-by: Michael Ellerman Signed-off-by: Steven Rostedt (VMware) commit 22ec9bb1cbcd613c73476ccd8f6a5e8c77793f66 Author: Linus Walleij Date: Sun Dec 2 12:04:10 2018 +0100 watchdog: mena21_wdt: Convert to GPIO descriptors This drops the old OF API use to look up global GPIO numbers and replace it with the GPIO descriptor API. Cc: Johannes Thumshirn Cc: Johannes Thumshirn Cc: Johannes Thumshirn Signed-off-by: Linus Walleij Acked-by: Johannes Thumshirn Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 8d4d4f3267e1fcad56ca5aa4eabf72472e10965f Author: Loic Poulain Date: Fri Nov 23 09:44:37 2018 +0100 dt-bindings: watchdog: Add Qualcomm PM8916 watchdog Document support for the Watchdog Timer (WDT) Controller in the Qualcomm PM8916 PMIC module. Signed-off-by: Loic Poulain Reviewed-by: Rob Herring Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 969c0acc039f77c6b9d000ccb8b9d3afca4d3667 Author: Loic Poulain Date: Fri Nov 23 09:44:36 2018 +0100 watchdog: Add pm8916 watchdog driver The PM816 module is a versatile PMIC with many diverse functions integrated, including, a watchdog. This watchdog is subcomponent of the PON (Power On) peripheral, in the same way as pwrkey/resin buttons. It works with two timers (2-stages), the first one generates an IRQ to the main SoC (APQ8016/MSM8916), the second one performs the reset. This driver expects the following device hierarchy: [pm8916]->[pm8916-pon]->[pm8916-wdt] It uses the pm8916 regmap to access PM8916 registers. Signed-off-by: Loic Poulain Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 4d9c6e90166f1a4b0132e8d8520a2fcd6d081e6b Author: Ryder Lee Date: Wed Nov 7 15:10:36 2018 +0800 dt-bindings: watchdog: update bindings for MT7629 SoC This updates dt-binding documentation for MT7629 SoC Signed-off-by: Ryder Lee Reviewed-by: Rob Herring Reviewed-by: Guenter Roeck Acked-by: Matthias Brugger Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 9077123c68074619177c9a8d3adce2527bd94179 Author: Wolfram Sang Date: Tue Dec 4 13:01:46 2018 +0100 watchdog: renesas_wdt: don't keep timer value during suspend/resume After discussing this mail thread [1] again, we concluded that giving userspace enough time to prepare is our favourite option. So, do not keep the time value when suspended but reset it when resuming. [1] https://patchwork.kernel.org/patch/10252209/ Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Reviewed-by: Guenter Roeck Reviewed-by: Fabrizio Castro Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 248e655b45ed2ce98aee9de439616fdd2b78b0f5 Author: Yangtao Li Date: Sat Dec 1 09:51:40 2018 -0500 watchdog: ie6xx_wdt: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 57808f448b3d2214df4cfa5ab046e09da2908cde Author: Yangtao Li Date: Sat Dec 1 09:51:39 2018 -0500 watchdog: bcm281xx: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit b1bbb0cb2c0ee6dccaf341f99dad9bdff5882acd Author: Colin Ian King Date: Thu Nov 29 23:25:00 2018 +0000 watchdog: asm9260_wdt: make array mode_name static, shrinks object size Don't populate the const array mode_name on the stack but instead make it static. Makes the object code smaller by 41 bytes: Before: text data bss dec hex filename 7699 1872 0 9571 2563 drivers/watchdog/asm9260_wdt.o After: text data bss dec hex filename 7594 1936 0 9530 253a drivers/watchdog/asm9260_wdt.o (gcc version 8.2.0 x86_64) Signed-off-by: Colin Ian King Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 437a3f8ea493ba9b80c9bb983e15f4297fc653de Author: Jerry Hoemann Date: Wed Dec 5 17:42:23 2018 -0700 watchdog/hpwdt: Update driver version. Bump version number to reflect recent minor changes. Signed-off-by: Jerry Hoemann Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit de2cb0cc300ea9bdb7dee476d24c2b20d469c3f2 Author: Jerry Hoemann Date: Wed Dec 5 17:42:22 2018 -0700 watchdog/hpwdt: Do not claim unsupported hardware Do not claim when SSID 0x0289 as the watchdog features are not enabled/validated by the firmware. Signed-off-by: Jerry Hoemann Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 94d6b80c45d3f436d993aa026aa080866cb4b87e Author: Jerry Hoemann Date: Wed Dec 5 17:42:21 2018 -0700 watchdog/hpwdt: Exclude via blacklist Instead of having explicit if statments excluding devices, use a pci_device_id table of devices to blacklist. Signed-off-by: Jerry Hoemann Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit e1b83a31c79811409023aac560d5b0fc2967bec9 Author: Hardik Singh Rathore Date: Sun Dec 9 16:17:26 2018 +0530 Watchdog: remove outdated comment The lock field doesn't exist in watchdog_device structure. It was added by commit f4e9c82f64b5 ("watchdog: Add Locking support") and removed by commit b4ffb1909843 ("watchdog: Separate and maintain variables based on variable lifetime") Signed-off-by: Hardik Singh Rathore Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 9bbc7e4ce47ecefa142fcba55eef7754af1b0213 Author: Oliver O'Halloran Date: Mon Mar 19 16:14:03 2018 +1100 powerpc/zImage: Also check for stdout-path The /chosen/linux,stdout-path is "deprecated" in favour of /chosen/stdout-path so we should be checking for both. Signed-off-by: Oliver O'Halloran Signed-off-by: Michael Ellerman commit 505a314fb28ce122091691c51426fa85c084e115 Author: Benjamin Herrenschmidt Date: Mon Oct 8 15:08:31 2018 +1100 powerpc: Fix HMIs on big-endian with CONFIG_RELOCATABLE=y HMIs will crash the kernel due to BRANCH_LINK_TO_FAR(hmi_exception_realmode) Calling into the OPD instead of the actual code. Fixes: 2337d207288f ("powerpc/64: CONFIG_RELOCATABLE support for hmi interrupts") Signed-off-by: Benjamin Herrenschmidt [mpe: Use DOTSYM() rather than #ifdef] Signed-off-by: Michael Ellerman commit f1e0addca8bd7386f8cabbc64c9988fff91c131f Author: Rob Herring Date: Wed Dec 5 13:50:28 2018 -0600 macintosh: Use of_node_name_{eq, prefix} for node name comparisons Convert string compares of DT node names to use of_node_name_{eq,prefix} helpers instead. This removes direct access to the node name pointer. This changes a single case insensitive node name comparison to case sensitive for "ata4". This is the only instance of a case insensitive comparison for all the open coded node name comparisons on powerpc. Searching the commit history, there doesn't appear to be any reason for it to be case insensitive. A couple of open coded iterating thru the child node names are converted to use for_each_child_of_node() instead. Signed-off-by: Rob Herring Signed-off-by: Michael Ellerman commit c1fa31b0fc90a80d64a334e5d35dca211f9187f6 Author: Rob Herring Date: Wed Dec 5 13:50:25 2018 -0600 ide: 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. Cc: "David S. Miller" Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: linux-ide@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring Signed-off-by: Michael Ellerman commit 2c8e65b595cf0bf7c1413404dff9b928a64d27cb Author: Rob Herring Date: Wed Dec 5 13:50:18 2018 -0600 powerpc: 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. A couple of open coded iterating thru the child node names are converted to use for_each_child_of_node() instead. Signed-off-by: Rob Herring Signed-off-by: Michael Ellerman commit 2dab3dd1fac72b982308265cb322e8d47450052b Author: Linus Walleij Date: Sat Dec 22 11:15:04 2018 +0100 pinctrl: ocelot: Add dependency on HAS_IOMEM As usual the build fails on UM Linux because that thing does not have IOMEM. Depend on HAS_IOMEM solves the build problem. Cc: Alexandre Belloni Signed-off-by: Linus Walleij commit a7c23f8d154f7919c5fcfceea6e0897be2d5ab71 Author: Linus Walleij Date: Sat Dec 22 11:04:55 2018 +0100 gpio: sama5d2-piobu: Depend on OF_GPIO This driver clearly needs OF_GPIO so depend on it. Fixes a build error. Cc: Andrei Stefanescu Signed-off-by: Linus Walleij commit 0d1223dd9273b2ba3e965a81092a239405a4931c Author: Rob Herring Date: Wed Dec 5 13:50:17 2018 -0600 powerpc/pseries/pmem: Convert to %pOFn instead of device_node.name In preparation to remove the node name pointer from struct device_node, convert printf users to use the %pOFn format specifier. pmem.c was recently added and missed the initial conversion. Signed-off-by: Rob Herring Signed-off-by: Michael Ellerman commit 423e2f94456404b49d89ef587c34022987a581e1 Author: Michael Ellerman Date: Tue Nov 27 19:18:05 2018 +1100 powerpc/mm: Remove very old comment in hash-4k.h This comment talks about PTEs being 64-bits and PMD/PGD being 32-bits, but that hasn't been true since 2005 when David Gibson implemented 4-level page tables in the commit titled "Four level pagetables for ppc64". Remove it. Signed-off-by: Michael Ellerman commit 47918bc68b7427e961035949cc1501a864578a69 Author: Michael Ellerman Date: Tue Nov 27 19:16:44 2018 +1100 powerpc/pseries: Fix node leak in update_lmb_associativity_index() In update_lmb_associativity_index() we lookup dr_node using of_find_node_by_path() which takes a reference for us. In the non-error case we forget to drop the reference. Note that find_aa_index() does modify properties of the node, but doesn't need an extra reference held once it's returned. Signed-off-by: Michael Ellerman commit d69e11648e486ee0f21cb246f687b083f0d4e124 Author: Thierry Reding Date: Wed Nov 28 10:54:16 2018 +0100 mailbox: tegra-hsp: Use device-managed registration API In order to get rid of a lot of cleanup boilerplate code, use the device-managed registration API. Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit a54d03ed01b4ed64c22d2b53d61d4049ec49a51f Author: Bartosz Golaszewski Date: Wed Nov 28 10:54:15 2018 +0100 mailbox: tegra-hsp: use devm_kstrdup_const() Use devm_kstrdup_const() in the tegra-hsp driver. This mostly serves as an example of how to use this new routine to shrink driver code. Also use devm_kzalloc() instead of regular kzalloc() to shrink the driver even more. Doorbell objects are only removed in the driver's remove callback so it's safe to convert all memory allocations to devres. Signed-off-by: Bartosz Golaszewski Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 9a63f0f4059955210ae74c745513332a568e9738 Author: Thierry Reding Date: Wed Nov 28 10:54:14 2018 +0100 mailbox: tegra-hsp: Add suspend/resume support Upon resuming from a system sleep state, the interrupts for all active shared mailboxes need to be reenabled, otherwise they will not work. Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 91b1b1c3da8a8fd9ee4538e00dd5e5fb5be1cdb4 Author: Thierry Reding Date: Wed Nov 28 10:54:13 2018 +0100 mailbox: tegra-hsp: Add support for shared mailboxes The Tegra HSP block supports 'shared mailboxes' that are simple 32-bit registers consisting of a FULL bit in MSB position and 31 bits of data. The hardware can be configured to trigger interrupts when a mailbox is empty or full. Add support for these shared mailboxes to the HSP driver. The initial use for the mailboxes is the Tegra Combined UART. For this purpose, we use interrupts to receive data, and spinning to wait for the transmit mailbox to be emptied to minimize unnecessary overhead. Based on work by Mikko Perttunen . Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit fed8b7e366e7c8f81e957ef91aa8f0a38e038c66 Author: Mikko Perttunen Date: Wed Nov 28 10:54:12 2018 +0100 dt-bindings: tegra186-hsp: Add shared mailboxes Shared mailboxes are a mechanism to transport data from one processor in the system to another. They are bidirectional links with both a producer and a consumer. Interrupts are used to let the consumer know when data was written to the mailbox by the producer, and to let the producer know when the consumer has read the data from the mailbox. These interrupts are mapped to one or more "shared interrupts". Typically each processor in the system owns one of these shared interrupts. Add documentation to the device tree bindings about how clients can use mailbox specifiers to request a specific shared mailbox and select which direction they drive. Also document how to specify the shared interrupts in addition to the existing doorbell interrupt. Signed-off-by: Mikko Perttunen Acked-by: Jon Hunter Reviewed-by: Rob Herring Acked-by: Thierry Reding Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 8ed82e23875e6014d9aa8e03bf4301b27d614050 Author: Mikko Perttunen Date: Wed Nov 28 10:54:11 2018 +0100 mailbox: Allow multiple controllers per device Look through the whole controller list when mapping device tree phandles to controllers instead of stopping at the first one. Each controller is intended to only contain one kind of mailbox, but some devices (like Tegra HSP) implement multiple kinds and use the same device tree node for all of them. As such, we need to allow multiple mbox_controllers per device tree node. Signed-off-by: Mikko Perttunen Signed-off-by: Jassi Brar commit a8803d7421cc2be2ac12a8155e5d824f04259eff Author: Thierry Reding Date: Wed Nov 28 10:54:10 2018 +0100 mailbox: Support blocking transfers in atomic context The mailbox framework supports blocking transfers via completions for clients that can sleep. In order to support blocking transfers in cases where the transmission is not permitted to sleep, add a new ->flush() callback that controller drivers can implement to busy loop until the transmission has been completed. A new mbox_flush() function can be called by mailbox consumers in atomic context to make sure a transfer has completed. Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 5f470b3638a4ed03df79b993ece819cac2f4ca7e Author: Scott Wood Date: Fri Dec 21 22:07:54 2018 -0600 powerpc/configs/85xx: Enable CONFIG_DEBUG_KERNEL This is required for CONFIG_DEBUG_INFO to work. Signed-off-by: Scott Wood commit ccdde478e8445adaa85f30e555de9fab564d742a Author: Scott Wood Date: Fri Dec 21 21:32:51 2018 -0600 powerpc/dts/fsl: Fix dtc-flagged interrupt errors mpc8641_hpcn was updated to 4-cell interrupt specifiers, but PCI interrupt-map was not updated. It was also missing #interrupt-cells on the outer PCI buses. p1020rdb-pc was updated to 4-cell interrupt specifiers, but the ethernet-phy nodes weren't updated. mpc832x_rdb had an invalid "interrupts = <0>" on the ethernet-phy nodes. Besides being the wrong number of cells, 0 is not a valid IPIC interrupt according to ipic.c. Presumably it was meant to indicate that these PHYs are not connected to an interrupt. Signed-off-by: Scott Wood commit a6ee0c00a70b115e365d71eb5debcfb9de74dd1b Author: Yuantian Tang Date: Wed Oct 31 14:57:36 2018 +0800 clk: qoriq: add more compatibles strings Add more SoC compatible strings to support more chips. Signed-off-by: Yuantian Tang Reviewed-by: Rob Herring Acked-by: Stephen Boyd Signed-off-by: Scott Wood commit 54877957e95b0e41f472ee3a7e07100d61259de2 Author: Scott Wood Date: Wed Oct 31 14:57:35 2018 +0800 powerpc/fsl: Use new clockgen binding The driver retains compatibility with old device trees, but we don't want the old nodes lying around to be copied, or used as a reference (some of the mux options are incorrect), or even just being clutter. Signed-off-by: Scott Wood Signed-off-by: Tang Yuantian [scottwood: removed sysclk node added by Andy] Signed-off-by: Scott Wood commit 0deae39cec6dab3a66794f3e9e83ca4dc30080f1 Author: Christophe Leroy Date: Mon Dec 10 11:41:29 2018 +0000 powerpc/83xx: handle machine check caused by watchdog timer When the watchdog timer is set in interrupt mode, it causes a machine check when it times out. The purpose of this mode is to ease debugging, not to crash the kernel and reboot the machine. This patch implements a special handling for that, in order to not crash the kernel if the watchdog times out while in interrupt or within the idle task. Signed-off-by: Christophe Leroy [scottwood: added missing #include] Signed-off-by: Scott Wood commit 65eed012d1f2d0f0bf0ffc036826d58147de77b8 Author: Omar Sandoval Date: Fri Dec 21 18:45:18 2018 -0800 xfs: reallocate realtime summary cache on growfs At mount time, we allocate m_rsum_cache with the number of realtime bitmap blocks. However, xfs_growfs_rt() can increase the number of realtime bitmap blocks. Using the cache after this happens may access out of the bounds of the cache. Fix it by reallocating the cache in this case. Fixes: 355e3532132b ("xfs: cache minimum realtime summary level") Signed-off-by: Omar Sandoval Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 01f45c8fb8b951e8d5cf648ce7ec16505ce303e7 Author: Alexandre Belloni Date: Tue Nov 20 16:12:30 2018 +0100 powerpc/fsl-rio: fix spelling mistake "reserverd" -> "reserved" Fix a spelling mistake in a register description. Signed-off-by: Alexandre Belloni Signed-off-by: Scott Wood commit c6e5485e0cb509292a14e880e1944143f99758c7 Author: Christoph Hellwig Date: Wed Nov 14 09:23:07 2018 +0100 powerpc/fsl_pci: simplify fsl_pci_dma_set_mask swiotlb will only bounce buffer when the effective dma address for the device is smaller than the actual DMA range. Instead of flipping between the swiotlb and nommu ops for FSL SOCs that have the second outbound window just don't set the bus dma_mask in this case. Signed-off-by: Christoph Hellwig Signed-off-by: Scott Wood commit 7811eade247cdf90b26dd0951613e77614192771 Author: Sabyasachi Gupta Date: Mon Nov 5 07:52:48 2018 +0530 arch/powerpc/fsl_rmu: Use dma_zalloc_coherent Replaced dma_alloc_coherent + memset with dma_zalloc_coherent Signed-off-by: Sabyasachi Gupta Signed-off-by: Scott Wood commit d52266fc74beacf2aefad934bd4011d62e9584e0 Author: Colin Ian King Date: Fri Dec 21 17:00:48 2018 -0800 Input: drv2667 - fix indentation issues There are some statements that are indented incorrectly, fix this by removing the extra tabs. Signed-off-by: Colin Ian King Signed-off-by: Dmitry Torokhov commit 9aa3aa15f4c2f74f47afd6c5db4b420fadf3f315 Author: Kangjie Lu Date: Fri Dec 21 13:10:39 2018 -0600 hwmon: (lm80) fix a missing check of bus read in lm80 probe In lm80_probe(), if lm80_read_value() fails, it returns a negative error number which is stored to data->fan[f_min] and will be further used. We should avoid using the data if the read fails. The fix checks if lm80_read_value() fails, and if so, returns with the error number. Signed-off-by: Kangjie Lu Signed-off-by: Guenter Roeck commit c9c63915519b1def7043b184680f33c24cd49d7b Author: Kangjie Lu Date: Fri Dec 21 13:01:33 2018 -0600 hwmon: (lm80) fix a missing check of the status of SMBus read If lm80_read_value() fails, it returns a negative number instead of the correct read data. Therefore, we should avoid using the data if it fails. The fix checks if lm80_read_value() fails, and if so, returns with the error number. Signed-off-by: Kangjie Lu [groeck: One variable for return values is enough] Signed-off-by: Guenter Roeck commit ce28bb4453880759c5bdc2751629f1a865ea4a6e Merge: 64935310f2fc0 6cafab50eea32 Author: David S. Miller Date: Fri Dec 21 15:06:20 2018 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net commit 2298a6f09f455f64bf253e6fb5c1ff72f38a6249 Author: Thierry Reding Date: Thu Dec 20 18:20:02 2018 +0100 mailbox: ti-msgmgr: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 368d7767b50154eb052938a13494879b00135ed3 Author: Thierry Reding Date: Thu Dec 20 18:20:01 2018 +0100 mailbox: stm32-ipcc: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Reviewed-by: Ludovic Barre Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 08f2f88a3bbf3cdfdf3b890159d45519e2d5bbeb Author: Thierry Reding Date: Thu Dec 20 18:20:00 2018 +0100 mailbox: rockchip: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Reviewed-by: Caesar Wang Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 83dd44a17d40ab258aede6f560d27444e7dcfba7 Author: Thierry Reding Date: Thu Dec 20 18:19:59 2018 +0100 mailbox: qcom-apcs: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Reviewed-by: Bjorn Andersson Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 85a555246e6db7b4e9803704e1e0c694dfe658a0 Author: Thierry Reding Date: Thu Dec 20 18:19:58 2018 +0100 mailbox: platform-mhu: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Acked-by: Neil Armstrong Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit a3abf4363c7ec8f980a0ac1c880e2627349d8626 Author: Thierry Reding Date: Thu Dec 20 18:19:57 2018 +0100 mailbox: omap: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit ec1c674f0ae3905cd540ab2f30d9c4265981d7b4 Author: Thierry Reding Date: Thu Dec 20 18:19:56 2018 +0100 mailbox: mtk-cmdq: Remove needless devm_kfree() calls Memory allocated through device-managed functions doesn't need to be explicitly freed, so these calls can be removed. Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 8aed5719557269807447b8bb936067b36a54b787 Author: Thierry Reding Date: Thu Dec 20 18:19:55 2018 +0100 mailbox: mtk-cmdq: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 0b7f5fe837f682dbb9f751afb513a4b28c7ceb56 Author: Thierry Reding Date: Thu Dec 20 18:19:54 2018 +0100 mailbox: xgene-slimpro: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit d0c196dbee7957ea446c4047c501537aeccf5fa0 Author: Thierry Reding Date: Thu Dec 20 18:19:53 2018 +0100 mailbox: sti: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Acked-by: Lee Jones Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 87f63f578b734ca45cb8ebe251bd65560b89de26 Author: Thierry Reding Date: Thu Dec 20 18:19:52 2018 +0100 mailbox: altera: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 4013286c7231e05780c6e73b91d357678f819b4b Author: Thierry Reding Date: Thu Dec 20 18:19:51 2018 +0100 mailbox: imx: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Reviewed-by: Oleksij Rempel Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit ad3e7f9651ca344fc14b1709c7f91d9e570c389c Author: Thierry Reding Date: Thu Dec 20 18:19:50 2018 +0100 mailbox: hi6220: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Reviewed-by: Leo Yan Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit e73cb83c807b3a1c3c430b646668ce358b13ee74 Author: Thierry Reding Date: Thu Dec 20 18:19:49 2018 +0100 mailbox: hi3660: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Tested-by: Leo Yan Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 6267ee6afae0a3c130dc585118dd60e090c6448b Author: Thierry Reding Date: Thu Dec 20 18:19:48 2018 +0100 mailbox: bcm-pdc: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 0cafc12ab9cc163e6078db8ec978c200a632e88e Author: Thierry Reding Date: Thu Dec 20 18:19:47 2018 +0100 mailbox: bcm-flexrm: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Signed-off-by: Thierry Reding Acked-by: Scott Branden Signed-off-by: Jassi Brar commit 709cbeea1b34f92619140b20bf15602a7f1240d8 Author: Thierry Reding Date: Thu Dec 20 18:19:46 2018 +0100 mailbox: bcm2835: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Reviewed-by: Eric Anholt Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 6aba2f4aac1ac030edacc76a10043e4d1b885e3d Author: Thierry Reding Date: Thu Dec 20 18:19:45 2018 +0100 mailbox: arm-mhu: Use device-managed registration API Get rid of some boilerplate driver removal code by using the newly added device-managed registration API. Reviewed-by: Sudeep Holla Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit e898d9cdd3a9f105863d63dd3b46443742a4757c Author: Thierry Reding Date: Thu Dec 20 18:19:44 2018 +0100 mailbox: Add device-managed registration functions Add device-managed equivalents of the mbox_controller_register() and mbox_controller_unregister() functions that can be used to have the devres infrastructure automatically unregister mailbox controllers on driver probe failure or driver removal. This can help remove a lot of boiler plate code from drivers. Reviewed-by: Bjorn Andersson Reviewed-by: Sudeep Holla Signed-off-by: Thierry Reding Signed-off-by: Jassi Brar commit 1c3243f61fa7daea78de9866af2625f559ebf456 Author: Matt Turner Date: Fri Dec 21 11:17:55 2018 -0800 alpha: Remove some unused variables Fixes: 42a0cc347858 ("sys: don't hold uts_sem while accessing userspace memory") Signed-off-by: Matt Turner commit 1f4883f300da4f4d9d31eaa80f7debf6ce74843b Author: Dave Jiang Date: Mon Dec 10 13:36:14 2018 -0700 libnvdimm/security: Add documentation for nvdimm security support Add theory of operation for the security support that's going into libnvdimm. Signed-off-by: Dave Jiang Reviewed-by: Jing Lin Signed-off-by: Dan Williams commit ecaa4a97b3908be0bf3ad12181ae8c44d1816d40 Author: Dave Jiang Date: Mon Dec 10 13:33:24 2018 -0700 tools/testing/nvdimm: add Intel DSM 1.8 support for nfit_test Adding test support for new Intel DSM from v1.8. The ability of simulating master passphrase update and master secure erase have been added to nfit_test. Signed-off-by: Dave Jiang Signed-off-by: Dan Williams commit 926f74802cb1ce0ef0c3b9f806ea542beb57e50d Author: Dave Jiang Date: Mon Dec 10 13:32:16 2018 -0700 tools/testing/nvdimm: Add overwrite support for nfit_test With the implementation of Intel NVDIMM DSM overwrite, we are adding unit test to nfit_test for testing of overwrite operation. Signed-off-by: Dave Jiang Signed-off-by: Dan Williams commit 3c13e2ac747a37e683597d3d875f839f2bc150e1 Author: Dave Jiang Date: Mon Dec 10 13:20:42 2018 -0700 tools/testing/nvdimm: Add test support for Intel nvdimm security DSMs Add nfit_test support for DSM functions "Get Security State", "Set Passphrase", "Disable Passphrase", "Unlock Unit", "Freeze Lock", and "Secure Erase" for the fake DIMMs. Also adding a sysfs knob in order to put the DIMMs in "locked" state. The order of testing DIMM unlocking would be. 1a. Disable DIMM X. 1b. Set Passphrase to DIMM X. 2. Write to /sys/devices/platform/nfit_test.0/nfit_test_dimm/test_dimmX/lock_dimm 3. Renable DIMM X 4. Check DIMM X state via sysfs "security" attribute for nmemX. Signed-off-by: Dave Jiang Signed-off-by: Dan Williams commit 89fa9d8ea7bdfa841d19044485cec5f4171069e5 Author: Dave Jiang Date: Mon Dec 10 10:53:22 2018 -0700 acpi/nfit, libnvdimm/security: add Intel DSM 1.8 master passphrase support With Intel DSM 1.8 [1] two new security DSMs are introduced. Enable/update master passphrase and master secure erase. The master passphrase allows a secure erase to be performed without the user passphrase that is set on the NVDIMM. The commands of master_update and master_erase are added to the sysfs knob in order to initiate the DSMs. They are similar in opeartion mechanism compare to update and erase. [1]: http://pmem.io/documents/NVDIMM_DSM_Interface-V1.8.pdf Signed-off-by: Dave Jiang Signed-off-by: Dan Williams commit 7d988097c546187ada602cc9bccd0f03d473eb8f Author: Dave Jiang Date: Thu Dec 13 15:36:18 2018 -0700 acpi/nfit, libnvdimm/security: Add security DSM overwrite support Add support for the NVDIMM_FAMILY_INTEL "ovewrite" capability as described by the Intel DSM spec v1.7. This will allow triggering of overwrite on Intel NVDIMMs. The overwrite operation can take tens of minutes. When the overwrite DSM is issued successfully, the NVDIMMs will be unaccessible. The kernel will do backoff polling to detect when the overwrite process is completed. According to the DSM spec v1.7, the 128G NVDIMMs can take up to 15mins to perform overwrite and larger DIMMs will take longer. Given that overwrite puts the DIMM in an indeterminate state until it completes introduce the NDD_SECURITY_OVERWRITE flag to prevent other operations from executing when overwrite is happening. The NDD_WORK_PENDING flag is added to denote that there is a device reference on the nvdimm device for an async workqueue thread context. Signed-off-by: Dave Jiang Signed-off-by: Dan Williams commit 64e77c8c047fb91ea8c7800c1238108a72f0bf9c Author: Dave Jiang Date: Fri Dec 7 14:02:12 2018 -0700 acpi/nfit, libnvdimm: Add support for issue secure erase DSM to Intel nvdimm Add support to issue a secure erase DSM to the Intel nvdimm. The required passphrase is acquired from an encrypted key in the kernel user keyring. To trigger the action, "erase " is written to the "security" sysfs attribute. Signed-off-by: Dave Jiang Signed-off-by: Dan Williams commit d2a4ac73f56a5d0709d28b41fec8d15e4500f8f1 Author: Dave Jiang Date: Fri Dec 7 13:29:09 2018 -0700 acpi/nfit, libnvdimm: Add enable/update passphrase support for Intel nvdimms Add support for enabling and updating passphrase on the Intel nvdimms. The passphrase is the an encrypted key in the kernel user keyring. We trigger the update via writing "update " to the sysfs attribute "security". If no exists (for enabling security) then a 0 should be used. Signed-off-by: Dave Jiang Signed-off-by: Dan Williams commit 03b65b22ada8115a7a7bfdf0789f6a94adfd6070 Author: Dave Jiang Date: Fri Dec 7 10:33:30 2018 -0700 acpi/nfit, libnvdimm: Add disable passphrase support to Intel nvdimm. Add support to disable passphrase (security) for the Intel nvdimm. The passphrase used for disabling is pulled from an encrypted-key in the kernel user keyring. The action is triggered by writing "disable " to the sysfs attribute "security". Signed-off-by: Dave Jiang Signed-off-by: Dan Williams commit f6653a0e0877572c87f6dab5351e7bd6b6b7100c Author: Alex Deucher Date: Thu Dec 20 10:08:46 2018 -0500 drm/amdgpu: Add new VegaM pci id Add a new pci id. Reviewed-by: Leo Liu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 0f6be2c09af65a85d34653e609b5f45e25a9e95a Author: Michel Dänzer Date: Fri Nov 30 18:15:22 2018 +0100 drm/ttm: Use drm_debug_printer for all ttm_bo_mem_space_debug output No need for pr_err here, the pr_err message in ttm_bo_evict is enough to draw attention to something not going as planned. Reviewed-by: Christian König Reviewed-by: Junwei Zhang Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 06d6370e7b200882ab23bafd86a4024c7571c778 Author: Evan Quan Date: Thu Dec 20 22:44:54 2018 +0800 drm/amdgpu: add Vega20 PSP ASD firmware loading Add PSP ASD firmware loading on Vega20. Not sure why this was missing before. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit d8a706414af4827fc0b4b1c0c631c607351938b9 Author: Dan Williams Date: Fri Dec 21 11:35:53 2018 -0800 dax: Use non-exclusive wait in wait_entry_unlocked() get_unlocked_entry() uses an exclusive wait because it is guaranteed to eventually obtain the lock and follow on with an unlock+wakeup cycle. The wait_entry_unlocked() path does not have the same guarantee. Rather than open-code an extra wakeup, just switch to a non-exclusive wait. Cc: Jan Kara Cc: Matthew Wilcox Reported-by: Linus Torvalds Signed-off-by: Dan Williams commit aa74be6eeade1caf3ef945ff1812059f3d7dc947 Author: Yishai Hadas Date: Sun Dec 9 12:52:36 2018 +0200 IB/mlx5: Allocate the per-port Q counter shared when DEVX is supported The per-port Q counter is some kernel resource and as such may be used by few UID(s) upon DEVX usage. To enable using it for QP/RQ when DEVX context is used need to allocate it with a sharing mode indication to let firmware allows its usage. The UID = 0xffff was chosen to mark it. Signed-off-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 5801169a2ed20003f771acecf3ac00574cf10a38 Author: Frank Rowand Date: Tue Dec 18 11:40:03 2018 -0800 of: __of_detach_node() - remove node from phandle cache Non-overlay dynamic devicetree node removal may leave the node in the phandle cache. Subsequent calls to of_find_node_by_phandle() will incorrectly find the stale entry. Remove the node from the cache. Add paranoia checks in of_find_node_by_phandle() as a second level of defense (do not return cached node if detached, do not add node to cache if detached). Fixes: 0b3ce78e90fc ("of: cache phandle nodes to reduce cost of of_find_node_by_phandle()") Reported-by: Michael Bringmann Cc: stable@vger.kernel.org # v4.17+ Signed-off-by: Frank Rowand Signed-off-by: Rob Herring commit b8a9ac1a5b99a2fcbed19fd29d2d59270c281a31 Author: Frank Rowand Date: Tue Dec 18 11:40:02 2018 -0800 of: of_node_get()/of_node_put() nodes held in phandle cache The phandle cache contains struct device_node pointers. The refcount of the pointers was not incremented while in the cache, allowing use after free error after kfree() of the node. Add the proper increment and decrement of the use count. Fixes: 0b3ce78e90fc ("of: cache phandle nodes to reduce cost of of_find_node_by_phandle()") Cc: stable@vger.kernel.org # v4.17+ Signed-off-by: Frank Rowand Signed-off-by: Rob Herring commit 75bf8a2a2f6b0def50009a631ea2f22f0143ba6c Author: Parav Pandit Date: Fri Dec 21 16:19:27 2018 +0200 IB/umad: Start using dev_groups of class Start using core defined dev_groups of a class which allows to add device attributes to the core kernel and simplify the umad module. Signed-off-by: Parav Pandit Reviewed-by: Jack Morgenstein Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit cdb53b65ae1b3beac2aaddf6c2d0cef798863466 Author: Parav Pandit Date: Fri Dec 21 16:19:26 2018 +0200 IB/umad: Use class_groups and let core create class file Use class->class_groups core kernel facility to create the abi version file instead of open coding. Signed-off-by: Parav Pandit Reviewed-by: Jack Morgenstein Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e9dd5daf884cf591f9c9a122351d2f9ccf7b97d3 Author: Parav Pandit Date: Fri Dec 21 16:19:25 2018 +0200 IB/umad: Refactor code to use cdev_device_add() Refactor code to use cdev_device_add() and do other minor refactors while modifying these functions as below. 1. Instead of returning generic -1, return an actual error for ib_umad_init_port(). 2. Introduce and use ib_umad_init_port_dev() for sm and umad char devices. 3. Instead of kobj, use more light weight kref to refcount ib_umad_device. 4. Use modern cdev_device_add() single code cut down three steps of cdev_add(), device_create(). This further helps to move device sysfs files to class attributes in subsequent patch. 5. Remove few empty lines while refactoring these functions. 6. Use sizeof() instead of sizeof to avoid checkpatch warning. 7. Use struct_size() for calculation of ib_umad_port. Signed-off-by: Parav Pandit Reviewed-by: Jack Morgenstein Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 594d1644cd59447f4fceb592448d5cd09eb09b5e Author: Chris Perl Date: Mon Dec 17 10:56:38 2018 -0500 NFS: nfs_compare_mount_options always compare auth flavors. This patch removes the check from nfs_compare_mount_options to see if a `sec' option was passed for the current mount before comparing auth flavors and instead just always compares auth flavors. Consider the following scenario: You have a server with the address 192.168.1.1 and two exports /export/a and /export/b. The first export supports `sys' and `krb5' security, the second just `sys'. Assume you start with no mounts from the server. The following results in EIOs being returned as the kernel nfs client incorrectly thinks it can share the underlying `struct nfs_server's: $ mkdir /tmp/{a,b} $ sudo mount -t nfs -o vers=3,sec=krb5 192.168.1.1:/export/a /tmp/a $ sudo mount -t nfs -o vers=3 192.168.1.1:/export/b /tmp/b $ df >/dev/null df: ‘/tmp/b’: Input/output error Signed-off-by: Chris Perl Signed-off-by: Anna Schumaker commit 64935310f2fc0128373bbbcfb5b8b49fd26e2ae8 Merge: 7fa4bd739fc0f 682ec859518d7 Author: David S. Miller Date: Fri Dec 21 10:24:54 2018 -0800 Merge branch 'skb_ext-fixes' Paolo Abeni says: ==================== net: skb extension follow-ups This series includes some follow-up for the recently added skb extension. The first patch addresses an unlikely race while adding skb extensions, and the following two are just minor code clean-up. v1 -> v2: - be sure to flag the newly added extension as active in skb_ext_add() ==================== Signed-off-by: David S. Miller commit 682ec859518d73435cc924d816da2953343241c1 Author: Paolo Abeni Date: Fri Dec 21 19:03:15 2018 +0100 net: minor cleanup in skb_ext_add() When the extension to be added is already present, the only skb field we may need to update is 'extensions': we can reorder the code and avoid a branch. v1 -> v2: - be sure to flag the newly added extension as active Signed-off-by: Paolo Abeni Acked-by: Florian Westphal Signed-off-by: David S. Miller commit d312d0a6846a4553bd955afd414f8f55398ece07 Author: Paolo Abeni Date: Fri Dec 21 19:03:14 2018 +0100 net: drop the unused helper skb_ext_get() Such helper is currently unused, and skb extension users are better off using skb_ext_add()/skb_ext_del(). So let's drop it. Signed-off-by: Paolo Abeni Acked-by: Florian Westphal Signed-off-by: David S. Miller commit e94e50bd88f7ed2f2d40c32c06efd61c36c33ec8 Author: Paolo Abeni Date: Fri Dec 21 19:03:13 2018 +0100 net: fix possible user-after-free in skb_ext_add() On cow we can free the old extension: we must avoid dereferencing such extension after skb_ext_maybe_cow(). Since 'new' contents are always equal to 'old' after the copy, we can fix the above accessing the relevant data using 'new'. Fixes: df5042f4c5b9 ("sk_buff: add skb extension infrastructure") Signed-off-by: Paolo Abeni Acked-by: Florian Westphal Signed-off-by: David S. Miller commit cf7ad3030271c55a7119a8c2162563e3f6e93879 Author: Parav Pandit Date: Fri Dec 21 16:19:24 2018 +0200 IB/umad: Avoid destroying device while it is accessed ib_umad_reg_agent2() and ib_umad_reg_agent() access the device name in dev_notice(), while concurrently, ib_umad_kill_port() can destroy the device using device_destroy(). cpu-0 cpu-1 ----- ----- ib_umad_ioctl() [...] ib_umad_kill_port() device_destroy(dev) ib_umad_reg_agent() dev_notice(dev) Therefore, first mark ib_dev as NULL, to block any further access in file ops, unregister the mad agent and destroy the device at the end after mutex is unlocked. This ensures that device doesn't get destroyed, while it may get accessed. Fixes: 0f29b46d49b0 ("IB/mad: add new ioctl to ABI to support new registration options") Signed-off-by: Parav Pandit Reviewed-by: Jack Morgenstein Reviewed-by: Ira Weiny Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 900d07c12d4ed0e2c237655b55383df8d2c715ff Author: Parav Pandit Date: Fri Dec 21 16:19:23 2018 +0200 IB/umad: Simplify and avoid dynamic allocation of class Simplify code to have a static structure instance for umad class allocation. This will allow to have class attributes defined along with class registration in subsequent patch and allows more class methods definition similar to ib_core module. Signed-off-by: Parav Pandit Reviewed-by: Jack Morgenstein Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 3030cf95ab2084678e9d2e0315d29cec80479eb0 Author: Alexandre Belloni Date: Sun Sep 9 23:15:04 2018 +0200 alpha: rtc: simplify alpha_rtc_init Use devm_rtc_allocate_device to simplify choosing the rtc_ops in alpha_rtc_init(). Signed-off-by: Alexandre Belloni Signed-off-by: Matt Turner commit a104d44b183ce34b645bbcc8483d9d39fd488c55 Author: Daniel Bristot de Oliveira Date: Tue Sep 25 20:31:48 2018 +0200 alpha: Fix a typo on ptrace.h - struct has as little information as possible. * I does not have* + struct has as little information as possible. *It does not have* Signed-off-by: Daniel Bristot de Oliveira Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Thomas Gleixner Cc: linux-alpha@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Matt Turner commit fb430b39dbb0def3c7fc47a79fb02c5dfcda9f9c Author: Colin Ian King Date: Fri Oct 12 15:53:14 2018 +0100 alpha: fix spelling mistake QSD_PORT_ACTUVE -> QSD_PORT_ACTIVE Trivial fix to spelling mistake in kernel error message Signed-off-by: Colin Ian King Signed-off-by: Matt Turner commit a8faab540f0ab2a03afd12e361d3c6e463226fae Author: Firoz Khan Date: Tue Nov 13 15:01:53 2018 +0530 alpha: generate uapi header and syscall table header files System call table generation script must be run to gener- ate unistd_32.h and syscall_table.h files. This patch will have changes which will invokes the script. This patch will generate unistd_32.h and syscall_table.h files by the syscall table generation script invoked by alpha/Makefile and the generated files against the removed files must be identical. The generated uapi header file will be included in uapi/- asm/unistd.h and generated system call table header file will be included by kernel/systbls.S file. Signed-off-by: Firoz Khan Signed-off-by: Matt Turner commit cabcebd33b8b80276d4cbbb1091e784dfbc516f8 Author: Firoz Khan Date: Tue Nov 13 15:01:52 2018 +0530 alpha: add system call table generation support The system call tables are in different format in all architecture and it will be difficult to manually add, modify or delete the syscall table entries in the res- pective files. To make it easy by keeping a script and which will generate the uapi header and syscall table file. This change will also help to unify the implemen- tation across all architectures. The system call table generation script is added in kernel/syscalls directory which contain the scripts to generate both uapi header file and system call table files. The syscall.tbl will be input for the scripts. syscall.tbl contains the list of available system calls along with system call number and corresponding entry point. Add a new system call in this architecture will be possible by adding new entry in the syscall.tbl file. Adding a new table entry consisting of: - System call number. - ABI. - System call name. - Entry point name. syscallhdr.sh and syscalltbl.sh will generate uapi header unistd_32.h and syscall_table.h files respectively. Both .sh files will parse the content syscall.tbl to generate the header and table files. unistd_32.h will be included by uapi/asm/unistd.h and syscall_table.h is included by kernel/syscall.S - the real system call table. ARM, s390 and x86 architecuture does have similar support. I leverage their implementation to come up with a generic solution. Signed-off-by: Firoz Khan Signed-off-by: Matt Turner commit b67bfd298f4c7ab3762aebb354a0b16635c82211 Author: Firoz Khan Date: Tue Nov 13 15:01:51 2018 +0530 alpha: add __NR_syscalls along with NR_SYSCALLS NR_SYSCALLS macro holds the number of system call exist in alpha architecture. We have to change the value of NR- _SYSCALLS, if we add or delete a system call. One of the patch in this patch series has a script which will generate a uapi header based on syscall.tbl file. The syscall.tbl file contains the total number of system calls information. So we have two option to update NR_SY- CALLS value. 1. Update NR_SYSCALLS in asm/unistd.h manually by count- ing the no.of system calls. No need to update NR_SYS- CALLS until we either add a new system call or delete existing system call. 2. We can keep this feature it above mentioned script, that will count the number of syscalls and keep it in a generated file. In this case we don't need to expli- citly update NR_SYSCALLS in asm/unistd.h file. The 2nd option will be the recommended one. For that, I added the __NR_syscalls macro in uapi/asm/unistd.h along with NR_SYSCALLS asm/unistd.h. The macro __NR_syscalls also added for making the name convention same across all architecture. While __NR_syscalls isn't strictly part of the uapi, having it as part of the generated header to simplifies the implementation. We also need to enclose this macro with #ifdef __KERNEL__ to avoid side effects. Signed-off-by: Firoz Khan Signed-off-by: Matt Turner commit d8bf616be5f05b955d3ee32ad92d4cdb87e30349 Author: Firoz Khan Date: Tue Nov 13 15:01:50 2018 +0530 alpha: remove CONFIG_OSF4_COMPAT flag from syscall table Remove CONFIG_OSF4_COMPAT config flag from system call table - systbls.S and to keep the same feature, add the flag in osf_sys.c. One of the patch in this patch series will generate the system call table file. In order to come up with a common implementation across all architecture, we need this change. Signed-off-by: Firoz Khan Signed-off-by: Matt Turner commit 150fbd536f9eb3044c2b048dc13ee648a78afb93 Author: Firoz Khan Date: Tue Nov 13 15:01:49 2018 +0530 alpha: move __IGNORE* entries to non uapi header All the __IGNORE* entries are resides in the uapi header file move to non uapi header asm/unistd.h as it is not used by any user space applications. It is correct to keep __IGNORE* entry in non uapi header asm/unistd.h while uapi/asm/unistd.h must hold information only useful for user space applications. One of the patch in this patch series will generate uapi header file. The information which directly used by the user space application must be present in uapi file. Signed-off-by: Firoz Khan Signed-off-by: Matt Turner commit 7fa4bd739fc0fa209fa5120383aab17f6e9600f7 Author: Daniel Borkmann Date: Fri Dec 21 14:04:46 2018 +0100 bpf: fix segfault in test_verifier selftest Minor fallout from merge resolution, test_verifier was segfaulting because the REJECT result was correct, but errstr was NULL. Properly fix it as in 339bbff2d6e0. Fixes: 339bbff2d6e0 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next") Signed-off-by: Daniel Borkmann Signed-off-by: David S. Miller commit 718c43038f287e843c2f63d946977de90014cb11 Author: Al Viro Date: Thu Dec 20 03:16:27 2018 -0500 mount_fs: suppress MAC on MS_SUBMOUNT as well as MS_KERNMOUNT Reviewed-by: David Howells Signed-off-by: Al Viro commit d2497e12e230c3f1be8ca6a0609a98c8c609fb80 Author: Al Viro Date: Sun Dec 16 01:37:06 2018 -0500 smack: rewrite smack_sb_eat_lsm_opts() make it use smack_add_opt() and avoid separate copies - gather non-LSM options by memmove() in place Reviewed-by: David Howells Signed-off-by: Al Viro commit c3300aaf95fb4e5be41e731fa6427d0d996d32ac Author: Al Viro Date: Sun Dec 16 01:52:24 2018 -0500 smack: get rid of match_token() same issue as with selinux... [fix by Andrei Vagin folded in] Reviewed-by: David Howells Signed-off-by: Al Viro commit 55c0e5bd078eba2d41d76fa25d5d5e55f1ff09ee Author: Al Viro Date: Sun Dec 16 01:09:45 2018 -0500 smack: take the guts of smack_parse_opts_str() into a new helper smack_add_opt() adds an already matched option to growing smack_mnt_options Reviewed-by: David Howells Signed-off-by: Al Viro commit 757cbe597fe8490c7c0a9650ebe5d60195f151d4 Author: Al Viro Date: Fri Dec 14 23:42:21 2018 -0500 LSM: new method: ->sb_add_mnt_opt() Adding options to growing mnt_opts. NFS kludge with passing context= down into non-text-options mount switched to it, and with that the last use of ->sb_parse_opts_str() is gone. Reviewed-by: David Howells Signed-off-by: Al Viro commit 99dbbb593fe6b39153c15ea9b9c63ea911864cf2 Author: Al Viro Date: Fri Dec 14 21:56:23 2018 -0500 selinux: rewrite selinux_sb_eat_lsm_opts() make it use selinux_add_opt() and avoid separate copies - gather non-LSM options by memmove() in place Reviewed-by: David Howells Signed-off-by: Al Viro commit da3d76abb2e74c07b1cd620ee5e3b31227846c7c Author: Al Viro Date: Mon Dec 17 10:14:16 2018 -0500 selinux: regularize Opt_... names a bit Reviewed-by: David Howells Signed-off-by: Al Viro commit 169d68efb03b728588c209c682f14328eec485c0 Author: Al Viro Date: Fri Dec 14 22:44:50 2018 -0500 selinux: switch away from match_token() It's not a good fit, unfortunately, and the next step will make it even less so. Open-code what we need here. Reviewed-by: David Howells Signed-off-by: Al Viro commit ba6418623385abf19a6c15cf0b1cfaacfdf9afc8 Author: Al Viro Date: Fri Dec 14 20:28:15 2018 -0500 selinux: new helper - selinux_add_opt() the guts of the loop in selinux_parse_opts_str() - takes one (already recognized) option and adds it to growing selinux_mnt_opts. Reviewed-by: David Howells Signed-off-by: Al Viro commit 84d8c4a5ef696ca96fa7a8d64db9222658b9d142 Author: Al Viro Date: Thu Dec 13 15:18:44 2018 -0500 LSM: bury struct security_mnt_opts no users left Reviewed-by: David Howells Signed-off-by: Al Viro commit 12085b14a4440a6d12ff7966702c010df87caef0 Author: Al Viro Date: Thu Dec 13 15:18:05 2018 -0500 smack: switch to private smack_mnt_opts Reviewed-by: David Howells Signed-off-by: Al Viro commit bd3236557bb256d6491df125e5e9d0393c70e4d2 Author: Al Viro Date: Thu Dec 13 15:04:59 2018 -0500 selinux: switch to private struct selinux_mnt_opts none of the convolutions needed, just 4 strings, TYVM... Reviewed-by: David Howells Signed-off-by: Al Viro commit 204cc0ccf1d49c6292aeef4c8edd1b3d10ff933c Author: Al Viro Date: Thu Dec 13 13:41:47 2018 -0500 LSM: hide struct security_mnt_opts from any generic code Keep void * instead, allocate on demand (in parse_str_opts, at the moment). Eventually both selinux and smack will be better off with private structures with several strings in those, rather than this "counter and two pointers to dynamically allocated arrays" ugliness. This commit allows to do that at leisure, without disrupting anything outside of given module. Changes: * instead of struct security_mnt_opt use an opaque pointer initialized to NULL. * security_sb_eat_lsm_opts(), security_sb_parse_opts_str() and security_free_mnt_opts() take it as var argument (i.e. as void **); call sites are unchanged. * security_sb_set_mnt_opts() and security_sb_remount() take it by value (i.e. as void *). * new method: ->sb_free_mnt_opts(). Takes void *, does whatever freeing that needs to be done. * ->sb_set_mnt_opts() and ->sb_remount() might get NULL as mnt_opts argument, meaning "empty". Reviewed-by: David Howells Signed-off-by: Al Viro commit e3489f8974e178d723259a842a1e61708dd7dc1e Author: Al Viro Date: Thu Dec 13 00:24:36 2018 -0500 selinux: kill selinux_sb_get_mnt_opts() it's much easier to just do the right thing in ->sb_show_options(), without bothering with allocating and populating arrays, etc. Reviewed-by: David Howells Signed-off-by: Al Viro commit 5b4002391153acebce2557af318bbdc17e235134 Author: Al Viro Date: Wed Dec 12 20:13:29 2018 -0500 LSM: turn sb_eat_lsm_opts() into a method Kill ->sb_copy_data() - it's used only in combination with immediately following ->sb_parse_opts_str(). Turn that combination into a new method. This is just a mechanical move - cleanups will be the next step. Reviewed-by: David Howells Signed-off-by: Al Viro commit 6a0440e5b7562512c021aa1b5a706fcc545773db Author: Al Viro Date: Mon Dec 10 17:30:41 2018 -0500 nfs_remount(): don't leak, don't ignore LSM options quietly * if mount(2) passes something like "context=foo" with MS_REMOUNT in flags (/sbin/mount.nfs will _not_ do that - you need to issue the syscall manually), you'll get leaked copies for LSM options. The reason is that instead of nfs_{alloc,free}_parsed_mount_data() nfs_remount() uses kzalloc/kfree, which lacks the needed cleanup. * selinux options are not changed on remount (as for any other fs), but in case of NFS the failure is quiet - they are not compared to what we used to have, with complaint in case of attempted changes. Trivially fixed by converting to use of security_sb_remount(). Reviewed-by: David Howells Signed-off-by: Al Viro commit a65001e8a4d465693d0191297a6fd864c96b3147 Author: Al Viro Date: Mon Dec 10 17:19:21 2018 -0500 btrfs: sanitize security_mnt_opts use 1) keeping a copy in btrfs_fs_info is completely pointless - we never use it for anything. Getting rid of that allows for simpler calling conventions for setup_security_options() (caller is responsible for freeing mnt_opts in all cases). 2) on remount we want to use ->sb_remount(), not ->sb_set_mnt_opts(), same as we would if not for FS_BINARY_MOUNTDATA. Behaviours *are* close (in fact, selinux sb_set_mnt_opts() ought to punt to sb_remount() in "already initialized" case), but let's handle that uniformly. And the only reason why the original btrfs changes didn't go for security_sb_remount() in btrfs_remount() case is that it hadn't been exported. Let's export it for a while - it'll be going away soon anyway. Reviewed-by: David Howells Signed-off-by: Al Viro commit 8d64124a6a93ec68fda6f781e48a7b95d9dd17d9 Author: Al Viro Date: Mon Dec 10 15:34:12 2018 -0500 selinux; don't open-code a loop in sb_finish_set_opts() Reviewed-by: David Howells Signed-off-by: Al Viro commit a10d7c22b34bcf744679019269bfb33ebf0b75ee Author: Al Viro Date: Wed Dec 5 11:58:35 2018 -0500 LSM: split ->sb_set_mnt_opts() out of ->sb_kern_mount() ... leaving the "is it kernel-internal" logics in the caller. Reviewed-by: David Howells Signed-off-by: Al Viro commit f5c0c26d9008b355babb6d16f3d7c4de3bada0e7 Author: Al Viro Date: Sat Nov 17 12:09:18 2018 -0500 new helper: security_sb_eat_lsm_opts() combination of alloc_secdata(), security_sb_copy_data(), security_sb_parse_opt_str() and free_secdata(). Reviewed-by: David Howells Signed-off-by: Al Viro commit c039bc3c2498724946304a8f964244a9b6af1043 Author: Al Viro Date: Sat Dec 1 23:06:57 2018 -0500 LSM: lift extracting and parsing LSM options into the caller of ->sb_remount() This paves the way for retaining the LSM options from a common filesystem mount context during a mount parameter parsing phase to be instituted prior to actual mount/reconfiguration actions. Reviewed-by: David Howells Signed-off-by: Al Viro commit 6be8750b4cba8c37170f46b29841d112f1be749b Author: Al Viro Date: Sat Dec 1 22:42:44 2018 -0500 LSM: lift parsing LSM options into the caller of ->sb_kern_mount() This paves the way for retaining the LSM options from a common filesystem mount context during a mount parameter parsing phase to be instituted prior to actual mount/reconfiguration actions. Reviewed-by: David Howells Signed-off-by: Al Viro commit 6466f3d193a99426db067855345e763de2160f1c Author: Al Viro Date: Sat Dec 1 22:55:40 2018 -0500 smack: make smack_parse_opts_str() clean up on failure fixes e.g. a btrfs leak... Reviewed-by: David Howells Signed-off-by: Al Viro commit 31af12efd0a259de9b0d8ef626503911f13b584f Author: Darrick J. Wong Date: Fri Dec 21 08:42:51 2018 -0800 iomap: take responsibility for the filesystem iomap code XFS is the primary user of the filesystem iomap code, so we (the XFS community, specifically) will explicitly take responsibility for its maintenance. Signed-off-by: Darrick J. Wong Acked-by: Al Viro Reviewed-by: Dave Chinner Acked-by: Christoph Hellwig commit 3cc31fa65d85610574c0f6a474e89f4c419923d5 Author: Eric Sandeen Date: Fri Dec 21 08:42:50 2018 -0800 iomap: don't search past page end in iomap_is_partially_uptodate iomap_is_partially_uptodate() is intended to check wither blocks within the selected range of a not-uptodate page are uptodate; if the range we care about is up to date, it's an optimization. However, the iomap implementation continues to check all blocks up to from+count, which is beyond the page, and can even be well beyond the iop->uptodate bitmap. I think the worst that will happen is that we may eventually find a zero bit and return "not partially uptodate" when it would have otherwise returned true, and skip the optimization. Still, it's clearly an invalid memory access that must be fixed. So: fix this by limiting the search to within the page as is done in the non-iomap variant, block_is_partially_uptodate(). Zorro noticed thiswhen KASAN went off for 512 byte blocks on a 64k page system: BUG: KASAN: slab-out-of-bounds in iomap_is_partially_uptodate+0x1a0/0x1e0 Read of size 8 at addr ffff800120c3a318 by task fsstress/22337 Reported-by: Zorro Lang Signed-off-by: Eric Sandeen Signed-off-by: Eric Sandeen Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 9b9afe4a0ef149db2472f13d6fa3c705d2867c9c Author: Anup Patel Date: Tue Dec 4 15:59:51 2018 +0530 RISC-V: Select GENERIC_SCHED_CLOCK for clocksource drivers The riscv_timer driver can provide sched_clock using "rdtime" instruction but to achieve this we require generic sched_clock framework hence this patch selects GENERIC_SCHED_CLOCK for RISCV. Signed-off-by: Anup Patel Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt commit a266cdba17b36497da47055f31454995c5e50f43 Author: Olof Johansson Date: Tue Oct 30 23:47:08 2018 -0700 RISC-V: lib: minor asm cleanup Fix tab/space conversion and use ENTRY/ENDPROC macros. Signed-off-by: Olof Johansson Signed-off-by: Palmer Dabbelt commit 358f3fff5271629f26261dadff73a9f8484aee12 Merge: 3aed8c43267eb 7ba12bb676c2f Author: Palmer Dabbelt Date: Fri Dec 21 08:15:39 2018 -0800 RISC-V: Move from EARLY_PRINTK to SBI earlycon Now that we have earlycon support in the SBI console driver there is no reason to have our arch-specific early printk support. This patch set turns on SBI earlycon support and removes the old early printk. commit 3aed8c43267ebad70b5130d21155db6d9d7c8ebe Author: Nick Kossifidis Date: Sun Nov 18 02:06:56 2018 +0200 RISC-V: Update Kconfig to better handle CMDLINE Added a menu to choose how the built-in command line will be used and CMDLINE_EXTEND for compatibility with FDT code. v2: Improved help messages, removed references to bootloader and made them more descriptive. I also asked help from a friend who's a language expert just in case. v3: This time used the corrected text v4: Copy the config strings from the arm32 port. v5: Actually copy the config strings from the arm32 port. Signed-off-by: Nick Kossifidis Signed-off-by: Debbie Maliotaki Signed-off-by: Palmer Dabbelt commit 397182e0db56b8894a43631ce72de14d90a29834 Author: David Abdurachmanov Date: Thu Dec 6 11:26:26 2018 +0100 riscv: remove unused variable in ftrace Noticed while building kernel-4.20.0-0.rc5.git2.1.fc30 for Fedora 30/RISCV. [..] BUILDSTDERR: arch/riscv/kernel/ftrace.c: In function 'prepare_ftrace_return': BUILDSTDERR: arch/riscv/kernel/ftrace.c:135:6: warning: unused variable 'err' [-Wunused-variable] BUILDSTDERR: int err; BUILDSTDERR: ^~~ [..] Signed-off-by: David Abdurachmanov Fixes: e949b6db51dc1 ("riscv/function_graph: Simplify with function_graph_enter()") Reviewed-by: Olof Johansson Acked-by: Steven Rostedt (VMware) Signed-off-by: Palmer Dabbelt commit cd378dbb3dafbee16ef956d4101ede567f6ea2f7 Author: Yangtao Li Date: Tue Nov 20 09:11:02 2018 -0500 RISC-V: add of_node_put() use of_node_put() to release the refcount. Signed-off-by: Yangtao Li Signed-off-by: Palmer Dabbelt commit 94f9bf118f1e294b3f2092f8bde02860f5e3ea3f Author: Atish Patra Date: Tue Nov 20 15:07:50 2018 -0800 RISC-V: Fix of_node_* refcount Fix of_node* refcount at various places by using of_node_put. Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 8b699616f399b58071cda41e5a1125d8480ac982 Author: Andrea Parri Date: Sat Dec 1 01:01:56 2018 +0100 riscv, atomic: Add #define's for the atomic_{cmp,}xchg_*() variants If an architecture does not define the atomic_{cmp,}xchg_*() variants, the generic implementation defaults them to the fully-ordered version. riscv's had its own variants since "the beginning", but it never told (#define-d these for) the generic implementation: it is time to do so. Signed-off-by: Andrea Parri Acked-by: Peter Zijlstra (Intel) Signed-off-by: Palmer Dabbelt commit 3715917408f35395922d06a5a6868c278b0e5c17 Merge: fa2323325e8b0 6277053afa342 Author: David S. Miller Date: Fri Dec 21 08:00:27 2018 -0800 Merge tag 'mlx5-XDP-100Mpps' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-XDP-100Mpps This series from Tariq, mainly adds the support of mlx5 Multi Packet WQE (TX descriptor) - ConnectX-5 and above - for XDP TX, which allows us to overcome the 70Mpps PCIe bottleneck of conventional TX queues (single TX descriptor per packet), and achieve the 100Mpps milestone with the MPWQE approach. In the first five patches, Tariq did minor improvements to mlx5 tx path, for better debug-ability and code structuring. Next two patches lay down the foundation for MPWQE implementation to store the in-flight XDP TX information for multiple packets of one descriptor (WQE). Next: Support Enhanced Multi-Packet TX WQE for XDP In this patch we add support for the HW feature, which is supported starting from ConnectX-5. Performance: Tested packet rate for UDP 64Byte multi-stream over ConnectX-5 NICs. CPU: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz XDP_TX: We see a huge gain on single port ConnectX-5, and reach the 100 Mpps milestone. * Single-port HCA: Before: 70 Mpps After: 100 Mpps (+42.8%) * Dual-port HCA: Before: 51.7 Mpps After: 57.3 Mpps (+10.8%) * In both cases we tested traffic on one port and for now On Dual-port HCAs we see only a small gain, we are working to overcome this bottleneck, but for the moment only with experimental firmware on dual port HCAs we can reach the wanted numbers as seen on Single-port HCAs. XDP_REDIRECT: Redirect from (A) ConnectX-5 to (B) ConnectX-5. Due to a setup limitation, (A) and (B) are on different NUMA nodes, so absolute performance numbers are not optimal. - Note: Below is the transmit rate of (B), not the redirect rate of (A) which is in some cases higher. * (B) is single-port: Before: 77 Mpps After: 90 Mpps (+16.8%) * (B) is dual-port: Before: 61 Mpps After: 72 Mpps (+18%) Last patch adds a knob in mlx5 ethtool private flag to turn on/off XDP TX MPWQE. ==================== Signed-off-by: David S. Miller commit b239b4d65d6442fabd6db694f9d014268b8711c1 Author: Masahiro Yamada Date: Fri Dec 21 12:12:40 2018 +0900 firmware: remove unnecessary patterns from .gitignore Commit df85b2d767aa ("firmware: Restore support for built-in firmware") should not have restored this .gitignore blindly. *.gen.S is only pattern that should be ignored by git. Signed-off-by: Masahiro Yamada commit 2e5b2d7c408ed5fbe918b7409496b1acc84ff7bc Author: Christoph Hellwig Date: Thu Dec 20 18:36:20 2018 +0100 bsg: deprecate BIDI support in bsg Besides the OSD command set that never got traction, the only SCSI command using bidirectional buffers is XDWRITEREAD in the 10 and 32 byte variants, which is extremely esoteric and has been removed from the spec again as of SBC4r15. It probably doesn't make sense to keep the support code around just for that, so start deprecating the support. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 6b4505352e4b1ee27faa97ae46b9baa8bc6a31f0 Author: Dennis Zhou Date: Wed Dec 19 16:43:53 2018 -0600 blkcg: remove unused __blkg_release_rcu() An earlier commit 7fcf2b033b84 ("blkcg: change blkg reference counting to use percpu_ref") moved around the release call from blkg_put() to be a part of the percpu_ref cleanup. Remove the additional unused code which should have been removed earlier. Signed-off-by: Dennis Zhou Signed-off-by: Jens Axboe commit 6ab2187992f4b0112852e5a097a2b6c7d167e2e5 Author: Dennis Zhou Date: Wed Dec 19 16:43:21 2018 -0600 blkcg: clean up blkg_tryget_closest() The implementation of blkg_tryget_closest() wasn't super obvious and became a point of suspicion when debugging [1]. So let's clean it up so it's obviously not the problem. Also add missing RCU read locking to bio_clone_blkg_association(), which got exposed by adding the RCU read lock held check in blkg_tryget_closest(). [1] https://lore.kernel.org/linux-block/a7e97e4b-0dd8-3a54-23b7-a0f27b17fde8@kernel.dk/ Signed-off-by: Dennis Zhou Signed-off-by: Jens Axboe commit 4b2c01ad902ec02fa962b233decd2f14be3714ba Author: Jörgen Storvist Date: Fri Dec 21 14:40:44 2018 +0100 USB: serial: option: add Fibocom NL678 series Added USB serial option driver support for Fibocom NL678 series cellular module: VID 2cb7 and PIDs 0x0104 and 0x0105. Reserved network and ADB interfaces. T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=2cb7 ProdID=0104 Rev=03.10 S: Manufacturer=Fibocom S: Product=Fibocom NL678-E Modem S: SerialNumber=12345678 C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan I: If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=2cb7 ProdID=0105 Rev=03.10 S: Manufacturer=Fibocom S: Product=Fibocom NL678-E Modem S: SerialNumber=12345678 C: #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#= 4 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether I: If#= 5 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether I: If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) Signed-off-by: Jörgen Storvist Cc: stable Acked-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman commit cd6a22310ec2a70092e136d0cd65bb77c1502521 Merge: 1e12a521d6917 177c459b08a34 Author: Greg Kroah-Hartman Date: Fri Dec 21 16:46:08 2018 +0100 Merge USB 4.20-rc8 mergepoint into usb-next We need the USB changes in here for additional patches to be able to apply cleanly. Signed-off-by: Greg Kroah-Hartman commit 3c78c77bafb18bbbd22f6bda6f508699431ceb11 Author: Masahiro Yamada Date: Fri Dec 21 12:12:39 2018 +0900 scripts: remove unnecessary ihex2fw and check-lc_ctypes from .gitignore Commit c512d2544c68 ("gitignore: ignore scripts/ihex2fw") was unneeded. ihex2fw was generated in firmware/ instead of scripts/ at that time although ihex2fw.c was pushed back and forth between those directories in the past. check-lc_ctype was removed by commit cb43fb5775df ("docs: remove DocBook from the building system"). Signed-off-by: Masahiro Yamada commit 733f4ef46d3ea31e44cebfec851528089a783f0f Author: Masahiro Yamada Date: Thu Dec 20 18:27:26 2018 +0900 um: remove unused filechk_gen_header in Makefile This is a leftover of commit ecba97d4aacf ("[PATCH] uml makefiles sanitized"). Signed-off-by: Masahiro Yamada commit 4b31a32caf0a28e4726f1bf267ff8a804ed864e2 Author: Masahiro Yamada Date: Tue Dec 11 20:01:09 2018 +0900 kconfig: update current_pos in the second lexer To simplify the generated lexer, let the hand-made lexer update the file name and line number for the parser. I tested this with DEBUG_PARSE, and confirmed the same file names and line numbers were dumped. Signed-off-by: Masahiro Yamada commit 824fa3b3b5e3647de0530328e8734c24418eec49 Author: Masahiro Yamada Date: Tue Dec 11 20:01:08 2018 +0900 kconfig: switch to ASSIGN_VAL state in the second lexer To simplify the generated lexer, switch to the ASSIGN_VAL state in the hand-made lexer. Signed-off-by: Masahiro Yamada commit b3d1d9d3c36214a50c18ba377b47152c021768df Author: Masahiro Yamada Date: Tue Dec 11 20:01:07 2018 +0900 kconfig: stop associating kconf_id with yylval The lexer has conventionally associated kconf_id data with yylval to carry additional information to the parser. No token is relying on this any more. Signed-off-by: Masahiro Yamada commit caaebb3c6de3493c7f11f79a5dddc6691a40e55f Author: Masahiro Yamada Date: Tue Dec 11 20:01:06 2018 +0900 kconfig: refactor end token rules T_ENDMENU, T_ENDCHOICE, T_ENDIF are the last users of kconf_id associated with yylval. Refactor them to not use it. Signed-off-by: Masahiro Yamada commit f5451582c4e22ce8912aae4950810f3598c9b516 Author: Masahiro Yamada Date: Tue Dec 11 20:01:05 2018 +0900 kconfig: stop supporting '.' and '/' in unquoted words In my understanding, special characters such as '.' and '/' are supported in unquoted words to use bare file paths in the "source" statement. With the previous commit surrounding all file paths with double quotes, we can drop this. Signed-off-by: Masahiro Yamada commit 8636a1f9677db4f883f29a072f401303acfc2edd Author: Masahiro Yamada Date: Tue Dec 11 20:01:04 2018 +0900 treewide: surround Kconfig file paths with double quotes The Kconfig lexer supports special characters such as '.' and '/' in the parameter context. In my understanding, the reason is just to support bare file paths in the source statement. I do not see a good reason to complicate Kconfig for the room of ambiguity. The majority of code already surrounds file paths with double quotes, and it makes sense since file paths are constant string literals. Make it treewide consistent now. Signed-off-by: Masahiro Yamada Acked-by: Wolfram Sang Acked-by: Geert Uytterhoeven Acked-by: Ingo Molnar commit 48547bd23d0eeb2cf3a63ed588b46236eac5f2c3 Author: Masahiro Yamada Date: Tue Dec 11 20:01:03 2018 +0900 microblaze: surround string default in Kconfig with double quotes I guess this is a constant value instead of a symbol. Signed-off-by: Masahiro Yamada Acked-by: Michal Simek commit 171a515d080327b861d5e5fc9bbfa77f10cfddd7 Author: Masahiro Yamada Date: Tue Dec 11 20:01:02 2018 +0900 kconfig: use T_WORD instead of T_VARIABLE for variables There is no grammatical ambiguity by using T_WORD for variables. The parser can distinguish variables from symbols from the context. Signed-off-by: Masahiro Yamada commit c3d228713b10e6dd1bd44853168cec8e23ae7e0f Author: Masahiro Yamada Date: Tue Dec 11 20:01:01 2018 +0900 kconfig: use specific tokens instead of T_ASSIGN for assignments Currently, the lexer returns T_ASSIGN for all of =, :=, and += associating yylval with the flavor. I want to make the generated lexer as simple as possible. So, the lexer should convert keywords to tokens without thinking about the meaning. = -> T_EQUAL := -> T_COLON_EQUAL += -> T_PLUS_EQUAL Unfortunately, Kconfig uses = instead of == for the equal operator. So, the same token T_EQUAL is used for assignment and comparison. The parser can still distinguish them from the context. Signed-off-by: Masahiro Yamada commit ce2164ab58316e27180034112f97608a764f5b37 Author: Masahiro Yamada Date: Tue Dec 11 20:01:00 2018 +0900 kconfig: refactor scanning and parsing "option" properties For the keywords "modules", "defconfig_list", and "allnoconfig_y", the lexer should pass specific tokens instead of generic T_WORD. This simplifies both the lexer and the parser. Signed-off-by: Masahiro Yamada commit 3c8f317d4cf15e7a67457cfdd1e63182a34bcb69 Author: Masahiro Yamada Date: Tue Dec 11 20:00:59 2018 +0900 kconfig: use distinct tokens for type and default properties This commit removes kconf_id::stype to prepare for the entire removal of kconf_id.c To simplify the lexer, I want keywords straight-mapped to tokens. Signed-off-by: Masahiro Yamada commit 745d51dc8a29e00e9ba14e090aa3c8a41e7221d9 Author: Yangtao Li Date: Thu Nov 22 07:39:24 2018 -0500 ata: pata_macio: add of_node_put() of_find_node_by_path() acquires a reference to the node returned by it and that reference needs to be dropped by its caller. This place doesn't do that, so fix it. Acked-by: Bartlomiej Zolnierkiewicz Signed-off-by: Yangtao Li Signed-off-by: Jens Axboe commit c3b5725965228014215de553eed3492dbd80a4bd Merge: b27d9668be60d 8ff00ba79283e Author: Mark Brown Date: Fri Dec 21 13:43:35 2018 +0000 Merge remote-tracking branch 'regulator/topic/coupled' into regulator-next commit b27d9668be60d42904b71ab1a9e4d152c7b5c920 Merge: 67a2ab931e9f7 cd07e3701fa6a Author: Mark Brown Date: Fri Dec 21 13:43:32 2018 +0000 Merge branch 'regulator-4.21' into regulator-next commit 67a2ab931e9f79f516566e69c92e566b71fb20d1 Merge: 7566ec393f416 2bb1666369339 Author: Mark Brown Date: Fri Dec 21 13:43:30 2018 +0000 Merge branch 'regulator-4.20' into regulator-linus commit a0aea130afebcd091d5396d13f25b9da24c9144a Author: Robert Hoo Date: Wed Dec 19 21:51:43 2018 +0800 KVM: x86: Add CPUID support for new instruction WBNOINVD Signed-off-by: Robert Hoo Signed-off-by: Paolo Bonzini commit 642fb53d350b3ff6a8c85062fcab271d61a56b75 Merge: da801ab56ad87 f83f97684a737 Author: Linus Walleij Date: Fri Dec 21 14:24:59 2018 +0100 Merge tag 'sh-pfc-for-v4.21-tag3' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: sh-pfc: Fixes for v4.21 - Miscellaneous fixes, - Build-time validation for pins/marks mismatches. commit 57d5edfe640edaaece9208cdbd7f464d255785cd Author: Andrew Jones Date: Fri Dec 21 12:22:22 2018 +0100 kvm: selftests: ucall: fix exit mmio address guessing Fix two more bugs in the exit_mmio address guessing. The first bug was that the start and step calculations were wrong since they were dividing the number of address bits instead of the address space. The second other bug was that the guessing algorithm wasn't considering the valid physical and virtual address ranges correctly for an identity map. Signed-off-by: Andrew Jones Signed-off-by: Paolo Bonzini commit b9b6a2ea2baf69204a6e5f311e0d24fe3b956f2e Author: Arnaldo Carvalho de Melo Date: Wed Dec 19 18:54:36 2018 -0300 perf trace: Do not hardcode the size of the tracepoint common_ fields We shouldn't hardcode the size of the tracepoint common_ fields, use the offset of the 'id'/'__syscallnr' field in the sys_enter event instead. This caused the augmented syscalls code to fail on a particular build of a PREEMPT_RT_FULL kernel where these extra 'common_migrate_disable' and 'common_padding' fields were before the syscall id one: # cat /sys/kernel/debug/tracing/events/raw_syscalls/sys_enter/format name: sys_enter ID: 22 format: 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 short common_migrate_disable; offset:8; size:2; signed:0; field:unsigned short common_padding; offset:10; size:2; signed:0; field:long id; offset:16; size:8; signed:1; field:unsigned long args[6]; offset:24; size:48; signed:0; print fmt: "NR %ld (%lx, %lx, %lx, %lx, %lx, %lx)", REC->id, REC->args[0], REC->args[1], REC->args[2], REC->args[3], REC->args[4], REC->args[5] # All those 'common_' prefixed fields are zeroed when they hit a BPF tracepoint hook, we better just discard those, i.e. somehow pass an offset to the BPF program from the start of the ctx and make adjustments in the 'perf trace' handlers to adjust the offset of the syscall arg offsets obtained from tracefs. Till then, fix it the quick way and add this to the augmented_raw_syscalls.c to bet it to work in such kernels: diff --git a/tools/perf/examples/bpf/augmented_raw_syscalls.c b/tools/perf/examples/bpf/augmented_raw_syscalls.c index 53c233370fae..1f746f931e13 100644 --- a/tools/perf/examples/bpf/augmented_raw_syscalls.c +++ b/tools/perf/examples/bpf/augmented_raw_syscalls.c @@ -38,12 +38,14 @@ struct bpf_map SEC("maps") syscalls = { struct syscall_enter_args { unsigned long long common_tp_fields; + long rt_common_tp_fields; long syscall_nr; unsigned long args[6]; }; struct syscall_exit_args { unsigned long long common_tp_fields; + long rt_common_tp_fields; long syscall_nr; long ret; }; Just to check that this was the case. Fix it properly later, for now remove the hardcoding of the offset in the 'perf trace' side and document the situation with this patch. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-2pqavrktqkliu5b9nzouio21@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 14541b1e7e723859ff2c75c6fc10cdbbec6b8c34 Author: Stanislav Fomichev Date: Thu Nov 15 16:32:01 2018 -0800 perf build: Don't unconditionally link the libbfd feature test to -liberty and -lz Current libbfd feature test unconditionally links against -liberty and -lz. While it's required on some systems (e.g. opensuse), it's completely unnecessary on the others, where only -lbdf is sufficient (debian). This patch streamlines (and renames) the following feature checks: feature-libbfd - only link against -lbfd (debian), see commit 2cf9040714f3 ("perf tools: Fix bfd dependency libraries detection") feature-libbfd-liberty - link against -lbfd and -liberty feature-libbfd-liberty-z - link against -lbfd, -liberty and -lz (opensuse), see commit 280e7c48c3b8 ("perf tools: fix BFD detection on opensuse") (feature-liberty{,-z} were renamed to feature-libbfd-liberty{,z} for clarity) The main motivation is to fix this feature test for bpftool which is currently broken on debian (libbfd feature shows OFF, but we still unconditionally link against -lbfd and it works). Tested on debian with only -lbfd installed (without -liberty); I'd appreciate if somebody on the other systems can test this new detection method. Signed-off-by: Stanislav Fomichev Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/4dfc634cfcfb236883971b5107cf3c28ec8a31be.1542328222.git.sdf@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5ce29d522e9b8cdc158329a8539bcd6206fc5bf4 Author: Arnaldo Carvalho de Melo Date: Wed Dec 19 10:10:51 2018 -0300 perf beauty mmap: PROT_WRITE should come before PROT_EXEC To match strace output: # cat mmap.c #include int main(void) { mmap(0, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); return 0; } # strace -e mmap ./mmap |& grep -v ^+++ mmap(NULL, 103484, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f5bae400000 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5bae3fe000 mmap(NULL, 3889792, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f5bade40000 mmap(0x7f5bae1ec000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ac000) = 0x7f5bae1ec000 mmap(0x7f5bae1f2000, 14976, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f5bae1f2000 mmap(NULL, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f5bae419000 # trace -e mmap ./mmap |& grep -v ^+++ mmap(NULL, 103484, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6646c25000 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS) = 0x7f6646c23000 mmap(NULL, 3889792, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f6646665000 mmap(0x7f6646a11000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ac000) = 0x7f6646a11000 mmap(0x7f6646a17000, 14976, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS) = 0x7f6646a17000 mmap(NULL, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS) = 0x7f6646c3e000 # Reported-by: Namhyung Kim Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-nt49d6iqle80cw8f529ovaqi@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f76214f93783f9f902954cf6e57fd818c4bffe29 Author: Arnaldo Carvalho de Melo Date: Wed Dec 19 10:01:20 2018 -0300 perf trace: Check if the raw_syscalls:sys_{enter,exit} are setup before setting tp filter While updating 'perf trace' on an machine with an old precompiled augmented_raw_syscalls.o that didn't setup the syscall map the new 'perf trace' codebase notices the augmented_raw_syscalls.o eBPF event, decides to use it instead of the old raw_syscalls:sys_{enter,exit} method, but then because we don't have the syscall map tries to set the tracepoint filter on the sys_{enter,exit} evsels, that are NULL, segfaulting. Make the code more robust by checking it those tracepoints have their respective evsels in place before trying to set the tp filter. With this we still get everything to work, just not setting up the syscall filters, which is better than a segfault. Now to update the precompiled augmented_raw_syscalls.o and continue development :-) Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-3ft5rjdl05wgz2pwpx2z8btu@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2bcbd406715dca256912b9c5ae449c7968f15705 Author: Sean Christopherson Date: Thu Dec 20 12:25:18 2018 -0800 Revert "compiler-gcc: disable -ftracer for __noclone functions" The -ftracer optimization was disabled in __noclone as a workaround to GCC duplicating a blob of inline assembly that happened to define a global variable. It has been pointed out that no amount of workarounds can guarantee the compiler won't duplicate inline assembly[1], and that disabling the -ftracer optimization has several unintended and nasty side effects[2][3]. Now that the offending KVM code which required the workaround has been properly fixed and no longer uses __noclone, remove the -ftracer optimization tweak from __noclone. [1] https://lore.kernel.org/lkml/ri6y38lo23g.fsf@suse.cz/T/#u [2] https://lore.kernel.org/lkml/20181218140105.ajuiglkpvstt3qxs@treble/T/#u [3] https://patchwork.kernel.org/patch/8707981/#21817015 This reverts commit 95272c29378ee7dc15f43fa2758cb28a5913a06d. Suggested-by: Andi Kleen Cc: Paolo Bonzini Cc: Nadav Amit Cc: Andi Kleen Cc: Josh Poimboeuf Cc: Martin Jambor Cc: Arnd Bergmann Cc: Steven Rostedt Cc: Miroslav Benes Signed-off-by: Sean Christopherson Reviewed-by: Andi Kleen Reviewed-by: Miguel Ojeda Signed-off-by: Paolo Bonzini commit cd07e3701fa6a4c68f8493ee1d12caa18d46ec6a Author: Kangjie Lu Date: Fri Dec 21 00:29:19 2018 -0600 regulator: tps65910: fix a missing check of return value tps65910_reg_set_bits() may fail. The fix checks if it fails, and if so, returns with its error code. Signed-off-by: Kangjie Lu Signed-off-by: Mark Brown commit 453eafbe65f72c04fc7c74c5c95c04e78e907dfb Author: Sean Christopherson Date: Thu Dec 20 12:25:17 2018 -0800 KVM: VMX: Move VM-Enter + VM-Exit handling to non-inline sub-routines Transitioning to/from a VMX guest requires KVM to manually save/load the bulk of CPU state that the guest is allowed to direclty access, e.g. XSAVE state, CR2, GPRs, etc... For obvious reasons, loading the guest's GPR snapshot prior to VM-Enter and saving the snapshot after VM-Exit is done via handcoded assembly. The assembly blob is written as inline asm so that it can easily access KVM-defined structs that are used to hold guest state, e.g. moving the blob to a standalone assembly file would require generating defines for struct offsets. The other relevant aspect of VMX transitions in KVM is the handling of VM-Exits. KVM doesn't employ a separate VM-Exit handler per se, but rather treats the VMX transition as a mega instruction (with many side effects), i.e. sets the VMCS.HOST_RIP to a label immediately following VMLAUNCH/VMRESUME. The label is then exposed to C code via a global variable definition in the inline assembly. Because of the global variable, KVM takes steps to (attempt to) ensure only a single instance of the owning C function, e.g. vmx_vcpu_run, is generated by the compiler. The earliest approach placed the inline assembly in a separate noinline function[1]. Later, the assembly was folded back into vmx_vcpu_run() and tagged with __noclone[2][3], which is still used today. After moving to __noclone, an edge case was encountered where GCC's -ftracer optimization resulted in the inline assembly blob being duplicated. This was "fixed" by explicitly disabling -ftracer in the __noclone definition[4]. Recently, it was found that disabling -ftracer causes build warnings for unsuspecting users of __noclone[5], and more importantly for KVM, prevents the compiler for properly optimizing vmx_vcpu_run()[6]. And perhaps most importantly of all, it was pointed out that there is no way to prevent duplication of a function with 100% reliability[7], i.e. more edge cases may be encountered in the future. So to summarize, the only way to prevent the compiler from duplicating the global variable definition is to move the variable out of inline assembly, which has been suggested several times over[1][7][8]. Resolve the aforementioned issues by moving the VMLAUNCH+VRESUME and VM-Exit "handler" to standalone assembly sub-routines. Moving only the core VMX transition codes allows the struct indexing to remain as inline assembly and also allows the sub-routines to be used by nested_vmx_check_vmentry_hw(). Reusing the sub-routines has a happy side-effect of eliminating two VMWRITEs in the nested_early_check path as there is no longer a need to dynamically change VMCS.HOST_RIP. Note that callers to vmx_vmenter() must account for the CALL modifying RSP, e.g. must subtract op-size from RSP when synchronizing RSP with VMCS.HOST_RSP and "restore" RSP prior to the CALL. There are no great alternatives to fudging RSP. Saving RSP in vmx_enter() is difficult because doing so requires a second register (VMWRITE does not provide an immediate encoding for the VMCS field and KVM supports Hyper-V's memory-based eVMCS ABI). The other more drastic alternative would be to use eschew VMCS.HOST_RSP and manually save/load RSP using a per-cpu variable (which can be encoded as e.g. gs:[imm]). But because a valid stack is needed at the time of VM-Exit (NMIs aren't blocked and a user could theoretically insert INT3/INT1ICEBRK at the VM-Exit handler), a dedicated per-cpu VM-Exit stack would be required. A dedicated stack isn't difficult to implement, but it would require at least one page per CPU and knowledge of the stack in the dumpstack routines. And in most cases there is essentially zero overhead in dynamically updating VMCS.HOST_RSP, e.g. the VMWRITE can be avoided for all but the first VMLAUNCH unless nested_early_check=1, which is not a fast path. In other words, avoiding the VMCS.HOST_RSP by using a dedicated stack would only make the code marginally less ugly while requiring at least one page per CPU and forcing the kernel to be aware (and approve) of the VM-Exit stack shenanigans. [1] cea15c24ca39 ("KVM: Move KVM context switch into own function") [2] a3b5ba49a8c5 ("KVM: VMX: add the __noclone attribute to vmx_vcpu_run") [3] 104f226bfd0a ("KVM: VMX: Fold __vmx_vcpu_run() into vmx_vcpu_run()") [4] 95272c29378e ("compiler-gcc: disable -ftracer for __noclone functions") [5] https://lkml.kernel.org/r/20181218140105.ajuiglkpvstt3qxs@treble [6] https://patchwork.kernel.org/patch/8707981/#21817015 [7] https://lkml.kernel.org/r/ri6y38lo23g.fsf@suse.cz [8] https://lkml.kernel.org/r/20181218212042.GE25620@tassilo.jf.intel.com Suggested-by: Andi Kleen Suggested-by: Martin Jambor Cc: Paolo Bonzini Cc: Nadav Amit Cc: Andi Kleen Cc: Josh Poimboeuf Cc: Martin Jambor Cc: Arnd Bergmann Cc: Steven Rostedt Cc: Miroslav Benes Signed-off-by: Sean Christopherson Reviewed-by: Andi Kleen Signed-off-by: Paolo Bonzini commit 051a2d3e59e51ae49fd56aef34e472832897ce46 Author: Sean Christopherson Date: Thu Dec 20 12:25:16 2018 -0800 KVM: VMX: Explicitly reference RCX as the vmx_vcpu pointer in asm blobs Use '%% " _ASM_CX"' instead of '%0' to dereference RCX, i.e. the 'struct vcpu_vmx' pointer, in the VM-Enter asm blobs of vmx_vcpu_run() and nested_vmx_check_vmentry_hw(). Using the symbolic name means that adding/removing an output parameter(s) requires "rewriting" almost all of the asm blob, which makes it nearly impossible to understand what's being changed in even the most minor patches. Opportunistically improve the code comments. Signed-off-by: Sean Christopherson Reviewed-by: Andi Kleen Signed-off-by: Paolo Bonzini commit 77ea906082dcfa63ad8a07ace6d5033d30c4175b Author: Axel Lin Date: Fri Dec 21 10:49:29 2018 +0800 regulator: mcp16502: Select REGMAP_I2C to fix build error Fix build error when CONFIG_REGMAP_I2C=m && CONFIG_REGULATOR_MCP16502=y. drivers/regulator/mcp16502.o: In function `mcp16502_probe': mcp16502.c:(.text+0xca): undefined reference to `__devm_regmap_init_i2c' Signed-off-by: Axel Lin Signed-off-by: Mark Brown commit da801ab56ad874897b0b255216767c983e665a4c Author: Alexandre Belloni Date: Thu Dec 20 15:44:31 2018 +0100 pinctrl: ocelot: add MSCC Jaguar2 support Jaguar2 has the same register layout as Ocelot but it has 64 pins, meaning that there are 2 registers instead of one. Signed-off-by: Alexandre Belloni Signed-off-by: Linus Walleij commit c6ad45973380af5ef43b708a54d7475d93f86638 Merge: e81434995081f ae59a7e1945bc Author: Paolo Bonzini Date: Fri Dec 21 11:48:41 2018 +0100 Merge tag 'kvm-ppc-next-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc into kvm-next Second PPC KVM update for 4.21 This has 5 commits that fix page dirty tracking when running nested HV KVM guests, from Suraj Jitindar Singh. commit e81434995081fd7efb755fd75576b35dbb0850b1 Author: Sean Christopherson Date: Thu Dec 20 14:21:08 2018 -0800 KVM: x86: Use jmp to invoke kvm_spurious_fault() from .fixup ____kvm_handle_fault_on_reboot() provides a generic exception fixup handler that is used to cleanly handle faults on VMX/SVM instructions during reboot (or at least try to). If there isn't a reboot in progress, ____kvm_handle_fault_on_reboot() treats any exception as fatal to KVM and invokes kvm_spurious_fault(), which in turn generates a BUG() to get a stack trace and die. When it was originally added by commit 4ecac3fd6dc2 ("KVM: Handle virtualization instruction #UD faults during reboot"), the "call" to kvm_spurious_fault() was handcoded as PUSH+JMP, where the PUSH'd value is the RIP of the faulting instructing. The PUSH+JMP trickery is necessary because the exception fixup handler code lies outside of its associated function, e.g. right after the function. An actual CALL from the .fixup code would show a slightly bogus stack trace, e.g. an extra "random" function would be inserted into the trace, as the return RIP on the stack would point to no known function (and the unwinder will likely try to guess who owns the RIP). Unfortunately, the JMP was replaced with a CALL when the macro was reworked to not spin indefinitely during reboot (commit b7c4145ba2eb "KVM: Don't spin on virt instruction faults during reboot"). This causes the aforementioned behavior where a bogus function is inserted into the stack trace, e.g. my builds like to blame free_kvm_area(). Revert the CALL back to a JMP. The changelog for commit b7c4145ba2eb ("KVM: Don't spin on virt instruction faults during reboot") contains nothing that indicates the switch to CALL was deliberate. This is backed up by the fact that the PUSH was left intact. Note that an alternative to the PUSH+JMP magic would be to JMP back to the "real" code and CALL from there, but that would require adding a JMP in the non-faulting path to avoid calling kvm_spurious_fault() and would add no value, i.e. the stack trace would be the same. Using CALL: ------------[ cut here ]------------ kernel BUG at /home/sean/go/src/kernel.org/linux/arch/x86/kvm/x86.c:356! invalid opcode: 0000 [#1] SMP CPU: 4 PID: 1057 Comm: qemu-system-x86 Not tainted 4.20.0-rc6+ #75 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 RIP: 0010:kvm_spurious_fault+0x5/0x10 [kvm] Code: <0f> 0b 66 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 55 49 89 fd 41 RSP: 0018:ffffc900004bbcc8 EFLAGS: 00010046 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffffffffffff RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff888273fd8000 R08: 00000000000003e8 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000784 R12: ffffc90000371fb0 R13: 0000000000000000 R14: 000000026d763cf4 R15: ffff888273fd8000 FS: 00007f3d69691700(0000) GS:ffff888277800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055f89bc56fe0 CR3: 0000000271a5a001 CR4: 0000000000362ee0 Call Trace: free_kvm_area+0x1044/0x43ea [kvm_intel] ? vmx_vcpu_run+0x156/0x630 [kvm_intel] ? kvm_arch_vcpu_ioctl_run+0x447/0x1a40 [kvm] ? kvm_vcpu_ioctl+0x368/0x5c0 [kvm] ? kvm_vcpu_ioctl+0x368/0x5c0 [kvm] ? __set_task_blocked+0x38/0x90 ? __set_current_blocked+0x50/0x60 ? __fpu__restore_sig+0x97/0x490 ? do_vfs_ioctl+0xa1/0x620 ? __x64_sys_futex+0x89/0x180 ? ksys_ioctl+0x66/0x70 ? __x64_sys_ioctl+0x16/0x20 ? do_syscall_64+0x4f/0x100 ? entry_SYSCALL_64_after_hwframe+0x44/0xa9 Modules linked in: vhost_net vhost tap kvm_intel kvm irqbypass bridge stp llc ---[ end trace 9775b14b123b1713 ]--- Using JMP: ------------[ cut here ]------------ kernel BUG at /home/sean/go/src/kernel.org/linux/arch/x86/kvm/x86.c:356! invalid opcode: 0000 [#1] SMP CPU: 6 PID: 1067 Comm: qemu-system-x86 Not tainted 4.20.0-rc6+ #75 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 RIP: 0010:kvm_spurious_fault+0x5/0x10 [kvm] Code: <0f> 0b 66 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 41 55 49 89 fd 41 RSP: 0018:ffffc90000497cd0 EFLAGS: 00010046 RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffffffffffff RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff88827058bd40 R08: 00000000000003e8 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000784 R12: ffffc90000369fb0 R13: 0000000000000000 R14: 00000003c8fc6642 R15: ffff88827058bd40 FS: 00007f3d7219e700(0000) GS:ffff888277900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f3d64001000 CR3: 0000000271c6b004 CR4: 0000000000362ee0 Call Trace: vmx_vcpu_run+0x156/0x630 [kvm_intel] ? kvm_arch_vcpu_ioctl_run+0x447/0x1a40 [kvm] ? kvm_vcpu_ioctl+0x368/0x5c0 [kvm] ? kvm_vcpu_ioctl+0x368/0x5c0 [kvm] ? __set_task_blocked+0x38/0x90 ? __set_current_blocked+0x50/0x60 ? __fpu__restore_sig+0x97/0x490 ? do_vfs_ioctl+0xa1/0x620 ? __x64_sys_futex+0x89/0x180 ? ksys_ioctl+0x66/0x70 ? __x64_sys_ioctl+0x16/0x20 ? do_syscall_64+0x4f/0x100 ? entry_SYSCALL_64_after_hwframe+0x44/0xa9 Modules linked in: vhost_net vhost tap kvm_intel kvm irqbypass bridge stp llc ---[ end trace f9daedb85ab3ddba ]--- Fixes: b7c4145ba2eb ("KVM: Don't spin on virt instruction faults during reboot") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit c2a7fad5fcd3267899803f07878f9f4ff719a120 Author: Sean Christopherson Date: Thu Dec 20 12:53:20 2018 -0800 MAINTAINERS: Add arch/x86/kvm sub-directories to existing KVM/x86 entry A series currently sitting in KVM's queue for 4.21 moves the bulk of KVM's VMX code to a dedicated VMX sub-directory[1]. As a result, get_maintainers.pl doesn't get any hits on the newly relocated VMX files when the script is run with --pattern-depth=1. Add all arch/x86/kvm sub-directories to the existing MAINTAINERS entry for KVM/x86 instead of arch/x86/kvm/vmx as other code, e.g. SVM, may get similar treatment in the near future. [1] https://patchwork.kernel.org/cover/10710751/ Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit a49d784d5a8272d0f63c448fe8dc69e589db006e Author: Rafał Miłecki Date: Tue Dec 18 16:58:08 2018 +0100 pinctrl: bcm: ns: support updated DT binding as syscon subnode Documentation has been recently updated specifying that pinctrl should be subnode of the CRU "syscon". Support that by using parent node for regmap and reading "offset" property from the DT. Signed-off-by: Rafał Miłecki Signed-off-by: Linus Walleij commit 2ae80900f239484069569380e1fc4340fd6e0089 Author: Rafał Miłecki Date: Tue Dec 18 16:57:44 2018 +0100 dt-bindings: pinctrl: bcm4708-pinmux: rework binding to use syscon As pointed by Rob, CRU is a kind of block that can't be guaranteed to have everything exposed as subnodes. It's a set of various registers that aren't tied to any single device. It could be described much more accurately as MFD (Multi-Function Device). Some hardware blocks may indeed want to access a register or two of the CRU which requires describing it as the "syscon". While at it replace exmple node name with the standard "pinctrl" (also pointed out by Rob). Signed-off-by: Rafał Miłecki Signed-off-by: Linus Walleij commit 72ab2f76319e15f7ad1f9d5f529df47099d4d271 Author: Jan Kotas Date: Tue Dec 18 16:10:42 2018 +0000 gpio: Add Cadence GPIO driver This patch adds a driver for Cadence GPIO controller. It can be enabled with GPIO_CADENCE Kconfig option. It uses generic GPIO infrastructure and works as an interrupt controller. At the moment it only supports level sensitive irqs. Signed-off-by: Jan Kotas Signed-off-by: Linus Walleij commit e4b194aa0bf522dad9ecf0568eb0fdd598a2713b Author: Jan Kotas Date: Tue Dec 18 16:10:41 2018 +0000 dt-bindings: gpio: Add bindings for Cadence GPIO This patch adds a DT binding documentation for Cadence GPIO controller. Signed-off-by: Jan Kotas Reviewed-by: Rob Herring [Removed interrupt-parent] Signed-off-by: Linus Walleij commit 6c905f91d8ae103cc0767267509a456f961a279d Author: Colin Ian King Date: Tue Dec 18 12:28:02 2018 +0000 gpiolib-acpi: remove unused variable 'err', cleans up build warning Variable err is defined but never used. Remove it. Cleans up warning: warning: unused variable ‘err’ [-Wunused-variable] Signed-off-by: Colin Ian King Acked-by: Mika Westerberg Signed-off-by: Linus Walleij commit f0df462f3ae1d10131f8ff7daa016ce1a8686727 Author: Uwe Kleine-König Date: Tue Dec 18 09:47:57 2018 +0100 gpio: mxs: read pin level directly instead of using .get Calling readl directly instead of going through another function that results in the same result to remove some overhead. I didn't try to measure the performance gain, but IMHO there is little benefit from abstracting a GPIO register access in the GPIO driver. Signed-off-by: Uwe Kleine-König Signed-off-by: Linus Walleij commit ac5ffda2447f033ddc44a87882dfcfed38d944dc Author: Uros Bizjak Date: Mon Nov 26 17:00:08 2018 +0100 KVM/x86: Use SVM assembly instruction mnemonics instead of .byte streams Recently the minimum required version of binutils was changed to 2.20, which supports all SVM instruction mnemonics. The patch removes all .byte #defines and uses real instruction mnemonics instead. Signed-off-by: Uros Bizjak Signed-off-by: Paolo Bonzini commit 71883a62fcd6c70639fa12cda733378b4d997409 Author: Lan Tianyu Date: Thu Dec 6 21:21:13 2018 +0800 KVM/MMU: Flush tlb directly in the kvm_zap_gfn_range() Originally, flush tlb is done by slot_handle_level_range(). This patch moves the flush directly to kvm_zap_gfn_range() when range flush is available, so that only the requested range can be flushed. Signed-off-by: Lan Tianyu Signed-off-by: Paolo Bonzini commit 3cc5ea94de5f71dff0d3353f610e729308583e6b Author: Lan Tianyu Date: Thu Dec 6 21:21:12 2018 +0800 KVM/MMU: Flush tlb directly in kvm_set_pte_rmapp() This patch is to flush tlb directly in kvm_set_pte_rmapp() function when Hyper-V remote TLB flush is available, returning 0 so that kvm_mmu_notifier_change_pte() does not flush again. Signed-off-by: Lan Tianyu Signed-off-by: Paolo Bonzini commit 0cf853c5e238edf503ebda2fe541e6f4a3d5bd40 Author: Lan Tianyu Date: Thu Dec 6 21:21:11 2018 +0800 KVM/MMU: Move tlb flush in kvm_set_pte_rmapp() to kvm_mmu_notifier_change_pte() This patch is to move tlb flush in kvm_set_pte_rmapp() to kvm_mmu_notifier_change_pte() in order to avoid redundant tlb flush. Signed-off-by: Lan Tianyu Signed-off-by: Paolo Bonzini commit 748c0e312fce983bd7854b369b192e24dce90878 Author: Lan Tianyu Date: Thu Dec 6 21:21:10 2018 +0800 KVM: Make kvm_set_spte_hva() return int The patch is to make kvm_set_spte_hva() return int and caller can check return value to determine flush tlb or not. Signed-off-by: Lan Tianyu Acked-by: Paul Mackerras Signed-off-by: Paolo Bonzini commit c3134ce240eed2eaa9703579ef99c3099665236e Author: Lan Tianyu Date: Thu Dec 6 21:21:09 2018 +0800 KVM: Replace old tlb flush function with new one to flush a specified range. This patch is to replace kvm_flush_remote_tlbs() with kvm_flush_ remote_tlbs_with_address() in some functions without logic change. Signed-off-by: Lan Tianyu Signed-off-by: Paolo Bonzini commit 40ef75a758b291dc2cc88ecef36ffbb0eb095e00 Author: Lan Tianyu Date: Thu Dec 6 21:21:08 2018 +0800 KVM/MMU: Add tlb flush with range helper function This patch is to add wrapper functions for tlb_remote_flush_with_range callback and flush tlb directly in kvm_mmu_zap_collapsible_spte(). kvm_mmu_zap_collapsible_spte() returns flush request to the slot_handle_leaf() and the latter does flush on demand. When range flush is available, make kvm_mmu_zap_collapsible_spte() to flush tlb with range directly to avoid returning range back to slot_handle_leaf(). Signed-off-by: Lan Tianyu Signed-off-by: Paolo Bonzini commit 1f3a3e46cc49e81ab84d32710d3dae30697753a5 Author: Lan Tianyu Date: Thu Dec 6 21:21:07 2018 +0800 KVM/VMX: Add hv tlb range flush support This patch is to register tlb_remote_flush_with_range callback with hv tlb range flush interface. Signed-off-by: Lan Tianyu Signed-off-by: Paolo Bonzini commit cc4edae4b924b39877b5abb25074065930c5a6d5 Author: Lan Tianyu Date: Thu Dec 6 21:21:05 2018 +0800 x86/hyper-v: Add HvFlushGuestAddressList hypercall support Hyper-V provides HvFlushGuestAddressList() hypercall to flush EPT tlb with specified ranges. This patch is to add the hypercall support. Reviewed-by: Michael Kelley Signed-off-by: Lan Tianyu Signed-off-by: Paolo Bonzini commit a49b96352e68368c2e6784d13b0b4b7b8d830922 Author: Lan Tianyu Date: Thu Dec 6 21:21:04 2018 +0800 KVM: Add tlb_remote_flush_with_range callback in kvm_x86_ops Add flush range call back in the kvm_x86_ops and platform can use it to register its associated function. The parameter "kvm_tlb_range" accepts a single range and flush list which contains a list of ranges. Signed-off-by: Lan Tianyu Signed-off-by: Paolo Bonzini commit ee85dec2fe9c860c40f6e2e1d53052b80f36cd58 Author: Luwei Kang Date: Wed Oct 24 16:05:16 2018 +0800 KVM: x86: Disable Intel PT when VMXON in L1 guest Currently, Intel Processor Trace do not support tracing in L1 guest VMX operation(IA32_VMX_MISC[bit 14] is 0). As mentioned in SDM, on these type of processors, execution of the VMXON instruction will clears IA32_RTIT_CTL.TraceEn and any attempt to write IA32_RTIT_CTL causes a general-protection exception (#GP). Signed-off-by: Luwei Kang Signed-off-by: Paolo Bonzini commit b08c28960f254bd246af8e30a468dfc7dd56e03b Author: Chao Peng Date: Wed Oct 24 16:05:15 2018 +0800 KVM: x86: Set intercept for Intel PT MSRs read/write To save performance overhead, disable intercept Intel PT MSRs read/write when Intel PT is enabled in guest. MSR_IA32_RTIT_CTL is an exception that will always be intercepted. Signed-off-by: Chao Peng Signed-off-by: Luwei Kang Signed-off-by: Paolo Bonzini commit bf8c55d8dc094c85a3f98cd302a4dddb720dd63f Author: Chao Peng Date: Wed Oct 24 16:05:14 2018 +0800 KVM: x86: Implement Intel PT MSRs read/write emulation This patch implement Intel Processor Trace MSRs read/write emulation. Intel PT MSRs read/write need to be emulated when Intel PT MSRs is intercepted in guest and during live migration. Signed-off-by: Chao Peng Signed-off-by: Luwei Kang Signed-off-by: Paolo Bonzini commit 6c0f0bba85a0de83b32ff8ccf3e5965815cc069b Author: Luwei Kang Date: Wed Oct 24 16:05:13 2018 +0800 KVM: x86: Introduce a function to initialize the PT configuration Initialize the Intel PT configuration when cpuid update. Include cpuid inforamtion, rtit_ctl bit mask and the number of address ranges. Signed-off-by: Luwei Kang Signed-off-by: Paolo Bonzini commit 2ef444f1600bfc2d8522df0f537aafef79befa7e Author: Chao Peng Date: Wed Oct 24 16:05:12 2018 +0800 KVM: x86: Add Intel PT context switch for each vcpu Load/Store Intel Processor Trace register in context switch. MSR IA32_RTIT_CTL is loaded/stored automatically from VMCS. In Host-Guest mode, we need load/resore PT MSRs only when PT is enabled in guest. Signed-off-by: Chao Peng Signed-off-by: Luwei Kang Signed-off-by: Paolo Bonzini commit 86f5201df0d3e3efc78d3eac7fc5a59b813287cd Author: Chao Peng Date: Wed Oct 24 16:05:11 2018 +0800 KVM: x86: Add Intel Processor Trace cpuid emulation Expose Intel Processor Trace to guest only when the PT works in Host-Guest mode. Signed-off-by: Chao Peng Signed-off-by: Luwei Kang Signed-off-by: Paolo Bonzini commit f99e3daf94ff35dd4a878d32ff66e1fd35223ad6 Author: Chao Peng Date: Wed Oct 24 16:05:10 2018 +0800 KVM: x86: Add Intel PT virtualization work mode Intel Processor Trace virtualization can be work in one of 2 possible modes: a. System-Wide mode (default): When the host configures Intel PT to collect trace packets of the entire system, it can leave the relevant VMX controls clear to allow VMX-specific packets to provide information across VMX transitions. KVM guest will not aware this feature in this mode and both host and KVM guest trace will output to host buffer. b. Host-Guest mode: Host can configure trace-packet generation while in VMX non-root operation for guests and root operation for native executing normally. Intel PT will be exposed to KVM guest in this mode, and the trace output to respective buffer of host and guest. In this mode, tht status of PT will be saved and disabled before VM-entry and restored after VM-exit if trace a virtual machine. Signed-off-by: Chao Peng Signed-off-by: Luwei Kang Signed-off-by: Paolo Bonzini commit e0018afec50a4846789d92a1b7cd6cd7f816c448 Author: Luwei Kang Date: Wed Oct 24 16:05:09 2018 +0800 perf/x86/intel/pt: add new capability for Intel PT This adds support for "output to Trace Transport subsystem" capability of Intel PT. It means that PT can output its trace to an MMIO address range rather than system memory buffer. Acked-by: Song Liu Signed-off-by: Luwei Kang Reviewed-by: Thomas Gleixner Signed-off-by: Paolo Bonzini commit 69843a913fc86b3d0ef503d6cc15886ef8943626 Author: Luwei Kang Date: Wed Oct 24 16:05:08 2018 +0800 perf/x86/intel/pt: Add new bit definitions for PT MSRs Add bit definitions for Intel PT MSRs to support trace output directed to the memeory subsystem and holds a count if packet bytes that have been sent out. These are required by the upcoming PT support in KVM guests for MSRs read/write emulation. Signed-off-by: Luwei Kang Signed-off-by: Paolo Bonzini commit 61be2998ca541f7d9f487479b2ec519d83328085 Author: Luwei Kang Date: Wed Oct 24 16:05:07 2018 +0800 perf/x86/intel/pt: Introduce intel_pt_validate_cap() intel_pt_validate_hw_cap() validates whether a given PT capability is supported by the hardware. It checks the PT capability array which reflects the capabilities of the hardware on which the code is executed. For setting up PT for KVM guests this is not correct as the capability array for the guest can be different from the host array. Provide a new function to check against a given capability array. Acked-by: Song Liu Signed-off-by: Luwei Kang Signed-off-by: Paolo Bonzini commit f6d079ce867d679e4dffef5b3112c7634215fd88 Author: Chao Peng Date: Wed Oct 24 16:05:06 2018 +0800 perf/x86/intel/pt: Export pt_cap_get() pt_cap_get() is required by the upcoming PT support in KVM guests. Export it and move the capabilites enum to a global header. As a global functions, "pt_*" is already used for ptrace and other things, so it makes sense to use "intel_pt_*" as a prefix. Acked-by: Song Liu Signed-off-by: Chao Peng Signed-off-by: Luwei Kang Signed-off-by: Paolo Bonzini commit 887eda13b570f62a8b7d3eadc91734e44d95e636 Author: Chao Peng Date: Wed Oct 24 16:05:05 2018 +0800 perf/x86/intel/pt: Move Intel PT MSRs bit defines to global header The Intel Processor Trace (PT) MSR bit defines are in a private header. The upcoming support for PT virtualization requires these defines to be accessible from KVM code. Move them to the global MSR header file. Reviewed-by: Thomas Gleixner Signed-off-by: Chao Peng Signed-off-by: Luwei Kang Signed-off-by: Paolo Bonzini commit 8cee58161efffcb5ba691c33fe4de3eb75cf46cb Author: Andrew Jones Date: Tue Nov 6 14:57:12 2018 +0100 kvm: selftests: aarch64: dirty_log_test: support greater than 40-bit IPAs When KVM has KVM_CAP_ARM_VM_IPA_SIZE we can test with > 40-bit IPAs by using the 'type' field of KVM_CREATE_VM. Signed-off-by: Andrew Jones Signed-off-by: Radim Krčmář commit cdbd2428482486bcb2ab86dd7d99e8adec2b7c39 Author: Andrew Jones Date: Tue Nov 6 14:57:11 2018 +0100 kvm: selftests: add pa-48/va-48 VM modes Signed-off-by: Andrew Jones Signed-off-by: Radim Krčmář commit 696ade770f08a194b85dbf22d6f1613285905ae5 Author: Andrew Jones Date: Tue Nov 6 14:57:10 2018 +0100 kvm: selftests: dirty_log_test: improve mode param management Signed-off-by: Andrew Jones Signed-off-by: Radim Krčmář commit fd3f6f813976620553e951eb10d3a11b673a8131 Author: Andrew Jones Date: Tue Nov 6 14:57:09 2018 +0100 kvm: selftests: dirty_log_test: reset guest test phys offset We need to reset the offset for each mode as it will change depending on the number of guest physical address bits. Signed-off-by: Andrew Jones Signed-off-by: Radim Krčmář commit 6498e1da84daec4b3ef97e2174b07ea0af3ff06e Author: Andrew Jones Date: Tue Nov 6 14:57:08 2018 +0100 kvm: selftests: dirty_log_test: always use -t There's no reason not to always test the topmost physical addresses, and if the user wants to try lower addresses then '-p' (used to be '-o before this patch) can be used. Let's remove the '-t' option and just always do what it did. Signed-off-by: Andrew Jones Signed-off-by: Radim Krčmář commit d4df5a15602e8edc2e90f5ee880de3cf7dbd92cd Author: Andrew Jones Date: Tue Nov 6 14:57:07 2018 +0100 kvm: selftests: dirty_log_test: don't identity map the test mem It isn't necessary and can even cause problems when testing high guest physical addresses. This patch leaves the test memory id- mapped by default, but when using '-t' the test memory virtual addresses stay the same even though the physical addresses switch to the topmost valid addresses. Signed-off-by: Andrew Jones Signed-off-by: Radim Krčmář commit b442324b581556e106010bb092dbb7e3ee25c94c Author: Andrew Jones Date: Tue Nov 6 14:57:06 2018 +0100 kvm: selftests: x86_64: dirty_log_test: fix -t Signed-off-by: Andrew Jones Signed-off-by: Radim Krčmář commit bdd303cb1bdb24e71eef8e4510b27166bfadf286 Author: Wei Yang Date: Mon Nov 5 14:45:03 2018 +0800 KVM: fix some typos Signed-off-by: Wei Yang [Preserved the iff and a probably intentional weird bracket notation. Also dropped the style change to make a single-purpose patch. - Radim] Signed-off-by: Radim Krčmář commit 649472a1694fb72a9e586bc40bfcf9282a4e8ccc Author: Peng Hao Date: Fri Nov 2 17:05:17 2018 +0800 x86/kvmclock: convert to SPDX identifiers Update the verbose license text with the matching SPDX license identifier. Signed-off-by: Peng Hao [Changed deprecated GPL-2.0+ to GPL-2.0-or-later. - Radim] Signed-off-by: Radim Krčmář commit 9b7ebff23cb8a8e126b3852ad0b1bfb284f25273 Author: Sean Christopherson Date: Mon Nov 5 10:44:32 2018 -0800 KVM: x86: Remove KF() macro placeholder Although well-intentioned, keeping the KF() definition as a hint for handling scattered CPUID features may be counter-productive. Simply redefining the bit position only works for directly manipulating the guest's CPUID leafs, e.g. it doesn't make guest_cpuid_has() magically work. Taking an alternative approach, e.g. ensuring the bit position is identical between the Linux-defined and hardware-defined features, may be a simpler and/or more effective method of exposing scattered features to the guest. Signed-off-by: Sean Christopherson Signed-off-by: Radim Krčmář commit 788fc1e9ad8e1d332d3a18692028d1faee6fabb0 Author: Jim Mattson Date: Fri Nov 9 09:35:11 2018 -0800 kvm: vmx: Allow guest read access to IA32_TSC Let the guest read the IA32_TSC MSR with the generic RDMSR instruction as well as the specific RDTSC(P) instructions. Note that the hardware applies the TSC multiplier and offset (when applicable) to the result of RDMSR(IA32_TSC), just as it does to the result of RDTSC(P). Signed-off-by: Jim Mattson Reviewed-by: Peter Shier Reviewed-by: Marc Orr Reviewed-by: Liran Alon Signed-off-by: Radim Krčmář commit 9ebdfe5230f2e50e3ba05c57723a06e90946815a Author: Jim Mattson Date: Mon Nov 26 11:22:32 2018 -0800 kvm: nVMX: NMI-window and interrupt-window exiting should wake L2 from HLT According to the SDM, "NMI-window exiting" VM-exits wake a logical processor from the same inactive states as would an NMI and "interrupt-window exiting" VM-exits wake a logical processor from the same inactive states as would an external interrupt. Specifically, they wake a logical processor from the shutdown state and from the states entered using the HLT and MWAIT instructions. Fixes: 6dfacadd5858 ("KVM: nVMX: Add support for activity state HLT") Signed-off-by: Jim Mattson Reviewed-by: Peter Shier Suggested-by: Sean Christopherson [Squashed comments of two Jim's patches and used the simplified code hunk provided by Sean. - Radim] Signed-off-by: Radim Krčmář commit e081354d6aa7b67c6d0ef51ff8c428b6c261a6fe Author: Tambe, William Date: Tue Nov 13 16:51:20 2018 +0000 KVM: nSVM: Fix nested guest support for PAUSE filtering. Currently, the nested guest's PAUSE intercept intentions are not being honored. Instead, since the L0 hypervisor's pause_filter_count and pause_filter_thresh values are still in place, these values are used instead of those programmed in the VMCB by the L1 hypervisor. To honor the desired PAUSE intercept support of the L1 hypervisor, the L0 hypervisor must use the PAUSE filtering fields of the L1 hypervisor. This requires saving and restoring of both the L0 and L1 hypervisor's PAUSE filtering fields. Signed-off-by: William Tambe Signed-off-by: Radim Krčmář commit 7a86dab8cf2f0fdf508f3555dddfc236623bff60 Author: Jim Mattson Date: Fri Dec 14 14:34:43 2018 -0800 kvm: Change offset in kvm_write_guest_offset_cached to unsigned Since the offset is added directly to the hva from the gfn_to_hva_cache, a negative offset could result in an out of bounds write. The existing BUG_ON only checks for addresses beyond the end of the gfn_to_hva_cache, not for addresses before the start of the gfn_to_hva_cache. Note that all current call sites have non-negative offsets. Fixes: 4ec6e8636256 ("kvm: Introduce kvm_write_guest_offset_cached()") Reported-by: Cfir Cohen Signed-off-by: Jim Mattson Reviewed-by: Cfir Cohen Reviewed-by: Peter Shier Reviewed-by: Krish Sadhukhan Reviewed-by: Sean Christopherson Signed-off-by: Radim Krčmář commit f1b9dd5eb86cec1fcf66aad17e7701d98d024a9a Author: Jim Mattson Date: Mon Dec 17 13:53:33 2018 -0800 kvm: Disallow wraparound in kvm_gfn_to_hva_cache_init Previously, in the case where (gpa + len) wrapped around, the entire region was not validated, as the comment claimed. It doesn't actually seem that wraparound should be allowed here at all. Furthermore, since some callers don't check the return code from this function, it seems prudent to clear ghc->memslot in the event of an error. Fixes: 8f964525a121f ("KVM: Allow cross page reads and writes from cached translations.") Reported-by: Cfir Cohen Signed-off-by: Jim Mattson Reviewed-by: Cfir Cohen Reviewed-by: Marc Orr Cc: Andrew Honig Signed-off-by: Radim Krčmář commit ba7424b200d347fbbf9fadecaffb2a0feb740039 Author: YueHaibing Date: Tue Dec 18 01:01:49 2018 +0000 KVM: VMX: Remove duplicated include from vmx.c Remove duplicated include. Signed-off-by: YueHaibing Reviewed-by: David Hildenbrand Signed-off-by: Radim Krčmář commit b85c32dd27495075380350fcd5d614a6b45311b8 Author: Vitaly Kuznetsov Date: Wed Dec 19 12:15:18 2018 +0100 selftests: kvm: report failed stage when exit reason is unexpected When we get a report like ==== Test Assertion Failure ==== x86_64/state_test.c:157: run->exit_reason == KVM_EXIT_IO pid=955 tid=955 - Success 1 0x0000000000401350: main at state_test.c:154 2 0x00007fc31c9e9412: ?? ??:0 3 0x000000000040159d: _start at ??:? Unexpected exit reason: 8 (SHUTDOWN), it is not obvious which particular stage failed. Add the info. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Radim Krčmář commit e87555e550cef4941579cd879759a7c0dee24e68 Author: Vitaly Kuznetsov Date: Wed Dec 19 12:06:13 2018 +0100 KVM: x86: svm: report MSR_IA32_MCG_EXT_CTL as unsupported AMD doesn't seem to implement MSR_IA32_MCG_EXT_CTL and svm code in kvm knows nothing about it, however, this MSR is among emulated_msrs and thus returned with KVM_GET_MSR_INDEX_LIST. The consequent KVM_GET_MSRS, of course, fails. Report the MSR as unsupported to not confuse userspace. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Radim Krčmář commit ed8e48122728acfaf7bfa904cba034d83905b43a Author: Paolo Bonzini Date: Fri Dec 21 11:25:59 2018 +0100 KVM: x86: fix size of x86_fpu_cache objects The memory allocation in b666a4b69739 ("kvm: x86: Dynamically allocate guest_fpu", 2018-11-06) is wrong, there are other members in struct fpu before the fpregs_state union and the patch should be doing something similar to the code in fpu__init_task_struct_size. It's enough to run a guest and then rmmod kvm to see slub errors which are actually caused by memory corruption. For now let's revert it to sizeof(struct fpu), which is conservative. I have plans to move fsave/fxsave/xsave directly in KVM, without using the kernel FPU helpers, and once it's done, the size of the object in the cache will be something like kvm_xstate_size. Signed-off-by: Paolo Bonzini commit 6ac5af6ec12dadca37dd86f93a4125f6a04ffb4c Author: Ludovic Desroches Date: Thu Nov 8 14:14:42 2018 +0100 MAINTAINERS: merge at91 pinctrl entries In order to be aware of all changes related to at91 pinctrl drivers, merge the two entries. Make use of the opportunity to replace Atmel by Microchip. Signed-off-by: Ludovic Desroches Signed-off-by: Linus Walleij commit a2161fd7c23cad7f9e962cb63d39ca2dbd41b960 Author: Aisheng Dong Date: Mon Dec 17 15:38:15 2018 +0000 pinctrl: imx8qxp: break the dependency on SOC_IMX8QXP ARM64 SoC does not encourage people to add more finegrained SoC config options rather than a single ARCH_ in arch Kconfig. So this patch aims to break the dependency on SOC_IMX8QXP. Cc: Linus Walleij Cc: Fabio Estevam Cc: Stefan Agner Cc: Pengutronix Kernel Team Acked-by: Shawn Guo Signed-off-by: Dong Aisheng Signed-off-by: Linus Walleij commit 8b78de956f31c5f210d190766cd23b9f1f6a8ee6 Author: Masahiro Yamada Date: Fri Dec 14 17:44:46 2018 +0900 pinctrl: uniphier: constify uniphier_pinctrl_socdata These are constant data. Signed-off-by: Masahiro Yamada Signed-off-by: Linus Walleij commit b5af33df50e91f7c79c050ec73062577b9d0dae3 Author: Ryder Lee Date: Thu Dec 13 10:27:50 2018 +0800 pinctrl: mediatek: improve Kconfig dependencies Remove prompts to make all pinctrl cores to non-visible symbols and make sure the target SoCs would be coupled with the corresponding cores. Signed-off-by: Ryder Lee Tested-by: Kevin Hilman Signed-off-by: Linus Walleij commit 533918b6f6ae7566b703adf0346dd15f2a60fe77 Author: Tao Ren Date: Wed Dec 12 13:53:05 2018 -0800 gpio: aspeed: remove duplicated statement Remove duplicated assignment statement from aspeed_gpio_probe() function. Signed-off-by: Tao Ren Acked-by: Joel Stanley Signed-off-by: Linus Walleij commit d1040ea06f0004fe22e881a8fe88db12ef83b98c Author: Arnd Bergmann Date: Mon Dec 10 21:59:45 2018 +0100 pinctrl: msm: mark PM functions as __maybe_unused Without CONFIG_PM_SLEEP, we get annoying warnings about unused functions: drivers/pinctrl/qcom/pinctrl-msm.c:1082:12: error: 'msm_pinctrl_resume' defined but not used [-Werror=unused-function] static int msm_pinctrl_resume(struct device *dev) ^~~~~~~~~~~~~~~~~~ drivers/pinctrl/qcom/pinctrl-msm.c:1075:12: error: 'msm_pinctrl_suspend' defined but not used [-Werror=unused-function] static int msm_pinctrl_suspend(struct device *dev) Mark them as __maybe_unused to shut up the warning and silently drop the functions without having to add ugly #ifdefs. Fixes: 977d057ad346 ("pinctrl: msm: Add sleep pinctrl state transitions") Signed-off-by: Arnd Bergmann Reviewed-by: Evan Green Signed-off-by: Linus Walleij commit b766470b876409b9d821c5773a08a90f8cc50c76 Author: Maxime Ripard Date: Mon Dec 17 14:16:26 2018 +0100 dt-bindings: pinctrl: sunxi: Add supply properties The pinctrl node can have multiple regulators for each of its GPIO banks. Add the property descriptions. Signed-off-by: Maxime Ripard Signed-off-by: Linus Walleij commit 4dd3d60a5ecdaac13f728eccdf0d962bc34d18d4 Author: Martin Blumenstingl Date: Sun Dec 9 20:50:55 2018 +0100 pinctrl: meson: meson8b: add the missing GPIO_GROUPs for BOOT and CARD Add the BOOT and CARD pins as GROUP_GROUPs as well so they can be configured in devicetree using groups = BOOTx or groups = CARDx. This makes the behavior consistent with other pins inside the same driver as well as with the BOOT and CARD pins of the GXBB and GXL pinctrl drivers. Fixes: 0fefcb6876d0d6 ("pinctrl: Add support for Meson8b") Signed-off-by: Martin Blumenstingl Signed-off-by: Linus Walleij commit 619cdd17f60f18c034a111e773fb8f8220470a01 Author: Martin Blumenstingl Date: Sun Dec 9 20:50:54 2018 +0100 pinctrl: meson: meson8: add the missing GPIO_GROUPs for BOOT and CARD Add the BOOT and CARD pins as GROUP_GROUPs as well so they can be configured in devicetree using groups = BOOTx or groups = CARDx. This makes the behavior consistent with other pins inside the same driver as well as with the BOOT and CARD pins of the GXBB and GXL pinctrl drivers. Fixes: 6ac730951104a4 ("pinctrl: add driver for Amlogic Meson SoCs") Signed-off-by: Martin Blumenstingl Signed-off-by: Linus Walleij commit 8e5ba8b8baffc3a17e96e3f72d1fd82a1675c251 Author: Martin Blumenstingl Date: Sun Dec 9 20:50:52 2018 +0100 pinctrl: meson: meson8: rename the "gpio" function to "gpio_periphs" Rename the existing "gpio" function to "gpio_periphs". This makes it consistent with the "gpio_aobus" function. Also GXBB and GXL are also using the "gpio_periphs" naming, so this makes the code here consistent with other Amlogic pinctrl drivers. No functional changes since thee "gpio" function is currently not used. Signed-off-by: Martin Blumenstingl Signed-off-by: Linus Walleij commit 54a9cbbfca53d0220a2f4bfc56da33ed12d6b5da Author: Martin Blumenstingl Date: Sun Dec 9 20:50:53 2018 +0100 pinctrl: meson: meson8: rename the "gpio" function to "gpio_periphs" Rename the existing "gpio" function to "gpio_periphs". This makes it consistent with the "gpio_aobus" function. Also GXBB and GXL are also using the "gpio_periphs" naming, so this makes the code here consistent with other Amlogic pinctrl drivers. No functional changes since thee "gpio" function is currently not used. Signed-off-by: Martin Blumenstingl Signed-off-by: Linus Walleij commit 2b745ac3cceb8fc1d9985990c8241a821ea97e53 Author: Martin Blumenstingl Date: Sun Dec 9 20:50:51 2018 +0100 pinctrl: meson: meson8b: fix the GPIO function for the GPIOAO pins The GPIOAO pins (as well as the two exotic GPIO_BSD_EN and GPIO_TEST_N) only belong to the pin controller in the AO domain. With the current definition these pins cannot be referred to in .dts files as group (which is possible on GXBB and GXL for example). Add a separate "gpio_aobus" function to fix the mapping between the pin controller and the GPIO pins in the AO domain. This is similar to how the GXBB and GXL drivers implement this functionality. Fixes: 9dab1868ec0db4 ("pinctrl: amlogic: Make driver independent from two-domain configuration") Signed-off-by: Martin Blumenstingl Signed-off-by: Linus Walleij commit 42f9b48cc5402be11d2364275eb18c257d2a79e8 Author: Martin Blumenstingl Date: Sun Dec 9 20:50:50 2018 +0100 pinctrl: meson: meson8: fix the GPIO function for the GPIOAO pins The GPIOAO pins (as well as the two exotic GPIO_BSD_EN and GPIO_TEST_N) only belong to the pin controller in the AO domain. With the current definition these pins cannot be referred to in .dts files as group (which is possible on GXBB and GXL for example). Add a separate "gpio_aobus" function to fix the mapping between the pin controller and the GPIO pins in the AO domain. This is similar to how the GXBB and GXL drivers implement this functionality. Fixes: 9dab1868ec0db4 ("pinctrl: amlogic: Make driver independent from two-domain configuration") Signed-off-by: Martin Blumenstingl Signed-off-by: Linus Walleij commit fb0b35d307b7109d245f45be780d15fb368f94c5 Author: Andrei.Stefanescu@microchip.com Date: Wed Dec 12 11:57:15 2018 +0000 gpio: add driver for SAMA5D2 PIOBU pins PIOBU pins do not lose their voltage during Backup/Self-refresh. This patch adds a simple GPIO controller for them and a maintainer for the driver. This driver adds support for using the pins as GPIO offering the possibility to read/set the voltage. Signed-off-by: Andrei Stefanescu Signed-off-by: Linus Walleij commit 6bd925a8b779b262b007d638171c80398cfbc217 Author: Andrei.Stefanescu@microchip.com Date: Wed Dec 12 11:57:11 2018 +0000 dt-bindings: arm: atmel: describe SECUMOD usage as a GPIO controller This patch describes the Security Module's usage as a GPIO controller for its PIOBU pins. These pins have the special property of maintaining their voltage during suspend-to-mem. Signed-off-by: Andrei Stefanescu Reviewed-by: Rob Herring Signed-off-by: Linus Walleij commit 249d1bb22901a214f3e7265362057fba471b7204 Author: Hardik Singh Rathore Date: Fri Dec 21 01:06:42 2018 -0800 Input: touchscreen - fix coding style issue This patch fixes the coding style problem reported by checkpatch.pl as below: ERROR: foo* bar should be "foo *bar" Signed-off-by: Hardik Singh Rathore Signed-off-by: Dmitry Torokhov commit a465d38fa3dce6a0dc2d5814cb3aa7b0d2982c6b Merge: 442a5d000a4ca 2c3b0463bb28e f9dca0f0675e7 584923efe91f2 Author: Rafael J. Wysocki Date: Fri Dec 21 10:07:37 2018 +0100 Merge branches 'pm-devfreq', 'pm-avs' and 'pm-tools' * pm-devfreq: PM / devfreq: add devfreq_suspend/resume() functions PM / devfreq: add support for suspend/resume of a devfreq device PM / devfreq: refactor set_target frequency function * pm-avs: PM / AVS: SmartReflex: Switch to SPDX Licence ID PM / AVS: SmartReflex: NULL check before some freeing functions is not needed PM / AVS: SmartReflex: remove unused function * pm-tools: tools/power/x86/intel_pstate_tracer: Fix non root execution for post processing a trace file tools/power turbostat: consolidate duplicate model numbers tools/power turbostat: fix goldmont C-state limit decoding cpupower : Auto-completion for cpupower tool tools/power turbostat: reduce debug output tools/power turbosat: fix AMD APIC-id output commit 442a5d000a4cabe8330074ad874da0f5ea47bb4f Merge: 6f049e7c87fd6 8234f6734c5d7 96c6935212d63 d32dcc6c69706 943a10f85265d Author: Rafael J. Wysocki Date: Fri Dec 21 10:06:44 2018 +0100 Merge branches 'pm-core', 'pm-qos', 'pm-domains' and 'pm-sleep' * pm-core: PM-runtime: Switch autosuspend over to using hrtimers * pm-qos: PM / QoS: Change to use DEFINE_SHOW_ATTRIBUTE macro * pm-domains: PM / Domains: remove define_genpd_open_function() and define_genpd_debugfs_fops() * pm-sleep: PM / sleep: convert to DEFINE_SHOW_ATTRIBUTE commit 6f049e7c87fd60b9d2649c53e397741d50eb3d44 Merge: 3a56fe685dc96 bcbeef5f001ca Author: Rafael J. Wysocki Date: Fri Dec 21 10:06:18 2018 +0100 Merge branch 'pm-opp' * pm-opp: PM / Domains: Propagate performance state updates PM / Domains: Factorize dev_pm_genpd_set_performance_state() PM / Domains: Save OPP table pointer in genpd OPP: Don't return 0 on error from of_get_required_opp_performance_state() OPP: Add dev_pm_opp_xlate_performance_state() helper OPP: Improve _find_table_of_opp_np() PM / Domains: Make genpd performance states orthogonal to the idlestates OPP: Fix missing debugfs supply directory for OPPs OPP: Use opp_table->regulators to verify no regulator case OPP: Remove of_dev_pm_opp_find_required_opp() OPP: Rename and relocate of_genpd_opp_to_performance_state() OPP: Configure all required OPPs OPP: Add dev_pm_opp_{set|put}_genpd_virt_dev() helper PM / Domains: Add genpd_opp_to_performance_state() OPP: Populate OPPs from "required-opps" property OPP: Populate required opp tables from "required-opps" property OPP: Separate out custom OPP handler specific code OPP: Identify and mark genpd OPP tables PM / Domains: Rename genpd virtual devices as virt_dev commit 3a56fe685dc96ee0adb5958787ab9a2e24347e5a Merge: 7edcbbf29006b 04dab58a39d40 2849dd8bc72b6 108c35a908d48 Author: Rafael J. Wysocki Date: Fri Dec 21 10:06:06 2018 +0100 Merge branches 'pm-cpuidle', 'pm-cpufreq' and 'pm-cpufreq-sched' * pm-cpuidle: cpuidle: Add 'above' and 'below' idle state metrics cpuidle: big.LITTLE: fix refcount leak cpuidle: Add cpuidle.governor= command line parameter cpuidle: poll_state: Disregard disable idle states Documentation: admin-guide: PM: Add cpuidle document * pm-cpufreq: cpufreq: qcom-hw: Add support for QCOM cpufreq HW driver dt-bindings: cpufreq: Introduce QCOM cpufreq firmware bindings cpufreq: nforce2: Remove meaningless return cpufreq: ia64: Remove unused header files cpufreq: imx6q: save one condition block for normal case of nvmem read cpufreq: imx6q: remove unused code cpufreq: pmac64: add of_node_put() cpufreq: powernv: add of_node_put() Documentation: intel_pstate: Clarify coordination of P-State limits cpufreq: intel_pstate: Force HWP min perf before offline cpufreq: s3c24xx: Change to use DEFINE_SHOW_ATTRIBUTE macro * pm-cpufreq-sched: sched/cpufreq: Add the SPDX tags commit 3eb85368460d942005ba305829e279d0fe4767e0 Merge: 4cd9da8ad1c98 5c6a1177826e5 Author: Rafael J. Wysocki Date: Fri Dec 21 10:04:23 2018 +0100 Merge branch 'acpi-pci' * acpi-pci: ACPI: Make PCI slot detection driver depend on PCI ACPI/IORT: Stub out ACS functions when CONFIG_PCI is not set arm64: select ACPI PCI code only when both features are enabled PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set ACPICA: Remove PCI bits from ACPICA when CONFIG_PCI is unset ACPI: Allow CONFIG_PCI to be unset for reboot ACPI: Move PCI reset to a separate function commit 4cd9da8ad1c98a2c9c2b30cbd5c40faba0047bae Merge: 1027fb0fb94aa 1f000e1bfff42 1a2fa02f7489d 98cff8b23ed1c f8c6d1402b89f Author: Rafael J. Wysocki Date: Fri Dec 21 10:04:14 2018 +0100 Merge branches 'acpi-tables', 'acpi-soc', 'acpi-apei' and 'acpi-misc' * acpi-tables: ACPI / tables: Add an ifdef around amlcode and dsdt_amlcode ACPI / tables: add DSDT AmlCode new declaration name support ACPI: SPCR: Consider baud rate 0 as preconfigured state * acpi-soc: ACPI / LPSS: Ignore acpi_device_fix_up_power() return value ACPI / APD: Add clock frequency for Hisilicon Hip08 SPI controller * acpi-apei: ACPI/APEI: Clear GHES block_status before panic() ACPI, APEI, EINJ: Change to use DEFINE_SHOW_ATTRIBUTE macro * acpi-misc: ACPI: fix acpi_find_child_device() invocation in acpi_preset_companion() commit 1027fb0fb94aaaaa36ad58193fc61c36efaced85 Merge: 28586a51eea66 3b15e830ba59a Author: Rafael J. Wysocki Date: Fri Dec 21 10:03:16 2018 +0100 Merge branch 'acpica' * acpica: ACPICA: Update version to 20181213 ACPICA: change coding style to match ACPICA, no functional change ACPICA: Debug output: Add option to display method/object evaluation ACPICA: disassembler: disassemble OEMx tables as AML ACPICA: Add "Windows 2018.2" string in the _OSI support ACPICA: Expressions in package elements are not supported ACPICA: Update buffer-to-string conversions ACPICA: add comments, no functional change ACPICA: Remove defines that use deprecated flag ACPICA: Add "Windows 2018" string in the _OSI support ACPICA: Update version to 20181031 ACPICA: iASL: Enhance error detection ACPICA: iASL: adding definition and disassembly for TPM2 revision 3 ACPICA: Use %d for signed int print formatting instead of %u ACPICA: Debugger: refactor to fix unused variable warning commit 0b9f28fed3f70ff9a0380fe308739dd72a30a6f6 Author: Nicolas Saenz Julienne Date: Fri Dec 21 00:47:40 2018 -0800 Input: add official Raspberry Pi's touchscreen driver Add's support to Raspberry Pi's 7" Touch device. Instead of using a conventional bus all information is copied into a memory mapped area by RPi's firmware. Based on the driver found in RPi's kernel repository. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Rob Herring Acked-by: Eric Anholt Signed-off-by: Dmitry Torokhov commit 4d8f727b83bcd6702c2d210330872c9122d2d360 Author: Dan Carpenter Date: Fri Dec 21 00:38:30 2018 -0800 Input: nomadik-ske-keypad - fix a loop timeout test The loop exits with "timeout" set to -1 not to 0. Fixes: 1158f0f16224 ("Input: add support for Nomadik SKE keypad controller") Signed-off-by: Dan Carpenter Signed-off-by: Dmitry Torokhov commit 1e12a521d6917004f8b95a3b5864b92edc2694c8 Merge: eafb27fa52835 8d503f206c336 Author: Greg Kroah-Hartman Date: Fri Dec 21 08:36:54 2018 +0100 Merge tag 'usb-serial-4.21-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-next Johan writes: USB-serial updates for 4.21-rc1 Here are the USB-serial updates for 4.21-rc1, including: - support for mos7840 3-port devices - improved ftdi baud-rate divisor calculations - support for a new class of f81534 devices Included are also various clean ups and some new pl2303 device ids. All have been in linux-next with no reported issues. Signed-off-by: Johan Hovold * tag 'usb-serial-4.21-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: pl2303: add ids for Hewlett-Packard HP POS pole displays USB: serial: mos7840: remove set but not used variables 'number, serial' USB: serial: mos7840: add a product ID for the new product USB: serial: mos7840: clean up register handling USB: serial: ftdi_sio: use rounding when calculating baud rate divisors USB: serial: f81534: fix reading old/new IC config USB: serial: mos7840: remove set but not used variables 'st, data1, iflag' USB: serial: quatech2: remove set but not used variable 'port_priv' commit fbc4904c287778ddb74bf6060ac9dec51992fc53 Author: Christian Brauner Date: Thu Dec 20 11:40:57 2018 +0100 MAINTAINERS: add another Android binder maintainer As briefly discussed with Greg and Todd, add Christian as maintainer for binder{fs}. Signed-off-by: Christian Brauner Acked-By: Martijn Coenen Signed-off-by: Greg Kroah-Hartman commit 6277053afa34253eb8d8d147388e4426e615bae4 Author: Tariq Toukan Date: Tue Nov 20 11:50:30 2018 +0200 net/mlx5e: XDP, Add user control for XDP TX MPWQE feature Add ethtool private flag 'xdp_tx_mpwqe' to control the feature from userspace. Feature is set ON by default, if supported. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 5e0d2eef771ee78b092bf93d040eac02a0965fea Author: Tariq Toukan Date: Wed Nov 21 14:08:06 2018 +0200 net/mlx5e: XDP, Support Enhanced Multi-Packet TX WQE Add support for the HW feature of multi-packet WQE in XDP xmit flow. The conventional TX descriptor (WQE, Work Queue Element) serves a single packet. Our HW has support for multi-packet WQE (MPWQE) in which a single descriptor serves multiple TX packets. This reduces both the PCI overhead and the CPU cycles wasted on writing them. In this patch we add support for the HW feature, which is supported starting from ConnectX-5. Performance: Tested packet rate for UDP 64Byte multi-stream over ConnectX-5 NICs. CPU: Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz XDP_TX: We see a huge gain on single port ConnectX-5, and reach the 100 Mpps milestone. * Single-port HCA: Before: 70 Mpps After: 100 Mpps (+42.8%) * Dual-port HCA: Before: 51.7 Mpps After: 57.3 Mpps (+10.8%) * In both cases we tested traffic on one port and for now On Dual-port HCAs we see only small gain, we are working to overcome this bottleneck, but for the moment only with experimental firmware on dual port HCAs we can reach the wanted numbers as seen on Single-port HCAs. XDP_REDIRECT: Redirect from (A) ConnectX-5 to (B) ConnectX-5. Due to a setup limitation, (A) and (B) are on different NUMA nodes, so absolute performance numbers are not optimal. Note: Below is the transmit rate of (B), not the redirect rate of (A) which is in some cases higher. * (B) is single-port: Before: 77 Mpps After: 90 Mpps (+16.8%) * (B) is dual-port: Before: 61 Mpps After: 72 Mpps (+18%) Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 1feeab80078078186b5080fe15c51a5cce724a0e Author: Tariq Toukan Date: Sun Oct 14 14:46:57 2018 +0300 net/mlx5e: XDP, Add array for WQE info descriptors Each xdp_wqe_info instance describes the number of data-segments and WQEBBs of the WQE. This is useful for a downstream patch that adds support for Multi-Packet TX WQE feature. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit fea28dd6a281045e18c1412ab5bba54436c11088 Author: Tariq Toukan Date: Sun Oct 14 14:37:48 2018 +0300 net/mlx5e: XDP, Maintain a FIFO structure for xdp_info instances This provides infrastructure to have multiple xdp_info instances for the same consumer index. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit b8180392edd97cd5bfdf12270315a72fe601cf7e Author: Tariq Toukan Date: Wed Nov 21 14:06:02 2018 +0200 net/mlx5e: XDP, Replace boolean doorbell indication with segment pointer Instead of calculating the control segment to be used upon an XDP xmit doorbell, save it in SQ structure. Nullify when no pending doorbell. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit db02a308cd724fd37416012c8077d3e0ea2bf386 Author: Tariq Toukan Date: Thu Nov 15 11:48:41 2018 +0200 net/mlx5e: XDP, Warn upon polling an error CQE Do not ignore the CQE opcode. This helps expose issues and debug them. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit feb2ff9d74f76a174e284255b7e537b6c090c13c Author: Tariq Toukan Date: Wed Nov 21 14:04:45 2018 +0200 net/mlx5e: XDP, Change the XDP SQ redirect indication Do not maintain an SQ state bit to indicate whether an XDP SQ serves redirect operations. Instead, rely on the fact that such an XDP SQ doesn't reside in an RQ instance, while the others do. This info is not known to the XDP SQ functions themselves, and they rely on their callers to distinguish between the cases. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 4fb2f516186ea25dea326f97880431e14a5b9e9d Author: Tariq Toukan Date: Wed Nov 21 13:56:17 2018 +0200 net/mlx5e: XDP, Precede XDP-related operations in RQ poll by a loaded program check At the end of the RQ polling loop, some XDP-related operations might be required. Before checking them one by one, check if an XDP program is even loaded. Combine all the checks and operations in a single function in xdp files. This saves unnecessary checks for non-XDP flows. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit e05b8d4fc30a68540e5c0eef3e2bacd1f27b8172 Author: Tariq Toukan Date: Thu Nov 15 11:48:41 2018 +0200 net/mlx5e: TX, Print opcode in error CQE warning The opcode indicates about the error reason. Printing it helps in debug. Signed-off-by: Tariq Toukan Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit 7f92891778dff62303c070ac81de7b7d80de331a Author: Alexey Kardashevskiy Date: Thu Dec 20 12:10:36 2018 +1100 vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] subdriver POWER9 Witherspoon machines come with 4 or 6 V100 GPUs which are not pluggable PCIe devices but still have PCIe links which are used for config space and MMIO. In addition to that the GPUs have 6 NVLinks which are connected to other GPUs and the POWER9 CPU. POWER9 chips have a special unit on a die called an NPU which is an NVLink2 host bus adapter with p2p connections to 2 to 3 GPUs, 3 or 2 NVLinks to each. These systems also support ATS (address translation services) which is a part of the NVLink2 protocol. Such GPUs also share on-board RAM (16GB or 32GB) to the system via the same NVLink2 so a CPU has cache-coherent access to a GPU RAM. This exports GPU RAM to the userspace as a new VFIO device region. This preregisters the new memory as device memory as it might be used for DMA. This inserts pfns from the fault handler as the GPU memory is not onlined until the vendor driver is loaded and trained the NVLinks so doing this earlier causes low level errors which we fence in the firmware so it does not hurt the host system but still better be avoided; for the same reason this does not map GPU RAM into the host kernel (usual thing for emulated access otherwise). This exports an ATSD (Address Translation Shootdown) register of NPU which allows TLB invalidations inside GPU for an operating system. The register conveniently occupies a single 64k page. It is also presented to the userspace as a new VFIO device region. One NPU has 8 ATSD registers, each of them can be used for TLB invalidation in a GPU linked to this NPU. This allocates one ATSD register per an NVLink bridge allowing passing up to 6 registers. Due to the host firmware bug (just recently fixed), only 1 ATSD register per NPU was actually advertised to the host system so this passes that alone register via the first NVLink bridge device in the group which is still enough as QEMU collects them all back and presents to the guest via vPHB to mimic the emulated NPU PHB on the host. In order to provide the userspace with the information about GPU-to-NVLink connections, this exports an additional capability called "tgt" (which is an abbreviated host system bus address). The "tgt" property tells the GPU its own system address and allows the guest driver to conglomerate the routing information so each GPU knows how to get directly to the other GPUs. For ATS to work, the nest MMU (an NVIDIA block in a P9 CPU) needs to know LPID (a logical partition ID or a KVM guest hardware ID in other words) and PID (a memory context ID of a userspace process, not to be confused with a linux pid). This assigns a GPU to LPID in the NPU and this is why this adds a listener for KVM on an IOMMU group. A PID comes via NVLink from a GPU and NPU uses a PID wildcard to pass it through. This requires coherent memory and ATSD to be available on the host as the GPU vendor only supports configurations with both features enabled and other configurations are known not to work. Because of this and because of the ways the features are advertised to the host system (which is a device tree with very platform specific properties), this requires enabled POWERNV platform. The V100 GPUs do not advertise any of these capabilities via the config space and there are more than just one device ID so this relies on the platform to tell whether these GPUs have special abilities such as NVLinks. Signed-off-by: Alexey Kardashevskiy Acked-by: Alex Williamson Signed-off-by: Michael Ellerman commit c2c0f1cde0ef56ba5d6f553db73f51e753d7550a Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:31 2018 +1100 vfio_pci: Allow regions to add own capabilities VFIO regions already support region capabilities with a limited set of fields. However the subdriver might have to report to the userspace additional bits. This adds an add_capability() hook to vfio_pci_regops. Signed-off-by: Alexey Kardashevskiy Acked-by: Alex Williamson Signed-off-by: Michael Ellerman commit a15b1883fee11e07e5db7f003a863cc419647e79 Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:30 2018 +1100 vfio_pci: Allow mapping extra regions So far we only allowed mapping of MMIO BARs to the userspace. However there are GPUs with on-board coherent RAM accessible via side channels which we also want to map to the userspace. The first client for this is NVIDIA V100 GPU with NVLink2 direct links to a POWER9 NPU-enabled CPU; such GPUs have 16GB RAM which is coherently mapped to the system address space, we are going to export these as an extra PCI region. We already support extra PCI regions and this adds support for mapping them to the userspace. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson Acked-by: Alex Williamson Signed-off-by: Michael Ellerman commit 58629c0dc34904d135af944d120eb23165ec3b61 Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:29 2018 +1100 powerpc/powernv/npu: Fault user page into the hypervisor's pagetable When a page fault happens in a GPU, the GPU signals the OS and the GPU driver calls the fault handler which populated a page table; this allows the GPU to complete an ATS request. On the bare metal get_user_pages() is enough as it adds a pte to the kernel page table but under KVM the partition scope tree does not get updated so ATS will still fail. This reads a byte from an effective address which causes HV storage interrupt and KVM updates the partition scope tree. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit 135ef954051b102870a8d47a8eb822af1f1b1ec1 Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:28 2018 +1100 powerpc/powernv/npu: Check mmio_atsd array bounds when populating A broken device tree might contain more than 8 values and introduce hard to debug memory corruption bug. This adds the boundary check. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit 1b785611e1191751e1fb44ac3e89a0bd68ec7971 Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:27 2018 +1100 powerpc/powernv/npu: Add release_ownership hook In order to make ATS work and translate addresses for arbitrary LPID and PID, we need to program an NPU with LPID and allow PID wildcard matching with a specific MSR mask. This implements a helper to assign a GPU to LPAR and program the NPU with a wildcard for PID and a helper to do clean-up. The helper takes MSR (only DR/HV/PR/SF bits are allowed) to program them into NPU2 for ATS checkout requests support. This exports pnv_npu2_unmap_lpar_dev() as following patches will use it from the VFIO driver. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit 0bd971676e68f14427406f4dbbdeb9586e4f24b3 Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:26 2018 +1100 powerpc/powernv/npu: Add compound IOMMU groups At the moment the powernv platform registers an IOMMU group for each PE. There is an exception though: an NVLink bridge which is attached to the corresponding GPU's IOMMU group making it a master. Now we have POWER9 systems with GPUs connected to each other directly bypassing PCI. At the moment we do not control state of these links so we have to put such interconnected GPUs to one IOMMU group which means that the old scheme with one GPU as a master won't work - there will be up to 3 GPUs in such group. This introduces a npu_comp struct which represents a compound IOMMU group made of multiple PEs - PCI PEs (for GPUs) and NPU PEs (for NVLink bridges). This converts the existing NVLink1 code to use the new scheme. >From now on, each PE must have a valid iommu_table_group_ops which will either be called directly (for a single PE group) or indirectly from a compound group handlers. This moves IOMMU group registration for NVLink-connected GPUs to npu-dma.c. For POWER8, this stores a new compound group pointer in the PE (so a GPU is still a master); for POWER9 the new group pointer is stored in an NPU (which is allocated per a PCI host controller). Signed-off-by: Alexey Kardashevskiy [mpe: Initialise npdev to NULL in pnv_try_setup_npu_table_group()] Signed-off-by: Michael Ellerman commit 83fb8ccf975138283c7f6d3685d9c5e2292381dd Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:25 2018 +1100 powerpc/powernv/npu: Convert NPU IOMMU helpers to iommu_table_group_ops At the moment NPU IOMMU is manipulated directly from the IODA2 PCI PE code; PCI PE acts as a master to NPU PE. Soon we will have compound IOMMU groups with several PEs from several different PHB (such as interconnected GPUs and NPUs) so there will be no single master but a one big IOMMU group. This makes a first step and converts an NPU PE with a set of extern function to a table group. This should cause no behavioral change. Note that pnv_npu_release_ownership() has never been implemented. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson Signed-off-by: Michael Ellerman commit b04149c2dd85ac2d7839ef859a82cc1871fcf6ce Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:24 2018 +1100 powerpc/powernv/npu: Move single TVE handling to NPU PE Normal PCI PEs have 2 TVEs, one per a DMA window; however NPU PE has only one which points to one of two tables of the corresponding PCI PE. So whenever a new DMA window is programmed to PEs, the NPU PE needs to release old table in order to use the new one. Commit d41ce7b1bcc3e ("powerpc/powernv/npu: Do not try invalidating 32bit table when 64bit table is enabled") did just that but in pci-ioda.c while it actually belongs to npu-dma.c. This moves the single TVE handling to npu-dma.c. This does not implement restoring though as it is highly unlikely that we can set the table to PCI PE and cannot to NPU PE and if that fails, we could only set 32bit table to NPU PE and this configuration is not really supported or wanted. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit 847e6563aa8c6e335397b821b215ac4313580638 Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:23 2018 +1100 powerpc/powernv: Reference iommu_table while it is linked to a group The iommu_table pointer stored in iommu_table_group may get stale by accident, this adds referencing and removes a redundant comment about this. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson Signed-off-by: Michael Ellerman commit 5eada8a3f087df74af1c2797770a3e2249374fe1 Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:22 2018 +1100 powerpc/iommu_api: Move IOMMU groups setup to a single place Registering new IOMMU groups and adding devices to them are separated in code and the latter is dug in the DMA setup code which it does not really belong to. This moved IOMMU groups setup to a separate helper which registers a group and adds devices as before. This does not make a difference as IOMMU groups are not used anyway; the only dependency here is that iommu_add_device() requires a valid pointer to an iommu_table (set by set_iommu_table_base()). To keep the old behaviour, this does not add new IOMMU groups for PEs with no DMA weight and also skips NVLink bridges which do not have pci_controller_ops::setup_bridge (the normal way of adding PEs). Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson Signed-off-by: Michael Ellerman commit c4e9d3c1e65aac3f65995e9cb1cede7330c594dc Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:21 2018 +1100 powerpc/powernv/pseries: Rework device adding to IOMMU groups The powernv platform registers IOMMU groups and adds devices to them from the pci_controller_ops::setup_bridge() hook except one case when virtual functions (SRIOV VFs) are added from a bus notifier. The pseries platform registers IOMMU groups from the pci_controller_ops::dma_bus_setup() hook and adds devices from the pci_controller_ops::dma_dev_setup() hook. The very same bus notifier used for powernv does not add devices for pseries though as __of_scan_bus() adds devices first, then it does the bus/dev DMA setup. Both platforms use iommu_add_device() which takes a device and expects it to have a valid IOMMU table struct with an iommu_table_group pointer which in turn points the iommu_group struct (which represents an IOMMU group). Although the helper seems easy to use, it relies on some pre-existing device configuration and associated data structures which it does not really need. This simplifies iommu_add_device() to take the table_group pointer directly. Pseries already has a table_group pointer handy and the bus notified is not used anyway. For powernv, this copies the existing bus notifier, makes it work for powernv only which means an easy way of getting to the table_group pointer. This was tested on VFs but should also support physical PCI hotplug. Since iommu_add_device() receives the table_group pointer directly, pseries does not do TCE cache invalidation (the hypervisor does) nor allow multiple groups per a VFIO container (in other words sharing an IOMMU table between partitionable endpoints), this removes iommu_table_group_link from pseries. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson Signed-off-by: Michael Ellerman commit c409c6316166993163e29312aeaaf1c0c300a04a Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:20 2018 +1100 powerpc/pseries: Remove IOMMU API support for non-LPAR systems The pci_dma_bus_setup_pSeries and pci_dma_dev_setup_pSeries hooks are registered for the pseries platform which does not have FW_FEATURE_LPAR; these would be pre-powernv platforms which we never supported PCI pass through for anyway so remove it. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson Signed-off-by: Michael Ellerman commit 3be2df00e299821ad255498ac4411906a8d59cfa Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:19 2018 +1100 powerpc/pseries/npu: Enable platform support We already changed NPU API for GPUs to not to call OPAL and the remaining bit is initializing NPU structures. This searches for POWER9 NVLinks attached to any device on a PHB and initializes an NPU structure if any found. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit 68c0449ea16d775e762b532afddb4d6a5f161877 Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:18 2018 +1100 powerpc/pseries/iommu: Use memory@ nodes in max RAM address calculation We might have memory@ nodes with "linux,usable-memory" set to zero (for example, to replicate powernv's behaviour for GPU coherent memory) which means that the memory needs an extra initialization but since it can be used afterwards, the pseries platform will try mapping it for DMA so the DMA window needs to cover those memory regions too; if the window cannot cover new memory regions, the memory onlining fails. This walks through the memory nodes to find the highest RAM address to let a huge DMA window cover that too in case this memory gets onlined later. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit 0e759bd75285e96fbb4013d1303b08fdb8ba58e1 Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:17 2018 +1100 powerpc/powernv/npu: Move OPAL calls away from context manipulation When introduced, the NPU context init/destroy helpers called OPAL which enabled/disabled PID (a userspace memory context ID) filtering in an NPU per a GPU; this was a requirement for P9 DD1.0. However newer chip revision added a PID wildcard support so there is no more need to call OPAL every time a new context is initialized. Also, since the PID wildcard support was added, skiboot does not clear wildcard entries in the NPU so these remain in the hardware till the system reboot. This moves LPID and wildcard programming to the PE setup code which executes once during the booting process so NPU2 context init/destroy won't need to do additional configuration. This replaces the check for FW_FEATURE_OPAL with a check for npu!=NULL as this is the way to tell if the NPU support is present and configured. This moves pnv_npu2_init() declaration as pseries should be able to use it. This keeps pnv_npu2_map_lpar() in powernv as pseries is not allowed to call that. This exports pnv_npu2_map_lpar_dev() as following patches will use it from the VFIO driver. While at it, replace redundant list_for_each_entry_safe() with a simpler list_for_each_entry(). Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit 46a1449d9e39478a35d35d9d9025776f6cee24fb Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:16 2018 +1100 powerpc/powernv: Move npu struct from pnv_phb to pci_controller The powernv PCI code stores NPU data in the pnv_phb struct. The latter is referenced by pci_controller::private_data. We are going to have NPU2 support in the pseries platform as well but it does not store any private_data in in the pci_controller struct; and even if it did, it would be a different data structure. This makes npu a pointer and stores it one level higher in the pci_controller struct. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit c10c21efa4bccab486c2e6a047c13dfa6cf7426c Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:15 2018 +1100 powerpc/vfio/iommu/kvm: Do not pin device memory This new memory does not have page structs as it is not plugged to the host so gup() will fail anyway. This adds 2 helpers: - mm_iommu_newdev() to preregister the "memory device" memory so the rest of API can still be used; - mm_iommu_is_devmem() to know if the physical address is one of thise new regions which we must avoid unpinning of. This adds @mm to tce_page_is_contained() and iommu_tce_xchg() to test if the memory is device memory to avoid pfn_to_page(). This adds a check for device memory in mm_iommu_ua_mark_dirty_rm() which does delayed pages dirtying. Signed-off-by: Alexey Kardashevskiy Reviewed-by: Paul Mackerras Signed-off-by: Michael Ellerman commit e0bf78b0f9594d47dfa7e364a9071442fc1d9445 Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:14 2018 +1100 powerpc/mm/iommu/vfio_spapr_tce: Change mm_iommu_get to reference a region Normally mm_iommu_get() should add a reference and mm_iommu_put() should remove it. However historically mm_iommu_find() does the referencing and mm_iommu_get() is doing allocation and referencing. We are going to add another helper to preregister device memory so instead of having mm_iommu_new() (which pre-registers the normal memory and references the region), we need separate helpers for pre-registering and referencing. This renames: - mm_iommu_get to mm_iommu_new; - mm_iommu_find to mm_iommu_get. This changes mm_iommu_get() to reference the region so the name now reflects what it does. This removes the check for exact match from mm_iommu_new() as we want it to fail on existing regions; mm_iommu_get() should be used instead. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson Signed-off-by: Michael Ellerman commit ab7032e793f9ad799ca2692046fba5baed6d2a86 Author: Alexey Kardashevskiy Date: Wed Dec 19 19:52:13 2018 +1100 powerpc/ioda/npu: Call skiboot's hot reset hook when disabling NPU2 The skiboot firmware has a hot reset handler which fences the NVIDIA V100 GPU RAM on Witherspoons and makes accesses no-op instead of throwing HMIs: https://github.com/open-power/skiboot/commit/fca2b2b839a67 Now we are going to pass V100 via VFIO which most certainly involves KVM guests which are often terminated without getting a chance to offline GPU RAM so we end up with a running machine with misconfigured memory. Accessing this memory produces hardware management interrupts (HMI) which bring the host down. To suppress HMIs, this wires up this hot reset hook to vfio_pci_disable() via pci_disable_device() which switches NPU2 to a safe mode and prevents HMIs. Signed-off-by: Alexey Kardashevskiy Acked-by: Alistair Popple Reviewed-by: David Gibson Signed-off-by: Michael Ellerman commit ffca395b11c4a5a6df6d6345f794b0e3d578e2d0 Author: Christophe Leroy Date: Wed Nov 28 09:27:04 2018 +0000 powerpc/mm: Fix reporting of kernel execute faults on the 8xx On the 8xx, no-execute is set via PPP bits in the PTE. Therefore a no-exec fault generates DSISR_PROTFAULT error bits, not DSISR_NOEXEC_OR_G. This patch adds DSISR_PROTFAULT in the test mask. Fixes: d3ca587404b3 ("powerpc/mm: Fix reporting of kernel execute faults") Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 623d154305c06c83924b8fd2afbfdeba3b396fb7 Author: Jason Gunthorpe Date: Thu Dec 20 16:39:26 2018 -0700 IB/mlx5: Fix wrong error unwind The destroy_workqueue on error unwind is missing, and the code jumps to the wrong exit label. Fixes: 813e90b1aeaa ("IB/mlx5: Add advise_mr() support") Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e7c4d8e6045171896d763c551b90c672fb5ab42b Author: YueHaibing Date: Fri Dec 21 02:05:57 2018 +0000 IB/mlx4: Remove set but not used variable 'pd' Fixes gcc '-Wunused-but-set-variable' warning: drivers/infiniband/hw/mlx4/qp.c: In function '_mlx4_ib_destroy_qp': drivers/infiniband/hw/mlx4/qp.c:1612:22: warning: variable 'pd' set but not used [-Wunused-but-set-variable] Fixes: e00b64f7c54c ("RDMA: Cleanup undesired pd->uobject usage") Signed-off-by: YueHaibing Signed-off-by: Jason Gunthorpe commit ab66dcc76d6ab8fae9d69d149ae38c42605e7fc5 Author: Firoz Khan Date: Mon Dec 17 16:10:36 2018 +0530 powerpc: generate uapi header and system call table files System call table generation script must be run to gener- ate unistd_32/64.h and syscall_table_32/64/c32/spu.h files. This patch will have changes which will invokes the script. This patch will generate unistd_32/64.h and syscall_table- _32/64/c32/spu.h files by the syscall table generation script invoked by parisc/Makefile and the generated files against the removed files must be identical. The generated uapi header file will be included in uapi/- asm/unistd.h and generated system call table header file will be included by kernel/systbl.S file. Signed-off-by: Firoz Khan Signed-off-by: Michael Ellerman commit aff8503932004d10eec4d550ec3527117fe18724 Author: Firoz Khan Date: Mon Dec 17 16:10:34 2018 +0530 powerpc: add system call table generation support The system call tables are in different format in all architecture and it will be difficult to manually add or modify the system calls in the respective files. To make it easy by keeping a script and which will generate the uapi header and syscall table file. This change will also help to unify the implementation across all architectures. The system call table generation script is added in syscalls directory which contain the script to generate both uapi header file and system call table files. The syscall.tbl file will be the input for the scripts. syscall.tbl contains the list of available system calls along with system call number and corresponding entry point. Add a new system call in this architecture will be possible by adding new entry in the syscall.tbl file. Adding a new table entry consisting of: - System call number. - ABI. - System call name. - Entry point name. - Compat entry name, if required. syscallhdr.sh and syscalltbl.sh will generate uapi header- unistd_32/64.h and syscall_table_32/64/c32/spu.h files respectively. File syscall_table_32/64/c32/spu.h is incl- uded by syscall.S - the real system call table. Both *.sh files will parse the content syscall.tbl to generate the header and table files. ARM, s390 and x86 architecuture does have similar support. I leverage their implementation to come up with a generic solution. Signed-off-by: Firoz Khan Signed-off-by: Michael Ellerman commit fbf508da744053ff289777d6dd6e11ca8682be49 Author: Firoz Khan Date: Mon Dec 17 16:10:35 2018 +0530 powerpc: split compat syscall table out from native table PowerPC uses a syscall table with native and compat calls interleaved, which is a slightly simpler way to define two matching tables. As we move to having the tables generated, that advantage is no longer important, but the interleaved table gets in the way of using the same scripts as on the other archit- ectures. Split out a new compat_sys_call_table symbol that contains all the compat calls, and leave the main table for the nat- ive calls, to more closely match the method we use every- where else. Suggested-by: Arnd Bergmann Signed-off-by: Firoz Khan Signed-off-by: Michael Ellerman commit a11b763d617070a88267e2102e975b2cfc99b5a7 Author: Firoz Khan Date: Mon Dec 17 16:10:33 2018 +0530 powerpc: move macro definition from asm/systbl.h Move the macro definition for compat_sys_sigsuspend from asm/systbl.h to the file which it is getting included. One of the patch in this patch series is generating uapi header and syscall table files. In order to come up with a common implimentation across all architecture, we need to do this change. This change will simplify the implementation of system call table generation script and help to come up a common implementation across all architecture. Signed-off-by: Firoz Khan Signed-off-by: Michael Ellerman commit 8a19eeeab66dfdd7c67bc8e3048ac0064e8943d7 Author: Firoz Khan Date: Mon Dec 17 16:10:32 2018 +0530 powerpc: add __NR_syscalls along with NR_syscalls NR_syscalls macro holds the number of system call exist in powerpc architecture. We have to change the value of NR_syscalls, if we add or delete a system call. One of the patch in this patch series has a script which will generate a uapi header based on syscall.tbl file. The syscall.tbl file contains the number of system call information. So we have two option to update NR_syscalls value. 1. Update NR_syscalls in asm/unistd.h manually by count- ing the no.of system calls. No need to update NR_sys- calls until we either add a new system call or delete existing system call. 2. We can keep this feature in above mentioned script, that will count the number of syscalls and keep it in a generated file. In this case we don't need to expli- citly update NR_syscalls in asm/unistd.h file. The 2nd option will be the recommended one. For that, I added the __NR_syscalls macro in uapi/asm/unistd.h along with NR_syscalls asm/unistd.h. The macro __NR_syscalls also added for making the name convention same across all architecture. While __NR_syscalls isn't strictly part of the uapi, having it as part of the generated header to simplifies the implementation. We also need to enclose this macro with #ifdef __KERNEL__ to avoid side effects. Signed-off-by: Firoz Khan Signed-off-by: Michael Ellerman commit 2cd4bd192ee94848695c1c052d87913260e10f36 Author: Ram Pai Date: Thu Dec 20 12:03:30 2018 -0800 powerpc/pkeys: Fix handling of pkey state across fork() Protection key tracking information is not copied over to the mm_struct of the child during fork(). This can cause the child to erroneously allocate keys that were already allocated. Any allocated execute-only key is lost aswell. Add code; called by dup_mmap(), to copy the pkey state from parent to child explicitly. This problem was originally found by Dave Hansen on x86, which turns out to be a problem on powerpc aswell. Fixes: cf43d3b26452 ("powerpc: Enable pkey subsystem") Cc: stable@vger.kernel.org # v4.16+ Reviewed-by: Thiago Jung Bauermann Signed-off-by: Ram Pai Signed-off-by: Michael Ellerman commit 2f07229f02d4c55affccd11a61af4fd4b94dc436 Author: Greg Kurz Date: Tue Dec 11 18:58:21 2018 +0100 ocxl: Fix endiannes bug in read_afu_name() The AFU Descriptor Template in the PCI config space has a Name Space field which is a 24 Byte ASCII character string of descriptive name space for the AFU. The OCXL driver read the string four characters at a time with pci_read_config_dword(). This optimization is valid on a little-endian system since this is PCI, but a big-endian system ends up with each subset of four characters in reverse order. This could be fixed by switching to read characters one by one. Another option is to swap the bytes if we're big-endian. Go for the latter with le32_to_cpu(). Cc: stable@vger.kernel.org # v4.16 Signed-off-by: Greg Kurz Acked-by: Frederic Barrat Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit 34642d70ac7e5609e31c36edbf3b19e0d8833be7 Author: Breno Leitao Date: Mon Nov 26 18:12:01 2018 -0200 selftests/powerpc: Add checks for transactional sigreturn This is a new test case that creates a signal and starts a suspended transaction inside the signal handler. It returns from the signal handler with the CPU at suspended state, but without setting user context MSR Transaction State (TS) field. The kernel signal handler code should be able to handle this discrepancy instead of crashing. This code could be compiled and used to test 32 and 64-bits signal handlers. Signed-off-by: Breno Leitao Signed-off-by: Gustavo Romero Signed-off-by: Michael Ellerman commit 6f5b9f018f4c7686fd944d920209d1382d320e4e Author: Breno Leitao Date: Mon Nov 26 18:12:00 2018 -0200 powerpc/tm: Unset MSR[TS] if not recheckpointing There is a TM Bad Thing bug that can be caused when you return from a signal context in a suspended transaction but with ucontext MSR[TS] unset. This forces regs->msr[TS] to be set at syscall entrance (since the CPU state is transactional). It also calls treclaim() to flush the transaction state, which is done based on the live (mfmsr) MSR state. Since user context MSR[TS] is not set, then restore_tm_sigcontexts() is not called, thus, not executing recheckpoint, keeping the CPU state as not transactional. When calling rfid, SRR1 will have MSR[TS] set, but the CPU state is non transactional, causing the TM Bad Thing with the following stack: [ 33.862316] Bad kernel stack pointer 3fffd9dce3e0 at c00000000000c47c cpu 0x8: Vector: 700 (Program Check) at [c00000003ff7fd40] pc: c00000000000c47c: fast_exception_return+0xac/0xb4 lr: 00003fff865f442c sp: 3fffd9dce3e0 msr: 8000000102a03031 current = 0xc00000041f68b700 paca = 0xc00000000fb84800 softe: 0 irq_happened: 0x01 pid = 1721, comm = tm-signal-sigre Linux version 4.9.0-3-powerpc64le (debian-kernel@lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18) ) #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) WARNING: exception is not recoverable, can't continue The same problem happens on 32-bits signal handler, and the fix is very similar, if tm_recheckpoint() is not executed, then regs->msr[TS] should be zeroed. This patch also fixes a sparse warning related to lack of indentation when CONFIG_PPC_TRANSACTIONAL_MEM is set. Fixes: 2b0a576d15e0e ("powerpc: Add new transactional memory state to the signal context") CC: Stable # 3.10+ Signed-off-by: Breno Leitao Tested-by: Michal Suchánek Signed-off-by: Michael Ellerman commit 11be39584a2e283d2b2bc45f3202519aef703b7c Author: Breno Leitao Date: Mon Nov 26 18:11:59 2018 -0200 powerpc/tm: Print scratch value Usually a TM Bad Thing exception is raised due to three different problems. a) touching SPRs in an active transaction; b) using TM instruction with the facility disabled and c) setting a wrong MSR/SRR1 at RFID. The two initial cases are easy to identify by looking at the instructions. The latter case is harder, because the MSR is masked after RFID, so, it is very useful to look at the previous MSR (SRR1) before RFID as also the current and masked MSR. Since MSR is saved at paca just before RFID, this patch prints it if a TM Bad thing happen, helping to understand what is the invalid TM transition that is causing the exception. Signed-off-by: Breno Leitao Signed-off-by: Michael Ellerman commit 63a0d6b03b8e6fdd8c8ce5eec0ac04ef8e67d63f Author: Breno Leitao Date: Mon Nov 26 18:11:58 2018 -0200 powerpc/tm: Save MSR to PACA before RFID As other exit points, move SRR1 (MSR) into paca->tm_scratch, so, if there is a TM Bad Thing in RFID, it is easy to understand what was the SRR1 value being used. Signed-off-by: Breno Leitao Signed-off-by: Michael Ellerman commit e1c3743e1a20647c53b719dbf28b48f45d23f2cd Author: Breno Leitao Date: Wed Nov 21 17:21:09 2018 -0200 powerpc/tm: Set MSR[TS] just prior to recheckpoint On a signal handler return, the user could set a context with MSR[TS] bits set, and these bits would be copied to task regs->msr. At restore_tm_sigcontexts(), after current task regs->msr[TS] bits are set, several __get_user() are called and then a recheckpoint is executed. This is a problem since a page fault (in kernel space) could happen when calling __get_user(). If it happens, the process MSR[TS] bits were already set, but recheckpoint was not executed, and SPRs are still invalid. The page fault can cause the current process to be de-scheduled, with MSR[TS] active and without tm_recheckpoint() being called. More importantly, without TEXASR[FS] bit set also. Since TEXASR might not have the FS bit set, and when the process is scheduled back, it will try to reclaim, which will be aborted because of the CPU is not in the suspended state, and, then, recheckpoint. This recheckpoint will restore thread->texasr into TEXASR SPR, which might be zero, hitting a BUG_ON(). kernel BUG at /build/linux-sf3Co9/linux-4.9.30/arch/powerpc/kernel/tm.S:434! cpu 0xb: Vector: 700 (Program Check) at [c00000041f1576d0] pc: c000000000054550: restore_gprs+0xb0/0x180 lr: 0000000000000000 sp: c00000041f157950 msr: 8000000100021033 current = 0xc00000041f143000 paca = 0xc00000000fb86300 softe: 0 irq_happened: 0x01 pid = 1021, comm = kworker/11:1 kernel BUG at /build/linux-sf3Co9/linux-4.9.30/arch/powerpc/kernel/tm.S:434! Linux version 4.9.0-3-powerpc64le (debian-kernel@lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18) ) #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) enter ? for help [c00000041f157b30] c00000000001bc3c tm_recheckpoint.part.11+0x6c/0xa0 [c00000041f157b70] c00000000001d184 __switch_to+0x1e4/0x4c0 [c00000041f157bd0] c00000000082eeb8 __schedule+0x2f8/0x990 [c00000041f157cb0] c00000000082f598 schedule+0x48/0xc0 [c00000041f157ce0] c0000000000f0d28 worker_thread+0x148/0x610 [c00000041f157d80] c0000000000f96b0 kthread+0x120/0x140 [c00000041f157e30] c00000000000c0e0 ret_from_kernel_thread+0x5c/0x7c This patch simply delays the MSR[TS] set, so, if there is any page fault in the __get_user() section, it does not have regs->msr[TS] set, since the TM structures are still invalid, thus avoiding doing TM operations for in-kernel exceptions and possible process reschedule. With this patch, the MSR[TS] will only be set just before recheckpointing and setting TEXASR[FS] = 1, thus avoiding an interrupt with TM registers in invalid state. Other than that, if CONFIG_PREEMPT is set, there might be a preemption just after setting MSR[TS] and before tm_recheckpoint(), thus, this block must be atomic from a preemption perspective, thus, calling preempt_disable/enable() on this code. It is not possible to move tm_recheckpoint to happen earlier, because it is required to get the checkpointed registers from userspace, with __get_user(), thus, the only way to avoid this undesired behavior is delaying the MSR[TS] set. The 32-bits signal handler seems to be safe this current issue, but, it might be exposed to the preemption issue, thus, disabling preemption in this chunk of code. Changes from v2: * Run the critical section with preempt_disable. Fixes: 87b4e5393af7 ("powerpc/tm: Fix return of active 64bit signals") Cc: stable@vger.kernel.org (v3.9+) Signed-off-by: Breno Leitao Signed-off-by: Michael Ellerman commit d53ec8af56d5163f8a42e961ece3aeb5c560e79d Author: Steve Wise Date: Thu Dec 20 14:00:11 2018 -0800 RDMA/iwcm: Don't copy past the end of dev_name() string We now use dev_name(&ib_device->dev) instead of ib_device->name in iwpm messages. The name field in struct device is a const char *, where as ib_device->name is a char array of size IB_DEVICE_NAME_MAX, and it is pre-initialized to zeros. Since iw_cm_map() was using memcpy() to copy in the device name, and copying IWPM_DEVNAME_SIZE bytes, it ends up copying past the end of the source device name string and copying random bytes. This results in iwpmd failing the REGISTER_PID request from iwcm. Thus port mapping is broken. Validate the device and if names, and use strncpy() to inialize the entire message field. Fixes: 896de0090a85 ("RDMA/core: Use dev_name instead of ibdev->name") Cc: stable@vger.kernel.org Signed-off-by: Steve Wise Signed-off-by: Jason Gunthorpe commit ae59a7e1945bc2245bbb587071ca737e00daf443 Author: Suraj Jitindar Singh Date: Fri Dec 21 14:28:43 2018 +1100 KVM: PPC: Book3S HV: Keep rc bits in shadow pgtable in sync with host The rc bits contained in ptes are used to track whether a page has been accessed and whether it is dirty. The accessed bit is used to age a page and the dirty bit to track whether a page is dirty or not. Now that we support nested guests there are three ptes which track the state of the same page: - The partition-scoped page table in the L1 guest, mapping L2->L1 address - The partition-scoped page table in the host for the L1 guest, mapping L1->L0 address - The shadow partition-scoped page table for the nested guest in the host, mapping L2->L0 address The idea is to attempt to keep the rc state of these three ptes in sync, both when setting and when clearing rc bits. When setting the bits we achieve consistency by: - Initially setting the bits in the shadow page table as the 'and' of the other two. - When updating in software the rc bits in the shadow page table we ensure the state is consistent with the other two locations first, and update these before reflecting the change into the shadow page table. i.e. only set the bits in the L2->L0 pte if also set in both the L2->L1 and the L1->L0 pte. When clearing the bits we achieve consistency by: - The rc bits in the shadow page table are only cleared when discarding a pte, and we don't need to record this as if either bit is set then it must also be set in the pte mapping L1->L0. - When L1 clears an rc bit in the L2->L1 mapping it __should__ issue a tlbie instruction - This means we will discard the pte from the shadow page table meaning the mapping will have to be setup again. - When setup the pte again in the shadow page table we will ensure consistency with the L2->L1 pte. - When the host clears an rc bit in the L1->L0 mapping we need to also clear the bit in any ptes in the shadow page table which map the same gfn so we will be notified if a nested guest accesses the page. This case is what this patch specifically concerns. - We can search the nest_rmap list for that given gfn and clear the same bit from all corresponding ptes in shadow page tables. - If a nested guest causes either of the rc bits to be set by software in future then we will update the L1->L0 pte and maintain consistency. With the process outlined above we aim to maintain consistency of the 3 pte locations where we track rc for a given guest page. Signed-off-by: Suraj Jitindar Singh Signed-off-by: Paul Mackerras commit 90165d3da0760a0353518740ac307f0d81c4e400 Author: Suraj Jitindar Singh Date: Fri Dec 21 14:28:42 2018 +1100 KVM: PPC: Book3S HV: Introduce kvmhv_update_nest_rmap_rc_list() Introduce a function kvmhv_update_nest_rmap_rc_list() which for a given nest_rmap list will traverse it, find the corresponding pte in the shadow page tables, and if it still maps the same host page update the rc bits accordingly. Signed-off-by: Suraj Jitindar Singh Signed-off-by: Paul Mackerras commit 8b23eee4e55a32a2b51a180dfd27a8d214acc7a1 Author: Suraj Jitindar Singh Date: Fri Dec 21 14:28:41 2018 +1100 KVM: PPC: Book3S HV: Apply combination of host and l1 pte rc for nested guest The shadow page table contains ptes for translations from nested guest address to host address. Currently when creating these ptes we take the rc bits from the pte for the L1 guest address to host address translation. This is incorrect as we must also factor in the rc bits from the pte for the nested guest address to L1 guest address translation (as contained in the L1 guest partition table for the nested guest). By not calculating these bits correctly L1 may not have been correctly notified when it needed to update its rc bits in the partition table it maintains for its nested guest. Modify the code so that the rc bits in the resultant pte for the L2->L0 translation are the 'and' of the rc bits in the L2->L1 pte and the L1->L0 pte, also accounting for whether this was a write access when setting the dirty bit. Signed-off-by: Suraj Jitindar Singh Signed-off-by: Paul Mackerras commit 8400f8740651c1a3081c30b46004451c448f4d5f Author: Suraj Jitindar Singh Date: Fri Dec 21 14:28:40 2018 +1100 KVM: PPC: Book3S HV: Align gfn to L1 page size when inserting nest-rmap entry Nested rmap entries are used to store the translation from L1 gpa to L2 gpa when entries are inserted into the shadow (nested) page tables. This rmap list is located by indexing the rmap array in the memslot by L1 gfn. When we come to search for these entries we only know the L1 page size (which could be PAGE_SIZE, 2M or a 1G page) and so can only select a gfn aligned to that size. This means that when we insert the entry, so we can find it later, we need to align the gfn we use to select the rmap list in which to insert the entry to L1 page size as well. By not doing this we were missing nested rmap entries when modifying L1 ptes which were for a page also passed through to an L2 guest. Signed-off-by: Suraj Jitindar Singh Signed-off-by: Paul Mackerras commit bec6e03b5ea5618479548bce1da4e16088e25edc Author: Suraj Jitindar Singh Date: Fri Dec 21 14:28:39 2018 +1100 KVM: PPC: Book3S HV: Hold kvm->mmu_lock across updating nested pte rc bits We already hold the kvm->mmu_lock spin lock across updating the rc bits in the pte for the L1 guest. Continue to hold the lock across updating the rc bits in the pte for the nested guest as well to prevent invalidations from occurring. Signed-off-by: Suraj Jitindar Singh Signed-off-by: Paul Mackerras commit fa2323325e8b0c61ded1e3d2c6f12f3aa43c4e30 Author: Peter Oskolkov Date: Thu Dec 20 16:41:52 2018 -0800 selftests: net: reuseport_addr_any: silence clang warning Clang does not recognize that calls to error() terminate execution and complains about uninitialized variable use that happens after calls to error(). This noop patchset fixes this. Signed-off-by: Peter Oskolkov Signed-off-by: David S. Miller commit a02e8964eaf9271a8a5fcc0c55bd13f933bafc56 Author: Willem de Bruijn Date: Thu Dec 20 17:14:54 2018 -0500 virtio-net: ethtool configurable LRO Virtio-net devices negotiate LRO support with the host. Display the initially negotiated state with ethtool -k. Also allow configuring it with ethtool -K, reusing the existing virtnet_set_guest_offloads helper that configures LRO for XDP. This is conditional on VIRTIO_NET_F_CTRL_GUEST_OFFLOADS. Virtio-net negotiates TSO4 and TSO6 separately, but ethtool does not distinguish between the two. Display LRO as on only if any offload is active. RTNL is held while calling virtnet_set_features, same as on the path from virtnet_xdp_set. Changes v1 -> v2 - allow ethtool config (-K) only if VIRTIO_NET_F_CTRL_GUEST_OFFLOADS - show LRO as enabled if any LRO variant is enabled - do not allow configuration while XDP is active - differentiate current features from the capable set, to restore on XDP down only those features that were active on XDP up - move test out of VIRTIO_NET_F_CSUM/TSO branch, which is tx only Signed-off-by: Willem de Bruijn Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit c3e533692527046fb55020e7fac8c4272644ba45 Merge: 339bbff2d6e00 8527f9df04a8b Author: David S. Miller Date: Thu Dec 20 18:20:26 2018 -0800 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: 1) Support for destination MAC in ipset, from Stefano Brivio. 2) Disallow all-zeroes MAC address in ipset, also from Stefano. 3) Add IPSET_CMD_GET_BYNAME and IPSET_CMD_GET_BYINDEX commands, introduce protocol version number 7, from Jozsef Kadlecsik. A follow up patch to fix ip_set_byindex() is also included in this batch. 4) Honor CTA_MARK_MASK from ctnetlink, from Andreas Jaggi. 5) Statify nf_flow_table_iterate(), from Taehee Yoo. 6) Use nf_flow_table_iterate() to simplify garbage collection in nf_flow_table logic, also from Taehee Yoo. 7) Don't use _bh variants of call_rcu(), rcu_barrier() and synchronize_rcu_bh() in Netfilter, from Paul E. McKenney. 8) Remove NFC_* cache definition from the old caching infrastructure. 9) Remove layer 4 port rover in NAT helpers, use random port instead, from Florian Westphal. 10) Use strscpy() in ipset, from Qian Cai. 11) Remove NF_NAT_RANGE_PROTO_RANDOM_FULLY branch now that random port is allocated by default, from Xiaozhou Liu. 12) Ignore NF_NAT_RANGE_PROTO_RANDOM too, from Florian Westphal. 13) Limit port allocation selection routine in NAT to avoid softlockup splats when most ports are in use, from Florian. 14) Remove unused parameters in nf_ct_l4proto_unregister_sysctl() from Yafang Shao. 15) Direct call to nf_nat_l4proto_unique_tuple() instead of indirection, from Florian Westphal. 16) Several patches to remove all layer 4 NAT indirections, remove nf_nat_l4proto struct, from Florian Westphal. 17) Fix RTP/RTCP source port translation when SNAT is in place, from Alin Nastac. 18) Selective rule dump per chain, from Phil Sutter. 19) Revisit CLUSTERIP target, this includes a deadlock fix from netns path, sleep in atomic, remove bogus WARN_ON_ONCE() and disallow mismatching IP address and MAC address. Patchset from Taehee Yoo. 20) Update UDP timeout to stream after 2 seconds, from Florian. 21) Shrink UDP established timeout to 120 seconds like TCP timewait. 22) Sysctl knobs to set GRE timeouts, from Yafang Shao. 23) Move seq_print_acct() to conntrack core file, from Florian. 24) Add enum for conntrack sysctl knobs, also from Florian. 25) Place nf_conntrack_acct, nf_conntrack_helper, nf_conntrack_events and nf_conntrack_timestamp knobs in the core, from Florian Westphal. As a side effect, shrink netns_ct structure by removing obsolete sysctl anchors, also from Florian. ==================== Signed-off-by: David S. Miller commit 339bbff2d6e005a5586adeffc3d69a0eea50a764 Merge: e770454fabde2 1cf4a0ccc506b Author: David S. Miller Date: Thu Dec 20 17:31:36 2018 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2018-12-21 The following pull-request contains BPF updates for your *net-next* tree. There is a merge conflict in test_verifier.c. Result looks as follows: [...] }, { "calls: cross frame pruning", .insns = { [...] .prog_type = BPF_PROG_TYPE_SOCKET_FILTER, .errstr_unpriv = "function calls to other bpf functions are allowed for root only", .result_unpriv = REJECT, .errstr = "!read_ok", .result = REJECT, }, { "jset: functional", .insns = { [...] { "jset: unknown const compare not taken", .insns = { BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, 0, 0, BPF_FUNC_get_prandom_u32), BPF_JMP_IMM(BPF_JSET, BPF_REG_0, 1, 1), BPF_LDX_MEM(BPF_B, BPF_REG_8, BPF_REG_9, 0), BPF_EXIT_INSN(), }, .prog_type = BPF_PROG_TYPE_SOCKET_FILTER, .errstr_unpriv = "!read_ok", .result_unpriv = REJECT, .errstr = "!read_ok", .result = REJECT, }, [...] { "jset: range", .insns = { [...] }, .prog_type = BPF_PROG_TYPE_SOCKET_FILTER, .result_unpriv = ACCEPT, .result = ACCEPT, }, The main changes are: 1) Various BTF related improvements in order to get line info working. Meaning, verifier will now annotate the corresponding BPF C code to the error log, from Martin and Yonghong. 2) Implement support for raw BPF tracepoints in modules, from Matt. 3) Add several improvements to verifier state logic, namely speeding up stacksafe check, optimizations for stack state equivalence test and safety checks for liveness analysis, from Alexei. 4) Teach verifier to make use of BPF_JSET instruction, add several test cases to kselftests and remove nfp specific JSET optimization now that verifier has awareness, from Jakub. 5) Improve BPF verifier's slot_type marking logic in order to allow more stack slot sharing, from Jiong. 6) Add sk_msg->size member for context access and add set of fixes and improvements to make sock_map with kTLS usable with openssl based applications, from John. 7) Several cleanups and documentation updates in bpftool as well as auto-mount of tracefs for "bpftool prog tracelog" command, from Quentin. 8) Include sub-program tags from now on in bpf_prog_info in order to have a reliable way for user space to get all tags of the program e.g. needed for kallsyms correlation, from Song. 9) Add BTF annotations for cgroup_local_storage BPF maps and implement bpf fs pretty print support, from Roman. 10) Fix bpftool in order to allow for cross-compilation, from Ivan. 11) Update of bpftool license to GPLv2-only + BSD-2-Clause in order to be compatible with libbfd and allow for Debian packaging, from Jakub. 12) Remove an obsolete prog->aux sanitation in dump and get rid of version check for prog load, from Daniel. 13) Fix a memory leak in libbpf's line info handling, from Prashant. 14) Fix cpumap's frame alignment for build_skb() so that skb_shared_info does not get unaligned, from Jesper. 15) Fix test_progs kselftest to work with older compilers which are less smart in optimizing (and thus throwing build error), from Stanislav. 16) Cleanup and simplify AF_XDP socket teardown, from Björn. 17) Fix sk lookup in BPF kselftest's test_sock_addr with regards to netns_id argument, from Andrey. ==================== Signed-off-by: David S. Miller commit da7903092b880b25971ca9103cb0b934a44ace2b Author: Gustavo A. R. Silva Date: Tue Nov 27 22:30:27 2018 -0600 scsi: isci: request: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that, in this particular case, a dash is added as a token in order to separate the "Fall through" annotation from the rest of the comment on the same line, which is what GCC is expecting to find. Signed-off-by: Gustavo A. R. Silva Acked-by: Artur Paszkiewicz Signed-off-by: Martin K. Petersen commit 87be32b3ad27d7696cdc4340644894ba4c7a89e5 Author: Gustavo A. R. Silva Date: Tue Nov 27 22:30:11 2018 -0600 scsi: isci: remote_node_context: mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that, in this particular case, a dash is added as a token in order to separate the "Fall through" annotations from the rest of the comment on the same line, which is what GCC is expecting to find. Signed-off-by: Gustavo A. R. Silva Acked-by: Artur Paszkiewicz Signed-off-by: Martin K. Petersen commit 4f09ac9d96ceea2a0532e17b614b9b2835041c17 Author: Gustavo A. R. Silva Date: Tue Nov 27 22:30:01 2018 -0600 scsi: isci: remote_device: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Notice that, in this particular case, a dash is added as a token in order to separate the "fall through" annotations from the rest of the comment on the same line, which is what GCC is expecting to find. Signed-off-by: Gustavo A. R. Silva Acked-by: Artur Paszkiewicz Signed-off-by: Martin K. Petersen commit 1aba50b880e1834a6f2f1cb0df23ccce3e84b8a8 Author: Gustavo A. R. Silva Date: Tue Nov 27 22:29:55 2018 -0600 scsi: isci: phy: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 703127 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Acked-by: Artur Paszkiewicz Signed-off-by: Martin K. Petersen commit c2332b004907229b19a5687004290464df7c3e9d Author: Fred Herard Date: Wed Nov 21 12:04:43 2018 -0500 scsi: iscsi: Capture iscsi debug messages using tracepoints This commit enhances iscsi initiator modules to capture iscsi debug messages using linux kernel tracepoint facility: https://www.kernel.org/doc/Documentation/trace/tracepoints.txt The following tracepoint events have been created under the iscsi tracepoint event group: iscsi_dbg_conn - to capture connection debug messages (libiscsi module) iscsi_dbg_session - to capture session debug messages (libiscsi module) iscsi_dbg_eh - to capture error handling debug messages (libiscsi module) iscsi_dbg_tcp - to capture iscsi tcp debug messages (libiscsi_tcp module) iscsi_dbg_sw_tcp - to capture iscsi sw tcp debug messages (iscsi_tcp module) iscsi_dbg_trans_session - to cpature iscsi transsport sess debug messages (scsi_transport_iscsi module) iscsi_dbg_trans_conn - to capture iscsi transport conn debug messages (scsi_transport_iscsi module) [mkp: typos] Signed-off-by: Fred Herard Reviewed-by: Rajan Shanmugavelu Reviewed-by: Lee Duncan Reviewed-by: Douglas Gilbert Signed-off-by: Martin K. Petersen commit e770454fabde2e0f8fb3e5039a2b6df8f128bc9b Merge: a6ae520defea9 cda261f421ba2 Author: David S. Miller Date: Thu Dec 20 17:01:17 2018 -0800 Merge branch 'expand-txtimestamp-selftest' Willem de Bruijn says: ==================== expand txtimestamp selftest Convert the existing txtimestamp test to run as part of kselftest and return a pass/fail. Also expand the variations of timestamping tested, including packet sockets, ipv6 raw and dgram and passing options using cmsg. These are enough changes to split across a few patches, even if all changes are only this one test. ==================== Signed-off-by: David S. Miller commit cda261f421ba2682e25f46beb229172706fc7fcd Author: Willem de Bruijn Date: Thu Dec 20 16:22:54 2018 -0500 selftests: add txtimestamp kselftest Run the transmit timestamp tests as part of kselftests. Add a txtimestamp.sh test script that runs most variants: ipv4/ipv6, tcp/udp/raw/raw_ipproto/pf_packet, data/nodata, setsockopt/cmsg. The script runs tests with netem delays. Refine txtimestamp.c to validate results. Take expected netem delays as input and compare against real timestamps. To run without dependencies, add a listener socket to be able to connect in the case of TCP. Add the timestamping directory to the kselftests Makefile. Build all the binaries. Only run verified txtimestamp.sh. Signed-off-by: Willem de Bruijn Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller commit b52354aa068ee362a58ebb92e8bd0d0e18008364 Author: Willem de Bruijn Date: Thu Dec 20 16:22:53 2018 -0500 selftests: expand txtimestamp with ipv6 dgram + raw and pf_packet Expand the transmit timestamp regression test with support for missing protocols: ipv6 datagram and raw and pf_packet. Also refine resolve_hostname to independently request AF_INET or AF_INET6 addresses. Else, ipv4 addresses may be returned as AF_INET6. Signed-off-by: Willem de Bruijn Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller commit 7085f47fcdc599cb387a472e4cd9def739954119 Author: Willem de Bruijn Date: Thu Dec 20 16:22:52 2018 -0500 selftests: expand txtimestamp with cmsg support Commit 3dd17e63f513 ("sock: accept SO_TIMESTAMPING flags in socket cmsg") added support for passing tx timestamping options per-call in sendmsg. Expand the txtimestamp test with support for this feature. Signed-off-by: Willem de Bruijn Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller commit a6ae520defea9986a422032eda7f0bdbb1368a18 Author: Peter Oskolkov Date: Thu Dec 20 10:51:49 2018 -0800 net: seg6.h: remove an unused #include A minor code cleanup. Signed-off-by: Peter Oskolkov Signed-off-by: David S. Miller commit 4c5765e4851008812488686619e8592783b28b33 Author: Gustavo A. R. Silva Date: Tue Nov 27 22:32:52 2018 -0600 scsi: myrb: Mark expected switch fall-throughs In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1465234 ("Missing break in switch") Addresses-Coverity-ID: 1465238 ("Missing break in switch") Addresses-Coverity-ID: 1465242 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen commit 7fb1b8ca8fa1ee34ffc328f17f78da68c7cc04e6 Author: Sam Protsenko Date: Thu Dec 20 20:29:20 2018 +0200 ppp: Move PFC decompression to PPP generic layer Extract "Protocol" field decompression code from transport protocols to PPP generic layer, where it actually belongs. As a consequence, this patch fixes incorrect place of PFC decompression in L2TP driver (when it's not PPPOX_BOUND) and also enables this decompression for other protocols, like PPPoE. Protocol field decompression also happens in PPP Multilink Protocol code and in PPP compression protocols implementations (bsd, deflate, mppe). It looks like there is no easy way to get rid of that, so it was decided to leave it as is, but provide those cases with appropriate comments instead. Changes in v2: - Fix the order of checking skb data room and proto decompression - Remove "inline" keyword from ppp_decompress_proto() - Don't split line before function name - Prefix ppp_decompress_proto() function with "__" - Add ppp_decompress_proto() function with skb data room checks - Add description for introduced functions - Fix comments (as per review on mailing list) Signed-off-by: Sam Protsenko Reviewed-by: Guillaume Nault Signed-off-by: David S. Miller commit c7a082e4242fd8cd21a441071e622f87c16bdacc Author: Qian Cai Date: Thu Dec 13 08:27:27 2018 -0500 scsi: megaraid: fix out-of-bound array accesses UBSAN reported those with MegaRAID SAS-3 3108, [ 77.467308] UBSAN: Undefined behaviour in drivers/scsi/megaraid/megaraid_sas_fp.c:117:32 [ 77.475402] index 255 is out of range for type 'MR_LD_SPAN_MAP [1]' [ 77.481677] CPU: 16 PID: 333 Comm: kworker/16:1 Not tainted 4.20.0-rc5+ #1 [ 77.488556] Hardware name: Huawei TaiShan 2280 /BC11SPCD, BIOS 1.50 06/01/2018 [ 77.495791] Workqueue: events work_for_cpu_fn [ 77.500154] Call trace: [ 77.502610] dump_backtrace+0x0/0x2c8 [ 77.506279] show_stack+0x24/0x30 [ 77.509604] dump_stack+0x118/0x19c [ 77.513098] ubsan_epilogue+0x14/0x60 [ 77.516765] __ubsan_handle_out_of_bounds+0xfc/0x13c [ 77.521767] mr_update_load_balance_params+0x150/0x158 [megaraid_sas] [ 77.528230] MR_ValidateMapInfo+0x2cc/0x10d0 [megaraid_sas] [ 77.533825] megasas_get_map_info+0x244/0x2f0 [megaraid_sas] [ 77.539505] megasas_init_adapter_fusion+0x9b0/0xf48 [megaraid_sas] [ 77.545794] megasas_init_fw+0x1ab4/0x3518 [megaraid_sas] [ 77.551212] megasas_probe_one+0x2c4/0xbe0 [megaraid_sas] [ 77.556614] local_pci_probe+0x7c/0xf0 [ 77.560365] work_for_cpu_fn+0x34/0x50 [ 77.564118] process_one_work+0x61c/0xf08 [ 77.568129] worker_thread+0x534/0xa70 [ 77.571882] kthread+0x1c8/0x1d0 [ 77.575114] ret_from_fork+0x10/0x1c [ 89.240332] UBSAN: Undefined behaviour in drivers/scsi/megaraid/megaraid_sas_fp.c:117:32 [ 89.248426] index 255 is out of range for type 'MR_LD_SPAN_MAP [1]' [ 89.254700] CPU: 16 PID: 95 Comm: kworker/u130:0 Not tainted 4.20.0-rc5+ #1 [ 89.261665] Hardware name: Huawei TaiShan 2280 /BC11SPCD, BIOS 1.50 06/01/2018 [ 89.268903] Workqueue: events_unbound async_run_entry_fn [ 89.274222] Call trace: [ 89.276680] dump_backtrace+0x0/0x2c8 [ 89.280348] show_stack+0x24/0x30 [ 89.283671] dump_stack+0x118/0x19c [ 89.287167] ubsan_epilogue+0x14/0x60 [ 89.290835] __ubsan_handle_out_of_bounds+0xfc/0x13c [ 89.295828] MR_LdRaidGet+0x50/0x58 [megaraid_sas] [ 89.300638] megasas_build_io_fusion+0xbb8/0xd90 [megaraid_sas] [ 89.306576] megasas_build_and_issue_cmd_fusion+0x138/0x460 [megaraid_sas] [ 89.313468] megasas_queue_command+0x398/0x3d0 [megaraid_sas] [ 89.319222] scsi_dispatch_cmd+0x1dc/0x8a8 [ 89.323321] scsi_request_fn+0x8e8/0xdd0 [ 89.327249] __blk_run_queue+0xc4/0x158 [ 89.331090] blk_execute_rq_nowait+0xf4/0x158 [ 89.335449] blk_execute_rq+0xdc/0x158 [ 89.339202] __scsi_execute+0x130/0x258 [ 89.343041] scsi_probe_and_add_lun+0x2fc/0x1488 [ 89.347661] __scsi_scan_target+0x1cc/0x8c8 [ 89.351848] scsi_scan_channel.part.3+0x8c/0xc0 [ 89.356382] scsi_scan_host_selected+0x130/0x1f0 [ 89.361002] do_scsi_scan_host+0xd8/0xf0 [ 89.364927] do_scan_async+0x9c/0x320 [ 89.368594] async_run_entry_fn+0x138/0x420 [ 89.372780] process_one_work+0x61c/0xf08 [ 89.376793] worker_thread+0x13c/0xa70 [ 89.380546] kthread+0x1c8/0x1d0 [ 89.383778] ret_from_fork+0x10/0x1c This is because when populating Driver Map using firmware raid map, all non-existing VDs set their ldTgtIdToLd to 0xff, so it can be skipped later. From drivers/scsi/megaraid/megaraid_sas_base.c , memset(instance->ld_ids, 0xff, MEGASAS_MAX_LD_IDS); From drivers/scsi/megaraid/megaraid_sas_fp.c , /* For non existing VDs, iterate to next VD*/ if (ld >= (MAX_LOGICAL_DRIVES_EXT - 1)) continue; However, there are a few places that failed to skip those non-existing VDs due to off-by-one errors. Then, those 0xff leaked into MR_LdRaidGet(0xff, map) and triggered the out-of-bound accesses. Fixes: 51087a8617fe ("megaraid_sas : Extended VD support") Signed-off-by: Qian Cai Acked-by: Sumit Saxena Signed-off-by: Martin K. Petersen commit a8cc10e232f1fc651b6465ee120e7ecec06dc2f7 Author: Gustavo A. R. Silva Date: Thu Dec 20 09:43:53 2018 -0600 scsi: mpt3sas: mpt3sas_scsih: Mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1475400 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Signed-off-by: Martin K. Petersen commit e69fbf31ca2cf6d6a2afedd0f8b30dcd10e76049 Merge: aa9d6e0f33aea fbbae71d374f2 Author: David S. Miller Date: Thu Dec 20 16:47:10 2018 -0800 Merge tag 'wireless-drivers-next-for-davem-2018-12-20' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for 4.21 Last set of patches for 4.21. mt76 is still in very active development and having some refactoring as well as new features. But also other drivers got few new features and fixes. Major changes: ath10k * add amsdu support for QCA6174 monitor mode * report tx rate using the new ieee80211_tx_rate_update() API * wcn3990 support is not experimental anymore iwlwifi * support for FW version 43 for 9000 and 22000 series brcmfmac * add support for CYW43012 SDIO chipset * add the raw 4354 PCIe device ID for unprogrammed Cypress boards mwifiex * add NL80211_STA_INFO_RX_BITRATE support mt76 * use the same firmware for mt76x2e and mt76x2u * mt76x0e survey support * more unification between mt76x2 and mt76x0 * mt76x0e AP mode support * mt76x0e DFS support * rework and fix tx status handling for mt76x0 and mt76x2 ==================== Signed-off-by: David S. Miller commit 7223d80912d8977219b09f1605483026d79e704b Author: YueHaibing Date: Thu Dec 20 02:43:44 2018 +0000 scsi: fcoe: remove set but not used variable 'port' Fixes gcc '-Wunused-but-set-variable' warning: drivers/scsi/fcoe/fcoe.c: In function 'fcoe_recv_frame': drivers/scsi/fcoe/fcoe.c:1672:20: warning: variable 'port' set but not used [-Wunused-but-set-variable] drivers/scsi/fcoe/fcoe.c: In function 'fcoe_device_notification': drivers/scsi/fcoe/fcoe.c:1861:20: warning: variable 'port' set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing Acked-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen commit aa9d6e0f33aea8a1879e7e53fe0e436943f9ce0c Author: Stephen Hemminger Date: Thu Dec 20 09:52:28 2018 -0800 linux/netlink.h: drop unnecessary extern prefix Don't need extern prefix before function prototypes. Checkpatch has complained about this for a couple of years. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller commit 7de333090a803a6678c3848d4eed1031bbc3dc95 Merge: 639c1b2625af6 676f4bb168ca8 Author: David S. Miller Date: Thu Dec 20 16:42:39 2018 -0800 Merge branch 'ipv4-Prevent-user-triggerable-warning' Ido Schimmel says: ==================== net: ipv4: Prevent user triggerable warning Patch #1 prevents a user triaggerable warning in the flow dissector by setting 'skb->dev' in skbs used for IPv4 output route get requests. Patch #2 adds a test case that triggers the warning without the first patch. I have audited all the RTM_GETROUTE handlers and could not find any other callpath where an skb is passed to the flow dissector with both 'skb->dev' and 'skb->sk' cleared. ==================== Signed-off-by: David S. Miller commit 676f4bb168ca855adb957ad7f470984d9391c320 Author: Ido Schimmel Date: Thu Dec 20 17:03:29 2018 +0000 selftests: rtnetlink: Add a test case for multipath route get Without previous patch a warning would be generated upon multipath route get when FIB multipath hash policy is to use a 5-tuple for multipath hash calculation. Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 21f9477537059344e4705719137f6695de93b662 Author: Ido Schimmel Date: Thu Dec 20 17:03:27 2018 +0000 net: ipv4: Set skb->dev for output route resolution When user requests to resolve an output route, the kernel synthesizes an skb where the relevant parameters (e.g., source address) are set. The skb is then passed to ip_route_output_key_hash_rcu() which might call into the flow dissector in case a multipath route was hit and a nexthop needs to be selected based on the multipath hash. Since both 'skb->dev' and 'skb->sk' are not set, a warning is triggered in the flow dissector [1]. The warning is there to prevent codepaths from silently falling back to the standard flow dissector instead of the BPF one. Therefore, instead of removing the warning, set 'skb->dev' to the loopback device, as its not used for anything but resolving the correct namespace. [1] WARNING: CPU: 1 PID: 24819 at net/core/flow_dissector.c:764 __skb_flow_dissect+0x314/0x16b0 ... RSP: 0018:ffffa0df41fdf650 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff8bcded232000 RCX: 0000000000000000 RDX: ffffa0df41fdf7e0 RSI: ffffffff98e415a0 RDI: ffff8bcded232000 RBP: ffffa0df41fdf760 R08: 0000000000000000 R09: 0000000000000000 R10: ffffa0df41fdf7e8 R11: ffff8bcdf27a3000 R12: ffffffff98e415a0 R13: ffffa0df41fdf7e0 R14: ffffffff98dd2980 R15: ffffa0df41fdf7e0 FS: 00007f46f6897680(0000) GS:ffff8bcdf7a80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055933e95f9a0 CR3: 000000021e636000 CR4: 00000000001006e0 Call Trace: fib_multipath_hash+0x28c/0x2d0 ? fib_multipath_hash+0x28c/0x2d0 fib_select_path+0x241/0x32f ? __fib_lookup+0x6a/0xb0 ip_route_output_key_hash_rcu+0x650/0xa30 ? __alloc_skb+0x9b/0x1d0 inet_rtm_getroute+0x3f7/0xb80 ? __alloc_pages_nodemask+0x11c/0x2c0 rtnetlink_rcv_msg+0x1d9/0x2f0 ? rtnl_calcit.isra.24+0x120/0x120 netlink_rcv_skb+0x54/0x130 rtnetlink_rcv+0x15/0x20 netlink_unicast+0x20a/0x2c0 netlink_sendmsg+0x2d1/0x3d0 sock_sendmsg+0x39/0x50 ___sys_sendmsg+0x2a0/0x2f0 ? filemap_map_pages+0x16b/0x360 ? __handle_mm_fault+0x108e/0x13d0 __sys_sendmsg+0x63/0xa0 ? __sys_sendmsg+0x63/0xa0 __x64_sys_sendmsg+0x1f/0x30 do_syscall_64+0x5a/0x120 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fixes: d0e13a1488ad ("flow_dissector: lookup netns by skb->sk if skb->dev is NULL") Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 639c1b2625af66501b24c8082231a83d4f5ad56b Author: Steen Hegelund Date: Thu Dec 20 14:16:31 2018 +0100 net: mscc: ocelot: Register poll timeout should be wall time not attempts When doing indirect access in the Ocelot chip, a command is setup, issued and then we need to poll until the result is ready. The polling timeout is specified in milliseconds in the datasheet and not in register access attempts. It is not a bug on the currently supported platform, but we observed that the code does not work properly on other platforms that we want to support as the timing requirements there are different. Signed-off-by: Steen Hegelund Signed-off-by: David S. Miller commit e57b2945aa654e48f85a41e8917793c64ecb9de8 Author: Yanjiang Jin Date: Thu Dec 20 16:32:35 2018 +0800 scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown() We must free all irqs during shutdown, else kexec's 2nd kernel would hang in pqi_wait_for_completion_io() as below: Call trace: pqi_wait_for_completion_io pqi_submit_raid_request_synchronous.constprop.78+0x23c/0x310 [smartpqi] pqi_configure_events+0xec/0x1f8 [smartpqi] pqi_ctrl_init+0x814/0xca0 [smartpqi] pqi_pci_probe+0x400/0x46c [smartpqi] local_pci_probe+0x48/0xb0 pci_device_probe+0x14c/0x1b0 really_probe+0x218/0x3fc driver_probe_device+0x70/0x140 __driver_attach+0x11c/0x134 bus_for_each_dev+0x70/0xc8 driver_attach+0x30/0x38 bus_add_driver+0x1f0/0x294 driver_register+0x74/0x12c __pci_register_driver+0x64/0x70 pqi_init+0xd0/0x10000 [smartpqi] do_one_initcall+0x60/0x1d8 do_init_module+0x64/0x1f8 load_module+0x10ec/0x1350 __se_sys_finit_module+0xd4/0x100 __arm64_sys_finit_module+0x28/0x34 el0_svc_handler+0x104/0x160 el0_svc+0x8/0xc This happens only in the following combinations: 1. smartpqi is built as module, not built-in; 2. We have a disk connected to smartpqi card; 3. Both kexec's 1st and 2nd kernels use this disk as Rootfs' mount point. Signed-off-by: Yanjiang Jin Acked-by: Don Brace Signed-off-by: Martin K. Petersen commit 463561e6b9facf93ef90b65d2c75a80c7262d778 Author: Colin Ian King Date: Thu Dec 20 16:50:50 2018 +0000 neighbour: remove stray semicolon Currently the stray semicolon means that the final term in the addition is being missed. Fix this by removing it. Cleans up clang warning: net/core/neighbour.c:2821:9: warning: expression result unused [-Wunused-value] Fixes: 82cbb5c631a0 ("neighbour: register rtnl doit handler") Signed-off-by: Colin Ian King Acked-By: Roopa Prabhu Signed-off-by: David S. Miller commit e52c9e0710d2f5d54a521d620a230ac2ae646dc7 Author: Don Brace Date: Thu Dec 20 19:32:12 2018 -0500 scsi: smartpqi: fix build warnings Fix kbuild warning and fallout from linux-next -Wimplicit-fallthrough. [mkp: added fall through statements] Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 0db6896ff6332ba694f1e61b93ae3b2640317633 Author: Mahesh Salgaonkar Date: Mon Aug 20 13:47:32 2018 +0530 powerpc/fadump: Do not allow hot-remove memory from fadump reserved area. For fadump to work successfully there should not be any holes in reserved memory ranges where kernel has asked firmware to move the content of old kernel memory in event of crash. Now that fadump uses CMA for reserved area, this memory area is now not protected from hot-remove operations unless it is cma allocated. Hence, fadump service can fail to re-register after the hot-remove operation, if hot-removed memory belongs to fadump reserved region. To avoid this make sure that memory from fadump reserved area is not hot-removable if fadump is registered. However, if user still wants to remove that memory, he can do so by manually stopping fadump service before hot-remove operation. Signed-off-by: Mahesh Salgaonkar Signed-off-by: Michael Ellerman commit f86593be1e7f5405b980bb4b11640250ac81d7cb Author: Mahesh Salgaonkar Date: Mon Aug 20 13:47:24 2018 +0530 powerpc/fadump: Throw proper error message on fadump registration failure fadump fails to register when there are holes in reserved memory area. This can happen if user has hot-removed a memory that falls in the fadump reserved memory area. Throw a meaningful error message to the user in such case. Signed-off-by: Mahesh Salgaonkar [mpe: is_reserved_memory_area_contiguous() returns bool, unsplit string] Signed-off-by: Michael Ellerman commit a4e92ce8e4c8275bacfe3529d6ac85d54a233d87 Author: Mahesh Salgaonkar Date: Mon Aug 20 13:47:17 2018 +0530 powerpc/fadump: Reservationless firmware assisted dump One of the primary issues with Firmware Assisted Dump (fadump) on Power is that it needs a large amount of memory to be reserved. On large systems with TeraBytes of memory, this reservation can be quite significant. In some cases, fadump fails if the memory reserved is insufficient, or if the reserved memory was DLPAR hot-removed. In the normal case, post reboot, the preserved memory is filtered to extract only relevant areas of interest using the makedumpfile tool. While the tool provides flexibility to determine what needs to be part of the dump and what memory to filter out, all supported distributions default this to "Capture only kernel data and nothing else". We take advantage of this default and the Linux kernel's Contiguous Memory Allocator (CMA) to fundamentally change the memory reservation model for fadump. Instead of setting aside a significant chunk of memory nobody can use, this patch uses CMA instead, to reserve a significant chunk of memory that the kernel is prevented from using (due to MIGRATE_CMA), but applications are free to use it. With this fadump will still be able to capture all of the kernel memory and most of the user space memory except the user pages that were present in CMA region. Essentially, on a P9 LPAR with 2 cores, 8GB RAM and current upstream: [root@zzxx-yy10 ~]# free -m total used free shared buff/cache available Mem: 7557 193 6822 12 541 6725 Swap: 4095 0 4095 With this patch: [root@zzxx-yy10 ~]# free -m total used free shared buff/cache available Mem: 8133 194 7464 12 475 7338 Swap: 4095 0 4095 Changes made here are completely transparent to how fadump has traditionally worked. Thanks to Aneesh Kumar and Anshuman Khandual for helping us understand CMA and its usage. TODO: - Handle case where CMA reservation spans nodes. Signed-off-by: Ananth N Mavinakayanahalli Signed-off-by: Mahesh Salgaonkar Signed-off-by: Hari Bathini Signed-off-by: Michael Ellerman commit 08fb726df13778a54592aaa1deea6a154637c868 Author: Mahesh Salgaonkar Date: Thu Dec 13 11:17:31 2018 +0530 powerpc/powernv: Move opal_power_control_init() call in opal_init(). opal_power_control_init() depends on opal message notifier to be initialized, which is done in opal_init()->opal_message_init(). But both these initialization are called through machine initcalls and it all depends on in which order they being called. So far these are called in correct order (may be we got lucky) and never saw any issue. But it is clearer to control initialization order explicitly by moving opal_power_control_init() into opal_init(). Signed-off-by: Mahesh Salgaonkar Signed-off-by: Michael Ellerman commit ae6263cc33742d1c179510b6aadd31108fe89a89 Author: Markus Elfring Date: Thu Jan 11 18:40:23 2018 +0100 powerpc/4xx: Delete an unnecessary return statement in two functions The script "checkpatch.pl" pointed information out like the following. WARNING: void function return statements are not generally useful Thus remove such a statement in the affected functions. Signed-off-by: Markus Elfring Signed-off-by: Michael Ellerman commit a8d5dadae59f5866ac3b68cb993d532c3bf761e4 Author: Markus Elfring Date: Thu Jan 11 18:28:54 2018 +0100 powerpc/4xx: Delete error message for a ENOMEM in two functions Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Michael Ellerman commit 52930bc6e87191af3894bec302774f334e117f7b Author: Markus Elfring Date: Thu Jan 11 18:10:02 2018 +0100 powerpc/4xx: Use seq_putc() in ocm_debugfs_show() A single character (line break) should be put into a sequence. Thus use the corresponding function "seq_putc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Michael Ellerman commit b52106a040e6f86848b05be1b4317479836e94d4 Author: Markus Elfring Date: Thu Jan 11 18:08:08 2018 +0100 powerpc/4xx: Combine four seq_printf() calls into two in ocm_debugfs_show() Some data were printed into a sequence by four separate function calls. Print the same data by two single function calls instead. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Michael Ellerman commit 96d19d70e1012383365c68e271d99f833a2d85f3 Author: Christophe Leroy Date: Thu Dec 20 07:25:28 2018 +0000 powerpc/8xx: Allow pinning IMMR TLB when using early debug console CONFIG_EARLY_DEBUG_CPM requires IMMR area TLB to be pinned otherwise it doesn't survive MMU_init, and the boot fails. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 5f639e5fad18f2673f1788cb04bde2bb2f8fe6da Author: Oliver O'Halloran Date: Wed Nov 14 17:19:58 2018 +1100 powerpc/powernv: Remove PCI_MSI ifdef checks CONFIG_PCI_MSI was made mandatory by commit a311e738b6d8 ("powerpc/powernv: Make PCI non-optional") so the #ifdef checks around CONFIG_PCI_MSI here can be removed entirely. Signed-off-by: Oliver O'Halloran Reviewed-by: Joel Stanley Signed-off-by: Michael Ellerman commit a083787680f80f2c16316a1d907bf8d3f6b42311 Author: Alexandre Belloni Date: Tue Nov 20 16:12:30 2018 +0100 powerpc/fsl-rio: fix spelling mistake "reserverd" -> "reserved" Fix a spelling mistake in a register description. Signed-off-by: Alexandre Belloni Signed-off-by: Michael Ellerman commit 0c9108b083706330cd5484d121fbb0ad67e8f647 Author: Ravi Bangoria Date: Wed Nov 21 09:26:37 2018 +0530 Powerpc/perf: Wire up PMI throttling Commit 14c63f17b1fde ("perf: Drop sample rate when sampling is too slow") introduced a way to throttle PMU interrupts if we're spending too much time just processing those. Wire up powerpc PMI handler to use this infrastructure. We have throttling of the *rate* of interrupts, but this adds throttling based on the *time taken* to process the interrupts. Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman commit 962ad710f7d64d441c4e02c0e9e5fddd1aeb54b7 Author: Tristram Ha Date: Wed Dec 19 18:59:31 2018 -0800 net: dsa: microchip: fix unicast frame leak Port partitioning is done by enabling UNICAST_VLAN_BOUNDARY and changing the default port membership of 0x7f to other values such that there is no communication between ports. In KSZ9477 the member for port 1 is 0x41; port 2, 0x42; port 3, 0x44; port 4, 0x48; port 5, 0x50; and port 7, 0x60. Port 6 is the host port. Setting a zero value can be used to stop port from receiving. However, when UNICAST_VLAN_BOUNDARY is disabled and the unicast addresses are already learned in the dynamic MAC table, setting zero still allows devices connected to those ports to communicate. This does not apply to multicast and broadcast addresses though. To prevent these leaks and make the function of port membership consistent UNICAST_VLAN_BOUNDARY should never be disabled. Note that UNICAST_VLAN_BOUNDARY is enabled by default in KSZ9477. Fixes: b987e98e50ab90e5 ("dsa: add DSA switch driver for Microchip KSZ9477") Signed-off-by: Tristram Ha Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 3a6d528a5e0179b1e8b20033c5cb7384dd7a830d Author: David S. Miller Date: Thu Dec 20 16:14:22 2018 -0800 vxlan: Correct merge error. When resolving the conflict wrt. the vxlan_fdb_update call in vxlan_changelink() I made the last argument false instead of true. Fix this. Signed-off-by: David S. Miller commit 8527f9df04a8b5f6ee24ae7bdda5a94d73c7d243 Author: Florian Westphal Date: Tue Dec 18 23:04:50 2018 +0100 netfilter: netns: shrink netns_ct struct remove the obsolete sysctl anchors and move auto_assign_helper_warned to avoid/cover a hole. Reduces size by 40 bytes on 64 bit. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit e716431356df2bc935f6516b14ebcff9fd3cc0d0 Merge: c337680fc1f43 a64917446eafc Author: David S. Miller Date: Thu Dec 20 15:51:55 2018 -0800 Merge tag 'mlx5-updates-2018-12-19' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2018-12-19 This series adds some misc updates and the support for tunnels over VLAN tc offloads. From Miroslav Lichvar, patches #1,2 1) Update timecounter at least twice per counter overflow 2) Extend PTP gettime function to read system clock From Gavi Teitz, patch #3 3) Increase VF representors' SQ size to 128 From Eli Britstein and Or Gerlitz, patches #4-10 4) Adds the capability to support tunnels over VLAN device. Patch 4 avoids crash for TC flow with egress upper devices Patch 5 refactors tunnel routing devs into a helper function Patch 6 avoids crash for TC encap flows with vlan on underlay Patches 7-8 refactor encap tunnel header preparing code. Patch 9 adds support for building VLAN tagged ETH header. Patch 10 adds support for tunnel routing to VLAN device. From Aviv, patches 11,12 to fix earlier VF lag series 5) Fix query_nic_sys_image_guid() error during init 6) Fix LAG requirement when CONFIG_MLX5_ESWITCH is off ==================== Signed-off-by: David S. Miller commit fc3893fd5cfc3c654ae4b9c8d7ee39ea70e4bdc6 Author: Florian Westphal Date: Tue Dec 18 23:04:49 2018 +0100 netfilter: conntrack: remove empty pernet fini stubs after moving sysctl handling into single place, the init functions can't fail anymore and some of the fini functions are empty. Remove them and change return type to void. This also simplifies error unwinding in conntrack module init path. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit cb2833ed0044f910877b810077bc6da2ac5f09a2 Author: Florian Westphal Date: Tue Dec 18 23:04:48 2018 +0100 netfilter: conntrack: merge ecache and timestamp sysctl tables with main one Similar to previous change, this time for eache and timestamp. Unlike helper and acct, these can be disabled at build time, so they need ifdef guards. Next patch will remove a few (now obsolete) functions. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit d912dec124288553c734e25fef3ecfef92f894db Author: Florian Westphal Date: Tue Dec 18 23:04:47 2018 +0100 netfilter: conntrack: merge acct and helper sysctl table with main one Needless copy&paste, just handle all in one. Next patch will handle acct and timestamp, which have similar functions. Intentionally leaves cruft behind, will be cleaned up in a followup patch. The obsolete sysctl pointers in netns_ct struct are left in place and removed in a single change, as changes to netns trigger rebuild of almost all files. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 4a65798a94089f31883eee705f580e4b2d734ecf Author: Florian Westphal Date: Tue Dec 18 23:04:46 2018 +0100 netfilter: conntrack: add mnemonics for sysctl table Its a bit hard to see what table[3] really lines up with, so add human-readable mnemonics and use them for initialisation. This makes it easier to see e.g. which sysctls are not exported to unprivileged userns. objdiff shows no changes. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 4b216e21cfca77132ef0215f553eda91eb1d038b Author: Florian Westphal Date: Tue Dec 18 23:04:45 2018 +0100 netfilter: conntrack: un-export seq_print_acct Only one caller, just place it where its needed. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit a0badcc6652f9871a9908d67297f910cba657b0f Author: Yafang Shao Date: Tue Dec 18 21:14:07 2018 +0800 netfilter: conntrack: register sysctl table for gre This patch adds two sysctl knobs for GRE: net.netfilter.nf_conntrack_gre_timeout = 30 net.netfilter.nf_conntrack_gre_timeout_stream = 180 Update the Documentation as well. Signed-off-by: Yafang Shao Signed-off-by: Pablo Neira Ayuso commit c337680fc1f43a5e184099ee8784c868244f02e7 Merge: 6eea2db21012b 03a84ea3d8c53 Author: David S. Miller Date: Thu Dec 20 15:48:55 2018 -0800 Merge branch 'mlxsw-Two-usability-improvements' Ido Schimmel says: ==================== mlxsw: Two usability improvements This patchset contains two small improvements in the mlxsw driver. The first one, in patches #1-#2, relieves the user from the need to configure a VLAN interface and only later the corresponding VXLAN tunnel. The issue is explained in detail in the first patch. The second improvement is described below and allows the user to make use of VID 1 by having the driver use the reserved 4095 VID for untagged traffic. VLAN entries on a given port can be associated with either a bridge or a router. For example, if swp1.10 is assigned an IP address and swp1.20 is enslaved to a VLAN-unaware bridge, then both {Port 1, VID 10} and {Port 1, VID 20} would be associated with a filtering identifier (FID) of the correct type. In case swp1 itself is assigned an IP address or enslaved to a VLAN-unaware bridge, then a FID would be associated with {Port 1, VID 1}. Using VID 1 for this purpose means that VLAN devices with VID 1 cannot be created over mlxsw ports, as this VID is (ab)used as the default VLAN. Instead of using VID 1 for this purpose, we can use VID 4095 which is reserved for internal use and cannot be configured by either the 8021q or the bridge driver. Patches #3-#7 perform small and non-functional changes that finally allow us to switch to VID 4095 as the default VID in patch #8. Patch #9 removes the limitation about creation of VLAN devices with VID 1 over mlxsw ports. Patches #10-#11 add test cases. ==================== Signed-off-by: David S. Miller commit 03a84ea3d8c537f04b862972e2132dff86a4e93d Author: Ido Schimmel Date: Thu Dec 20 19:42:37 2018 +0000 selftests: forwarding: Add router test with VID 1 Previous patches made it possible to setup VLAN devices with VID 1 over mlxsw ports. Verify this functionality actually works by conducting a simple router test over VID 1. Adding this test as a generic test since it can be run using veth pairs and it can also be useful for other physical devices where VID 1 was considered reserved (knowingly or not). Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 29b1e34efd39ee9f6bc2db3fafad0e4615f15475 Author: Ido Schimmel Date: Thu Dec 20 19:42:35 2018 +0000 selftests: mlxsw: Adjust test regarding VID 1 Previous patches made it possible to create VLAN devices with VID 1 over mlxsw ports. Adjust the test to verify such an operation succeeds. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit d8a1f7ab2c1fb4ee53c16ad048ad045770d99f14 Author: Ido Schimmel Date: Thu Dec 20 19:42:34 2018 +0000 mlxsw: spectrum: Remove limitation regarding VID 1 VID 1 is not reserved anymore, so remove the check that prevented the creation of VLAN devices with this VID over mlxsw ports. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 0417d25e7dad2ab61a42afb07bb0b9512fd0e6df Author: Ido Schimmel Date: Thu Dec 20 19:42:33 2018 +0000 mlxsw: spectrum: Switch to VID 4095 as default VID There is no need to abuse VID 1 anymore and we can instead use VID 4095 as the default VLAN, which will be configured on the port throughout its lifetime. The OVS join / leave functions are changed to enable VIDs 1-4094 (inclusive) instead of 2-4095. This because VID 4095 is now the default VLAN instead of 1. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 16f6aceb72e7e27efae092c1020c5f0b312a4745 Author: Ido Schimmel Date: Thu Dec 20 19:42:32 2018 +0000 mlxsw: spectrum: Add an helper function to cleanup VLAN entries VLAN entries on a port can be associated with either a bridge VLAN or a router port. Before the VLAN entry is destroyed these associations need to be cleaned up. Currently, this is always invoked from the function which destroys the VLAN entry, but next patch is going to skip the destruction of the default entry when a port in unlinked from a LAG. The above does not mean that the associations should not be cleaned up, so add a helper that will be invoked from both call sites. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 346fca3b58cbe0505f4328276e46e22ffc9a11d8 Author: Ido Schimmel Date: Thu Dec 20 19:42:30 2018 +0000 mlxsw: spectrum: Store pointer to default port VLAN in port struct Subsequent patches will need to access the default port VLAN. Since this VLAN will exist throughout the lifetime of the port, simply store it in the port's struct. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit ab6c3b79ec7b1d10cec411015eb5a7599e2b7e52 Author: Ido Schimmel Date: Thu Dec 20 19:42:29 2018 +0000 mlxsw: spectrum: Allow controlling destruction of default port VLAN The function allows flushing all the existing VLAN entries on a port. It is invoked when a port is destroyed and when it is unlinked from a LAG. In the latter case, when moving to the new default VLAN, there will not be a need to destroy the default VLAN entry. Therefore, add an argument that allows to control whether the default port VLAN should be destroyed or not. Currently it is always set to 'true'. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 262e1ff91c3bc9d6b082c123fc7035c1e6347469 Author: Ido Schimmel Date: Thu Dec 20 19:42:27 2018 +0000 mlxsw: spectrum: Set PVID during port initialization Currently, the driver does not set the port's PVID when initializing a new port. This is because the driver is using VID 1 as PVID which is the firmware default. Subsequent patches are going to change the PVID the driver is setting when initializing a new port. Prepare for that by explicitly setting the port's PVID. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit a2d2a20553f0b74a2872fba58a152e93341eddd7 Author: Ido Schimmel Date: Thu Dec 20 19:42:26 2018 +0000 mlxsw: spectrum: Replace hard-coded default VID with a define Subsequent patches are going to replace the current default VID (1) with VLAN_N_VID - 1 (4095). Prepare for this conversion by replacing the hard-coded '1' with a define. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 9d15dceb8a36919897d52ec8e4a6e6efa57f9f19 Author: Ido Schimmel Date: Thu Dec 20 19:42:25 2018 +0000 selftests: mlxsw: Add a test case for L3 VNI Previous patch added the ability to offload a VXLAN tunnel used for L3 VNI when it is present in the VLAN-aware bridge before the corresponding VLAN interface is configured. This patch adds a test case to verify that. Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit f40be47a3e409724104d370385817d90215149b4 Author: Ido Schimmel Date: Thu Dec 20 19:42:23 2018 +0000 mlxsw: spectrum_router: Do not force specific configuration order In symmetric routing, the only two members in the VLAN corresponding to the L3 VNI are the router port and the VXLAN tunnel. In case the VXLAN device is already enslaved to the bridge and only later the VLAN interface is configured, the tunnel will not be offloaded. The reason for this is that when the router interface (RIF) corresponding to the VLAN interface is configured, it calls the core fid_get() API which does not check if NVE should be enabled on the FID. Instead, call into the bridge code which will check if NVE should be enabled on the FID. This effectively means that the same code path is used to retrieve a FID when either a local port or a router port joins the FID. Signed-off-by: Ido Schimmel Acked-by: Jiri Pirko Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 294304e4c522d797b7ea8200ab74354843fa68e9 Author: Florian Westphal Date: Tue Dec 18 00:05:29 2018 +0100 netfilter: conntrack: udp: set stream timeout to 2 minutes We have no explicit signal when a UDP stream has terminated, peers just stop sending. For suspected stream connections a timeout of two minutes is sane to keep NAT mapping alive a while longer. It matches tcp conntracks 'timewait' default timeout value. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit d535c8a69c1924e70186d80be0a9cecaf475f166 Author: Florian Westphal Date: Thu Dec 6 11:50:49 2018 +0100 netfilter: conntrack: udp: only extend timeout to stream mode after 2s Currently DNS resolvers that send both A and AAAA queries from same source port can trigger stream mode prematurely, which results in non-early-evictable conntrack entry for three minutes, even though DNS requests are done in a few milliseconds. Add a two second grace period where we continue to use the ordinary 30-second default timeout. Its enough for DNS request/response traffic, even if two request/reply packets are involved. ASSURED is still set, else conntrack (and thus a possible NAT mapping ...) gets zapped too in case conntrack table runs full. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 6eea2db21012b287f880edeeffc42f49c3a057d7 Merge: 2be09de7d6a06 643bae17fd4cc Author: David S. Miller Date: Thu Dec 20 15:34:30 2018 -0800 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2018-12-20 This series contains updates to e100, igb, ixgbe, i40e and ice drivers. I replaced spinlocks for mutex locks to reduce the latency on CPU0 for igb when updating the statistics. This work was based off a patch provided by Jan Jablonsky, which was against an older version of the igb driver. Jesus adjusts the receive packet buffer size from 32K to 30K when running in QAV mode, to stay within 60K for total packet buffer size for igb. Vinicius adds igb kernel documentation regarding the CBS algorithm and its implementation in the i210 family of NICs. YueHaibing from Huawei fixed the e100 driver that was potentially passing a NULL pointer, so use the kernel macro IS_ERR_OR_NULL() instead. Konstantin Khorenko fixes i40e where we were not setting up the neigh_priv_len in our net_device, which caused the driver to read beyond the neighbor entry allocated memory. Miroslav Lichvar extends the PTP gettime() to read the system clock by adding support for PTP_SYS_OFFSET_EXTENDED ioctl in i40e. Young Xiao fixed the ice driver to only enable NAPI on q_vectors that actually have transmit and receive rings. Kai-Heng Feng fixes an igb issue that when placed in suspend mode, the NIC does not wake up when a cable is plugged in. This was due to the driver not setting PME during runtime suspend. Stephen Douthit enables the ixgbe driver allow DSA devices to use the MII interface to talk to switches. ==================== Signed-off-by: David S. Miller commit bb7e22a8ab00ff9ba911a45ba8784cef9e6d6f7a Author: Huy Nguyen Date: Tue Dec 18 14:15:56 2018 +0200 IB/mlx5: Fix long EEH recover time with NVMe offloads On NVMe offloads connection with many IO queues, EEH takes long time to recover. The culprit is the synchronize_srcu in the destroy_mkey. The solution is to use synchronize_srcu only for ODP mkey. Fixes: b4cfe447d47b ("IB/mlx5: Implement on demand paging by adding support for MMU notifiers") Signed-off-by: Huy Nguyen Reviewed-by: Daniel Jurgens Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 1cf4a0ccc506b5c027afc5eaf3fddc83f96f31e7 Merge: 77ea5f4cbe208 28cb6f1eaffdc Author: Daniel Borkmann Date: Thu Dec 20 23:47:10 2018 +0100 Merge branch 'bpf-sockmap-fixes-and-improvements' John Fastabend says: ==================== Set of bpf fixes and improvements to make sockmap with kTLS usable with "real" applications. This set came as the fallout of pulling kTLS+sockmap into Cilium[1] and running in container environment. Roughly broken into three parts, Patches 1-3: resolve/improve handling of size field in sk_msg_md Patch 4: it became difficult to use this in Cilium when the SK_PASS verdict was not correctly handle. So handle the case correctly. Patch 5-8: Set of issues found while running OpenSSL TX kTLS enabled applications. This resolves the most obvious issues and gets applications using kTLS TX up and running with sock{map|has}. Other than the "sk_msg, zap ingress queue on psock down" (PATCH 6/8) which can potentially cause a WARNING the issues fixed in this series do not cause kernel side warnings, BUG, etc. but instead cause stalls and other odd behavior in the user space applications when using kTLS with BPF policies applied. Primarily tested with 'curl' compiled with latest openssl and also 'openssl s_client/s_server' containers using Cilium network plugin with docker/k8s. Some basic testing with httpd was also enabled. Cilium CI tests will be added shortly to cover these cases as well. We also have 'wrk' and other test and benchmarking tools we can run now. We have two more sets of patches currently under testing that will be sent shortly to address a few more issues. First the OpenSSL RX kTLS side breaks when both sk_msg and sk_skb_verdict programs are used with kTLS, the sk_skb_verdict programs are not enforced. Second skmsg needs to call into tcp stack to send to indicate consumed data. ==================== Signed-off-by: Daniel Borkmann commit 28cb6f1eaffdc5a6a9707cac55f4a43aa3fd7895 Author: John Fastabend Date: Thu Dec 20 11:35:36 2018 -0800 bpf: tls_sw, init TLS ULP removes BPF proto hooks The existing code did not expect users would initialize the TLS ULP without subsequently calling the TLS TX enabling socket option. If the application tries to send data after the TLS ULP enable op but before the TLS TX enable op the BPF sk_msg verdict program is skipped. This patch resolves this by converting the ipv4 sock ops to be calculated at init time the same way ipv6 ops are done. This pulls in any changes to the sock ops structure that have been made after the socket was created including the changes from adding the socket to a sock{map|hash}. This was discovered by running OpenSSL master branch which calls the TLS ULP setsockopt early in TLS handshake but only enables the TLS TX path once the handshake has completed. As a result the datapath missed the initial handshake messages. Fixes: 02c558b2d5d6 ("bpf: sockmap, support for msg_peek in sk_msg with redirect ingress") Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann commit 0608c69c9a805c6264689d7eab4203eab88cf1da Author: John Fastabend Date: Thu Dec 20 11:35:35 2018 -0800 bpf: sk_msg, sock{map|hash} redirect through ULP A sockmap program that redirects through a kTLS ULP enabled socket will not work correctly because the ULP layer is skipped. This fixes the behavior to call through the ULP layer on redirect to ensure any operations required on the data stream at the ULP layer continue to be applied. To do this we add an internal flag MSG_SENDPAGE_NOPOLICY to avoid calling the BPF layer on a redirected message. This is required to avoid calling the BPF layer multiple times (possibly recursively) which is not the current/expected behavior without ULPs. In the future we may add a redirect flag if users _do_ want the policy applied again but this would need to work for both ULP and non-ULP sockets and be opt-in to avoid breaking existing programs. Also to avoid polluting the flag space with an internal flag we reuse the flag space overlapping MSG_SENDPAGE_NOPOLICY with MSG_WAITFORONE. Here WAITFORONE is specific to recv path and SENDPAGE_NOPOLICY is only used for sendpage hooks. The last thing to verify is user space API is masked correctly to ensure the flag can not be set by user. (Note this needs to be true regardless because we have internal flags already in-use that user space should not be able to set). But for completeness we have two UAPI paths into sendpage, sendfile and splice. In the sendfile case the function do_sendfile() zero's flags, ./fs/read_write.c: static ssize_t do_sendfile(int out_fd, int in_fd, loff_t *ppos, size_t count, loff_t max) { ... fl = 0; #if 0 /* * We need to debate whether we can enable this or not. The * man page documents EAGAIN return for the output at least, * and the application is arguably buggy if it doesn't expect * EAGAIN on a non-blocking file descriptor. */ if (in.file->f_flags & O_NONBLOCK) fl = SPLICE_F_NONBLOCK; #endif file_start_write(out.file); retval = do_splice_direct(in.file, &pos, out.file, &out_pos, count, fl); } In the splice case the pipe_to_sendpage "actor" is used which masks flags with SPLICE_F_MORE. ./fs/splice.c: static int pipe_to_sendpage(struct pipe_inode_info *pipe, struct pipe_buffer *buf, struct splice_desc *sd) { ... more = (sd->flags & SPLICE_F_MORE) ? MSG_MORE : 0; ... } Confirming what we expect that internal flags are in fact internal to socket side. Fixes: d3b18ad31f93 ("tls: add bpf support to sk_msg handling") Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann commit a136678c0bdbb650daff5df5eec1dab960e074a7 Author: John Fastabend Date: Thu Dec 20 11:35:34 2018 -0800 bpf: sk_msg, zap ingress queue on psock down In addition to releasing any cork'ed data on a psock when the psock is removed we should also release any skb's in the ingress work queue. Otherwise the skb's eventually get free'd but late in the tear down process so we see the WARNING due to non-zero sk_forward_alloc. void sk_stream_kill_queues(struct sock *sk) { ... WARN_ON(sk->sk_forward_alloc); ... } Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface") Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann commit 552de91068828daef50a227a665068cf8dde835e Author: John Fastabend Date: Thu Dec 20 11:35:33 2018 -0800 bpf: sk_msg, fix socket data_ready events When a skb verdict program is in-use and either another BPF program redirects to that socket or the new SK_PASS support is used the data_ready callback does not wake up application. Instead because the stream parser/verdict is using the sk data_ready callback we wake up the stream parser/verdict block. Fix this by adding a helper to check if the stream parser block is enabled on the sk and if so call the saved pointer which is the upper layers wake up function. This fixes application stalls observed when an application is waiting for data in a blocking read(). Fixes: d829e9c4112b ("tls: convert to generic sk_msg interface") Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann commit 51199405f967207de372d9b60989eb87d7ae8809 Author: John Fastabend Date: Thu Dec 20 11:35:32 2018 -0800 bpf: skb_verdict, support SK_PASS on RX BPF path Add SK_PASS verdict support to SK_SKB_VERDICT programs. Now that support for redirects exists we can implement SK_PASS as a redirect to the same socket. This simplifies the BPF programs and avoids an extra map lookup on RX path for simple visibility cases. Further, reduces user (BPF programmer in this context) confusion when their program drops skb due to lack of support. Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann commit 7a69c0f250568e6ab72f401b2c69aa0e666c94f2 Author: John Fastabend Date: Thu Dec 20 11:35:31 2018 -0800 bpf: skmsg, replace comments with BUILD bug Enforce comment on structure layout dependency with a BUILD_BUG_ON to ensure the condition is maintained. Suggested-by: Daniel Borkmann Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann commit bc1b4f013b5029b4c8b63fb9ba8d084119486d7b Author: John Fastabend Date: Thu Dec 20 11:35:30 2018 -0800 bpf: sk_msg, improve offset chk in _is_valid_access The check for max offset in sk_msg_is_valid_access uses sizeof() which is incorrect because it would allow accessing possibly past the end of the struct in the padded case. Further, it doesn't preclude accessing any padding that may be added in the middle of a struct. All told this makes it fragile to rely on. To fix this explicitly check offsets with fields using the bpf_ctx_range() and bpf_ctx_range_till() macros. For reference the current structure layout looks as follows (reported by pahole) struct sk_msg_md { union { void * data; /* 8 */ }; /* 0 8 */ union { void * data_end; /* 8 */ }; /* 8 8 */ __u32 family; /* 16 4 */ __u32 remote_ip4; /* 20 4 */ __u32 local_ip4; /* 24 4 */ __u32 remote_ip6[4]; /* 28 16 */ __u32 local_ip6[4]; /* 44 16 */ __u32 remote_port; /* 60 4 */ /* --- cacheline 1 boundary (64 bytes) --- */ __u32 local_port; /* 64 4 */ __u32 size; /* 68 4 */ /* size: 72, cachelines: 2, members: 10 */ /* last cacheline: 8 bytes */ }; So there should be no padding at the moment but fixing this now prevents future errors. Reported-by: Alexei Starovoitov Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann commit 9ee79a65d176e5815877aa148acc956e4cc90c53 Author: John Fastabend Date: Thu Dec 20 11:35:29 2018 -0800 bpf: sk_msg, fix sk_msg_md access past end test Currently, the test to ensure reads past the end of the sk_msg_md data structure fail is incorrectly expecting success. Fix this typo and use correct expected error. Fixes: 945a47d87cee ("bpf: sk_msg, add tests for size field") Reported-by: Alexei Starovoitov Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann commit 64711f9a47d4defa90417f5e8db8ed0060bc3275 Author: Max Filippov Date: Wed Dec 19 19:48:37 2018 -0800 xtensa: implement jump_label support Use 3-byte 'nop' and 'j' instructions that are always present. Don't let assembler mark a spot right after patchable 'j' instruction as unreachable and later put literals or padding bytes there. Add separate implementations of patch_text for SMP and UP cases, avoiding use of atomics on UP. Signed-off-by: Max Filippov commit 77ea5f4cbe2084db9ab021ba73fb7eadf1610884 Author: Jesper Dangaard Brouer Date: Wed Dec 19 17:00:23 2018 +0100 bpf/cpumap: make sure frame_size for build_skb is aligned if headroom isn't The frame_size passed to build_skb must be aligned, else it is possible that the embedded struct skb_shared_info gets unaligned. For correctness make sure that xdpf->headroom in included in the alignment. No upstream drivers can hit this, as all XDP drivers provide an aligned headroom. This was discovered when playing with implementing XDP support for mvneta, which have a 2 bytes DSA header, and this Marvell ARM64 platform didn't like doing atomic operations on an unaligned skb_shinfo(skb)->dataref addresses. Fixes: 1c601d829ab0 ("bpf: cpumap xdp_buff to skb conversion and allocation") Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Daniel Borkmann commit 842a9c837e2017127250a93204368f13e660ed9d Author: Or Gerlitz Date: Tue Dec 11 18:10:43 2018 +0200 IB/mlx5: Simplify netdev unbinding When dealing with netdev unregister events, we just need to know that this is our currently bounded netdev. There's no need to do any further checks/queries. This patch doesn't change any functionality. Signed-off-by: Or Gerlitz Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 641d1207d2ed0ef21ff5ad61e067d630028e2f62 Author: Michael Guralnik Date: Sun Dec 9 11:58:06 2018 +0200 IB/core: Move query port to ioctl Add a method for query port under the uverbs global methods. Current ib_port_attr struct is passed as a single attribute and port_cap_flags2 is added as a new attribute to the function. Signed-off-by: Michael Guralnik Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 4fa2813d26c82680216e535c18a690ca0c4e860a Author: Michael Guralnik Date: Sun Dec 9 11:58:05 2018 +0200 RDMA/nldev: Expose port_cap_flags2 port_cap_flags2 represents IBTA PortInfo:CapabilityMask2. The field safely extends the RDMA_NLDEV_ATTR_CAP_FLAGS operand as it was exported as 64 bit to allow this kind of extension. Signed-off-by: Michael Guralnik Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2e8039c656224b4a21e1947f45946d32a59bae53 Author: Michael Guralnik Date: Sun Dec 9 11:58:04 2018 +0200 IB/core: uverbs copy to struct or zero helper Add a helper to zero fill fields before copying data to UVERBS_ATTR_STRUCT. As UVERBS_ATTR_STRUCT can be used as an extensible struct, we want to make sure that if the user supplies us with a struct that has new fields that we are not aware of, we return them zeroed to the user. This helper should be used when using UVERBS_ATTR_STRUCT for an extendable data structure and there is a need to make sure that extended members of the struct, that the kernel doesn't handle, are returned zeroed to the user. This is needed due to the fact that UVERBS_ATTR_STRUCT allows non-zero values for members after 'last' member. Signed-off-by: Michael Guralnik Reviewed-by: Majd Dibbiny Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 24ad02c48c69c37427cc3412f6597493091eca3c Author: Andreas Klinger Date: Fri Dec 14 20:48:25 2018 +0100 gpio-omap.txt: add reg and interrupts properties Document properties reg and interrupts for OMAP GPIO controller bindings Also add unit address in node name of the example Signed-off-by: Andreas Klinger Acked-by: Linus Walleij Signed-off-by: Rob Herring commit 485773d3c5c7fa1462c0a6b36187922c2dcba914 Author: Lubomir Rintel Date: Mon Dec 3 12:47:10 2018 +0100 dt-bindings: mrvl,intc: fix a trivial typo s/whold/whole/. Signed-off-by: Lubomir Rintel Signed-off-by: Rob Herring commit f55c3ec42a97bca408f0208ec08e3382340c7be7 Author: Yuval Shaia Date: Fri Dec 14 08:05:49 2018 -0800 IB/rxe: Reuse code which sets port state Same code is executed in both rxe_param_set_add and rxe_notify functions. Make one function and call it from both places. Since both callers already have a rxe object use it directly instead of deriving it from the net device. Signed-off-by: Yuval Shaia Reviewed-by: Steve Wise   Reviewed-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit d5108e69fe013ff47ab815b849caba9cc33ca1e5 Author: Parav Pandit Date: Fri Dec 14 00:32:42 2018 -0600 IB/rxe: Make counters thread safe Current rxe device counters are not thread safe. When multiple QPs are used, they can be racy. Make them thread safe by making it atomic64. Fixes: 0b1e5b99a48b ("IB/rxe: Add port protocol stats") Signed-off-by: Parav Pandit Signed-off-by: Jason Gunthorpe commit 6e3722baac048fdf95b867c5ee7e270718e8630d Author: Yishai Hadas Date: Wed Dec 19 16:28:15 2018 +0200 IB/mlx5: Use the correct commands for UMEM and UCTX allocation During testing the command format was changed to close a security hole. Revise the driver to use the command format that will actually be supported in GA firmware. Both the UMEM and UCTX are intended only for use by the kernel and cannot be executed using a general command. Since the UMEM and CTX are not part of the general object the caps bits were moved to be some log_xxx location in the general HCA caps. The firmware code was adapted as well to match the above. Fixes: a8b92ca1b0e5 ("IB/mlx5: Introduce DEVX") Signed-off-by: Yishai Hadas Reviewed-by: Achiad Shochat Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 425518cc5ede0d7a71886816368e4bef60e418db Author: Yishai Hadas Date: Wed Dec 19 16:28:11 2018 +0200 IB/mlx5: Use uid as part of alloc/dealloc transport domain Use uid as part of alloc/dealloc transport domain to let firmware manages the resources correctly. Fixes: d2d19121ae2f ("IB/mlx5: Set uid as part of TD commands") Signed-off-by: Yishai Hadas Reviewed-by: Artemy Kovalyov Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 1f000e1bfff42e960e5d4562213a95016acc712f Author: Nathan Chancellor Date: Thu Dec 20 12:38:56 2018 -0700 ACPI / tables: Add an ifdef around amlcode and dsdt_amlcode Clang warns: drivers/acpi/tables.c:715:14: warning: unused variable 'amlcode' [-Wunused-variable] static void *amlcode __attribute__ ((weakref("AmlCode"))); ^ drivers/acpi/tables.c:716:14: warning: unused variable 'dsdt_amlcode' [-Wunused-variable] static void *dsdt_amlcode __attribute__ ((weakref("dsdt_aml_code"))); ^ 2 warnings generated. The only uses of these variables are hiddem behind CONFIG_ACPI_CUSTOM_DSDT so do the same thing here. Fixes: 82e4eb4e9653 (ACPI / tables: add DSDT AmlCode new declaration name support) Signed-off-by: Nathan Chancellor Signed-off-by: Rafael J. Wysocki commit 98cff8b23ed1c763a029ee81ea300df0d153d07d Author: Lenny Szubowicz Date: Wed Dec 19 11:50:52 2018 -0500 ACPI/APEI: Clear GHES block_status before panic() In __ghes_panic() clear the block status in the APEI generic error status block for that generic hardware error source before calling panic() to prevent a second panic() in the crash kernel for exactly the same fatal error. Otherwise ghes_probe(), running in the crash kernel, would see an unhandled error in the APEI generic error status block and panic again, thereby precluding any crash dump. Signed-off-by: Lenny Szubowicz Signed-off-by: David Arcari Tested-by: Tyler Baicar Acked-by: Borislav Petkov Signed-off-by: Rafael J. Wysocki commit ed50edfb72352c4bee489b5b27418a30177cf38f Merge: bd1c24ccf9eb0 71bef2fd583be Author: Jason Gunthorpe Date: Thu Dec 20 13:24:50 2018 -0700 Merge branch 'mlx5-next' into rdma.git From git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux mlx5 updates taken for dependencies on following patches. * branche 'mlx5-next': (23 commits) IB/mlx5: Introduce uid as part of alloc/dealloc transport domain net/mlx5: Add shared Q counter bits net/mlx5: Continue driver initialization despite debugfs failure net/mlx5: Fold the modify lag code into function net/mlx5: Add lag affinity info to log net/mlx5: Split the activate lag function into two routines net/mlx5: E-Switch, Introduce flow counter affinity IB/mlx5: Unify e-switch representors load approach between uplink and VFs net/mlx5: Use lowercase 'X' for hex values net/mlx5: Remove duplicated include from eswitch.c net/mlx5: Remove the get protocol device interface entry net/mlx5: Support extended destination format in flow steering command net/mlx5: E-Switch, Change vhca id valid bool field to bit flag net/mlx5: Introduce extended destination fields net/mlx5: Revise gre and nvgre key formats net/mlx5: Add monitor commands layout and event data net/mlx5: Add support for plugged-disabled cable status in PME net/mlx5: Add support for PCIe power slot exceeded error in PME net/mlx5: Rework handling of port module events net/mlx5: Move flow counters data structures from flow steering header ... commit 643bae17fd4ccb503cdc6d99c1b4fbd2c4ca6a78 Author: Steve Douthit Date: Thu Dec 6 15:50:43 2018 +0000 ixgbe: use mii_bus to handle MII related ioctls Use the mii_bus callbacks to address the entire clause 22/45 address space. Enables userspace to poke switch registers instead of a single PHY address. The ixgbe firmware may be polling PHYs in a way that is not protected by the mii_bus lock. This isn't new behavior, but as Andrew Lunn pointed out there are more addresses available for conflicts. Signed-off-by: Stephen Douthit Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 8fa10ef01260937eb540b4e9bbc3efa023595993 Author: Steve Douthit Date: Thu Dec 6 15:50:39 2018 +0000 ixgbe: register a mdiobus Most dsa devices expect a 'struct mii_bus' pointer to talk to switches via the MII interface. While this works for dsa devices, it will not work safely with Linux PHYs in all configurations since the firmware of the ixgbe device may be polling some PHY addresses in the background. Signed-off-by: Stephen Douthit Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 1fb3a7a75e2efcc83ef21f2434069cddd6fae6f5 Author: Kai-Heng Feng Date: Mon Dec 3 13:54:38 2018 +0800 igb: Fix an issue that PME is not enabled during runtime suspend I210 ethernet card doesn't wakeup when a cable gets plugged. It's because its PME is not set. Since commit 42eca2302146 ("PCI: Don't touch card regs after runtime suspend D3"), if the PCI state is saved, pci_pm_runtime_suspend() stops calling pci_finish_runtime_suspend(), which enables the PCI PME. To fix the issue, let's not to save PCI states when it's runtime suspend, to let the PCI subsystem enables PME. Fixes: 42eca2302146 ("PCI: Don't touch card regs after runtime suspend D3") Signed-off-by: Kai-Heng Feng Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit eec903769b4ea476591ffff73bb7359f14f38c51 Author: Young Xiao Date: Thu Nov 29 01:54:10 2018 +0000 ice: Do not enable NAPI on q_vectors that have no rings If ice driver has q_vectors w/ active NAPI that has no rings, then this will result in a divide by zero error. To correct it I am updating the driver code so that we only support NAPI on q_vectors that have 1 or more rings allocated to them. See commit 13a8cd191a2b ("i40e: Do not enable NAPI on q_vectors that have no rings") for detail. Signed-off-by: Young Xiao Acked-by: Anirudh Venkataramanan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit 9a2d57a7a0626783a62d205f255d8227b212c14b Author: Miroslav Lichvar Date: Wed Nov 28 17:07:49 2018 +0100 i40e: extend PTP gettime function to read system clock This adds support for the PTP_SYS_OFFSET_EXTENDED ioctl. Cc: Richard Cochran Cc: Jacob Keller Signed-off-by: Miroslav Lichvar Tested-by: Andrew Bowers Acked-by: Jacob Keller Signed-off-by: Jeff Kirsher commit 31389b53b3e0b535867af9090a5d19ec64768d55 Author: Konstantin Khorenko Date: Fri Nov 23 19:10:28 2018 +0300 i40e: define proper net_device::neigh_priv_len Out of bound read reported by KASan. i40iw_net_event() reads unconditionally 16 bytes from neigh->primary_key while the memory allocated for "neighbour" struct is evaluated in neigh_alloc() as tbl->entry_size + dev->neigh_priv_len where "dev" is a net_device. But the driver does not setup dev->neigh_priv_len and we read beyond the neigh entry allocated memory, so the patch in the next mail fixes this. Signed-off-by: Konstantin Khorenko Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher commit cd0d465bb697a9c7bf66a9fe940f7981232f1676 Author: YueHaibing Date: Mon Nov 19 20:48:19 2018 +0800 e100: Fix passing zero to 'PTR_ERR' warning in e100_load_ucode_wait Fix a static code checker warning: drivers/net/ethernet/intel/e100.c:1349 e100_load_ucode_wait() warn: passing zero to 'PTR_ERR' Signed-off-by: YueHaibing Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 2be09de7d6a06f58e768de1255a687c9aaa66606 Merge: 44a7b3b6e3a45 1d51b4b1d3f2d Author: David S. Miller Date: Thu Dec 20 10:53:28 2018 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net Lots of conflicts, by happily all cases of overlapping changes, parallel adds, things of that nature. Thanks to Stephen Rothwell, Saeed Mahameed, and others for their guidance in these resolutions. Signed-off-by: David S. Miller commit bad87ee82f74707913a27f16d40cd8a1c340b47e Author: Vinicius Costa Gomes Date: Fri Nov 16 16:19:24 2018 -0800 Documentation: igb: Add a section about CBS Add some pointers to the definition of the CBS algorithm, and some notes about the limits of its implementation in the i210 family of controllers. Signed-off-by: Vinicius Costa Gomes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 6f9ae17530f996e90268dae5ee843e432e40ccb3 Author: Jesus Sanchez-Palencia Date: Fri Nov 16 16:19:23 2018 -0800 igb: Change RXPBSIZE size when setting Qav mode Section 4.5.9 of the datasheet says that the total size of all packet buffers combined (TxPB 0 + 1 + 2 + 3 + RxPB + BMC2OS + OS2BMC) must not exceed 60KB. Today we are configuring a total of 62KB, so reduce the RxPB from 32KB to 30KB in order to respect that. The choice of changing RxPBSIZE here is mainly because it seems more correct to give more priority to the transmit packet buffers over the receiver ones when running in Qav mode. Also, the BMC2OS and OS2BMC sizes are already too short. Signed-off-by: Jesus Sanchez-Palencia Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 00203ba40d40d7f33857416adfb18adaf0e40123 Author: Jens Axboe Date: Thu Dec 20 08:50:58 2018 -0700 kyber: use sbitmap add_wait_queue/list_del wait helpers sbq_wake_ptr() checks sbq->ws_active to know if it needs to loop the wait indexes or not. This requires the use of the sbitmap waitqueue wrappers, but kyber doesn't use those for its domain token waitqueue handling. Convert kyber to use the helpers. This fixes a hang with waiting for domain tokens. Fixes: 5d2ee7122c73 ("sbitmap: optimize wakeup check") Tested-by: Ming Lei Reported-by: Ming Lei Reviewed-by: Omar Sandoval Signed-off-by: Jens Axboe commit 9f6b7ef6c3ebe35be77b0ae3cf12e4d25ae80420 Author: Jens Axboe Date: Thu Dec 20 08:49:00 2018 -0700 sbitmap: add helpers for add/del wait queue handling After commit 5d2ee7122c73, users of sbitmap that need wait queue handling must use the provided helpers. But we only added prepare_to_wait()/finish_wait() style helpers, add the equivalent add_wait_queue/list_del wrappers as we.. This is needed to ensure kyber plays by the sbitmap waitqueue rules. Tested-by: Ming Lei Reviewed-by: Omar Sandoval Signed-off-by: Jens Axboe commit 59361316afcb08569af21e1af83e89c7051c055a Author: Jeff Kirsher Date: Thu Aug 2 10:13:10 2018 -0700 igb: reduce CPU0 latency when updating statistics This change is based off of the work and suggestion of Jan Jablonsky . The Watchdog workqueue in igb driver is scheduled every 2s for each network interface. That includes updating a statistics protected by spinlock. Function igb_update_stats in this case will be protected against preemption. According to number of a statistics registers (cca 60), processing this function might cause additional cpu load on CPU0. In case of statistics spinlock may be replaced with mutex, which reduce latency on CPU0. CC: Bernhard Kaindl CC: Jan Jablonsky Signed-off-by: Jeff Kirsher Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher commit 2122b40580dd9d0620398739c773d07a7b7939d0 Author: Noralf Trønnes Date: Thu Dec 20 19:13:09 2018 +0100 fbdev: fbcon: Fix unregister crash when more than one framebuffer When unregistering fbdev using unregister_framebuffer(), any bound console will unbind automatically. This is working fine if this is the only framebuffer, resulting in a switch to the dummy console. However if there is a fb0 and I unregister fb1 having a bound console, I eventually get a crash. The fastest way for me to trigger the crash is to do a reboot, resulting in this splat: [ 76.478825] WARNING: CPU: 0 PID: 527 at linux/kernel/workqueue.c:1442 __queue_work+0x2d4/0x41c [ 76.478849] Modules linked in: raspberrypi_hwmon gpio_backlight backlight bcm2835_rng rng_core [last unloaded: tinydrm] [ 76.478916] CPU: 0 PID: 527 Comm: systemd-udevd Not tainted 4.20.0-rc4+ #4 [ 76.478933] Hardware name: BCM2835 [ 76.478949] Backtrace: [ 76.478995] [] (dump_backtrace) from [] (show_stack+0x20/0x24) [ 76.479022] r6:00000000 r5:c0bc73be r4:00000000 r3:6fb5bf81 [ 76.479060] [] (show_stack) from [] (dump_stack+0x20/0x28) [ 76.479102] [] (dump_stack) from [] (__warn+0xec/0x12c) [ 76.479134] [] (__warn) from [] (warn_slowpath_null+0x4c/0x58) [ 76.479165] r9:c0eb6944 r8:00000001 r7:c0e927f8 r6:c0bc73be r5:000005a2 r4:c0139e84 [ 76.479197] [] (warn_slowpath_null) from [] (__queue_work+0x2d4/0x41c) [ 76.479222] r6:d7666a00 r5:c0e918ee r4:dbc4e700 [ 76.479251] [] (__queue_work) from [] (queue_work_on+0x60/0x88) [ 76.479281] r10:c0496bf8 r9:00000100 r8:c0e92ae0 r7:00000001 r6:d9403700 r5:d7666a00 [ 76.479298] r4:20000113 [ 76.479348] [] (queue_work_on) from [] (cursor_timer_handler+0x30/0x54) [ 76.479374] r7:d8a8fabc r6:c0e08088 r5:d8afdc5c r4:d8a8fabc [ 76.479413] [] (cursor_timer_handler) from [] (call_timer_fn+0x100/0x230) [ 76.479435] r4:c0e9192f r3:d758a340 [ 76.479465] [] (call_timer_fn) from [] (expire_timers+0x10c/0x12c) [ 76.479495] r10:40000000 r9:c0e9192f r8:c0e92ae0 r7:d8afdccc r6:c0e19280 r5:c0496bf8 [ 76.479513] r4:d8a8fabc [ 76.479541] [] (expire_timers) from [] (run_timer_softirq+0xa8/0x184) [ 76.479570] r9:00000001 r8:c0e19280 r7:00000000 r6:c0e08088 r5:c0e1a3e0 r4:c0e19280 [ 76.479603] [] (run_timer_softirq) from [] (__do_softirq+0x1ac/0x3fc) [ 76.479632] r10:c0e91680 r9:d8afc020 r8:0000000a r7:00000100 r6:00000001 r5:00000002 [ 76.479650] r4:c0eb65ec [ 76.479686] [] (__do_softirq) from [] (irq_exit+0xe8/0x168) [ 76.479716] r10:d8d1a9b0 r9:d8afc000 r8:00000001 r7:d949c000 r6:00000000 r5:c0e8b3f0 [ 76.479734] r4:00000000 [ 76.479764] [] (irq_exit) from [] (__handle_domain_irq+0x94/0xb0) [ 76.479793] [] (__handle_domain_irq) from [] (bcm2835_handle_irq+0x3c/0x48) [ 76.479823] r8:d8afdebc r7:d8afddfc r6:ffffffff r5:c0e089f8 r4:d8afddc8 r3:d8afddc8 [ 76.479851] [] (bcm2835_handle_irq) from [] (__irq_svc+0x70/0x98) The problem is in the console rebinding in fbcon_fb_unbind(). It uses the virtual console index as the new framebuffer index to bind the console(s) to. The correct way is to use the con2fb_map lookup table to find the framebuffer index. Fixes: cfafca8067c6 ("fbdev: fbcon: console unregistration from unregister_framebuffer") Signed-off-by: Noralf Trønnes Reviewed-by: Mikulas Patocka Acked-by: Daniel Vetter Signed-off-by: Bartlomiej Zolnierkiewicz commit e9462fffddad94ee4cb50f6000989133bd15fb96 Author: Geert Uytterhoeven Date: Thu Dec 20 19:13:09 2018 +0100 fbdev: Remove depends on HAS_DMA in case of platform dependency Remove dependencies on HAS_DMA where a Kconfig symbol depends on another symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST". In most cases this other symbol is an architecture or platform specific symbol, or PCI. Generic symbols and drivers without platform dependencies keep their dependencies on HAS_DMA, to prevent compiling subsystems or drivers that cannot work anyway. This simplifies the dependencies, and allows to improve compile-testing. Signed-off-by: Geert Uytterhoeven Reviewed-by: Mark Brown Acked-by: Robin Murphy Signed-off-by: Bartlomiej Zolnierkiewicz commit da2648390ce3d409218b6bbbf2386d8ddeec2265 Author: Lubomir Rintel Date: Thu Dec 20 19:13:09 2018 +0100 pxa168fb: trivial typo fix A missing space in an error message. Signed-off-by: Lubomir Rintel Cc: Jiri Kosina Signed-off-by: Bartlomiej Zolnierkiewicz commit 5c29085a724fb8b84bb492a6e2645e28d9bc3dae Author: Wen Yang Date: Thu Dec 20 19:13:08 2018 +0100 fbdev: fsl-diu: remove redundant null check on cmap The null check on &info->cmap is redundant since cmap is a struct inside fb_info and can never be null, so the check is always true. We may remove it. Signed-off-by: Wen Yang Acked-by: Timur Tabi Cc: zhong.weidong@zte.com.cn Signed-off-by: Bartlomiej Zolnierkiewicz commit 452f2d4934d23f32cd9246bc52cf2c0b80560e2f Author: Yangtao Li Date: Thu Dec 20 19:13:08 2018 +0100 fbdev: omap2: omapfb: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Cc: Fengguang Wu Cc: Mauro Carvalho Chehab Signed-off-by: Bartlomiej Zolnierkiewicz commit e0f5628bf2c163a815bb728fa7899e8dc0a4a82c Author: Colin Ian King Date: Thu Dec 20 19:13:08 2018 +0100 fbdev: uvesafb: fix spelling mistake "memoery" -> "memory" There is a spelling mistake in the module parameter description, fix it. Signed-off-by: Colin Ian King Cc: Michal Januszewski Signed-off-by: Bartlomiej Zolnierkiewicz commit 3d8b1933eb1c3c94ef8667996dbff6994d5d552f Author: Peter Rosin Date: Thu Dec 20 19:13:08 2018 +0100 fbdev: fbmem: add config option to center the bootup logo If there are extra logos (CONFIG_FB_LOGO_EXTRA) the heights of these extra logos are not considered when centering the first logo vertically. Signed-off-by: Peter Rosin Signed-off-by: Bartlomiej Zolnierkiewicz commit e41f184d83a3a1e12abbf00a829d9de579d6b0fe Author: Peter Rosin Date: Thu Dec 20 19:13:08 2018 +0100 fbdev: fbmem: make fb_show_logo_line return the end instead of the height In preparation for allowing centering of the bootup logo, make fb_show_logo_line return where the next free framebuffer line is, instead of returning the height of the shown logo. Signed-off-by: Peter Rosin Signed-off-by: Bartlomiej Zolnierkiewicz commit 2607391882fca37463187e7f2a9c76dec286947e Author: YueHaibing Date: Thu Dec 20 19:13:08 2018 +0100 video: fbdev: pxafb: Fix "WARNING: invalid free of devm_ allocated data" 'info->modes' got allocated with devm_kcalloc in of_get_pxafb_display. This gives this error message: ./drivers/video/fbdev/pxafb.c:2238:2-7: WARNING: invalid free of devm_ allocated data Fixes: c8f96304ec8b4 ("video: fbdev: pxafb: switch to devm_* API") Cc: stable@kernel.org [v4.19+] Signed-off-by: YueHaibing Reviewed-by: Daniel Mack Cc: Robert Jarzmik Signed-off-by: Bartlomiej Zolnierkiewicz commit f75df8d4b4fabfad7e3cba2debfad12741c6fde7 Author: Peter Rosin Date: Thu Dec 20 19:13:07 2018 +0100 fbdev: fbmem: behave better with small rotated displays and many CPUs Blitting an image with "negative" offsets is not working since there is no clipping. It hopefully just crashes. For the bootup logo, there is protection so that blitting does not happen as the image is drawn further and further to the right (ROTATE_UR) or further and further down (ROTATE_CW). There is however no protection when drawing in the opposite directions (ROTATE_UD and ROTATE_CCW). Add back this protection. The regression is 20-odd years old but the mindless warning-killing mentality displayed in commit 34bdb666f4b2 ("fbdev: fbmem: remove positive test on unsigned values") is also to blame, methinks. Fixes: 448d479747b8 ("fbdev: fb_do_show_logo() updates") Signed-off-by: Peter Rosin Cc: Tomi Valkeinen Cc: Fabian Frederick Cc: Geert Uytterhoeven cc: Geoff Levand Cc: James Simmons Signed-off-by: Bartlomiej Zolnierkiewicz commit fdac751355cd76e049f628afe6acb8ff4b1399f7 Author: Alexey Khoroshilov Date: Thu Dec 20 19:13:07 2018 +0100 video: clps711x-fb: release disp device node in probe() clps711x_fb_probe() increments refcnt of disp device node by of_parse_phandle() and leaves it undecremented on both successful and error paths. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Cc: Alexander Shiyan Signed-off-by: Bartlomiej Zolnierkiewicz commit b4a1ed0cd18b771e4279b4eb9cf39b565560eea6 Author: Rob Clark Date: Thu Dec 20 19:13:07 2018 +0100 fbdev: make FB_BACKLIGHT a tristate BACKLIGHT_CLASS_DEVICE is already tristate, but a dependency FB_BACKLIGHT prevents it from being built as a module. There doesn't seem to be any particularly good reason for this, so switch FB_BACKLIGHT over to tristate. Signed-off-by: Rob Clark Tested-by: Arnd Bergmann Cc: Simon Horman Cc: Geert Uytterhoeven Cc: Laurent Pinchart Cc: Daniel Vetter Cc: Ulf Magnusson Cc: Randy Dunlap Cc: Hans de Goede Signed-off-by: Bartlomiej Zolnierkiewicz commit c143a559b073aeea688b9bb7c5b46f3cf322d569 Author: Dan Carpenter Date: Thu Dec 20 19:13:07 2018 +0100 udlfb: fix some inconsistent NULL checking In the current kernel, then kzalloc() can't fail for small allocations, but if it did fail then we would have a NULL dereference in the error handling. Also in dlfb_usb_disconnect() if "info" were NULL then it would cause an Oops inside the unregister_framebuffer() function but it can't be NULL so let's remove that check. Fixes: 68a958a915ca ("udlfb: handle unplug properly") Signed-off-by: Dan Carpenter Cc: Bernie Thompson Cc: Mikulas Patocka Cc: Alexey Khoroshilov Cc: Colin Ian King Cc: Wen Yang [b.zolnierkie: added "Fixes:" tag] Signed-off-by: Bartlomiej Zolnierkiewicz commit adcc81f148d733b7e8e641300c5590a2cdc13bf3 Author: Paul Burton Date: Thu Dec 20 17:45:43 2018 +0000 MIPS: math-emu: Write-protect delay slot emulation pages Mapping the delay slot emulation page as both writeable & executable presents a security risk, in that if an exploit can write to & jump into the page then it can be used as an easy way to execute arbitrary code. Prevent this by mapping the page read-only for userland, and using access_process_vm() with the FOLL_FORCE flag to write to it from mips_dsemul(). This will likely be less efficient due to copy_to_user_page() performing cache maintenance on a whole page, rather than a single line as in the previous use of flush_cache_sigtramp(). However this delay slot emulation code ought not to be running in any performance critical paths anyway so this isn't really a problem, and we can probably do better in copy_to_user_page() anyway in future. A major advantage of this approach is that the fix is small & simple to backport to stable kernels. Reported-by: Andy Lutomirski Signed-off-by: Paul Burton Fixes: 432c6bacbd0c ("MIPS: Use per-mm page to execute branch delay slot instructions") Cc: stable@vger.kernel.org # v4.8+ Cc: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: Rich Felker Cc: David Daney commit b49d564344f773d8afee982153c8493e5f2eaf38 Author: Paul Gortmaker Date: Fri Dec 14 16:48:07 2018 -0500 security: integrity: partial revert of make ima_main explicitly non-modular In commit 4f83d5ea643a ("security: integrity: make ima_main explicitly non-modular") I'd removed after assuming that the function is_module_sig_enforced() was an LSM function and not a core kernel module function. Unfortunately the typical .config selections used in build testing provide an implicit presence, and so normal/typical build testing did not immediately reveal my incorrect assumption. Cc: Mimi Zohar Cc: Dmitry Kasatkin Cc: James Morris Cc: "Serge E. Hallyn" Cc: linux-ima-devel@lists.sourceforge.net Cc: linux-security-module@vger.kernel.org Reported-by: Randy Dunlap Signed-off-by: Paul Gortmaker Signed-off-by: James Morris commit 883f4def8b77e6870ce42be279564cca0256c611 Merge: ca46afdb2754d 89a0948984896 Author: Ingo Molnar Date: Thu Dec 20 18:51:47 2018 +0100 Merge tag 'perf-core-for-mingo-4.21-20181218' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: - Implement BPF based syscall filtering in 'perf trace', using BPF maps and the augmented_raw_syscalls.c BPF proggie (Arnaldo Carvalho de Melo) - Allow specifying in .perfconfig a set of events use in 'perf trace' in addition to any other specified from the command line. This initially will be used to always use the augmented_raw_syscalls.o precompiled BPF program for getting pointer contents. (Arnaldo Carvalho de Melo) - Allow fine grained control about how the syscall output should be formatted. This will be used to allow producing the same output produced by the 'strace' tool, to then use in regression tests comparing the output of 'perf trace' with the one produced from 'strace' (Arnaldo Carvalho de Melo) - Beautify the renameat2 olddirfd, newdirfd and flags arguments (Arnaldo Carvalho de Melo) - Beautify arch_prctl 'code' syscall arg (Arnaldo Carvalho de Melo) - Beautify fadvise64 'advice' syscall arg (Arnaldo Carvalho de Melo) - Relax checks on perf-PID.map ownership, resulting in symbols in executable anonymous maps setup by JITs in things like node.js to be resolved in a 'perf top' session run by root without the need for --force to be used (Arnaldo Carvalho de Melo) - Update asm-generic/unistd.h copy (Arnaldo Carvalho de Melo) - Do not use the first and last symbols when setting up address filters in auxtrace, this fails when we don't have a symbol table, filter the entire area based on the dso size. (Adrian Hunter) - Do not use kernel headers to build libsubcmd, we shouldn't use anything from outside tools/, fixes the build with the Android NDK (Arnaldo Carvalho de Melo) - Add several prototypes for systems lacking those, such as open_memstream(), sigqueue(), fixing warnings building with Android's bionic libc that were preventing the use of -Werror there (Arnaldo Carvalho de Melo) - Use LDFLAGS in the libtraceevent build commands, allowing developers to override its values (Jiri Olsa) - Link libperf-jvmti.so with LDFLAGS variable, allowing distro packages to propagate its settings when building this library (Jiri Olsa) - cs-etm (ARM CoreSight) fixes: (Leo Yan) - Correct packets swapping in cs_etm__flush() - Avoid stale branch samples when flush packet - Remove unused 'trace_on' in cs_etm_decoder - Refactor enumeration cs_etm_sample_type - Rename CS_ETM_TRACE_ON to CS_ETM_DISCONTINUITY - Treat NO_SYNC element as trace discontinuity - Treat EO_TRACE element as trace discontinuity - Generate branch sample for exception packet - Use shebangs in the 'perf test' shell scripts, making them identifiable as shell scripts (Michael Petlan) - Avoid segfaults caused by negated options in 'perf stat' (Michael Petlan) - Fix processing of dereferenced args in bprintk events in libtracevent (Steven Rostedt) Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar commit fbbae71d374f24887d78631e50210b7110fffb84 Merge: 19de2fa86e692 84758d4d43e9e Author: Kalle Valo Date: Thu Dec 20 19:25:43 2018 +0200 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for 4.21. Major changes: ath10k * add amsdu support for QCA6174 monitor mode * report tx rate using the new ieee80211_tx_rate_update() API * wcn3990 support is not experimental anymore commit 8c9d90eebd23b6d40ddf4ce5df5ca2b932336a06 Author: Jerry (Fangzhi) Zuo Date: Mon Dec 17 10:32:22 2018 -0500 drm/amd/display: Fix MST dp_blank REG_WAIT timeout Need to blank stream before deallocate MST payload. [drm:generic_reg_wait [amdgpu]] *ERROR* REG_WAIT timeout 10us * 3000 tries - dce110_stream_encoder_dp_blank line:944 ------------[ cut here ]------------ WARNING: CPU: 0 PID: 2201 at /var/lib/dkms/amdgpu/18.50-690240/build/amd/amdgpu/../display/dc/dc_helper.c:249 generic_reg_wait+0xe7/0x160 [amdgpu] Call Trace: dce110_stream_encoder_dp_blank+0x11c/0x180 [amdgpu] core_link_disable_stream+0x40/0x230 [amdgpu] ? generic_reg_update_ex+0xdb/0x130 [amdgpu] dce110_reset_hw_ctx_wrap+0xb7/0x1f0 [amdgpu] dce110_apply_ctx_to_hw+0x30/0x430 [amdgpu] ? dce110_apply_ctx_for_surface+0x206/0x260 [amdgpu] dc_commit_state+0x2ba/0x4d0 [amdgpu] amdgpu_dm_atomic_commit_tail+0x297/0xd70 [amdgpu] ? amdgpu_bo_pin_restricted+0x58/0x260 [amdgpu] ? wait_for_completion_timeout+0x1f/0x120 ? wait_for_completion_interruptible+0x1c/0x160 commit_tail+0x3d/0x60 [drm_kms_helper] drm_atomic_helper_commit+0xf6/0x100 [drm_kms_helper] drm_atomic_connector_commit_dpms+0xe5/0xf0 [drm] drm_mode_obj_set_property_ioctl+0x14f/0x250 [drm] drm_mode_connector_property_set_ioctl+0x2e/0x40 [drm] drm_ioctl+0x1e0/0x430 [drm] ? drm_mode_connector_set_obj_prop+0x70/0x70 [drm] ? ep_read_events_proc+0xb0/0xb0 ? ep_scan_ready_list.constprop.18+0x1e6/0x1f0 ? timerqueue_add+0x52/0x80 amdgpu_drm_ioctl+0x49/0x80 [amdgpu] do_vfs_ioctl+0x90/0x5f0 SyS_ioctl+0x74/0x80 do_syscall_64+0x74/0x140 entry_SYSCALL_64_after_hwframe+0x3d/0xa2 ---[ end trace 3ed7b77a97d60f72 ]--- Signed-off-by: Jerry (Fangzhi) Zuo Reviewed-by: Hersen Wu Acked-by: Harry Wentland Acked-by: Alex Deucher Tested-by: Lyude Paul Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 99b922f9ed6a6313c0d2247cde8aa1e4a0bd67e4 Author: Wenjing Liu Date: Wed Dec 5 12:14:45 2018 -0500 drm/amd/display: validate extended dongle caps [why] Some dongle doesn't have a valid extended dongle caps, but we still set the extended dongle caps to be valid. This causes validation fails for all timing. [how] If no dp_hdmi_max_pixel_clk is provided, don't use extended dongle caps. Signed-off-by: Wenjing Liu Reviewed-by: Aric Cyr Reviewed-by: Jun Lei Acked-by: Abdoulaye Berthe Acked-by: Leo Li Signed-off-by: Alex Deucher commit 9136e81e986a7a44bd360a2d2abf19de886feaa8 Author: Nicholas Kazlauskas Date: Wed Dec 19 08:35:51 2018 -0500 drm/amd/display: Use div_u64 for flip timestamp ns to ms Resolves __udivdi3 missing errors when building for i386. Fixes: 6378ef012ddc ("drm/amd/display: Add below the range support for FreeSync") Signed-off-by: Nicholas Kazlauskas Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 2bf55d2e6b71c8d79a7960d4f88bebc03f0e9a00 Author: James Zhu Date: Tue Dec 18 16:03:22 2018 -0500 drm/amdgpu/uvd:Change uvd ring name convention Since umr tool can't handle bracket, change uvd ring name convention. Signed-off-by: James Zhu Reviewed-by: Alex Deucher Reviewed-by: Christian König Signed-off-by: Alex Deucher commit c1973a1078dee6e8c9bd77825f40f84c21be142f Author: Evan Quan Date: Tue Dec 18 19:06:53 2018 +0800 drm/amd/powerplay: add Vega20 LCLK DPM level setting support Support manual LCLK DPM level switch on Vega20. Signed-off-by: Evan Quan Acked-by: Alex Deucher Reviewed-by: Rex Zhu Reviewed-by: Feifei Xu Signed-off-by: Alex Deucher commit 0346bfd9fe5ade369d9f946f82d6a43d113ba493 Author: Trigger Huang Date: Tue Dec 18 09:14:47 2018 +0800 drm/amdgpu: print process info when job timeout When a job is timeout, try to print the related process information for debugging Signed-off-by: Trigger Huang Reviewed-by: Christian König . Signed-off-by: Alex Deucher commit e01f2d41895102d824c6b8f5e011dd5e286d5e8b Author: Alex Deucher Date: Wed Dec 19 18:05:41 2018 -0500 drm/amdgpu/nbio7.4: add hw bug workaround for vega20 Configure PCIE_CI_CNTL to work around a hw bug that affects some multi-GPU compute workloads. Acked-by: Feifei Xu Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher commit 40978ac636136aa0fb018a470008a717fd69c89c Author: Alex Deucher Date: Wed Dec 19 18:01:53 2018 -0500 drm/amdgpu/nbio6.1: add hw bug workaround for vega10/12 Configure PCIE_CI_CNTL to work around a hw bug that affects some multi-GPU compute workloads. Acked-by: Feifei Xu Reviewed-by: Harish Kasiviswanathan Signed-off-by: Alex Deucher commit 215852f4b8bbf7a8d6a534dfb367bb0f1a2d5011 Author: Jona Crasselt Date: Thu Dec 20 17:57:37 2018 +0100 staging: mt7621-mmc: Correct spelling mistakes in comments Changed "avaiable" to "available" and "interupt" to "interrupt". Signed-off-by: Jona Crasselt Signed-off-by: Felix Windsheimer Signed-off-by: Greg Kroah-Hartman commit 84758d4d43e9e38f2bf9b5130b5f7db1c44f1e0b Author: Bhagavathi Perumal S Date: Thu Dec 20 14:26:00 2018 +0200 ath10k: add support to configure BB timing over wmi Add wmi configuration cmd to configure base band(BB) power amplifier(PA) off timing values in hardware. The default PA off timings were fine tuned to make proper DFS radar detection in QCA reference design. If ODM uses different PA in their design, then the same default PA off timing values cannot be used, it requires different settling time to detect radar pulses very sooner and avoid radar detection problems. In that case it provides provision to select proper PA off timing values based on the PA hardware used. The PA component is part of FEM hardware and new device tree entry "ext-fem-name" is used to indentify the FEM hardware. And this wmi configuration cmd is enabled via wmi service flag "WMI_SERVICE_BB_TIMING_CONFIG_SUPPORT". Other way is to apply these values through calibration data, but recalibration of all boards out there might not be feasible. This change tested on firmware ver 10.2.4-1.0-00042 in QCA988X chipset. Signed-off-by: Bhagavathi Perumal S Signed-off-by: Kalle Valo commit f3f587995c5af69b92693c2f5d40e3448ab6113d Author: Bhagavathi Perumal S Date: Thu Dec 20 14:25:43 2018 +0200 dt-bindings: net: ath10k: add new dt entry to identify external FEM This adds new dt entry ext-fem-name, it is used by ath10k driver to select correct timing parameters and configure it in target wifi hardware. The Front End Module(FEM) normally includes tx power amplifier(PA) and rx low noise amplifier(LNA). The default timing parameters like tx end to PA off timing values were fine tuned for internal FEM used in reference design. And these timing values can not be same if ODM modifies hardware design with different external FEM. This DT entry helps to choose correct timing values in driver if different external FEM hardware used. Signed-off-by: Bhagavathi Perumal S Reviewed-by: Rob Herring Signed-off-by: Kalle Valo commit e5404969a335e25e3eb822649a7f40e9c5ba2446 Author: Bhagavathi Perumal S Date: Thu Dec 20 14:25:32 2018 +0200 dt-bindings: net: ath10k: fix node name and device type in qcom ath10k example In qcom,ath10k documentation, ath10k is used as node name in the example of pci based device. Normally, node name should be class of device and not the model name, so fix it to node name "wifi". And remove the property device_type pci since only pci bridges should have this property. Signed-off-by: Bhagavathi Perumal S Reviewed-by: Rob Herring Signed-off-by: Kalle Valo commit 386f97e3b201d18578abb0e7037b85a1ae50c0a3 Author: Zhi Chen Date: Thu Dec 20 14:25:18 2018 +0200 ath10k: fix tx_stats memory leak Memory of tx_stats was allocated when a STA was added. But it's not freed if the STA failed to be added to driver. This issue could be seen in MDK3 attack case when STA number reached the limit. Tested: QCA9984 with firmware ver 10.4-3.9.0.1-00005 Signed-off-by: Zhi Chen Signed-off-by: Kalle Valo commit 2d3b55853b123c177037cf534c5aaa2650310094 Author: Zhi Chen Date: Thu Dec 20 14:24:43 2018 +0200 ath10k: fix peer stats null pointer dereference There was a race condition in SMP that an ath10k_peer was created but its member sta was null. Following are procedures of ath10k_peer creation and member sta access in peer statistics path. 1. Peer creation: ath10k_peer_create() =>ath10k_wmi_peer_create() =>ath10k_wait_for_peer_created() ... # another kernel path, RX from firmware ath10k_htt_t2h_msg_handler() =>ath10k_peer_map_event() =>wake_up() # ar->peer_map[id] = peer //add peer to map #wake up original path from waiting ... # peer->sta = sta //sta assignment 2. RX path of statistics ath10k_htt_t2h_msg_handler() =>ath10k_update_per_peer_tx_stats() =>ath10k_htt_fetch_peer_stats() # peer->sta //sta accessing Any access of peer->sta after peer was added to peer_map but before sta was assigned could cause a null pointer issue. And because these two steps are asynchronous, no proper lock can protect them. So both peer and sta need to be checked before access. Tested: QCA9984 with firmware ver 10.4-3.9.0.1-00005 Signed-off-by: Zhi Chen Signed-off-by: Kalle Valo commit a3542d0c73cec6a45bde512ea2b43666c05a8c54 Author: Govind Singh Date: Thu Dec 20 14:24:23 2018 +0200 dt: bindings: ath10k: add bindings for wifi iommu node WCN3990 wifi module can optionally make use of the IOMMU. Add binding documentation for phandle to the IOMMU and the stream id of wifi iommu block. Signed-off-by: Govind Singh Reviewed-by: Rob Herring Reviewed-by: Brian Norris Tested-by: Brian Norris Signed-off-by: Kalle Valo commit 5fac78aac91d89b4a04c1cbd92254f62935c2711 Author: Govind Singh Date: Thu Dec 20 14:24:10 2018 +0200 dt: bindings: ath10k: add missing dt properties for WCN3990 wifi node Add missing optional properties in WCN3990 wifi node. Signed-off-by: Govind Singh Reviewed-by: Rob Herring Reviewed-by: Brian Norris Tested-by: Brian Norris Signed-off-by: Kalle Valo commit 27120f2ac995d83fef383fb20e492037ecf09259 Author: Dan Carpenter Date: Thu Dec 20 09:53:45 2018 +0200 ath10k: remove an unnecessary NULL check The "survey" pointer is the address of an array element. We know that it can't be NULL so this check can be removed. Signed-off-by: Dan Carpenter Signed-off-by: Kalle Valo commit bd085be6ba9547795ddcbdc5cc0c78ea0201ba6e Author: Govind Singh Date: Thu Dec 20 09:53:43 2018 +0200 ath10k: move non-fatal warn logs to dbg level During driver load below warn logs are printed in the console. Since driver may not implement all wmi events sent by fw and all of them are non-fatal, move this log to debug level to remove un-necessary warn message on console. [ 361.887230] ath10k_snoc a000000.wifi: Unknown eventid: 16393 [ 361.907037] ath10k_snoc a000000.wifi: Unknown eventid: 237569 Signed-off-by: Govind Singh Signed-off-by: Kalle Valo commit c28dcbce0592a1a7e32975e28bdd80e5d8d2cfa3 Author: Dan Carpenter Date: Thu Dec 20 09:53:41 2018 +0200 ath10k: fix a NULL vs IS_ERR() check The devm_memremap() function doesn't return NULLs, it returns error pointers. Fixes: ba94c753ccb4 ("ath10k: add QMI message handshake for wcn3990 client") Signed-off-by: Dan Carpenter Signed-off-by: Kalle Valo commit 8765967592875f1b4b20a8541a325045e5f75a36 Author: Govind Singh Date: Thu Dec 20 09:53:36 2018 +0200 ath10k: remove work in progress logs from snoc driver All the necessary patches to make wifi running (over SNOC) are merged and tested on SDM845/QCS404 platform with WCN3990 wifi module, hence remove work in progress debug from snoc driver and Kconfig. Signed-off-by: Govind Singh Signed-off-by: Kalle Valo commit a2864772f33aa0f22914049b7fe777b7d4ec05ee Author: Bhagavathi Perumal S Date: Thu Dec 20 09:53:34 2018 +0200 ath10k: fix warning due to msdu limit error Some hardwares variants (QCA99x0) are limiting msdu deaggregation with some threshold value(default limit in QCA99x0 is 64 msdus), it was introduced to avoid excessive MSDU-deaggregation in error cases. When number of sub frames exceeds the limit, target hardware will send all msdus starting from present msdu in RAW format as a single msdu packet and it will be indicated with error status bit "RX_MSDU_END_INFO0_MSDU_LIMIT_ERR" set in rx descriptor. This msdu frame is a partial raw MSDU and does't have first msdu and ieee80211 header. It caused below warning message. [ 320.151332] ------------[ cut here ]------------ [ 320.155006] WARNING: CPU: 0 PID: 3 at drivers/net/wireless/ath/ath10k/htt_rx.c:1188 In our issue case, MSDU limit error happened due to FCS error and generated this warning message. This fixes the warning by handling the MSDU limit error. If msdu limit error happens, driver adds first MSDU's ieee80211 header and sets A-MSDU present bit in QOS header so that upper layer processes this frame if it is valid or drop it if FCS error set. And removed the warning message, hence partial msdus without first msdu is expected in msdu limit error cases. Tested on QCA9984, Firmware 10.4-3.6-00104 Signed-off-by: Bhagavathi Perumal S Signed-off-by: Kalle Valo commit 68c295f21abc192163c416b333aca7c41a195075 Author: Sathishkumar Muruganandam Date: Thu Dec 20 09:53:30 2018 +0200 ath10k: disable 4addr source port learning in 10.4 FW by default Currently in 10.4 FW, all the received 4addr frames are processed for source port learning which is enabled by default. This learning can't be disabled by default in FW since it breaks backward compatibility. Since ath10k uses mac80211 based 4addr mode, source port learning done in 10.4 FW is redundant and also causes issues when 3addr frames are transmitted/received for a 4addr station. One such visible functional impact is when GTK rekey frame from hostapd based AP to 4addr STA is dropped in AP's 10.4 FW. This is since GTK rekey EAPOL frame is 3addr frame on AP interface and STA enabled with 4addr is already allowed for receiving 3addr EAPOL frames. Source port learning implementation in 10.4 FW drops this 3addr GTK rekey frame in AP destinated for 4addr STA causing disassociation and re-association for every GTK rekey session. GTK rekey issue is not seen when learning is disabled in FW. To prevent such issues without breaking backward compatibility, FW advertises new service bit making the source port learning configurable and this learning is being currently disabled during ath10k vdev creation. * Tested HW: QCA9984 * Tested FW: 10.4-3.6.0.1-00004 Signed-off-by: Sathishkumar Muruganandam Signed-off-by: Kalle Valo commit 9a9cf0e63f707303dd4bbd2e14f812b85116b8b5 Author: Anilkumar Kolli Date: Thu Dec 20 09:53:28 2018 +0200 ath10k: report tx rate using ieee80211_tx_rate_update() Mesh path metric needs tx rate information from ieee80211_tx_status() call but in ath10k there is no mechanism to report tx rate information via ieee80211_tx_status(), the tx rate is only accessible via sta_statiscs() op. Per peer tx stats has tx rate info available, Tx rate is available to ath10k driver after every 4 PPDU sent in the air. For each PPDU, ath10k driver updates rate informattion to mac80211 using ieee80211_tx_rate_update(). Per peer txrate information is updated through per peer statistics and is available for QCA9888/QCA9984/QCA4019/QCA998X only Tested on QCA9984 with firmware-5.bin_10.4-3.5.3-00053 Tested on QCA998X with firmware-5.bin_10.2.4-1.0-00036 Signed-off-by: Anilkumar Kolli Signed-off-by: Kalle Valo commit e820d55cb99dd93ac2dc949cf486bb187e5cd70d Author: Guoqing Jiang Date: Wed Dec 19 14:19:25 2018 +0800 md: fix raid10 hang issue caused by barrier When both regular IO and resync IO happen at the same time, and if we also need to split regular. Then we can see tasks hang due to barrier. 1. resync thread [ 1463.757205] INFO: task md1_resync:5215 blocked for more than 480 seconds. [ 1463.757207] Not tainted 4.19.5-1-default #1 [ 1463.757209] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 1463.757212] md1_resync D 0 5215 2 0x80000000 [ 1463.757216] Call Trace: [ 1463.757223] ? __schedule+0x29a/0x880 [ 1463.757231] ? raise_barrier+0x8d/0x140 [raid10] [ 1463.757236] schedule+0x78/0x110 [ 1463.757243] raise_barrier+0x8d/0x140 [raid10] [ 1463.757248] ? wait_woken+0x80/0x80 [ 1463.757257] raid10_sync_request+0x1f6/0x1e30 [raid10] [ 1463.757265] ? _raw_spin_unlock_irq+0x22/0x40 [ 1463.757284] ? is_mddev_idle+0x125/0x137 [md_mod] [ 1463.757302] md_do_sync.cold.78+0x404/0x969 [md_mod] [ 1463.757311] ? wait_woken+0x80/0x80 [ 1463.757336] ? md_rdev_init+0xb0/0xb0 [md_mod] [ 1463.757351] md_thread+0xe9/0x140 [md_mod] [ 1463.757358] ? _raw_spin_unlock_irqrestore+0x2e/0x60 [ 1463.757364] ? __kthread_parkme+0x4c/0x70 [ 1463.757369] kthread+0x112/0x130 [ 1463.757374] ? kthread_create_worker_on_cpu+0x40/0x40 [ 1463.757380] ret_from_fork+0x3a/0x50 2. regular IO [ 1463.760679] INFO: task kworker/0:8:5367 blocked for more than 480 seconds. [ 1463.760683] Not tainted 4.19.5-1-default #1 [ 1463.760684] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 1463.760687] kworker/0:8 D 0 5367 2 0x80000000 [ 1463.760718] Workqueue: md submit_flushes [md_mod] [ 1463.760721] Call Trace: [ 1463.760731] ? __schedule+0x29a/0x880 [ 1463.760741] ? wait_barrier+0xdd/0x170 [raid10] [ 1463.760746] schedule+0x78/0x110 [ 1463.760753] wait_barrier+0xdd/0x170 [raid10] [ 1463.760761] ? wait_woken+0x80/0x80 [ 1463.760768] raid10_write_request+0xf2/0x900 [raid10] [ 1463.760774] ? wait_woken+0x80/0x80 [ 1463.760778] ? mempool_alloc+0x55/0x160 [ 1463.760795] ? md_write_start+0xa9/0x270 [md_mod] [ 1463.760801] ? try_to_wake_up+0x44/0x470 [ 1463.760810] raid10_make_request+0xc1/0x120 [raid10] [ 1463.760816] ? wait_woken+0x80/0x80 [ 1463.760831] md_handle_request+0x121/0x190 [md_mod] [ 1463.760851] md_make_request+0x78/0x190 [md_mod] [ 1463.760860] generic_make_request+0x1c6/0x470 [ 1463.760870] raid10_write_request+0x77a/0x900 [raid10] [ 1463.760875] ? wait_woken+0x80/0x80 [ 1463.760879] ? mempool_alloc+0x55/0x160 [ 1463.760895] ? md_write_start+0xa9/0x270 [md_mod] [ 1463.760904] raid10_make_request+0xc1/0x120 [raid10] [ 1463.760910] ? wait_woken+0x80/0x80 [ 1463.760926] md_handle_request+0x121/0x190 [md_mod] [ 1463.760931] ? _raw_spin_unlock_irq+0x22/0x40 [ 1463.760936] ? finish_task_switch+0x74/0x260 [ 1463.760954] submit_flushes+0x21/0x40 [md_mod] So resync io is waiting for regular write io to complete to decrease nr_pending (conf->barrier++ is called before waiting). The regular write io splits another bio after call wait_barrier which call nr_pending++, then the splitted bio would continue with raid10_write_request -> wait_barrier, so the splitted bio has to wait for barrier to be zero, then deadlock happens as follows. resync io regular io raise_barrier wait_barrier generic_make_request wait_barrier To resolve the issue, we need to call allow_barrier to decrease nr_pending before generic_make_request since regular IO is not issued to underlying devices, and wait_barrier is called again to ensure no internal IO happening. Fixes: fc9977dd069e ("md/raid10: simplify the splitting of requests.") Reported-and-tested-by: Siniša Bandin Signed-off-by: Guoqing Jiang Signed-off-by: Shaohua Li commit caea3c47ad515210129f06b6bbe53f82f69efebe Author: Guoqing Jiang Date: Fri Dec 7 18:24:21 2018 +0800 raid10: refactor common wait code from regular read/write request Both raid10_read_request and raid10_write_request share the same code at the beginning of them, so introduce regular_request_wait to clean up code, and call it in both request functions. Signed-off-by: Guoqing Jiang Signed-off-by: Shaohua Li commit 37b22c28946046e587c12b2b5bdaba7062e23f75 Author: Chengguang Xu Date: Wed Nov 14 07:33:09 2018 +0800 md: remvoe redundant condition check mempool_destroy() can handle NULL pointer correctly, so there is no need to check NULL pointer before calling mempool_destroy(). Signed-off-by: Chengguang Xu Signed-off-by: Shaohua Li commit be85f93ae2df32dea0b20908316f1d894c3e0f64 Author: Daniel Verkamp Date: Mon Nov 12 15:26:52 2018 -0800 lib/raid6: add option to skip algo benchmarking This is helpful for systems where fast startup time is important. It is especially nice to avoid benchmarking RAID functions that are never used (for example, BTRFS selects RAID6_PQ even if the parity RAID mode is not in use). This saves 250+ milliseconds of boot time on modern x86 and ARM systems with a dozen or more available implementations. The new option is defaulted to 'y' to match the previous behavior of always benchmarking on init. Signed-off-by: Daniel Verkamp Signed-off-by: Shaohua Li commit 0437de4fa09fe59b57d12b785e4afb73b0f34c05 Author: Daniel Verkamp Date: Mon Nov 12 15:26:51 2018 -0800 lib/raid6: sort algos in rough performance order Sort the list of RAID6 algorithms in roughly decreasing order of expected performance: newer instruction sets first (within each architecture) and wider unrollings first. This doesn't make any difference right now, since all functions are benchmarked; a follow-up change will make use of this by optionally choosing the first valid function rather than testing all of them. The Itanium raid6_intx{16,32} entries are also moved down to be near the other raid6_intx entries for clarity. Signed-off-by: Daniel Verkamp Signed-off-by: Shaohua Li commit 86919f9dd2dbb88bbbe4e381dc8e6b9e9a1b9eb5 Author: Daniel Verkamp Date: Mon Nov 12 15:22:18 2018 -0800 lib/raid6: check for assembler SSSE3 support Allow the x86 SSSE3 recovery function to be tested in raid6test. Signed-off-by: Daniel Verkamp Signed-off-by: Shaohua Li commit 58af3110a7c5d161f72f94a98c6f2b9b75bf5cf9 Author: Daniel Verkamp Date: Mon Nov 12 15:22:17 2018 -0800 lib/raid6: avoid __attribute_const__ redefinition This is defined in glibc's sys/cdefs.h on my system with the same definition as the raid6test fallback definition. Add a #ifndef check to avoid a compiler warning about redefining it. Signed-off-by: Daniel Verkamp Signed-off-by: Shaohua Li commit e731f3e28b7e7d1c745b03084e01036ee00018eb Author: Daniel Verkamp Date: Mon Nov 12 15:22:16 2018 -0800 lib/raid6: add missing include for raid6test Add #include for gettimeofday() to fix the compiler warning about an implicitly defined functions. Signed-off-by: Daniel Verkamp Signed-off-by: Shaohua Li commit f91389c8d2867d10a206273b8eb3b7955b65591e Author: Yue Haibing Date: Thu Nov 8 12:11:06 2018 +0000 md: remove set but not used variable 'bi_rdev' Fixes gcc '-Wunused-but-set-variable' warning: drivers/md/md.c: In function 'md_integrity_add_rdev': drivers/md/md.c:2149:24: warning: variable 'bi_rdev' set but not used [-Wunused-but-set-variable] It not used any more after commit 1501efadc524 ("md/raid: only permit hot-add of compatible integrity profiles") Signed-off-by: Yue Haibing Signed-off-by: Shaohua Li commit 85bd0107c6cd445a33066a57658fc585244a1100 Author: Yu Wang Date: Thu Dec 20 09:53:26 2018 +0200 ath10k: add amsdu support for monitor mode When processing HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND, if the length of a msdu is larger than the tailroom of the rx skb, skb_over_panic issue will happen when calling skb_put. In monitor mode, amsdu will be handled in this path, and msdu_len of the first msdu_desc is the length of the entire amsdu, which might be larger than the maximum length of a skb, in such case, it will hit the issue upon. To fix this issue, process msdu list separately for monitor mode. Successfully tested with: QCA6174 (FW version: RM.4.4.1.c2-00057-QCARMSWP-1). Signed-off-by: Yu Wang [kvalo@codeaurora.org: cosmetic cleanup] Signed-off-by: Kalle Valo commit 5816a0932b4fd74257b8cc5785bc8067186a8723 Author: Nathan Chancellor Date: Thu Dec 20 17:23:44 2018 +0100 drbd: Change drbd_request_detach_interruptible's return type to int Clang warns when an implicit conversion is done between enumerated types: drivers/block/drbd/drbd_state.c:708:8: warning: implicit conversion from enumeration type 'enum drbd_ret_code' to different enumeration type 'enum drbd_state_rv' [-Wenum-conversion] rv = ERR_INTR; ~ ^~~~~~~~ drbd_request_detach_interruptible's only call site is in the return statement of adm_detach, which returns an int. Change the return type of drbd_request_detach_interruptible to match, silencing Clang's warning. Reported-by: Nick Desaulniers Reviewed-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Signed-off-by: Jens Axboe commit a52c5a16cf19d8a85831bb1b915a221dd4ffae3c Author: Nathan Chancellor Date: Thu Dec 20 17:23:43 2018 +0100 drbd: Avoid Clang warning about pointless switch statment There are several warnings from Clang about no case statement matching the constant 0: In file included from drivers/block/drbd/drbd_receiver.c:48: In file included from drivers/block/drbd/drbd_int.h:48: In file included from ./include/linux/drbd_genl_api.h:54: In file included from ./include/linux/genl_magic_struct.h:236: ./include/linux/drbd_genl.h:321:1: warning: no case matching constant switch condition '0' GENL_struct(DRBD_NLA_HELPER, 24, drbd_helper_info, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/genl_magic_struct.h:220:10: note: expanded from macro 'GENL_struct' switch (0) { ^ Silence this warning by adding a 'case 0:' statement. Additionally, adjust the alignment of the statements in the ct_assert_unique macro to avoid a checkpatch warning. This solution was originally sent by Arnd Bergmann with a default case statement: https://lore.kernel.org/patchwork/patch/756723/ Link: https://github.com/ClangBuiltLinux/linux/issues/43 Suggested-by: Lars Ellenberg Signed-off-by: Nathan Chancellor Signed-off-by: Jens Axboe commit f31e583aa2c20892aca3add26957dee6ab80a534 Author: Lars Ellenberg Date: Thu Dec 20 17:23:42 2018 +0100 drbd: introduce P_ZEROES (REQ_OP_WRITE_ZEROES on the "wire") And also re-enable partial-zero-out + discard aligned. With the introduction of REQ_OP_WRITE_ZEROES, we started to use that for both WRITE_ZEROES and DISCARDS, hoping that WRITE_ZEROES would "do what we want", UNMAP if possible, zero-out the rest. The example scenario is some LVM "thin" backend. While an un-allocated block on dm-thin reads as zeroes, on a dm-thin with "skip_block_zeroing=true", after a partial block write allocated that block, that same block may well map "undefined old garbage" from the backends on LBAs that have not yet been written to. If we cannot distinguish between zero-out and discard on the receiving side, to avoid "undefined old garbage" to pop up randomly at later times on supposedly zero-initialized blocks, we'd need to map all discards to zero-out on the receiving side. But that would potentially do a full alloc on thinly provisioned backends, even when the expectation was to unmap/trim/discard/de-allocate. We need to distinguish on the protocol level, whether we need to guarantee zeroes (and thus use zero-out, potentially doing the mentioned full-alloc), or if we want to put the emphasis on discard, and only do a "best effort zeroing" (by "discarding" blocks aligned to discard-granularity, and zeroing only potential unaligned head and tail clippings to at least *try* to avoid "false positives" in an online-verify later), hoping that someone set skip_block_zeroing=false. For some discussion regarding this on dm-devel, see also https://www.mail-archive.com/dm-devel%40redhat.com/msg07965.html https://www.redhat.com/archives/dm-devel/2018-January/msg00271.html For backward compatibility, P_TRIM means zero-out, unless the DRBD_FF_WZEROES feature flag is agreed upon during handshake. To have upper layers even try to submit WRITE ZEROES requests, we need to announce "efficient zeroout" independently. We need to fixup max_write_zeroes_sectors after blk_queue_stack_limits(): if we can handle "zeroes" efficiently on the protocol, we want to do that, even if our backend does not announce max_write_zeroes_sectors itself. Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe commit 9848b6ddd8c92305252f94592c5e278574e7a6ac Author: Lars Ellenberg Date: Thu Dec 20 17:23:41 2018 +0100 drbd: skip spurious timeout (ping-timeo) when failing promote If you try to promote a Secondary while connected to a Primary and allow-two-primaries is NOT set, we will wait for "ping-timeout" to give this node a chance to detect a dead primary, in case the cluster manager noticed faster than we did. But if we then are *still* connected to a Primary, we fail (after an additional timeout of ping-timout). This change skips the spurious second timeout. Most people won't notice really, since "ping-timeout" by default is half a second. But in some installations, ping-timeout may be 10 or 20 seconds or more, and spuriously delaying the error return becomes annoying. Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe commit 9049ccd46f1f39166c99861c2c59d01ce3e20fd6 Author: Lars Ellenberg Date: Thu Dec 20 17:23:40 2018 +0100 drbd: don't retry connection if peers do not agree on "authentication" settings emma: "Unexpected data packet AuthChallenge (0x0010)" ava: "expected AuthChallenge packet, received: ReportProtocol (0x000b)" "Authentication of peer failed, trying again." Pattern repeats. There is no point in retrying the handshake, if we expect to receive an AuthChallenge, but the peer is not even configured to expect or use a shared secret. Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe commit 2c38f035117331eb78d0504843c79ea7c7fabf37 Author: Luc Van Oostenryck Date: Thu Dec 20 17:23:39 2018 +0100 drbd: fix print_st_err()'s prototype to match the definition print_st_err() is defined with its 4th argument taking an 'enum drbd_state_rv' but its prototype use an int for it. Fix this by using 'enum drbd_state_rv' in the prototype too. Signed-off-by: Luc Van Oostenryck Signed-off-by: Roland Kammerer Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe commit be80ff88356ab6f5529daf24d3052a4e3cc727ec Author: Lars Ellenberg Date: Thu Dec 20 17:23:38 2018 +0100 drbd: avoid spurious self-outdating with concurrent disconnect / down If peers are "simultaneously" told to disconnect from each other, either explicitly, or implicitly by taking down the resource, with bad timing, one side may see its disconnect "fail" with a result of "state change failed by peer", and interpret this as "please oudate yourself". Try to catch this by checking for current connection status, and possibly retry as local-only state change instead. Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe commit f708bd08ecbdc23d03aaedf5b3311ebe44cfdb50 Author: Lars Ellenberg Date: Thu Dec 20 17:23:37 2018 +0100 drbd: do not block when adjusting "disk-options" while IO is frozen "suspending" IO is overloaded. It can mean "do not allow new requests" (obviously), but it also may mean "must not complete pending IO", for example while the fencing handlers do their arbitration. When adjusting disk options, we suspend io (disallow new requests), then wait for the activity-log to become unused (drain all IO completions), and possibly replace it with a new activity log of different size. If the other "suspend IO" aspect is active, pending IO completions won't happen, and we would block forever (unkillable drbdsetup process). Fix this by skipping the activity log adjustment if the "al-extents" setting did not change. Also, in case it did change, fail early without blocking if it looks like we would block forever. Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe commit a2823ea92024e6cb8124bf49a055261a8508a795 Author: Lars Ellenberg Date: Thu Dec 20 17:23:36 2018 +0100 drbd: fix comment typos Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe commit fe43ed97bba3b11521abd934b83ed93143470e4f Author: Lars Ellenberg Date: Thu Dec 20 17:23:35 2018 +0100 drbd: reject attach of unsuitable uuids even if connected Multiple failure scenario: a) all good Connected Primary/Secondary UpToDate/UpToDate b) lose disk on Primary, Connected Primary/Secondary Diskless/UpToDate c) continue to write to the device, changes only make it to the Secondary storage. d) lose disk on Secondary, Connected Primary/Secondary Diskless/Diskless e) now try to re-attach on Primary This would have succeeded before, even though that is clearly the wrong data set to attach to (missing the modifications from c). Because we only compared our "effective" and the "to-be-attached" data generation uuid tags if (device->state.conn < C_CONNECTED). Fix: change that constraint to (device->state.pdsk != D_UP_TO_DATE) compare the uuids, and reject the attach. This patch also tries to improve the reverse scenario: first lose Secondary, then Primary disk, then try to attach the disk on Secondary. Before this patch, the attach on the Secondary succeeds, but since commit drbd: disconnect, if the wrong UUIDs are attached on a connected peer the Primary will notice unsuitable data, and drop the connection hard. Though unfortunately at a point in time during the handshake where we cannot easily abort the attach on the peer without more refactoring of the handshake. We now reject any attach to "unsuitable" uuids, as long as we can see a Primary role, unless we already have access to "good" data. Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe commit ad6e8979020628137478034dc5dce46d9dbd75b9 Author: Lars Ellenberg Date: Thu Dec 20 17:23:34 2018 +0100 drbd: attach on connected diskless peer must not shrink a consistent device If we would reject a new handshake, if the peer had attached first, and then connected, we should force disconnect if the peer first connects, and only then attaches. Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe commit 4ef2a4f43f5e52c6ff50a53cb49cf468bacf8cc2 Author: Lars Ellenberg Date: Thu Dec 20 17:23:33 2018 +0100 drbd: fix confusing error message during attach If we attach a (consistent) backing device, which knows about a last-agreed effective size, and that effective size is *larger* than the currently requested size, we refused to attach with ERR_DISK_TOO_SMALL Failure: (111) Low.dev. smaller than requested DRBD-dev. size. which is confusing to say the least. This patch changes the error code in that case to ERR_IMPLICIT_SHRINK Failure: (170) Implicit device shrinking not allowed. See kernel log. additional info from kernel: To-be-attached device has last effective > current size, and is consistent (9999 > 7777 sectors). Refusing to attach. It also allows to attach with an explicit size. Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe commit b17b59602b6dcf8f97a7dc7bc489a48388d7063a Author: Lars Ellenberg Date: Thu Dec 20 17:23:32 2018 +0100 drbd: disconnect, if the wrong UUIDs are attached on a connected peer With "on-no-data-accessible suspend-io", DRBD requires the next attach or connect to be to the very same data generation uuid tag it lost last. If we first lost connection to the peer, then later lost connection to our own disk, we would usually refuse to re-connect to the peer, because it presents the wrong data set. However, if the peer first connects without a disk, and then attached its disk, we accepted that same wrong data set, which would be "unexpected" by any user of that DRBD and cause "undefined results" (read: very likely data corruption). The fix is to forcefully disconnect as soon as we notice that the peer attached to the "wrong" dataset. Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe commit 94c43a13b8d6e3e0dd77b3536b5e04a84936b762 Author: Lars Ellenberg Date: Thu Dec 20 17:23:31 2018 +0100 drbd: ignore "all zero" peer volume sizes in handshake During handshake, if we are diskless ourselves, we used to accept any size presented by the peer. Which could be zero if that peer was just brought up and connected to us without having a disk attached first, in which case both peers would just "flip" their volume sizes. Now, even a diskless node will ignore "zero" sizes presented by a diskless peer. Also a currently Diskless Primary will refuse to shrink during handshake: it may be frozen, and waiting for a "suitable" local disk or peer to re-appear (on-no-data-accessible suspend-io). If the peer is smaller than what we used to be, it is not suitable. The logic for a diskless node during handshake is now supposed to be: believe the peer, if - I don't have a current size myself - we agree on the size anyways - I do have a current size, am Secondary, and he has the only disk - I do have a current size, am Primary, and he has the only disk, which is larger than my current size Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe commit d5412e8d8e6311c09fddcd7f1a4030b8bbe0caf7 Author: Lars Ellenberg Date: Thu Dec 20 17:23:30 2018 +0100 drbd: centralize printk reporting of new size into drbd_set_my_capacity() Previously, some implicit resizes that happend during handshake have not been reported as prominently as explicit resize. Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe commit 792c3fdd94a559b31c8d1477e37029c1ac881234 Author: Lars Ellenberg Date: Thu Dec 20 17:23:29 2018 +0100 drbd: must not use connection after kref_put(&connection->kref) Signed-off-by: Lars Ellenberg Signed-off-by: Jens Axboe commit d29e89e34952a9ad02c77109c71a80043544296e Author: Roland Kammerer Date: Thu Dec 20 17:23:28 2018 +0100 drbd: narrow rcu_read_lock in drbd_sync_handshake So far there was the possibility that we called genlmsg_new(GFP_NOIO)/mutex_lock() while holding an rcu_read_lock(). This included cases like: drbd_sync_handshake (acquire the RCU lock) drbd_asb_recover_1p drbd_khelper drbd_bcast_event genlmsg_new(GFP_NOIO) --> may sleep drbd_sync_handshake (acquire the RCU lock) drbd_asb_recover_1p drbd_khelper notify_helper genlmsg_new(GFP_NOIO) --> may sleep drbd_sync_handshake (acquire the RCU lock) drbd_asb_recover_1p drbd_khelper notify_helper mutex_lock --> may sleep While using GFP_ATOMIC whould have been possible in the first two cases, the real fix is to narrow the rcu_read_lock. Reported-by: Jia-Ju Bai Reviewed-by: Lars Ellenberg Signed-off-by: Roland Kammerer Signed-off-by: Jens Axboe commit 553a7cca769d551f1317186760631487c47e23bf Author: Karthikeyan Periyasamy Date: Thu Dec 20 09:53:17 2018 +0200 ath10k: fix kernel panic due to use after free This issue arise in a race condition between ath10k_sta_state() and ath10k_htt_fetch_peer_stats(), explained in below scenario Steps: 1. In ath10k_sta_state(), arsta->tx_stats get deallocated before peer deletion when the station moves from IEEE80211_STA_NONE to IEEE80211_STA_NOTEXIST state. 2. Meanwhile ath10k receive HTT_T2H_MSG_TYPE_PEER_STATS message. In ath10k_htt_fetch_peer_stats(), arsta->tx_stats get accessed after the peer validation check. Since arsta->tx_stats get freed before the peer deletion [1]. ath10k_htt_fetch_peer_stats() ended up in "use after free" situation. Fixed this issue by moving the arsta->tx_stats free handling after the peer deletion. so that ath10k_htt_fetch_peer_stats() will not end up in "use after free" situation. Kernel Panic: Unable to handle kernel NULL pointer dereference at virtual address 00000286 pgd = d8754000 [00000286] *pgd=00000000 Internal error: Oops: 5 [#1] PREEMPT SMP ARM ... CPU: 0 PID: 6245 Comm: hostapd Not tainted task: dc44cac0 ti: d4a38000 task.ti: d4a38000 PC is at kmem_cache_alloc+0x7c/0x114 LR is at ath10k_sta_state+0x190/0xd58 [ath10k_core] pc : [] lr : [] psr: 20000013 sp : d4a39b88 ip : 00000000 fp : 00000001 r10: 00000000 r9 : 1d3bc000 r8 : 00000dc0 r7 : 000080d0 r6 : d4a38000 r5 : dd401b00 r4 : 00000286 r3 : 00000000 r2 : d4a39ba0 r1 : 000080d0 r0 : dd401b00 Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user Control: 10c5787d Table: 5a75406a DAC: 00000015 Process hostapd (pid: 6245, stack limit = 0xd4a38238) Stack: (0xd4a39b88 to 0xd4a3a000) ... [] (kmem_cache_alloc) from [] (ath10k_sta_state+0x190/0xd58 [ath10k_core]) [] (ath10k_sta_state [ath10k_core]) from [] (sta_info_insert_rcu+0x418/0x61c [mac80211]) [] (sta_info_insert_rcu [mac80211]) from [] (ieee80211_add_station+0xf0/0x134 [mac80211]) [] (ieee80211_add_station [mac80211]) from [] (nl80211_new_station+0x330/0x36c [cfg80211]) [] (nl80211_new_station [cfg80211]) from [] (extack_doit+0x2c/0x74 [compat]) [] (extack_doit [compat]) from [] (genl_rcv_msg+0x274/0x30c) [] (genl_rcv_msg) from [] (netlink_rcv_skb+0x58/0xac) [] (netlink_rcv_skb) from [] (genl_rcv+0x20/0x34) [] (genl_rcv) from [] (netlink_unicast+0x11c/0x204) [] (netlink_unicast) from [] (netlink_sendmsg+0x30c/0x370) [] (netlink_sendmsg) from [] (sock_sendmsg+0x70/0x84) [] (sock_sendmsg) from [] (___sys_sendmsg.part.3+0x188/0x228) [] (___sys_sendmsg.part.3) from [] (__sys_sendmsg+0x4c/0x70) [] (__sys_sendmsg) from [] (ret_fast_syscall+0x0/0x44) Code: ebfffec1 e1a04000 ea00001b e5953014 (e7940003) ath10k_pci 0000:01:00.0: SWBA overrun on vdev 0, skipped old beacon Hardware tested: QCA9984 Firmware tested: 10.4-3.6.0.1-00004 Fixes: a904417fc ("ath10k: add extended per sta tx statistics support") Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Kalle Valo commit 8b1cce9f5832a8eda17d37a3c49fb7dd2d650f46 Author: Thierry Reding Date: Thu Dec 20 17:35:47 2018 +0100 dma-mapping: fix inverted logic in dma_supported The cleanup in commit 356da6d0cde3 ("dma-mapping: bypass indirect calls for dma-direct") accidentally inverted the logic in the check for the presence of a ->dma_supported() callback. Switch this back to the way it was to prevent a crash on boot. Fixes: 356da6d0cde3 ("dma-mapping: bypass indirect calls for dma-direct") Signed-off-by: Thierry Reding Signed-off-by: Christoph Hellwig commit bff70e5f78e9708de18cbed003abe10349719ba5 Author: YueHaibing Date: Thu Dec 20 09:53:10 2018 +0200 ath10k: remove set but not used variable 'num_tdls_vifs' Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/wireless/ath/ath10k/mac.c: In function 'ath10k_sta_state': drivers/net/wireless/ath/ath10k/mac.c:6238:7: warning: variable 'num_tdls_vifs' set but not used [-Wunused-but-set-variable] 'num_tdls_vifs' not used any more after 9a993cc1ea95 ("ath10k: fix the logic of limiting tdls peer counts") Also, remove the single called function ath10k_mac_tdls_vifs_count and ath10k_mac_tdls_vifs_count_iter. Signed-off-by: YueHaibing Signed-off-by: Kalle Valo commit 82c7b351be3fad005ba38a26f7f1ab7f0841e505 Author: Horia Geantă Date: Wed Dec 19 12:18:44 2018 +0200 Revert "arm64: defconfig: Enable FSL_MC_BUS and FSL_MC_DPIO" This reverts commit d9678adbe733a770428a98651beaa2817d503ed3. Received below report from Stefan. Revert the commit until CAAM driver dependency cycles are fixed. this patch in next-20181214 breaks "make modules_install" for arm64/defconfig on my Ubuntu machine: DEPMOD 4.20.0-rc6-next-20181214 depmod: ERROR: Found 6 modules in dependency cycles! depmod: ERROR: Cycle detected: caamalg_desc -> dpaa2_caam -> authenc depmod: ERROR: Cycle detected: caamalg_desc -> dpaa2_caam -> fsl_mc_dpio depmod: ERROR: Cycle detected: dpaa2_caam -> caamhash_desc -> dpaa2_caam depmod: ERROR: Cycle detected: caamalg_desc -> dpaa2_caam -> caamhash_desc -> error depmod: ERROR: Cycle detected: caamalg_desc -> dpaa2_caam -> caamhash_desc -> caamalg_desc Reported-by: Stefan Wahren Signed-off-by: Horia Geantă Signed-off-by: Arnd Bergmann commit 54518ed45734bb7ebf2773b1d32120c62338cc93 Merge: 8e22bce990b5d 6f61a2c8f1f61 Author: Arnd Bergmann Date: Thu Dec 20 17:36:08 2018 +0100 Merge tag 'renesas-fixes2-for-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into fixes Second Round of Renesas ARM Based SoC Fixes for v4.20 * R-Car D3 (r8a77995) SoC based Draak board - Correct CVBS input to allow probing of the VIN * tag 'renesas-fixes2-for-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: arm64: dts: renesas: draak: Fix CVBS input commit 17f3b556a3e3c9227549c3e7762c5c27a48e5c59 Author: Al Viro Date: Sat Nov 10 23:46:07 2018 -0500 selinux: expand superblock_doinit() calls Signed-off-by: Al Viro Reviewed-by: David Howells commit 43f5e655eff7e124d4e484515689cba374ab698e Author: David Howells Date: Thu Nov 1 23:07:25 2018 +0000 vfs: Separate changing mount flags full remount Separate just the changing of mount flags (MS_REMOUNT|MS_BIND) from full remount because the mount data will get parsed with the new fs_context stuff prior to doing a remount - and this causes the syscall to fail under some circumstances. To quote Eric's explanation: [...] mount(..., MS_REMOUNT|MS_BIND, ...) now validates the mount options string, which breaks systemd unit files with ProtectControlGroups=yes (e.g. systemd-networkd.service) when systemd does the following to change a cgroup (v1) mount to read-only: mount(NULL, "/run/systemd/unit-root/sys/fs/cgroup/systemd", NULL, MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_REMOUNT|MS_BIND, NULL) ... when the kernel has CONFIG_CGROUPS=y but no cgroup subsystems enabled, since in that case the error "cgroup1: Need name or subsystem set" is hit when the mount options string is empty. Probably it doesn't make sense to validate the mount options string at all in the MS_REMOUNT|MS_BIND case, though maybe you had something else in mind. This is also worthwhile doing because we will need to add a mount_setattr() syscall to take over the remount-bind function. Reported-by: Eric Biggers Signed-off-by: David Howells Signed-off-by: Al Viro Reviewed-by: David Howells commit e262e32d6bde0f77fb0c95d977482fc872c51996 Author: David Howells Date: Thu Nov 1 23:07:23 2018 +0000 vfs: Suppress MS_* flag defs within the kernel unless explicitly enabled Only the mount namespace code that implements mount(2) should be using the MS_* flags. Suppress them inside the kernel unless uapi/linux/mount.h is included. Signed-off-by: David Howells Signed-off-by: Al Viro Reviewed-by: David Howells commit d70f4ece9da12b7319a87d02d33a89353268c689 Merge: 9df95e8ec568f 489c066cfdf1c Author: Daniel Borkmann Date: Thu Dec 20 17:28:29 2018 +0100 Merge branch 'bpf-jset-verifier' Jakub Kicinski says: ==================== This is a v2 of the patch set to teach the verifier about BPF_JSET instruction. There is also a number of tests include for both basic functioning of the instruction and the verifier logic. The NFP JIT handling of JSET is tweaked. Last patch adds missing file to gitignore. Reposting part of previous series without the dead code elimination. ==================== Signed-off-by: Daniel Borkmann commit 489c066cfdf1cad776c5e041f32a2e3cdb05050a Author: Jakub Kicinski Date: Wed Dec 19 22:13:09 2018 -0800 selftests: bpf: add missing executables to .gitignore commit 435f90a338ae ("selftests/bpf: add a test case for sock_ops perf-event notification") missed adding new test to gitignore. Signed-off-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 4987eaccd2d1535eaa72d3bbe2b8bfc8267ba965 Author: Jakub Kicinski Date: Wed Dec 19 22:13:08 2018 -0800 nfp: bpf: optimize codegen for JSET with a constant The top word of the constant can only have bits set if sign extension set it to all-1, therefore we don't really have to mask the top half of the register. We can just OR it into the result as is. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 6e774845b321e729966fed7de4aa8ea59c2c3b2e Author: Jakub Kicinski Date: Wed Dec 19 22:13:07 2018 -0800 nfp: bpf: remove the trivial JSET optimization The verifier will now understand the JSET instruction, so don't mark the dead branch in the JIT as noop. We won't generate any code, anyway. Signed-off-by: Jakub Kicinski Reviewed-by: Quentin Monnet Signed-off-by: Daniel Borkmann commit 9b38c4056b2736bb5902e8b0911832db666fd19b Author: Jakub Kicinski Date: Wed Dec 19 22:13:06 2018 -0800 bpf: verifier: reorder stack size check with dead code sanitization Reorder the calls to check_max_stack_depth() and sanitize_dead_code() to separate functions which can rewrite instructions from pure checks. No functional changes. Signed-off-by: Jakub Kicinski Reviewed-by: Jiong Wang Signed-off-by: Daniel Borkmann commit 14507e35bd9dedcd14c24f9e5e0e0dd48e972e53 Author: Jakub Kicinski Date: Wed Dec 19 22:13:05 2018 -0800 selftests: bpf: verifier: add tests for JSET interpretation Validate that the verifier reasons correctly about the bounds and removes dead code based on results of JSET instruction. Signed-off-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 960ea056561a08e2b837b2f02d22c53226414a84 Author: Jakub Kicinski Date: Wed Dec 19 22:13:04 2018 -0800 bpf: verifier: teach the verifier to reason about the BPF_JSET instruction Some JITs (nfp) try to optimize code on their own. It could make sense in case of BPF_JSET instruction which is currently not interpreted by the verifier, meaning for instance that dead could would not be detected if it was under BPF_JSET branch. Teach the verifier basics of BPF_JSET, JIT optimizations will be removed shortly. Signed-off-by: Jakub Kicinski Reviewed-by: Jiong Wang Acked-by: Edward Cree Signed-off-by: Daniel Borkmann commit 5a8d5209ac0228c9cf8f335dfdfffa71c54b3201 Author: Jakub Kicinski Date: Wed Dec 19 22:13:03 2018 -0800 selftests: bpf: add trivial JSET tests We seem to have no JSET instruction test, and LLVM does not generate it at all, so let's add a simple hand-coded test to make sure JIT implementations are correct. v2: - extend test_verifier to handle multiple inputs and add the sample there (Daniel) - add a sign extension case Signed-off-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 44a7b3b6e3a458f9549c2cc28e74ecdc470e42f1 Merge: ac68a3d3c3eba 0c2ff8d796895 Author: David S. Miller Date: Thu Dec 20 08:26:16 2018 -0800 Merge branch 'bnxt_en-next' Michael Chan says: ==================== bnxt_en: Update for net-next. Three main changes in this series, besides the usual firmware spec update: 1. Add support for a new firmware communication channel direct to the firmware processor that handles flow offloads. This speeds up flow offload operations. 2. Use 64-bit internal flow handles to increase the number of flows that can be offloaded. 3. Add level-2 context memory paging so that we can configure more context memory for RDMA on the 57500 chips. Allocate more context memory if RDMA is enabled on the 57500 chips. ==================== Signed-off-by: David S. Miller commit 0c2ff8d796895448b3a23c9cf7f37e721daeea48 Author: Michael Chan Date: Thu Dec 20 03:38:53 2018 -0500 bnxt_en: Adjust default RX coalescing ticks to 10 us. For a little better performance on faster machines and faster link speeds. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit abd43a13525db70926999ebe3e272c38119fdfbe Author: Venkat Duvvuru Date: Thu Dec 20 03:38:52 2018 -0500 bnxt_en: Support for 64-bit flow handle. Older firmware only supports 16-bit flow handle, because of which the number of flows that can be offloaded can’t scale beyond a point. Newer firmware supports 64-bit flow handle enabling the host to scale upto millions of flows. With the new 64-bit flow handle support, driver has to query flow stats in a different way compared to the older approach. This patch adds support for 64-bit flow handle and new way to query flow stats. Signed-off-by: Venkat Duvvuru Reviewed-by: Sriharsha Basavapatna Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit cf6daed098d14760d6605268d28bfdf7b3bfa375 Author: Michael Chan Date: Thu Dec 20 03:38:51 2018 -0500 bnxt_en: Increase context memory allocations on 57500 chips for RDMA. If RDMA is supported on the 57500 chip, increase context memory allocations for the resources used by RDMA. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 08fe9d1816067170e167867d06009fb0f41cb411 Author: Michael Chan Date: Thu Dec 20 03:38:50 2018 -0500 bnxt_en: Add Level 2 context memory paging support. Add the new functions bnxt_alloc_ctx_pg_tbls()/bnxt_free_ctx_pg_tbls() to allocate and free pages for context memory. The new functions will handle the different levels of paging support and allocate/free the pages accordingly using the existing functions. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 4f49b2b8d4167b712ce876bff08bd9606a44f7a6 Author: Michael Chan Date: Thu Dec 20 03:38:49 2018 -0500 bnxt_en: Enhance bnxt_alloc_ring()/bnxt_free_ring(). To support level 2 context page memory structures, enhance the bnxt_ring_mem_info structure with a "depth" field to specify the page level and add a flag to specify using full pages for L1 and L2 page tables. This is needed to support RDMA functionality on 57500 chips since RDMA requires more context memory. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 760b6d33410cda351f236058585471cb0f417978 Author: Venkat Duvvuru Date: Thu Dec 20 03:38:48 2018 -0500 bnxt_en: Add support for 2nd firmware message channel. Earlier, some of the firmware commands (ex: CFA_FLOW_*) which are processed by KONG processor were sent to the CHIMP processor from the host. This approach was taken as there was no direct message channel to KONG. CHIMP in turn used to send them to KONG. Newer firmware supports a new message channel which the host can send messages directly to the KONG processor. This patch adds support for required changes needed in the driver to support direct KONG message channel. This speeds up flow related messages sent to the firmware for CLS_FLOWER offload. Signed-off-by: Venkat Duvvuru Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 5c209fc82159f2f71e2772f28cd1d447b821e98d Author: Venkat Duvvuru Date: Thu Dec 20 03:38:47 2018 -0500 bnxt_en: Introduce bnxt_get_hwrm_resp_addr & bnxt_get_hwrm_seq_id routines. These routines will be enhanced in the subsequent patch to return the 2nd firmware comm. channel's hwrm response address & sequence id respectively. Signed-off-by: Venkat Duvvuru Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 89455017fb8dd5dff0d088ecb82bccf9f9b715cd Author: Venkat Duvvuru Date: Thu Dec 20 03:38:46 2018 -0500 bnxt_en: Avoid arithmetic on void * pointer. Typecast hwrm_cmd_resp_addr to (u8 *) from (void *) before doing arithmetic. Signed-off-by: Venkat Duvvuru Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 2e9ee3987719148308ff1794aa91f8314f839ccd Author: Venkat Duvvuru Date: Thu Dec 20 03:38:45 2018 -0500 bnxt_en: Use macros for firmware message doorbell offsets. In preparation for adding a 2nd communication channel to firmware. Signed-off-by: Venkat Duvvuru Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit fc718bb2d1efa4348995b4811c243ec59f913a59 Author: Venkat Duvvuru Date: Thu Dec 20 03:38:44 2018 -0500 bnxt_en: Set hwrm_intr_seq_id value to its inverted value. Set hwrm_intr_seq_id value to its inverted value instead of HWRM_SEQ_INVALID, when an hwrm completion of type CMPL_BASE_TYPE_HWRM_DONE is received. This will enable us to use the complete 16-bit sequence ID space. Signed-off-by: Venkat Duvvuru Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 3322479e6d17ea17b75848fd7c7702ccf82c9c35 Author: Michael Chan Date: Thu Dec 20 03:38:43 2018 -0500 bnxt_en: Update firmware interface spec. to 1.10.0.33. The major changes are in the flow offload firmware APIs. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit ac68a3d3c3eba61c693d63a89223e1df8fe1f0c6 Merge: a9cd3439e3c6d fa89a4593b927 Author: David S. Miller Date: Thu Dec 20 08:21:47 2018 -0800 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 2018-12-20 Two last patches for this release cycle: 1) Remove an unused variable in xfrm_policy_lookup_bytype(). From YueHaibing. 2) Fix possible infinite loop in __xfrm6_tunnel_alloc_spi(). Also from YueHaibing. Please pull or let me know if there are problems. ==================== Signed-off-by: David S. Miller commit 74ff666bd7ba2da563f99f2a8af7bf9f20008bc9 Merge: b3fc4e0e966ea aa167f3fed0c3 2a9d92fb3a128 Author: Mark Brown Date: Thu Dec 20 16:01:30 2018 +0000 Merge remote-tracking branches 'spi/topic/mem' and 'spi/topic/mtd' into spi-next commit b3fc4e0e966eaaf2f8afa1de3280770acd838b87 Merge: 2d54911644e4d 916d9802e4b07 Author: Mark Brown Date: Thu Dec 20 16:01:28 2018 +0000 Merge branch 'spi-4.21' into spi-next commit 2d54911644e4d5ea1ba01500d3a46dabc3b1e75a Merge: 7566ec393f416 29bdedfd9cf40 Author: Mark Brown Date: Thu Dec 20 16:01:26 2018 +0000 Merge branch 'spi-4.20' into spi-linus commit 3f47de2c6b6068cf7d5221f8f307969e7e4f1fc5 Merge: bda090cfeb502 8ac686d7dfed7 Author: Arnd Bergmann Date: Thu Dec 20 16:59:42 2018 +0100 Merge tag 'samsung-dt-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/dt Samsung DTS ARM changes for v4.21, part 2 1. Add missing CPUs in cooling maps for Odroid X2 (missed in previous round of fixups). 2. Fix clock configuration in audio subsystem on Odroid XU3/XU4. * tag 'samsung-dt-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: dts: exynos: Specify I2S assigned clocks in proper node ARM: dts: exynos: Add missing CPUs in cooling maps for Odroid X2 Signed-off-by: Arnd Bergmann commit bda090cfeb502a650d887e6c66be9644286d815c Merge: 984199efb0be4 c266a2b4407af Author: Arnd Bergmann Date: Thu Dec 20 16:58:23 2018 +0100 Merge tag 'sunxi-dt64-for-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/dt Allwinner arm64 DT changes for 4.21 - round 2 Bluetooth using a Broadcom (now Cypress) chip connected to an UART on the Bananapi M64 is enabled using serdev and the updated bindings for Broadcom Bluetooth. The patch series had been sitting on the mailing lists for a month, and the driver bits were just merged on 2018/12/19. * tag 'sunxi-dt64-for-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: arm64: dts: allwinner: a64: bananapi-m64: Add Bluetooth device node Signed-off-by: Arnd Bergmann commit 984199efb0be4857ebe360205bda608b9e1aee9d Merge: f1a6caf73c662 afdd273e269ca Author: Arnd Bergmann Date: Thu Dec 20 16:54:17 2018 +0100 Merge tag 'sunxi-dt-for-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/dt Allwinner DT changes for 4.21 - round 2 This is a small pull request for some lingering things that didn't make the first round of patches. First, the new suniv device tree included device tree headers for the clock and reset indices. These header filers are going in through the clock tree. Thus with the dt and core branches in arm-soc alone, it doesn't build. One fix is included to remove the #include statements. The defined macros aren't used yet as they were properly removed during the review phase. Second, Bluetooth using Broadcom (now Cypress) chips connected to UARTs on various boards is enabled using serdev and the updated bindings for Broadcom Bluetooth. The patch series had been sitting on the mailing lists for a month, and the driver bits were just merged on 2018/12/19. * tag 'sunxi-dt-for-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: ARM: dts: sunxi: Enable Broadcom-based Bluetooth for multiple boards ARM: dts: suniv: Fix improper bindings include patch Signed-off-by: Arnd Bergmann commit f1a6caf73c66226e78f297618288c8b3445d13c0 Merge: ea096315361bb 30648e9f86477 Author: Arnd Bergmann Date: Thu Dec 20 16:47:25 2018 +0100 Merge tag 'imx-qspi-dt-clean' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/dt Freescale QSPI device tree cleanup for 4.21: - It contains a series from Schrempf Frieder that cleans up FSL QSPI device tree nodes. The current device trees are broken because they use an inconsistent scheme for assigning the reg properties. It becomes a problem with ongoing QSPI driver under SPI framework. So the cleanup is a preparation for new driver landing in the next cycle. * tag 'imx-qspi-dt-clean' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: arm64: dts: Add spi-[tx/rx]-bus-width for the FSL QSPI controller arm64: dts: Remove unused properties from FSL QSPI driver nodes ARM: dts: Add spi-[tx/rx]-bus-width for the FSL QSPI controller ARM: dts: imx6sx-sdb: Fix the reg properties for the FSL QSPI nodes ARM: dts: Remove unused properties from FSL QSPI driver nodes Signed-off-by: Arnd Bergmann commit 942104a21ce4951420ddf6c6b3179a0627301f7e Author: NeilBrown Date: Mon Dec 10 09:58:37 2018 +1100 docs: improve pathname-lookup document structure Get rid of some unneeded structural elements around the new (to RST) pathname-lookup document. Signed-off-by: NeilBrown [ jc: grabbed from email and changelog added ] Signed-off-by: Jonathan Corbet commit 6b5a49b46cf128c8360509ea5a8e6391cf6f1c43 Author: Helen Koike Date: Fri Dec 7 17:11:58 2018 -0200 configfs: fix wrong name of struct in documentation The name of the struct is configfs_bin_attribute instead of configfs_attribute Signed-off-by: Helen Koike Fixes: 03607ace807b ("configfs: implement binary attributes") Signed-off-by: Jonathan Corbet commit ea096315361bbec7d0b40de4937e7e09fd85f8e7 Author: Maxime Ripard Date: Fri Dec 14 10:55:38 2018 +0100 ARM: dts: suniv: Fix improper bindings include patch The clock and reset bindings are going through different trees, and while the patch doesn't contain any value defined in that header, it still includes those files and result in a build breakage when building the DT without the matching clock and reset patches applied. Signed-off-by: Maxime Ripard Signed-off-by: Arnd Bergmann commit eafb27fa5283599ce6c5492ea18cf636a28222bb Author: Macpaul Lin Date: Wed Dec 19 12:11:03 2018 +0800 cdc-acm: fix abnormal DATA RX issue for Mediatek Preloader. Mediatek Preloader is a proprietary embedded boot loader for loading Little Kernel and Linux into device DRAM. This boot loader also handle firmware update. Mediatek Preloader will be enumerated as a virtual COM port when the device is connected to Windows or Linux OS via CDC-ACM class driver. When the USB enumeration has been done, Mediatek Preloader will send out handshake command "READY" to PC actively instead of waiting command from the download tool. Since Linux 4.12, the commit "tty: reset termios state on device registration" (93857edd9829e144acb6c7e72d593f6e01aead66) causes Mediatek Preloader receiving some abnoraml command like "READYXX" as it sent. This will be recognized as an incorrect response. The behavior change also causes the download handshake fail. This change only affects subsequent connects if the reconnected device happens to get the same minor number. By disabling the ECHO termios flag could avoid this problem. However, it cannot be done by user space configuration when download tool open /dev/ttyACM0. This is because the device running Mediatek Preloader will send handshake command "READY" immediately once the CDC-ACM driver is ready. This patch wants to fix above problem by introducing "DISABLE_ECHO" property in driver_info. When Mediatek Preloader is connected, the CDC-ACM driver could disable ECHO flag in termios to avoid the problem. Signed-off-by: Macpaul Lin Cc: stable@vger.kernel.org Reviewed-by: Johan Hovold Acked-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman commit 10f9d7fd56fec2244636dffb122673af663cf383 Merge: 826833df4e4b3 5da94b50475ac Author: Arnd Bergmann Date: Thu Dec 20 16:37:38 2018 +0100 Merge tag 'am654-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/kristo/linux into next/dt AM65x DT changes for 4.21. Includes: - Pinctrl support - I2C support - ECAP PWM support - Power domain handling for UARTs - McSPI support * tag 'am654-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/kristo/linux: arm64: dts: ti: k3-am654: Enable main domain McSPI0 arm64: dts: ti: k3-am654: Add McSPI DT nodes arm64: dts: ti: k3-am654: Populate power-domain property for UART nodes arm64: dts: ti: k3-am654-base-board: Enable ECAP PWM arm64: dts: ti: k3-am65-main: Add ECAP PWM node arm64: dts: ti: k3-am654-base-board: Add I2C nodes arm64: dts: ti: am654-base-board: Add pinmux for main uart0 arm64: dts: ti: k3-am65: Add pinctrl regions dt-bindings: pinctrl: k3: Introduce pinmux definitions arm64: dts: ti: k3-am654: Fix wakeup_uart reg address Signed-off-by: Arnd Bergmann commit 826833df4e4b396beef6420647aabe409bd84533 Merge: bc8bd33891d31 c7a851b7050e2 Author: Arnd Bergmann Date: Thu Dec 20 16:34:06 2018 +0100 Merge tag 'omap-for-v4.21/dt-ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/dt Add interconnect target module dts data for omaps for v4.21 This big set of changes adds SoC specific l4 interconnect target module device tree data for am335x, am437x, omap5 and dra7 SoCs. We also move existing devices to the right location in the l4 interconnect hierarcy. This is similar to what we've already done for omap4 l4 interconnects earlier, and follows what is documented in the ti-sysc driver dts binding in Documentation/devicetree/bindings/bus/ti-sysc.txt. These changes will essentially replace the struct ti_sysc and clock entries in the arch/arm/mach-omap2/omap_hwmod_*_data.c files. Then a few merge windows later, we can start dropping the built-in platform data from the omap_hwmod_*_data.c files in favor of the device tree data only. For now, we verify the device tree data module data against the built-in data and warn about changes to prevent regressions. With the device tree data, we are also probing devices with the ti-sysc interconnect target module instead of omap_device. This fixes up the handling for multiple device instances in a single interconnect target module that has caused trouble earlier. A custom wrapper driver has been needed earlier for such cases. And as the device tree data is organized by the l4 interconnect instances, we will be able to use genpd later on. This is because each interconnect instance is also often also a single power domain. This series of changes has been brewing for several months now. I did not want to send a pull request earlier as people were still seeing device specific issues until recently though. However, it turned out that all the issues were quite trivial to fix. I had missed adding device tree ranges for the l3 data port used on some devices, and I had missed converting the device addresses for a few devices. And some devices like needed fixes for deferred probe handling such as the EHCI PHY for built-in case on omap5. Anyways, in case of trouble, we can easily just revert changes for a single device if needed. * tag 'omap-for-v4.21/dt-ti-sysc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: Cosmetic fix for omap5 USB node names ARM: dts: Fix wrong address for omap5 sata phy ARM: dts: Add missing ranges for dra7 mcasp l3 ports ARM: dts: Fix ranges for am335x epwmss ARM: dts: Fix hsi gdd range for omap4 ARM: dts: Add am335x mcasp with l3 data port ranges ARM: dts: Add missing ranges for am437x mcasp l3 ports ARM: dts: dra7: Move the ti,no-idle quirk on proper gmac node ARM: dts: Revert am335x mcasp ti-sysc changes ARM: dts: omap5: Add l4 interconnect hierarchy and ti-sysc data ARM: dts: Use dra7 mcasp compatible for mcasp instances ARM: dts: dra7: Move l4 child devices to probe them with ti-sysc ARM: dts: dra7: Add l4 interconnect hierarchy and ti-sysc data ARM: dts: am335x: Move l4 child devices to probe them with ti-sysc ARM: dts: am335x: Add l4 interconnect hierarchy and ti-sysc data ARM: dts: am437x: Move l4 child devices to probe them with ti-sysc ARM: dts: am437x: Add l4 interconnect hierarchy and ti-sysc data ARM: dts: dra7: convert to use new clkctrl layout ARM: dts: am43xx: convert to use new clkctrl layout ARM: dts: am33xx: convert to use new clkctrl layout Signed-off-by: Arnd Bergmann commit 54a67c753610a762ec9f5de3a6fda76a3c3bdb8e Author: Mike Rapoport Date: Thu Dec 6 23:13:01 2018 +0200 docs/mm-api: link slab_common.c to "The Slab Cache" section Several functions in mm/slab_common.c have kernel-doc comments, it makes perfect sense to link them to the MM API reference. Signed-off-by: Mike Rapoport Signed-off-by: Jonathan Corbet commit 16df1456aa858a86f398dbc7d27649eb6662b0cc Author: Dan Carpenter Date: Wed Dec 19 22:19:25 2018 +0300 mm, memory_hotplug: update a comment in unregister_memory() The remove_memory_block() function was renamed to in commit cc292b0b4302 ("drivers/base/memory.c: rename remove_memory_block() to remove_memory_section()"). Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit c0b8a8709ebe0f72523a1e76f30a1bde821c060c Author: Yangtao Li Date: Sat Dec 15 03:36:36 2018 -0500 component: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Greg Kroah-Hartman commit f496990f1f4b1dbf4f878f6864cbf4e303189177 Author: Mike Rapoport Date: Thu Dec 6 23:13:00 2018 +0200 slab: make kmem_cache_create{_usercopy} description proper kernel-doc Add the description for kmem_cache_create, fixup the return value paragraph and make both kmem_cache_create and add the second '*' to the comment opening. Signed-off-by: Mike Rapoport Signed-off-by: Jonathan Corbet commit bc8bd33891d3129e1ca0425879a30130cc80af1c Merge: 5385c226b63db ac1e507fe61db Author: Arnd Bergmann Date: Thu Dec 20 16:32:23 2018 +0100 Merge tag 'zynq-dt-for-v5.0' of https://github.com/Xilinx/linux-xlnx into next/dt arm: dts: zynq: DT changes for v5.0 - Fix mmc node name * tag 'zynq-dt-for-v5.0' of https://github.com/Xilinx/linux-xlnx: ARM: dts: Use mmc@ instead sdhci@ Signed-off-by: Arnd Bergmann commit c58eef061dda7d843dcc0ad6fea7e597d4c377c0 Author: Colin Ian King Date: Wed Dec 19 16:30:07 2018 +0000 staging: wilc1000: fix missing read_write setting when reading data Currently the cmd.read_write setting is not initialized so it contains garbage from the stack. Fix this by setting it to 0 to indicate a read is required. Detected by CoverityScan, CID#1357925 ("Uninitialized scalar variable") Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver") Signed-off-by: Colin Ian King Cc: stable Acked-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman commit 012c5e8d819ccb048c86df213f7d57a3d4043a2c Author: Jona Crasselt Date: Wed Dec 19 17:07:05 2018 +0100 mt7621-mmc: char * array declaration might be better as static const Issue reported by checkpatch.pl. Signed-off-by: Jona Crasselt Signed-off-by: Felix Windsheimer Signed-off-by: Greg Kroah-Hartman commit 515ba7e7f032a609b649d85aa10f4b258ff2edef Author: Jona Crasselt Date: Wed Dec 19 17:07:04 2018 +0100 mt7621-mmc: return statement in void function unnecessary Issue reported by checkpatch.pl. Signed-off-by: Jona Crasselt Signed-off-by: Felix Windsheimer Signed-off-by: Greg Kroah-Hartman commit 43c978a16eee76ac45ae3223ccafcfa6186bcc46 Author: Jona Crasselt Date: Wed Dec 19 17:07:03 2018 +0100 mt7621-mmc: Alignment should match open parenthesis Issue reported by checkpatch.pl. Signed-off-by: Jona Crasselt Signed-off-by: Felix Windsheimer Signed-off-by: Greg Kroah-Hartman commit 71fbc630160f485dac04d35e7df81cc97d021628 Author: Jona Crasselt Date: Wed Dec 19 17:07:02 2018 +0100 mt7621-mmc: Removed unnecessary blank lines Issue reported by checkpatch.pl. Signed-off-by: Jona Crasselt Signed-off-by: Felix Windsheimer Signed-off-by: Greg Kroah-Hartman commit 641e96e03aa0444389daad7d0422c9d52faf2f15 Author: Jona Crasselt Date: Wed Dec 19 17:07:01 2018 +0100 mt7621-mmc: Fix some coding style issues Fix some comment-related issues reported by checkpatch.pl: - Block comments use * on subsequent lines - Block comments use a trailing */ on a separate line Signed-off-by: Jona Crasselt Signed-off-by: Felix Windsheimer Signed-off-by: Greg Kroah-Hartman commit 5385c226b63db5827814e381c5aa290814445c03 Merge: b125eb0bf4699 d1d4445abffb2 Author: Arnd Bergmann Date: Thu Dec 20 16:30:59 2018 +0100 Merge tag 'zynqmp-dt-for-v5.0' of https://github.com/Xilinx/linux-xlnx into next/dt arm64: dts: zynqmp: DT changes for v5.0 - Fix node names - Fix wakeup-source - Wire ddrc - Label gpio controller (PS gpio) * tag 'zynqmp-dt-for-v5.0' of https://github.com/Xilinx/linux-xlnx: arm64: dts: zynqmp: Fix node names which contain "_" arm64: dts: zynqmp: Add missing gpio-controller to ps gpio arm64: dts: zynqmp: Add DDRC node arm64: dts: zynqmp: replace gpio-key,wakeup with wakeup-source property arm64: dts: zynqmp: Use mmc@ instead sdhci@ Signed-off-by: Arnd Bergmann commit efa0f49496be359ab3e068b0a75b15808c354b7f Author: Alexander Shiyan Date: Thu Dec 20 09:19:30 2018 +0300 serial: sccnxp: Allow to use non-standard baud rates This patch adds support for the use of non-standard baud rates. For these purposes, we use the built-in timer/counter. Signed-off-by: Alexander Shiyan Signed-off-by: Greg Kroah-Hartman commit 4ce193fdba48516717a4840043abb83f71109ee2 Author: Alexander Shiyan Date: Thu Dec 20 09:19:29 2018 +0300 serial: sccnxp: Adds a delay between sequential read/write cycles This patch adds a delay between sequential read/write cycles, to ensure the required minimum inactive time (tRWD). A time value from the datasheet has been added for each type of supported chips. The “inline” compiler attribute has been removed from the read/write functions, simply allow the compiler to control this. Signed-off-by: Alexander Shiyan Signed-off-by: Greg Kroah-Hartman commit 663abb1a7a7ff8fea9ab0145463de7fcff823755 Author: Ryan Case Date: Wed Dec 19 12:33:53 2018 -0800 tty: serial: qcom_geni_serial: Fix UART hang If a serial console write occured while a UART transmit command was waiting for a done signal then no further data would be sent until something new kicked the system into gear. If there is already data waiting in the circular buffer we must re-enable the tx watermark so we receive the expected interrupts. Signed-off-by: Ryan Case Reviewed-by: Evan Green Signed-off-by: Greg Kroah-Hartman commit 3c66eb4ba18dd1cab0d1bde651cde6d8bdb47696 Author: Matthias Kaehlcke Date: Wed Dec 19 10:17:47 2018 -0800 tty: serial: qcom_geni_serial: Fix wrap around of TX buffer Before commit a1fee899e5bed ("tty: serial: qcom_geni_serial: Fix softlock") the size of TX transfers was limited to the TX FIFO size, and wrap arounds of the UART circular buffer were split into two transfers. With the commit wrap around are allowed within a transfer. The TX FIFO of the geni serial port uses a word size of 4 bytes. In case of a circular buffer wrap within a transfer the driver currently may write an incomplete word to the FIFO, with some bytes containing data from the circular buffer and others being zero. Since the transfer isn't completed yet the zero bytes are sent as if they were actual data. Handle wrap arounds of the TX buffer properly and ensure that words written to the TX FIFO always contain valid data (unless the transfer is completed). Fixes: a1fee899e5bed ("tty: serial: qcom_geni_serial: Fix softlock") Signed-off-by: Matthias Kaehlcke Reviewed-by: Evan Green Tested-by: Ryan Case Signed-off-by: Greg Kroah-Hartman commit 3e730e858139c3bed9587ca50ce0f2aa12fe9523 Merge: 9f23b7ba6379f 16ad9501b1f2e Author: Arnd Bergmann Date: Thu Dec 20 16:11:02 2018 +0100 Merge tag 'qcom-drivers-for-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into next/drivers Qualcomm ARM Based Driver Updates for v4.21 Part 2 - Redo * Fix SCM compilation error * tag 'qcom-drivers-for-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux: firmware: qcom: scm: fix compilation error when disabled Signed-off-by: Arnd Bergmann commit 9f23b7ba6379fd80f0857cf4750e9eda83fe5408 Merge: a6f119a06960e fee10bd226786 Author: Arnd Bergmann Date: Thu Dec 20 16:10:32 2018 +0100 Merge tag 'zynq-soc-for-v5.0' of https://github.com/Xilinx/linux-xlnx into next/drivers ARM: Xilinx Zynq SoC patches for v5.0 - Adding pl353 smc driver * tag 'zynq-soc-for-v5.0' of https://github.com/Xilinx/linux-xlnx: memory: pl353: Add driver for arm pl353 static memory controller dt-bindings: memory: Add pl353 smc controller devicetree binding information Signed-off-by: Arnd Bergmann commit 916d9802e4b0723c1e4650e58e04c0259c14b85c Author: Hoan Nguyen An Date: Thu Dec 20 17:48:42 2018 +0900 spi: sh-msiof: Reduce the number of times write to and perform the transmission from FIFO The current state of the spi-sh-msiof, in master transfer mode: if t-> bits_per_word <= 8, if the data length is divisible by 4 ((len & 3) = 0), the length of each word will be 32 bits In case of data length can not be divisible by 4 ((len & 3) != 0), always set each word to be 8 bits, this will increase the number of times that write to FIFO, increasing the number of times it should be transmitted. Assume that the number of bytes of data length more than 64 bytes, each transmission will write 64 times into the TFDR then transmit, a maximum one-time transmission will transmit 64 bytes if each word is 8 bits long. Switch to setting if t->bits_per_word <= 8, the word length will be 32 bits although the data length is not divisible by 4, then if leftover, will transmit the balance and the length of each words is 1 byte. The maximum each can transmit up to 64 x 4 (Data Size = 32 bits (4 bytes)) = 256 bytes. TMDR2 : Bits 28 to 24 BITLEN1[4:0] Data Size (8 to 32 bits) Bits 23 to 16 WDLEN1[7:0] Word Count (1 to 64 words) Signed-off-by: Hoan Nguyen An Signed-off-by: Mark Brown commit 3e60b4fc86710cd2095628c67b296e7cc4b239c1 Author: Yangtao Li Date: Sat Dec 15 03:21:48 2018 -0500 regulator: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Mark Brown commit f4c8f980283b4832dad4d9ff4d5ecb3d7763efae Author: Axel Lin Date: Wed Dec 19 16:58:04 2018 +0800 regulator: mcp16502: Fix missing n_voltages setting The n_voltages setting is not set, fix it. Signed-off-by: Axel Lin Signed-off-by: Mark Brown commit 4906d09164c00979dcbb28060231d9ce46ab2061 Author: Axel Lin Date: Thu Dec 20 21:14:13 2018 +0800 regulator: mcp16502: Use #ifdef CONFIG_PM_SLEEP around mcp16502_suspend/resume_noirq mcp16502_suspend/resume_noirq is only used by SET_NOIRQ_SYSTEM_SLEEP_PM_OPS when CONFIG_PM_SLEEP is defined. So use #ifdef CONFIG_PM_SLEEP instead CONFIG_SUSPEND guard. Signed-off-by: Axel Lin Signed-off-by: Mark Brown commit 31d1b7710262fba12282b24083f20dc76e0efc93 Merge: 217188d9f985b 7566ec393f416 Author: Bartlomiej Zolnierkiewicz Date: Thu Dec 20 15:35:07 2018 +0100 Merge tag 'v4.20-rc7' of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into fbdev-for-next Linux 4.20-rc7 Sync with upstream (which now contains fbdev-v4.20 changes) to prepare a base for fbdev-v4.21 changes. commit cfdfaf4a86406f8eff7901de09f4910341eb9e31 Merge: e9f2e05a5f19c 95d386c2d2e76 Author: Radim Krčmář Date: Thu Dec 20 14:54:09 2018 +0100 Merge tag 'kvm-ppc-next-4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc PPC KVM update for 4.21 from Paul Mackerras The main new feature this time is support in HV nested KVM for passing a device that is emulated by a level 0 hypervisor and presented to level 1 as a PCI device through to a level 2 guest using VFIO. Apart from that there are improvements for migration of radix guests under HV KVM and some other fixes and cleanups. commit 704cfd7f5f71c6bc6cdfaa63a16ed0f72882b1a1 Author: Patrice Chotard Date: Thu Dec 20 14:32:15 2018 +0100 ARM: sti: remove pen_release and boot_lock The pen_release implementation was created for Versatile platforms to work around boot loaders that did not differentiate between the various different secondary CPUs on this ARM development platform. This should not be true of modern platforms where we send IPIs to specific CPUs to wake them up. Remove the pen_release stuff from SoCs that make use of the per-CPU IPI mechanism. The boot_lock is something that was required for ARM development platforms to ensure that the delay calibration worked properly. This is not necessary for modern platforms that have better bus bandwidth and do not need to calibrate the delay loop for secondary cores. Remove the boot_lock entirely. Due to pen_release and boot_lock removal, .smp_prepare_cpus and .smp_boot_secondary STi callbacks must be reworked properly to allow secondary CPU bring up. Secondary CPU is initialized and started by a U-BOOTROM firmware. Secondary CPU is spinning and waiting for a write at cpu_strt_ptr. Writing secondary_startup address at cpu_strt_ptr makes it to jump directly to secondary_startup(). This write must be done in .smp_boot_secondary callback and not in .smp_prepare_cpus as previously, this insures that secondary_data struct is populated in __cpu_up() (stack, pgdir and swapper_pg_dir fields). The IPI in sti_boot_secondary() is useless, so remove it. This patch is the merged of Russell's patch [1] and the rework of .smp_prepare_cpus and .smp_boot_secondary STi callbacks [2]. [1] https://patchwork.kernel.org/patch/10729435/ [2] https://patchwork.kernel.org/patch/10735795/ Signed-off-by: Russell King Signed-off-by: Patrice Chotard commit a64917446eafc7212e962561622d697fce04e9a6 Author: Aviv Heller Date: Tue Dec 18 19:03:27 2018 +0200 net/mlx5: Fix LAG requirement when CONFIG_MLX5_ESWITCH is off If CONFIG_MLX5_ESWITCH is not defined, test for SR-IOV being disabled, instead of calling e-switch LAG prereq routine. Since LAG with SRIOV is allowed only when switchdev mode is on. Fixes: eff849b2c669 ("net/mlx5: Allow/disallow LAG according to pre-req only") Signed-off-by: Aviv Heller Signed-off-by: Saeed Mahameed commit 0a5b589111c395f2b18c2a508e241207daaa8cca Author: Aviv Heller Date: Thu Dec 20 01:37:17 2018 +0200 net/mlx5: Fix query_nic_sys_image_guid() error during init vport system image guid should be queried using vport nic API for Ethernet ports, and vport hca API for Infiniband ports. Fixes: fadd59fc50d0 ("net/mlx5: Introduce inter-device communication mechanism") Signed-off-by: Aviv Heller Signed-off-by: Saeed Mahameed commit e32ee6c78efa6a32bff782bbe7a9970b018996ca Author: Eli Britstein Date: Mon Dec 3 17:09:54 2018 +0200 net/mlx5e: Support tunnel encap over tagged Ethernet Generate encap header depending on the routed device to support native/tagged Ethernet header. Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit aa331450b81f071bc8d7b68d5baab1b78f93598a Author: Eli Britstein Date: Sun Dec 9 09:17:18 2018 +0200 net/mlx5e: Support VLAN encap ETH header generation Support generation of native or tagged Ethernet header for encap header, depending on provided net device. Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit c7bcb277bda46d75819fb2d475fa817c10dc209b Author: Eli Britstein Date: Mon Dec 3 17:09:54 2018 +0200 net/mlx5e: Re-order route and encap header memory allocation Change the order to first route IPv4/6 and return if error. Only after successful route continue to allocate an encap header, with no functional change. Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 05ada1adb65acd533f978651e7001e3568e7b98a Author: Eli Britstein Date: Sun Dec 9 09:17:18 2018 +0200 net/mlx5e: Tunnel encap ETH header helper function In tunnel encap we prepare the encap header for IPv4/6 cases, in two separate functions. For ETH header generation the code is almost duplicated. Move the ETH header generation code from IPv4/6 functions to a helper function, with no functional change. Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit b168cff0b9b216e68215cdb28db999f542482a56 Author: Eli Britstein Date: Wed Dec 19 09:29:10 2018 +0200 net/mlx5e: Fail attempt to offload e-switch TC encap flows with vlan on underlay Currently we don't support nor fail attempts to offload encap flows routed to vlan device on the underlay network. We wrongly consider a vlan underlay device to be on the same e-switch b/c the switchdev ID is retrieved recursively. Add explicit check for that and fail such attempts. Also align to a more strict check for the ingress and the underlay devices to practically be on the same eswitch. Fixes: ce99f6b97fcd ('net/mlx5e: Support SRIOV TC encapsulation offloads for IPv6 tunnels') Fixes: 3e621b19b0bb ('net/mlx5e: Support TC encapsulation offloads with upper devices') Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 442e1228cbaccee8a9365624608544460155c5d1 Author: Eli Britstein Date: Tue Dec 18 09:46:00 2018 +0200 net/mlx5e: Tunnel routing output devs helper function For tunnel we determine the output devs for IPv4/6 cases, in two separate functions, with a duplicated code. Move that code from IPv4/6 functions to a helper function, with no functional change. Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit a0646c88ed3ac527b71cf365b03ff4fc729d35b6 Author: Eli Britstein Date: Wed Dec 19 09:24:58 2018 +0200 net/mlx5e: Fail attempt to offload e-switch TC flows with egress upper devices We use the switchdev parent HW id helper to identify if the mirred device shares the same ASIC/port with the ingress device. This can get us wrong in the presence of upper devices such as vlan or bridge set over the HW devices (VF or uplink representors), b/c the switchdev ID is retrieved recursively. To fail offload attempts in such cases, we condition the check on the egress device to have not only the same switchdev ID but also the relevant mlx5 netdev ops. Fixes: 03a9d11e6eeb ('net/mlx5e: Add TC drop and mirred/redirect action parsing for SRIOV offloads') Signed-off-by: Eli Britstein Reviewed-by: Roi Dayan Acked-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 1ee4457c5c2a6172893eb1f464860c753c9b4e96 Author: Or Gerlitz Date: Tue Dec 18 13:32:46 2018 +0200 net/mlx5e: Allow vlans on e-switch uplink reps There are cases (e.g tunneling with vlan on underlay and potentially more) where this makes sense, so allow that. Signed-off-by: Or Gerlitz Reviewed-by: Eli Britstein Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 4c8fb2986d44c5a75949a88ac61deec0ed50a542 Author: Gavi Teitz Date: Wed Dec 12 21:23:18 2018 +0200 net/mlx5e: Increase VF representors' SQ size to 128 The default size for the VF representors' SQ was too small to handle high packet rates. Doubling the size from 64 to 128 drastically improves the packet rate under stress (by about 50%), whereas increasing the size beyond 128 has not shown to make any further difference. The impact of the SQ size was measured with UDP traffic, in the following topology: TG <-> PF <-> TC forwarding <-> VF representor <-> VF in VM over a single core processing bi-directional traffic, with the following results: SQ size of 64: SQ size of 128: Packet rate for 64B UDP packets: 860 [Kpps] 1280 [Kpps] Packet rate for 114B VxLan encapsulated UDP packets: 320 [Kpps] 500 [Kpps] Signed-off-by: Gavi Teitz Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 4a0475d57ad134429f9bb56068bb738b4afc5992 Author: Miroslav Lichvar Date: Mon Dec 3 13:59:42 2018 +0100 mlx5: extend PTP gettime function to read system clock Read the system time right before and immediately after reading the low register of the internal timer. This adds support for the PTP_SYS_OFFSET_EXTENDED ioctl. Cc: Richard Cochran Cc: Saeed Mahameed Signed-off-by: Miroslav Lichvar Signed-off-by: Saeed Mahameed commit 5d8678365c90b9ce1fd2243ff5ea562609f6cec1 Author: Miroslav Lichvar Date: Mon Dec 3 13:59:41 2018 +0100 mlx5: update timecounter at least twice per counter overflow The timecounter needs to be updated at least once in half of the cyclecounter interval to prevent timecounter_cyc2time() interpreting a new timestamp as an old value and causing a backward jump. This would be an issue if the timecounter multiplier was so small that the update interval would not be limited by the 64-bit overflow in multiplication. Shorten the calculated interval to make sure the timecounter is updated in time even when the system clock is slowed down by up to 10%, the multiplier is increased by up to 10%, and the scheduled overflow check is late by 15%. Cc: Richard Cochran Cc: Ariel Levkovich Cc: Saeed Mahameed Signed-off-by: Miroslav Lichvar Signed-off-by: Saeed Mahameed commit 8c6c942d33f2a79439e86f8f406afae40a5bc767 Author: YueHaibing Date: Thu Dec 20 02:42:51 2018 +0000 powerpc/eeh: Fix debugfs_simple_attr.cocci warnings Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for debugfs files. Semantic patch information: Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file() imposes some significant overhead as compared to DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe(). Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci Signed-off-by: YueHaibing Acked-by: Russell Currey Signed-off-by: Michael Ellerman commit c20577014f85f36d4e137d3d52a1f61225b4a3d2 Author: Alexey Kardashevskiy Date: Mon Nov 19 15:25:17 2018 +1100 powerpc/powernv/eeh/npu: Fix uninitialized variables in opal_pci_eeh_freeze_status The current implementation of the OPAL_PCI_EEH_FREEZE_STATUS call in skiboot's NPU driver does not touch the pci_error_type parameter so it might have garbage but the powernv code analyzes it nevertheless. This initializes pcierr and fstate to zero in all call sites. Signed-off-by: Alexey Kardashevskiy Reviewed-by: Sam Bobroff Signed-off-by: Michael Ellerman commit e59f5bd759b7dee57593c5b6c0441609bda5d530 Author: Diana Craciun Date: Wed Dec 12 16:03:10 2018 +0200 powerpc/fsl: Add FSL_PPC_BOOK3E as supported arch for nospectre_v2 boot arg Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit a25de7af340fcd19a59978ded2ff04ed329bca06 Author: Alexey Kardashevskiy Date: Tue Oct 16 13:34:09 2018 +1100 powerpc/powernv/ioda: Reduce a number of hooks in pnv_phb fixup_phb() is never used, this removes it. pick_m64_pe() and reserve_m64_pe() are always defined for all powernv PHBs: they are initialized by pnv_ioda_parse_m64_window() which is called unconditionally from pnv_pci_init_ioda_phb() which initializes all known PHB types on powernv so we can open code them. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman commit dfa88658fb0583abb92e062c7a9cd5a5b94f2a46 Author: Diana Craciun Date: Wed Dec 12 16:03:09 2018 +0200 powerpc/fsl: Update Spectre v2 reporting Report branch predictor state flush as a mitigation for Spectre variant 2. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit f21b0a45e4e48eafca38f11612244c5bd454a6c2 Author: Alexey Kardashevskiy Date: Tue Oct 16 13:30:03 2018 +1100 powerpc/powernv/ioda1: Remove dead code for a single device PE At the moment PNV_IODA_PE_DEV is only used for NPU PEs which are not present on IODA1 machines (i.e. POWER7) so let's remove a piece of dead code. Signed-off-by: Alexey Kardashevskiy Reviewed-by: Sam Bobroff Signed-off-by: Michael Ellerman commit 3bc8ea8603ae4c1e09aca8de229ad38b8091fcb3 Author: Diana Craciun Date: Wed Dec 12 16:03:08 2018 +0200 powerpc/fsl: Enable runtime patching if nospectre_v2 boot arg is used If the user choses not to use the mitigations, replace the code sequence with nops. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit 517ad4ae8aa93dccdb9a88c27257ecb421c9e848 Author: Alexey Kardashevskiy Date: Tue Oct 2 13:22:31 2018 +1000 vfio/spapr_tce: Get rid of possible infinite loop As a part of cleanup, the SPAPR TCE IOMMU subdriver releases preregistered memory. If there is a bug in memory release, the loop in tce_iommu_release() becomes infinite; this actually happened to me. This makes the loop finite and prints a warning on every failure to make the code more bug prone. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson Acked-by: Alex Williamson Signed-off-by: Michael Ellerman commit e7aa61f47b23afbec41031bc47ca8d6cb6516abc Author: Diana Craciun Date: Wed Dec 12 16:03:07 2018 +0200 powerpc/fsl: Flush branch predictor when entering KVM Switching from the guest to host is another place where the speculative accesses can be exploited. Flush the branch predictor when entering KVM. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit fa1ada78897f282917594ba8eba220a54f87dabb Author: Alexey Kardashevskiy Date: Fri Sep 28 16:48:25 2018 +1000 powerpc/powernv/npu: Remove unused headers and a macro. The macro and few headers are not used so remove them. Signed-off-by: Alexey Kardashevskiy Acked-by: Alistair Popple Signed-off-by: Michael Ellerman commit 7fef436295bf6c05effe682c8797dfcb0deb112a Author: Diana Craciun Date: Wed Dec 12 16:03:06 2018 +0200 powerpc/fsl: Flush the branch predictor at each kernel entry (32 bit) In order to protect against speculation attacks on indirect branches, the branch predictor is flushed at kernel entry to protect for the following situations: - userspace process attacking another userspace process - userspace process attacking the kernel Basically when the privillege level change (i.e.the kernel is entered), the branch predictor state is flushed. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit bdbf649efe21173cae63b4b71db84176420f9039 Author: Alexey Kardashevskiy Date: Fri Sep 28 16:45:39 2018 +1000 powerpc/powernv/ioda: Allocate indirect TCE levels of cached userspace addresses on demand The powernv platform maintains 2 TCE tables for VFIO - a hardware TCE table and a table with userspace addresses; the latter is used for marking pages dirty when corresponging TCEs are unmapped from the hardware table. a68bd1267b72 ("powerpc/powernv/ioda: Allocate indirect TCE levels on demand") enabled on-demand allocation of the hardware table, however it missed the other table so it has still been fully allocated at the boot time. This fixes the issue by allocating a single level, just like we do for the hardware table. Fixes: a68bd1267b72 ("powerpc/powernv/ioda: Allocate indirect TCE levels on demand") Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson Signed-off-by: Michael Ellerman commit 10c5e83afd4a3f01712d97d3bb1ae34d5b74a185 Author: Diana Craciun Date: Wed Dec 12 16:03:05 2018 +0200 powerpc/fsl: Flush the branch predictor at each kernel entry (64bit) In order to protect against speculation attacks on indirect branches, the branch predictor is flushed at kernel entry to protect for the following situations: - userspace process attacking another userspace process - userspace process attacking the kernel Basically when the privillege level change (i.e. the kernel is entered), the branch predictor state is flushed. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit f633a8ad636efb5d4bba1a047d4a0f1ef719aa06 Author: Diana Craciun Date: Wed Dec 12 16:03:04 2018 +0200 powerpc/fsl: Add nospectre_v2 command line argument When the command line argument is present, the Spectre variant 2 mitigations are disabled. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit 98518c4d8728656db349f875fcbbc7c126d4c973 Author: Diana Craciun Date: Wed Dec 12 16:03:03 2018 +0200 powerpc/fsl: Emulate SPRN_BUCSR register In order to flush the branch predictor the guest kernel performs writes to the BUCSR register which is hypervisor privilleged. However, the branch predictor is flushed at each KVM entry, so the branch predictor has been already flushed, so just return as soon as possible to guest. Signed-off-by: Diana Craciun [mpe: Tweak comment formatting] Signed-off-by: Michael Ellerman commit 7d8bad99ba5a22892f0cad6881289fdc3875a930 Author: Diana Craciun Date: Wed Dec 12 16:03:02 2018 +0200 powerpc/fsl: Fix spectre_v2 mitigations reporting Currently for CONFIG_PPC_FSL_BOOK3E the spectre_v2 file is incorrect: $ cat /sys/devices/system/cpu/vulnerabilities/spectre_v2 "Mitigation: Software count cache flush" Which is wrong. Fix it to report vulnerable for now. Fixes: ee13cb249fab ("powerpc/64s: Add support for software count cache flush") Cc: stable@vger.kernel.org # v4.19+ Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit 1cbf8990d79ff69da8ad09e8a3df014e1494462b Author: Diana Craciun Date: Wed Dec 12 16:03:01 2018 +0200 powerpc/fsl: Add macro to flush the branch predictor The BUCSR register can be used to invalidate the entries in the branch prediction mechanisms. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit 76a5eaa38b15dda92cd6964248c39b5a6f3a4e9d Author: Diana Craciun Date: Wed Dec 12 16:03:00 2018 +0200 powerpc/fsl: Add infrastructure to fixup branch predictor flush In order to protect against speculation attacks (Spectre variant 2) on NXP PowerPC platforms, the branch predictor should be flushed when the privillege level is changed. This patch is adding the infrastructure to fixup at runtime the code sections that are performing the branch predictor flush depending on a boot arg parameter which is added later in a separate patch. Signed-off-by: Diana Craciun Signed-off-by: Michael Ellerman commit 4bd46aa0353e022c2401a258e93b107880a66533 Author: Brad Love Date: Wed Dec 19 12:07:01 2018 -0500 media: cx23885: only reset DMA on problematic CPUs It is reported that commit 95f408bbc4e4 ("media: cx23885: Ryzen DMA related RiSC engine stall fixes") caused regresssions with other CPUs. Ensure that the quirk will be applied only for the CPUs that are known to cause problems. A module option is added for explicit control of the behaviour. Fixes: 95f408bbc4e4 ("media: cx23885: Ryzen DMA related RiSC engine stall fixes") Signed-off-by: Brad Love Signed-off-by: Mauro Carvalho Chehab commit e01b5781958de08942af341ce26768d5e0fbcdf5 Author: Anson Huang Date: Thu Dec 20 08:56:16 2018 +0000 rtc: add i.MX system controller RTC support i.MX8QXP is an ARMv8 SoC which has a Cortex-M4 system controller inside, the system controller is in charge of controlling power, clock and secure rtc etc.. This patch adds i.MX system controller RTC driver support, Linux kernel has to communicate with system controller via MU (message unit) IPC to set/get RTC time and other alarm functions, since the RTC set time needs to be done in secure EL3 mode (required by system controller firmware) and alarm functions needs to be done with general MU IRQ handle, these depend on other components which are NOT ready, so this patch ONLY enables the RTC time read. Signed-off-by: Anson Huang Signed-off-by: Alexandre Belloni commit 2ea44ca1ffccf89cfb9e6755156843e278ec9645 Author: Anson Huang Date: Thu Dec 20 08:56:07 2018 +0000 dt-bindings: fsl: scu: add rtc binding NXP i.MX8QXP is an ARMv8 SoC with a Cortex-M4 core inside as system controller, the system controller is in charge of system power, clock and secure RTC etc. management, Linux kernel has to communicate with system controller via MU (message unit) IPC to do RTC operation, this patch adds binding doc for i.MX system controller RTC driver. Signed-off-by: Anson Huang Reviewed-by: Rob Herring Signed-off-by: Alexandre Belloni commit bbb55cd708901dedbeeeb929c7012f35afea7882 Author: Nathan Chancellor Date: Mon Dec 10 18:35:14 2018 -0500 media: ddbridge: Move asm includes after linux ones Without this, cpumask_t and bool are not defined: In file included from drivers/media/pci/ddbridge/ddbridge-ci.c:19: In file included from drivers/media/pci/ddbridge/ddbridge.h:22: ./arch/arm/include/asm/irq.h:35:50: error: unknown type name 'cpumask_t' extern void arch_trigger_cpumask_backtrace(const cpumask_t *mask, ^ ./arch/arm/include/asm/irq.h:36:9: error: unknown type name 'bool' bool exclude_self); ^ Doing a survey of the kernel tree, this appears to be expected because '#include ' is always after the linux includes. This also fixes warnings of this variety (with Clang): In file included from drivers/media/pci/ddbridge/ddbridge-ci.c:19: In file included from drivers/media/pci/ddbridge/ddbridge.h:56: In file included from ./include/media/dvb_net.h:22: In file included from ./include/linux/netdevice.h:50: In file included from ./include/uapi/linux/neighbour.h:6: In file included from ./include/linux/netlink.h:9: In file included from ./include/net/scm.h:11: In file included from ./include/linux/sched/signal.h:6: ./include/linux/signal.h:87:11: warning: array index 3 is past the end of the array (which contains 2 elements) [-Warray-bounds] return (set->sig[3] | set->sig[2] | ^ ~ ./arch/arm/include/asm/signal.h:17:2: note: array 'sig' declared here unsigned long sig[_NSIG_WORDS]; ^ Fixes: b6973637c4cc ("media: ddbridge: remove another duplicate of io.h and sort includes") Signed-off-by: Nathan Chancellor Tested-by: Guenter Roeck Signed-off-by: Mauro Carvalho Chehab commit f242e0ac95cadb27527d0b06c957723c9f63dd74 Author: Christophe Leroy Date: Mon Dec 17 14:18:27 2018 +0000 powerpc/prom: move the device tree if not in declared memory. If the device tree doesn't reside in the memory which is declared inside it, it has to be moved as well as this memory will not be mapped by the kernel. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit ec2adcd8dd64588cb4bcd1c1e0b86304b9713e73 Author: Michael Ellerman Date: Mon Nov 5 20:01:01 2018 +1100 powerpc: Add some documentation of ISA versions Add some documentation on which CPU versions map to which ISA versions. This is all publicly available information, some of it already in the kernel source, but it's much nicer to have it all in one place. Signed-off-by: Michael Ellerman commit 2b874a5c7b75fdc90fdd1e2ffaa3ec5a9d21e253 Author: Michael Ellerman Date: Sat Dec 15 00:57:11 2018 +1100 powerpc/configs: Don't enable PPC_EARLY_DEBUG in defconfigs This reverts the remains of commit b9ef7d6b11c1 ("powerpc: Update default configurations"). That commit was proceeded by a commit which added a config option to control use of BOOTX for early debug, ie. PPC_EARLY_DEBUG_BOOTX, and then the update of the defconfigs was intended to not change behaviour by then enabling the new config option. However enabling PPC_EARLY_DEBUG had other consequences, notably causing us to register the udbg console at the end of udbg_early_init(). This means on a system which doesn't have anything that BOOTX can use (most systems), we register the udbg console very early but the bootx code just throws everything away, meaning early boot messages are never printed to the console. What we want to happen is for the udbg console to only be registered later (from setup_arch()) once we've setup udbg_putc, and then all early boot messages will be replayed. Fixes: b9ef7d6b11c1 ("powerpc: Update default configurations") Reported-by: Torsten Duwe Signed-off-by: Michael Ellerman commit 2fea82db113e4422ef5c8e6209908806e5fb6b63 Author: Arnd Bergmann Date: Mon Dec 10 22:51:57 2018 +0100 powerpc: eeh_event: convert semaphore to completion For this use case, completions and semaphores are equivalent, but semaphores are an awkward interface that should generally be avoided, so use the completion instead. Signed-off-by: Arnd Bergmann Signed-off-by: Michael Ellerman commit d1f75a96842b265ca2a89b7ed477a50637ea87f1 Author: Greg Kurz Date: Mon Dec 10 16:13:38 2018 +0100 ocxl/afu_irq: Don't include The AFU irq code doesn't need to reach out to the platform. Signed-off-by: Greg Kurz Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit 759bc01586535700fbb1aaf40dd727146e2e8b57 Author: Greg Kurz Date: Mon Dec 10 16:18:13 2018 +0100 ocxl: Clarify error path in setup_xsl_irq() Implementing rollback with goto and labels is a common practice that leads to prettier and more maintainable code. FWIW, this design pattern is already being used in alloc_link() a few lines below in this file. Do the same in setup_xsl_irq(). Signed-off-by: Greg Kurz Acked-by: Frederic Barrat Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit 3cfb9ebe906b51f2942b1e251009bb251efd2ba6 Author: Benjamin Herrenschmidt Date: Tue Dec 11 13:27:33 2018 +1100 powerpc/44x/bamboo: Fix PCI range The bamboo dts has a bug: it uses a non-naturally aligned range for PCI memory space. This isnt' supported by the code, thus causing PCI to break on this system. This is due to the fact that while the chip memory map has 1G reserved for PCI memory, it's only 512M aligned. The code doesn't know how to split that into 2 different PMMs and fails, so limit the region to 512M. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Michael Ellerman commit 51f4cc2047a4b7e9bf1b49acf06c110991fd4167 Author: Darren Stevens Date: Sun Aug 19 21:26:28 2018 +0100 powerpc/pasemi: Add Nemo board IRQ initroutine Add a IRQ init routine for the Nemo board which inits and attatches the i8259 found in the SB600, and a cascade routine to dispatch the interrupts. Signed-off-by: Darren Stevens Signed-off-by: Michael Ellerman commit 656fdf3ad8e0ae4c6c3d75af373df6cc9797bac1 Author: Darren Stevens Date: Sun Aug 19 21:23:57 2018 +0100 powerpc/pasemi: Add Nemo board device init code. Add routines for Nemo specific devices to init at boot time, these being board level power-off and SB600's rtc. Also add a run time variable to prevent these being activated if we boot on a reference board. Signed-off-by: Darren Stevens Signed-off-by: Michael Ellerman commit 0428a5f494a003c98c1d1fc98aae605c288dc066 Author: Darren Stevens Date: Sun Aug 19 21:21:47 2018 +0100 powerpc/pasemi: Add Nemo board IRQ initroutine Add a IRQ init routine for the Nemo board which inits and attatches the i8259 found in the SB600, and a cascade routine to dispatch the interrupts. Signed-off-by: Darren Stevens Signed-off-by: Michael Ellerman commit 68f211a4d1e5882e881bbb84b6505908dde5f625 Author: Darren Stevens Date: Sun Aug 19 21:21:55 2018 +0100 powerpc/pasemi: Add PCI initialisation for Nemo board. The A-Eon Amigaone X1000's Nemo motherboard has an AMD SB600 connected to one of the PCI-e root ports on its PaSemi Pwrficient 1628M SoC. Normally the SB600 southbridge would be connected to a hidden PCI-e port on the system's northbridge, and as a result doesn't fully comply with the PCI-e spec. Add code to relax the PCI-e detection in both the root port and the Linux kernel allowing on board devices to be detected. Signed-off-by: Darren Stevens Signed-off-by: Michael Ellerman commit 49a502ea23bf9dec47f8f3c3960909ff409cd1bb Author: Christophe Leroy Date: Fri Dec 14 15:23:33 2018 +0000 powerpc/mm: Make NULL pointer deferences explicit on bad page faults. As several other arches including x86, this patch makes it explicit that a bad page fault is a NULL pointer dereference when the fault address is lower than PAGE_SIZE In the mean time, this page makes all bad_page_fault() messages shorter so that they remain on one single line. And it prefixes them by "BUG: " so that they get easily grepped. Signed-off-by: Christophe Leroy [mpe: Avoid pr_cont()] Signed-off-by: Michael Ellerman commit 8dbdec0bcb416d0ef0bfd737620d08f5160ac290 Author: Dmitry V. Levin Date: Sun Dec 16 20:28:28 2018 +0300 powerpc/ptrace: Combine SYSCALL_EMU & SYSCALL_TRACE handling Combine the SYSCALL_EMU and SYSCALL_TRACE handling so that we only call tracehook_report_syscall_entry() in one place. Signed-off-by: Dmitry V. Levin [mpe: Flesh out change log, s/cached_flags/flags/, reflow comments] Signed-off-by: Michael Ellerman commit 25078dc1f74be16b858e914f52cc8f4d03c2271a Author: Christoph Hellwig Date: Sun Dec 16 17:53:49 2018 +0100 powerpc: use mm zones more sensibly Powerpc has somewhat odd usage where ZONE_DMA is used for all memory on common 64-bit configfs, and ZONE_DMA32 is used for 31-bit schemes. Move to a scheme closer to what other architectures use (and I dare to say the intent of the system): - ZONE_DMA: optionally for memory < 31-bit (64-bit embedded only) - ZONE_NORMAL: everything addressable by the kernel - ZONE_HIGHMEM: memory > 32-bit for 32-bit kernels Also provide information on how ZONE_DMA is used by defining ARCH_ZONE_DMA_BITS. Contains various fixes from Benjamin Herrenschmidt. Signed-off-by: Christoph Hellwig Signed-off-by: Michael Ellerman commit f3e5a8579c70d591db8e772cab93af0ec7e39849 Author: Christoph Hellwig Date: Sun Dec 16 18:19:51 2018 +0100 cxl: drop the dma_set_mask callback from vphb The CXL code never even looks at the dma mask, so there is no good reason for this sanity check. Remove it because it gets in the way of the dma ops refactoring. Signed-off-by: Christoph Hellwig Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit 44a0337b322e0ee2b817e334436366d394654d07 Author: Christoph Hellwig Date: Sun Dec 16 18:19:50 2018 +0100 powerpc/dma: split the two __dma_alloc_coherent implementations The implemementation for the CONFIG_NOT_COHERENT_CACHE case doesn't share any code with the one for systems with coherent caches. Split it off and merge it with the helpers in dma-noncoherent.c that have no other callers. Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt Signed-off-by: Michael Ellerman commit 9c15a87cfc6ce34bc6f2a5cee5e3994c28307942 Author: Christoph Hellwig Date: Sun Dec 16 18:19:49 2018 +0100 powerpc/dma: remove the unused dma_iommu_ops export Signed-off-by: Christoph Hellwig Signed-off-by: Michael Ellerman commit acddff9dc4392b5445ca393254712db47ebb24cf Author: Christoph Hellwig Date: Sun Dec 16 18:19:48 2018 +0100 powerpc/dma: remove the unused ISA_DMA_THRESHOLD export Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt Signed-off-by: Michael Ellerman commit 0e652390fb95ae567fe709d2b388f4e9c792224c Author: Christoph Hellwig Date: Sun Dec 16 18:19:47 2018 +0100 powerpc/dma: remove the unused ARCH_HAS_DMA_MMAP_COHERENT define Signed-off-by: Christoph Hellwig Acked-by: Benjamin Herrenschmidt Signed-off-by: Michael Ellerman commit 67d8208fba1324fa0198f9fc58a9edbe09596947 Author: Christoph Hellwig Date: Sun Dec 16 18:19:46 2018 +0100 crypto4xx_core: don't abuse __dma_sync_page This function is internal to the DMA API implementation. Instead use the DMA API to properly unmap. Note that the DMA API usage in this driver is a disaster and urgently needs some work - it is missing all the unmaps, seems to do a secondary map where it looks like it should to a unmap in one place to work around cache coherency and the directions passed in seem to be partially wrong. Signed-off-by: Christoph Hellwig Tested-by: Christian Lamparter Signed-off-by: Michael Ellerman commit 0aeba2d0d27c7341c10aeae7f013ad5f034d8b2d Author: Christoph Hellwig Date: Sun Dec 16 18:19:45 2018 +0100 powerpc/dma: properly wire up the unmap_page and unmap_sg methods The unmap methods need to transfer memory ownership back from the device to the cpu by identical means as dma_sync_*_to_cpu. I'm not sure powerpc needs to do any work in this transfer direction, but given that it does invalidate the caches in dma_sync_*_to_cpu already we should make sure we also do so on unmapping. Signed-off-by: Christoph Hellwig [mpe: s/dir/direction in dma_nommu_unmap_page()] Signed-off-by: Michael Ellerman commit 9286356907caa2d4737bd9dd8afe0b4ccaeea02b Author: Christoph Hellwig Date: Sun Dec 16 18:19:44 2018 +0100 powerpc: allow NOT_COHERENT_CACHE for amigaone AMIGAONE selects NOT_COHERENT_CACHE, so we better allow it. Signed-off-by: Christoph Hellwig Signed-off-by: Michael Ellerman commit b18f0ae92b0a1db565c3e505fa87b6971ad3b641 Author: Christophe Leroy Date: Fri Dec 14 10:27:47 2018 +0000 powerpc/prom: fix early DEBUG messages This patch fixes early DEBUG messages in prom.c: - Use %px instead of %p to see the addresses - Cast memblock_phys_mem_size() with (unsigned long long) to avoid build failure when phys_addr_t is not 64 bits. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit e1e71e201703500f708bdeaf64660a2a178cb6a0 Author: Greg Kurz Date: Sun Dec 16 22:28:50 2018 +0100 ocxl: Fix endiannes bug in ocxl_link_update_pe() All fields in the PE are big-endian. Use cpu_to_be32() like everywhere else something is written to the PE. Otherwise a wrong TID will be used by the NPU. If this TID happens to point to an existing thread sharing the same mm, it could be woken up by error. This is highly improbable though. The likely outcome of this is the NPU not finding the target thread and forcing the AFU into sending an interrupt, which userspace is supposed to handle anyway. Fixes: e948e06fc63a ("ocxl: Expose the thread_id needed for wait on POWER9") Cc: stable@vger.kernel.org # v4.18 Signed-off-by: Greg Kurz Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman commit 72e7bcc2cdf82bf03caaa5e6c9b0134c2fc2ee7d Author: Joel Stanley Date: Mon Nov 12 15:58:06 2018 +1030 powerpc/32: Avoid unsupported flags with clang When building for ppc32 with clang these flags are unsupported: -ffixed-r2 and -mmultiple llvm's lib/Target/PowerPC/PPCRegisterInfo.cpp marks r2 as reserved on when building for SVR4ABI and !ppc64: // The SVR4 ABI reserves r2 and r13 if (Subtarget.isSVR4ABI()) { // We only reserve r2 if we need to use the TOC pointer. If we have no // explicit uses of the TOC pointer (meaning we're a leaf function with // no constant-pool loads, etc.) and we have no potential uses inside an // inline asm block, then we can treat r2 has an ordinary callee-saved // register. const PPCFunctionInfo *FuncInfo = MF.getInfo(); if (!TM.isPPC64() || FuncInfo->usesTOCBasePtr() || MF.hasInlineAsm()) markSuperRegs(Reserved, PPC::R2); // System-reserved register markSuperRegs(Reserved, PPC::R13); // Small Data Area pointer register } This means we can safely omit -ffixed-r2 when building for 32-bit targets. The -mmultiple/-mno-multiple flags are not supported by clang, so platforms that might support multiple miss out on using multiple word instructions. We wrap these flags in cc-option so that when Clang gains support the kernel will be able use these flags. Clang 8 can then build a ppc44x_defconfig which boots in Qemu: make CC=clang-8 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- ppc44x_defconfig ./scripts/config -e CONFIG_DEVTMPFS -d DEVTMPFS_MOUNT make CC=clang-8 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- qemu-system-ppc -M bamboo \ -kernel arch/powerpc/boot/zImage \ -dtb arch/powerpc/boot/dts/bamboo.dtb \ -initrd ~/ppc32-440-rootfs.cpio \ -nographic -serial stdio -monitor pty -append "console=ttyS0" Link: https://github.com/ClangBuiltLinux/linux/issues/261 Link: https://bugs.llvm.org/show_bug.cgi?id=39556 Link: https://bugs.llvm.org/show_bug.cgi?id=39555 Signed-off-by: Joel Stanley Reviewed-by: Nick Desaulniers Signed-off-by: Michael Ellerman commit e213574a449f7a57d4202c1869bbc7680b6b5521 Author: Joel Stanley Date: Fri Nov 2 11:14:55 2018 +1030 raid6/ppc: Fix build for clang We cannot build these files with clang as it does not allow altivec instructions in assembly when -msoft-float is passed. Jinsong Ji wrote: > We currently disable Altivec/VSX support when enabling soft-float. So > any usage of vector builtins will break. > > Enable Altivec/VSX with soft-float may need quite some clean up work, so > I guess this is currently a limitation. > > Removing -msoft-float will make it work (and we are lucky that no > floating point instructions will be generated as well). This is a workaround until the issue is resolved in clang. Link: https://bugs.llvm.org/show_bug.cgi?id=31177 Link: https://github.com/ClangBuiltLinux/linux/issues/239 Signed-off-by: Joel Stanley Reviewed-by: Nick Desaulniers Signed-off-by: Michael Ellerman commit 3757cba80affcef2ef670f0db3d3504ccf967830 Author: Madhavan Srinivasan Date: Sun Jun 10 19:57:02 2018 +0530 powerpc/perf: Remove l2 bus events from HW cache event array Remove PM_L2_ST_MISS and PM_L2_ST from HW cache event array since these are bus events. And these needs to be programmed in groups. Hence remove them. Fixes: f1fb60bfde65 ('powerpc/perf: Export Power9 generic and cache events to sysfs') Signed-off-by: Madhavan Srinivasan Signed-off-by: Michael Ellerman commit 59029136d75022cb8b7c7bebd1738ae70232416e Author: Madhavan Srinivasan Date: Sun Jun 10 19:57:01 2018 +0530 powerpc/perf: Add constraints for power9 l2/l3 bus events In previous generation processors, both bus events and direct events of performance monitoring unit can be individually programmabled and monitored in PMCs. But in Power9, L2/L3 bus events are always available as a "bank" of 4 events. To obtain the counts for any of the l2/l3 bus events in a given bank, the user will have to program PMC4 with corresponding l2/l3 bus event for that bank. Patch enforce two contraints incase of L2/L3 bus events. 1)Any L2/L3 event when programmed is also expected to program corresponding PMC4 event from that group. 2)PMC4 event should always been programmed first due to group constraint logic limitation For ex. consider these L3 bus events PM_L3_PF_ON_CHIP_MEM (0x460A0), PM_L3_PF_MISS_L3 (0x160A0), PM_L3_CO_MEM (0x260A0), PM_L3_PF_ON_CHIP_CACHE (0x360A0), 1) This is an INVALID group for L3 Bus event monitoring, since it is missing PMC4 event. perf stat -e "{r160A0,r260A0,r360A0}" < > And this is a VALID group for L3 Bus events: perf stat -e "{r460A0,r160A0,r260A0,r360A0}" < > 2) This is an INVALID group for L3 Bus event monitoring, since it is missing PMC4 event. perf stat -e "{r260A0,r360A0}" < > And this is a VALID group for L3 Bus events: perf stat -e "{r460A0,r260A0,r360A0}" < > 3) This is an INVALID group for L3 Bus event monitoring, since it is missing PMC4 event. perf stat -e "{r360A0}" < > And this is a VALID group for L3 Bus events: perf stat -e "{r460A0,r360A0}" < > Patch here implements group constraint logic suggested by Michael Ellerman. Signed-off-by: Madhavan Srinivasan Signed-off-by: Michael Ellerman commit 2d46d4877b1afd14059393a48bdb8ce27955174c Author: Madhavan Srinivasan Date: Mon Oct 9 19:42:40 2017 +0530 powerpc/perf: Fix unit_sel/cache_sel checks Raw event code has couple of fields "unit" and "cache" in it, to capture the "unit" to monitor for a given pmcxsel and cache reload qualifier to program in MMCR1. isa207_get_constraint() refers "unit" field to update the MMCRC (L2/L3) Event bus control fields with "cache" bits of the raw event code. These are power8 specific and not supported by PowerISA v3.0 pmu. So wrap the checks to be power8 specific. Also, "cache" bit field is referred to update MMCR1[16:17] and this check can be power8 specific. Fixes: 7ffd948fae4cd ('powerpc/perf: factor out power8 pmu functions') Signed-off-by: Madhavan Srinivasan Signed-off-by: Michael Ellerman commit 8c31459d6138b07537346d976e7c30c760a1de01 Author: Madhavan Srinivasan Date: Mon Oct 9 19:42:39 2017 +0530 powerpc/perf: Cleanup cache_sel bits comment Update the raw event code comment in power9-pmu.c with respect to "cache" bits, since power9 MMCRC does not support these. Signed-off-by: Madhavan Srinivasan Signed-off-by: Michael Ellerman commit 333804dc3b7a92158ab63a48febff0d8ef89ada3 Author: Madhavan Srinivasan Date: Sun Dec 9 14:55:35 2018 +0530 powerpc/perf: Update perf_regs structure to include SIER On each sample, Sample Instruction Event Register (SIER) content is saved in pt_regs. SIER does not have a entry as-is in the pt_regs but instead, SIER content is saved in the "dar" register of pt_regs. Patch adds another entry to the perf_regs structure to include the "SIER" printing which internally maps to the "dar" of pt_regs. It also check for the SIER availability in the platform and present value accordingly Signed-off-by: Madhavan Srinivasan Signed-off-by: Michael Ellerman commit 17cfccc91545682513541924245abb876d296063 Author: Madhavan Srinivasan Date: Sun Dec 9 14:48:15 2018 +0530 powerpc/perf: Fix thresholding counter data for unknown type MMCRA[34:36] and MMCRA[38:44] expose the thresholding counter value. Thresholding counter can be used to count latency cycles such as load miss to reload. But threshold counter value is not relevant when the sampled instruction type is unknown or reserved. Patch to fix the thresholding counter value to zero when sampled instruction type is unknown or reserved. Fixes: 170a315f41c6('powerpc/perf: Support to export MMCRA[TEC*] field to userspace') Signed-off-by: Madhavan Srinivasan Signed-off-by: Michael Ellerman commit 374f3f5979f9b28bfb5b5799208d82d08ef518a7 Author: Aneesh Kumar K.V Date: Mon Nov 26 20:05:04 2018 +0530 powerpc/mm/hash: Handle user access of kernel address gracefully In commit 2865d08dd9ea ("powerpc/mm: Move the DSISR_PROTFAULT sanity check") we moved the protection fault access check before the vma lookup. That means we hit that WARN_ON when user space accesses a kernel address. Before that commit this was handled by find_vma() not finding vma for the kernel address and considering that access as bad area access. Avoid the confusing WARN_ON and convert that to a ratelimited printk. With the patch we now get: for load: a.out[5997]: User access of kernel address (c00000000000dea0) - exploit attempt? (uid: 1000) a.out[5997]: segfault (11) at c00000000000dea0 nip 1317c0798 lr 7fff80d6441c code 1 in a.out[1317c0000+10000] a.out[5997]: code: 60000000 60420000 3c4c0002 38427790 4bffff20 3c4c0002 38427784 fbe1fff8 a.out[5997]: code: f821ffc1 7c3f0b78 60000000 e9228030 <89290000> 993f002f 60000000 383f0040 for exec: a.out[6067]: User access of kernel address (c00000000000dea0) - exploit attempt? (uid: 1000) a.out[6067]: segfault (11) at c00000000000dea0 nip c00000000000dea0 lr 129d507b0 code 1 a.out[6067]: Bad NIP, not dumping instructions. Fixes: 2865d08dd9ea ("powerpc/mm: Move the DSISR_PROTFAULT sanity check") Signed-off-by: Aneesh Kumar K.V Tested-by: Breno Leitao [mpe: Don't split printk() string across lines] Signed-off-by: Michael Ellerman commit 5c6a1177826e5207306511a480b5aae79fd0fefb Author: Sinan Kaya Date: Wed Dec 19 22:46:59 2018 +0000 ACPI: Make PCI slot detection driver depend on PCI Since this is ACPI PCI slot detection driver for PCI, it doesn't make sense to compile this without PCI support in place. Signed-off-by: Sinan Kaya Signed-off-by: Rafael J. Wysocki commit 43554cebba50e709b9207c55ceca6bc281748586 Author: Sinan Kaya Date: Wed Dec 19 22:46:58 2018 +0000 ACPI/IORT: Stub out ACS functions when CONFIG_PCI is not set Remove PCI dependent code out of iort.c when CONFIG_PCI is not defined. A quick search reveals the following functions: 1. pci_request_acs() 2. pci_domain_nr() 3. pci_is_root_bus() 4. to_pci_dev() Both pci_domain_nr() and pci_is_root_bus() are defined in linux/pci.h. pci_domain_nr() is a stub function when CONFIG_PCI is not set and pci_is_root_bus() just returns a reference to a structure member which is still valid without CONFIG_PCI set. to_pci_dev() is a macro that expands to container_of. pci_request_acs() is the only code that gets pulled in from drivers/pci/*.c Signed-off-by: Sinan Kaya Acked-by: Lorenzo Pieralisi Signed-off-by: Rafael J. Wysocki commit 52146173a0333a8c9fbc1a3dd92958f376511b38 Author: Sinan Kaya Date: Wed Dec 19 22:46:57 2018 +0000 arm64: select ACPI PCI code only when both features are enabled ACPI and PCI are no longer coupled to each other. Specify requirements for both when pulling in code. Signed-off-by: Sinan Kaya Acked-by: Catalin Marinas Signed-off-by: Rafael J. Wysocki commit 5d32a66541c4683456507481a0944ed2985e75c7 Author: Sinan Kaya Date: Wed Dec 19 22:46:56 2018 +0000 PCI/ACPI: Allow ACPI to be built without CONFIG_PCI set We are compiling PCI code today for systems with ACPI and no PCI device present. Remove the useless code and reduce the tight dependency. Signed-off-by: Sinan Kaya Acked-by: Bjorn Helgaas # PCI parts Acked-by: Ingo Molnar Signed-off-by: Rafael J. Wysocki commit bd23fac3eaaa8bd79c02a2f139f68ac6424a9a7c Author: Sinan Kaya Date: Wed Dec 19 22:46:55 2018 +0000 ACPICA: Remove PCI bits from ACPICA when CONFIG_PCI is unset Allow ACPI to be built without PCI support in place. Signed-off-by: Sinan Kaya Signed-off-by: Rafael J. Wysocki commit 86689776878f0c1aee77604b9c5fce2ffb9ec65e Author: Sinan Kaya Date: Wed Dec 19 22:46:54 2018 +0000 ACPI: Allow CONFIG_PCI to be unset for reboot Make PCI reboot conditional on CONFIG_PCI set on the kernel configuration. Signed-off-by: Sinan Kaya Signed-off-by: Rafael J. Wysocki commit 36ad7d2b9e9bde9aeb097fcfd3c033b5c010f92a Author: Sinan Kaya Date: Wed Dec 19 22:46:53 2018 +0000 ACPI: Move PCI reset to a separate function Getting ready to factor out PCI specific code when CONFIG_PCI is unset. Create a acpi_pci_reset() that kick starts PCI specific reset. Signed-off-by: Sinan Kaya Signed-off-by: Rafael J. Wysocki commit 03ebe48e235f17d70f34890d34d8153b8a84c02e Merge: 2713fe37153ef b6d39cd82241b b65f501627fff 062e52a5af9cc a6906a8b0ebfb 69d24c6ed67c1 6d68b88e0993d c12b08ebbe16f dc9de8a2b20f4 Author: Joerg Roedel Date: Thu Dec 20 10:05:20 2018 +0100 Merge branches 'iommu/fixes', 'arm/renesas', 'arm/mediatek', 'arm/tegra', 'arm/omap', 'arm/smmu', 'x86/vt-d', 'x86/amd' and 'core' into next commit dc9de8a2b20f495696330d60a289935f36407995 Author: Joerg Roedel Date: Thu Dec 20 10:02:20 2018 +0100 iommu: Check for iommu_ops == NULL in iommu_probe_device() This check needs to be there and got lost at some point during development. Add it again. Fixes: 641fb0efbff0 ('iommu/of: Don't call iommu_ops->add_device directly') Reported-by: Marek Szyprowski Reported-by: kernelci.org bot Signed-off-by: Joerg Roedel commit a9cd3439e3c6d777a05c63b4d06c3500d1d4074e Author: David Ahern Date: Wed Dec 19 20:02:36 2018 -0800 neighbor: Use nda_policy for validating attributes in adds and dump requests Add NDA_PROTOCOL to nda_policy and use the policy for attribute parsing and validation for adding neighbors and in dump requests. Remove the now duplicate checks on nla_len. Signed-off-by: David Ahern Signed-off-by: David S. Miller commit d129a45b5c9d9ad814adb795413d76be6b28a47e Merge: 754d5da631458 1154bb26c879f Author: David S. Miller Date: Wed Dec 19 23:47:59 2018 -0800 Merge branch 'hns3-next' Peng Li says: ==================== net: hns3: code optimizations & bugfixes for HNS3 driver This patchset includes bugfixes and code optimizations for the HNS3 ethernet controller driver ==================== Signed-off-by: David S. Miller commit 1154bb26c879fea51c20aee167ddce4345caa255 Author: Peng Li Date: Thu Dec 20 11:52:06 2018 +0800 net: hns3: remove redundant variable initialization This patch removes the redundant variable initialization, as driver will devm_kzalloc to set value to hdev soon. Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 31a16f99e02c2e0b40a5fb05d66f5e56721027e2 Author: Peng Li Date: Thu Dec 20 11:52:05 2018 +0800 net: hns3: fix the descriptor index when get rss type Driver gets rss information from the last descriptor of the packet. When driver handle the rss type, ring->next_to_clean indicates the first descriptor of next packet. This patch fix the descriptor index with "ring->next_to_clean - 1". Fixes: 232fc64b6e62 ("net: hns3: Add HW RSS hash information to RX skb") Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 8edc2285b7285c5fbffe438dc8113260d3e76656 Author: Jian Shen Date: Thu Dec 20 11:52:04 2018 +0800 net: hns3: don't restore rules when flow director is disabled When user disables flow director, all the rules will be disabled. But when reset happens, it will restore all the rules again. It's not reasonable. This patch fixes it by add flow director status check before restore fules. Fixes: 6871af29b3ab ("net: hns3: Add reset handle for flow director") Fixes: c17852a8932f ("net: hns3: Add support for enable/disable flow director") Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 0285dbae5db842862d49f148cdcedad986447f34 Author: Jian Shen Date: Thu Dec 20 11:52:03 2018 +0800 net: hns3: fix vf id check issue when add flow director rule When add flow director fule for vf, the vf id is used as array subscript before valid checking, which may cause memory overflow. Fixes: dd74f815dd41 ("net: hns3: Add support for rule add/delete for flow director") Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 39cfbc9c4fc4a2888548c2624789e42e3f775721 Author: Huazhong Tan Date: Thu Dec 20 11:52:02 2018 +0800 net: hns3: reset tqp while doing DOWN operation While doing DOWN operation, the driver will reclaim the memory which has already used for TX. If the hardware is processing this memory, it will cause a RCB error to the hardware. According the hardware's description, the driver should reset the tqp before reclaim the memory during DOWN. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 75edb610860fda65ceedb017fc69afabd2806b8b Author: Jian Shen Date: Thu Dec 20 11:52:01 2018 +0800 net: hns3: add max vector number check for pf Each pf supports max 64 vectors and 128 tqps. For 2p/4p core scenario, there may be more than 64 cpus online. So the result of min_t(u16, num_Online_cpus(), tqp_num) may be more than 64. This patch adds check for the vector number. Fixes: dd38c72604dc ("net: hns3: fix for coalesce configuration lost during reset") Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 1b7d7b0581173219b82abbd81c88cf8aa7d402c2 Author: Peng Li Date: Thu Dec 20 11:52:00 2018 +0800 net: hns3: fix a bug caused by udelay udelay() in driver may always occupancy processor. If there is only one cpu in system, the VF driver may initialize fail when insmod PF and VF driver in the same system. This patch use msleep() to free cpu when VF wait PF message. Signed-off-by: Peng Li Signed-off-by: David S. Miller commit a298797532d9dc244abf349d7c2ed063732c6ba3 Author: Jian Shen Date: Thu Dec 20 11:51:59 2018 +0800 net: hns3: change default tc state to close In original codes, default tc value is set to the max tc. It's more reasonable to close tc by changing default tc value to 1. Users can enable it with lldp tool when they want to use tc. Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 8cdb992f0dc36d6382840b1a6320e0c327a7d644 Author: Jian Shen Date: Thu Dec 20 11:51:58 2018 +0800 net: hns3: refine the handle for hns3_nic_net_open/stop() When triggering nic down, there is a time window between bringing down the protocol stack and stopping the work task. If the net is up in the time window, it may bring up the protocol stack again. This patch fixes it by stop the work task at the beginning of hns3_nic_net_stop(). To keep symmetrical, start the work task at the end of hns3_nic_net_open(). Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 3fe970e76b374bdb4a6232cb8b78945e3d2b478f Author: YueHaibing Date: Wed Dec 5 07:59:03 2018 +0000 wil6210: remove set but not used variable 'wdev' Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/wireless/ath/wil6210/main.c: In function '_wil6210_disconnect': drivers/net/wireless/ath/wil6210/main.c:407:23: warning: variable 'wdev' set but not used [-Wunused-but-set-variable] It never used since commit ("e1b43407c034 wil6210: refactor disconnect flow") Signed-off-by: YueHaibing Reviewed-by: Maya Erez Signed-off-by: Kalle Valo commit 986b834884647e31dc5a78b8d0a6da210ebda0b0 Author: Yangtao Li Date: Mon Dec 3 08:25:57 2018 -0500 wil6210: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Kalle Valo commit 192a986d964c3ebd927da102adbf8bcc604c7cbc Author: Kyle Roeschley Date: Wed Dec 5 09:43:16 2018 +0200 ath6kl: Use debug instead of error message when disabled This is not an unexpected condition, so we don't need to be shouting to the world about it. Signed-off-by: Kyle Roeschley Signed-off-by: Kalle Valo commit 5803c12816c43bd09e5f4247dd9313c2d9a2c41b Author: Kyle Roeschley Date: Wed Dec 5 09:43:13 2018 +0200 ath6kl: Fix off by one error in scan completion When ath6kl was reworked to share code between regular and scheduled scans in commit 3b8ffc6a22ba ("ath6kl: Configure probed SSID list consistently"), probed SSID entry changed from 1-index to 0-indexed. However, ath6kl_cfg80211_scan_complete_event() was missed in that change. Fix its indexing so that we correctly clear out the probed SSID list. Signed-off-by: Kyle Roeschley Signed-off-by: Kalle Valo commit fb376a495fbdb886f38cfaf5a3805401b9e46f13 Author: Kyle Roeschley Date: Wed Dec 5 09:43:11 2018 +0200 ath6kl: Only use match sets when firmware supports it Commit dd45b7598f1c ("ath6kl: Include match ssid list in scheduled scan") merged the probed and matched SSID lists before sending them to the firmware. In the process, it assumed match set support is always available in ath6kl_set_probed_ssids, which breaks scans for hidden SSIDs. Now, check that the firmware supports matching SSIDs in scheduled scans before setting MATCH_SSID_FLAG. Fixes: dd45b7598f1c ("ath6kl: Include match ssid list in scheduled scan") Signed-off-by: Kyle Roeschley Signed-off-by: Kalle Valo commit 19de2fa86e692e918eade4042989d7725039df89 Author: Shahar S Matityahu Date: Wed Dec 19 11:36:19 2018 +0200 iwlwifi: dbg_ini: fix bad ini tlv parsing Add a break at the end of the ini tlv case. Fix both the internal and external tlv parsing. Signed-off-by: Shahar S Matityahu Signed-off-by: Emmanuel Grumbach Signed-off-by: Kalle Valo commit 06d4dd2f2ce1cdb625f77c0676d5af6ba310c01d Author: Christoph Hellwig Date: Fri Dec 14 09:15:02 2018 +0100 dma-mapping: deprecate dma_zalloc_coherent We now always return zeroed memory from dma_alloc_coherent. Note that simply passing GFP_ZERO to dma_alloc_coherent wasn't always doing the right thing to start with given that various allocators are not backed by the page allocator and thus would ignore GFP_ZERO. Signed-off-by: Christoph Hellwig commit 518a2f1925c3165befbf06b75e07636549d92c1c Author: Christoph Hellwig Date: Fri Dec 14 09:00:40 2018 +0100 dma-mapping: zero memory returned from dma_alloc_* If we want to map memory from the DMA allocator to userspace it must be zeroed at allocation time to prevent stale data leaks. We already do this on most common architectures, but some architectures don't do this yet, fix them up, either by passing GFP_ZERO when we use the normal page allocator or doing a manual memset otherwise. Signed-off-by: Christoph Hellwig Acked-by: Geert Uytterhoeven [m68k] Acked-by: Sam Ravnborg [sparc] commit 9517d448d543d8bd0f83e4edc29b4b53d74a7f71 Author: Luca Coelho Date: Wed Jun 13 15:26:37 2018 +0300 iwlwifi: bump the API version to 43 for 9000 and 22000 Bump the API version to 43 for 9000 and 22000 devices. Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit 2c47e5a1f25b1c894c9fe2f77c156c054ae8ffb7 Author: Sara Sharon Date: Thu Sep 6 10:03:22 2018 +0300 iwlwifi: dbg: add debug data to warning Add debug data to the warning issued when getting wrong region id from firmware. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit 83ea00d6873fd7a6b7e94cf40f6dd0007593fb1e Author: Gustavo A. R. Silva Date: Thu Aug 23 20:15:40 2018 -0500 iwlwifi: mvm: d3: use struct_size() in kzalloc() 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 foo { int stuff; void *entry[]; }; instance = kzalloc(sizeof(struct foo) + sizeof(void *) * count, GFP_KERNEL); Instead of leaving these open-coded and prone to type mistakes, we can now use the new struct_size() helper: instance = kzalloc(struct_size(instance, entry, count), GFP_KERNEL); This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit b71a9c35f214dbd9e9e33d36219bd0383f861677 Author: Colin Ian King Date: Sun Aug 26 23:31:17 2018 +0100 iwlwifi: mvm: fix spelling mistake "Recieved" -> "Received" Trivial fix to spelling mistake in debug message. Signed-off-by: Colin Ian King Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit 2c34be6c1fc8a0c90073dead7bce13937661eadf Author: Emmanuel Grumbach Date: Mon Sep 3 14:32:48 2018 +0300 iwlwifi: mvm: set TWT responder capability bit in 11AX SoftAP mode This is needed to test TWT requester on the client side. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit 8804351c17f90eb13684d13ea994e7600d2be846 Author: Luca Coelho Date: Thu Aug 30 15:07:03 2018 +0300 iwlwifi: remove unused and wrong PHY_CFG_* macros These macros are never used and are actually wrong, so it's very confusing. Remove them. Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit a06875a7f8fae2d5b4891abb28c2c4a44ee1ffe8 Author: Shahar S Matityahu Date: Tue Aug 28 16:15:55 2018 +0300 iwlwifi: wrt: add rt status and num of rx/tx fifos to dump Add the rt status of the last assert or 0 if the dump collection was not initiated by an assert. Add the number of rx and tx fifos in use. These fields are added to dump info lst file. Signed-off-by: Shahar S Matityahu Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit 35739348ba07186a6b186e3aae5728721ff57a9a Author: Sara Sharon Date: Wed Aug 22 10:50:49 2018 +0300 iwlwifi: mvm: clean up SSN incrementation Sometimes, due to SCD bug, we need to start the queue with an higher SSN. The queue allocation function currently increments the SSN in the packet itself, but it is pointless, since this value is overridden later by iwl_mvm_tx_mpdu with the value from mvmsta->tid_data[tid].seq_number. Updating tid data is sufficient. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit 3681729429f4626c85a4eb62e5ce76be0b626f87 Author: Sara Sharon Date: Mon Aug 27 14:07:20 2018 +0300 iwlwifi: pcie: lock txq a bit later in reclaim code In reclaim code, we don't need to take the queue lock for waking the queue. The code section is executed only when the tx path is stopped, and since the reclaim path is not executed in parallel to itself, no one can update the queue pointers, and accessing them is safe without a lock. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit 83eabf1e9810f3753d6dafd9a0dc3849924d4fc0 Author: Sara Sharon Date: Mon Aug 27 13:56:41 2018 +0300 iwlwifi: mvm: take station lock later in the code There is no need to lock mvm station for transport reclaim. Move the locking down, after the reclaim. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit bf9dfedaad9e65f2f580d3a573401d521d48b932 Author: Shaul Triebitz Date: Mon Jul 23 11:40:30 2018 +0300 iwlwifi: mvm: handle RX no data notification Handle RX no data notification, which is used for advertising NDP to radiotap. Signed-off-by: Golan Ben Ami Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit 57a3a454f30368f9b52ef406feff09571448e84e Author: Shaul Triebitz Date: Mon Aug 20 16:07:26 2018 +0300 iwlwifi: split HE capabilities between AP and STA HE capabilities differ between AP and STA. Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit aca432f06b8a60a92b27fb46e6518a19b28ca93f Author: Luca Coelho Date: Mon Aug 27 13:02:19 2018 +0300 iwlwifi: make MVM and DVM depend on MAC80211 It's not the iwlwifi module that depends on mac80211, but iwlmvm and iwldvm. To reflect this better, make MVM and DVM Kconfig options depend on MAC80211 instead. Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit 189b8d441b0f7825f0b4278851c52afaa0515ed2 Author: Naftali Goldstein Date: Wed Aug 22 12:18:19 2018 +0300 iwlwifi: mvm: fix setting HE ppe FW config The FW expects to get the ppe value for each NSS-BW pair in the same format as in the he phy capabilities IE, which means that a value of 0 implies ppe should be used for BPSK (mcs 0). If there are no PPE thresholds in the IE, or if for some NSS-RU pair there's no threshold set for it (this could happen because it's a variable-sized field), it means no PPE should not be used for that pair, so the value sent to FW should be 7 which corresponds to "none". Fixes: 514c30696fbc ("iwlwifi: add support for IEEE802.11ax") Signed-off-by: Naftali Goldstein Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit 4120e4a119ed8c8e28d20524713ab2e3df67a34d Author: Sara Sharon Date: Thu Aug 23 13:40:16 2018 +0300 iwlwifi: mvm: cleanup iwl_mvm_tx_skb_non_sta Make the coupling of station id and queue id clear. Group code together. Remove outdated comment. Never use an undefined hw queue as given from mac80211. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit a124caf8f3166cf1488bf606ccf70469ac76a9de Author: Sara Sharon Date: Thu Aug 23 11:03:17 2018 +0300 iwlwifi: mvm: remove pointless NULL assignment Assigning mvmsta to be NULL when we are about to exit the function is pointless. Remove it. Move the variable declaration to the scope it is used. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit 70dc179dd98622eda9809d02fa73b708d60e5e23 Author: Sara Sharon Date: Thu Aug 23 12:10:01 2018 +0300 iwlwifi: mvm: remove dead code In iwl_mvm_tx_skb_non_sta(), in case of managed interface, the AP station was supposed to be used for multicast frames instead of the auxiliary station to avoid frames possibly sent to an absent P2P GO. However, when moving to DQA mode, this was broken as no valid queue was assigned. This is fixed by a recent patch that directs all non-offchannel traffic to ap station earlier in the TX path. However, the broken, and now dead code, remained. Remove it. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit dabb0983349d6320197b88eeb9bb91d3fa0ed855 Author: Sara Sharon Date: Mon Aug 20 10:34:04 2018 +0300 iwlwifi: pcie: use iwl_tx_cmd_gen2 and not iwl_tx_cmd When building AMSDU for gen2, code uses iwl_tx_cmd. The only updated field is len, which is in the same location, so it is not a bug. However, it is a bit confusing and error prone, so change it. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo commit 90a8c74a8d7b0f3fdceadadb155da137e3b157cf Author: YueHaibing Date: Wed Dec 19 11:00:13 2018 +0800 ipw2x00: cleanup dead code Fix smatch warning: drivers/net/wireless/intel/ipw2x00/ipw2100.c:5606 shim__set_security() warn: always true condition '(sec->active_key <= 3) => (0-3 <= 3)' drivers/net/wireless/intel/ipw2x00/ipw2200.c:10725 shim__set_security() warn: always true condition '(sec->active_key <= 3) => (0-3 <= 3)' Signed-off-by: YueHaibing Signed-off-by: Kalle Valo commit 4f68ef64cd7feb1220232bd8f501d8aad340a099 Author: Jia-Ju Bai Date: Fri Dec 14 11:55:21 2018 +0800 cw1200: Fix concurrency use-after-free bugs in cw1200_hw_scan() The function cw1200_bss_info_changed() and cw1200_hw_scan() can be concurrently executed. The two functions both access a possible shared variable "frame.skb". This shared variable is freed by dev_kfree_skb() in cw1200_upload_beacon(), which is called by cw1200_bss_info_changed(). The free operation is protected by a mutex lock "priv->conf_mutex" in cw1200_bss_info_changed(). In cw1200_hw_scan(), this shared variable is accessed without the protection of the mutex lock "priv->conf_mutex". Thus, concurrency use-after-free bugs may occur. To fix these bugs, the original calls to mutex_lock(&priv->conf_mutex) and mutex_unlock(&priv->conf_mutex) are moved to the places, which can protect the accesses to the shared variable. Signed-off-by: Jia-Ju Bai Signed-off-by: Kalle Valo commit 861cb5eb467f5e38dce1aabe4e8db379255bd89b Author: Stefan Wahren Date: Wed Dec 12 20:20:06 2018 +0100 brcmfmac: Fix access point mode Since commit 1204aa17f3b4 ("brcmfmac: set WIPHY_FLAG_HAVE_AP_SME flag") the Raspberry Pi 3 A+ (BCM43455) isn't able to operate in AP mode with hostapd (device_ap_sme=1 use_monitor=0): brcmfmac: brcmf_cfg80211_stop_ap: setting AP mode failed -52 So add the missing mgmt_stypes for AP mode to fix this. Fixes: 1204aa17f3b4 ("brcmfmac: set WIPHY_FLAG_HAVE_AP_SME flag") Suggested-by: Arend van Spriel Signed-off-by: Stefan Wahren Acked-by: Arend van Spriel Signed-off-by: Kalle Valo commit 8c892df41500469729e0d662816300196e4f463d Author: Stijn Tintel Date: Tue Dec 4 20:29:05 2018 +0200 brcmfmac: fix roamoff=1 modparam When the update_connect_param callback is set, nl80211 expects the flag WIPHY_FLAG_SUPPORTS_FW_ROAM to be set as well. However, this flag is only set when modparam roamoff=0, while the callback is set unconditionally. Since commit 7f9a3e150ec7 this causes a warning in wiphy_register, which breaks brcmfmac. Disable the update_connect_param callback when roamoff=0 to fix this. Fixes: 7f9a3e150ec7 ("nl80211: Update ERP info using NL80211_CMD_UPDATE_CONNECT_PARAMS") Cc: Stable # 4.19+ Signed-off-by: Jonas Gorski Signed-off-by: Stijn Tintel Signed-off-by: Kalle Valo commit cc4dc97ffc69c253d5aa2c0068545ed6c8bc0bde Author: Yangtao Li Date: Mon Dec 3 08:31:45 2018 -0500 cw1200: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Kalle Valo commit 71bef2fd583be4a5e414faf193fc243f8447c51b Author: Yishai Hadas Date: Wed Dec 19 16:28:10 2018 +0200 IB/mlx5: Introduce uid as part of alloc/dealloc transport domain Introduce uid as part of alloc/dealloc transport domain to match the device specification. Signed-off-by: Yishai Hadas Reviewed-by: Artemy Kovalyov Signed-off-by: Leon Romanovsky commit d2a68c4effd821f0871d20368f76b609349c8a3b Author: Steven Rostedt (VMware) Date: Sat Dec 8 12:58:51 2018 -0500 x86/ftrace: Do not call function graph from dynamic trampolines Since commit 79922b8009c07 ("ftrace: Optimize function graph to be called directly"), dynamic trampolines should not be calling the function graph tracer at the end. If they do, it could cause the function graph tracer to trace functions that it filtered out. Right now it does not cause a problem because there's a test to check if the function graph tracer is attached to the same function as the function tracer, which for now is true. But the function graph tracer is undergoing changes that can make this no longer true which will cause the function graph tracer to trace other functions. For example: # cd /sys/kernel/tracing/ # echo do_IRQ > set_ftrace_filter # mkdir instances/foo # echo ip_rcv > instances/foo/set_ftrace_filter # echo function_graph > current_tracer # echo function > instances/foo/current_tracer Would cause the function graph tracer to trace both do_IRQ and ip_rcv, if the current tests change. As the current tests prevent this from being a problem, this code does not need to be backported. But it does make the code cleaner. Cc: Thomas Gleixner Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: x86@kernel.org Signed-off-by: Steven Rostedt (VMware) commit 1923f851eb0baa79d11cd0574c6100c2de840d75 Author: Don Brace Date: Tue Dec 18 17:39:13 2018 -0600 scsi: smartpqi: update driver version - need to bump up the driver version because of the OFA patch and the fw status register read timeout patch. Reviewed-by: Gerry Morong Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 4fd22c13ad4409ee44a121b54855bb48d2afd58a Author: Mahesh Rajashekhara Date: Tue Dec 18 17:39:07 2018 -0600 scsi: smartpqi: add ofa support - when OFA event occurs, driver will stop traffic to RAID/HBA path. Driver waits for all the outstanding requests to complete. - Driver sends OFA event acknowledgment to firmware. - Driver will wait until the new firmware is up and running. - Driver will free up the resources. - Driver calls SIS/PQI initialization and rescans the device list. - Driver will resume the traffic to RAID/HBA path. Reviewed-by: Murthy Bhat Signed-off-by: Mahesh Rajashekhara Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 65111785acccb836ec75263b03b0e33f21e74f47 Author: Mahesh Rajashekhara Date: Tue Dec 18 17:39:01 2018 -0600 scsi: smartpqi: increase fw status register read timeout Problem: - during the driver initialization, driver will poll fw for KERNEL_UP in a 30 seconds timeout. - if the firmware is not ready after 30 seconds, driver will not be loaded. Fix: - change timeout from 30 seconds to 3 minutes. Reported-by: Feng Li Reviewed-by: Ajish Koshy Reviewed-by: Murthy Bhat Reviewed-by: Dave Carroll Reviewed-by: Kevin Barnett Signed-off-by: Mahesh Rajashekhara Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit f7cb8ac6e776158fab003d8dc6b7f564f005f502 Author: Don Brace Date: Fri Dec 7 16:30:12 2018 -0600 scsi: smartpqi: bump driver version Reviewed-by: Gerry Morong Reviewed-by: Dave Carroll Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 3d46a59a191e81f7ada771b8db71553916b851da Author: Don Brace Date: Fri Dec 7 16:30:05 2018 -0600 scsi: smartpqi: add smp_utils support Reviewed-by: Scott Benesh Reviewed-by: Mahesh Rajashekhara Reviewed-by: Scott Teel Reviewed-by: Dave Carroll Reviewed-by: Kevin Barnett Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 2ba55c9851d74eb015a554ef69ddf2ef061d5780 Author: Kevin Barnett Date: Fri Dec 7 16:29:51 2018 -0600 scsi: smartpqi: correct lun reset issues Problem: The Linux kernel takes a logical volume offline after a LUN reset. This is generally accompanied by this message in the dmesg output: Device offlined - not ready after error recovery Root Cause: The root cause is a "quirk" in the timeout handling in the Linux SCSI layer. The Linux kernel places a 30-second timeout on most media access commands (reads and writes) that it send to device drivers. When a media access command times out, the Linux kernel goes into error recovery mode for the LUN that was the target of the command that timed out. Every command that timed out is kept on a list inside of the Linux kernel to be retried later. The kernel attempts to recover the command(s) that timed out by issuing a LUN reset followed by a TEST UNIT READY. If the LUN reset and TEST UNIT READY commands are successful, the kernel retries the command(s) that timed out. Each SCSI command issued by the kernel has a result field associated with it. This field indicates the final result of the command (success or error). When a command times out, the kernel places a value in this result field indicating that the command timed out. The "quirk" is that after the LUN reset and TEST UNIT READY commands are completed, the kernel checks each command on the timed-out command list before retrying it. If the result field is still "timed out", the kernel treats that command as not having been successfully recovered for a retry. If the number of commands that are in this state are greater than two, the kernel takes the LUN offline. Fix: When our RAIDStack receives a LUN reset, it simply waits until all outstanding commands complete. Generally, all of these outstanding commands complete successfully. Therefore, the fix in the smartpqi driver is to always set the command result field to indicate success when a request completes successfully. This normally isn’t necessary because the result field is always initialized to success when the command is submitted to the driver. So when the command completes successfully, the result field is left untouched. But in this case, the kernel changes the result field behind the driver’s back and then expects the field to be changed by the driver as the commands that timed-out complete. Reviewed-by: Dave Carroll Reviewed-by: Scott Teel Signed-off-by: Kevin Barnett Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 7ff44499bafbd376115f0bb6b578d980f56ee13b Author: Dave Carroll Date: Fri Dec 7 16:29:45 2018 -0600 scsi: smartpqi: correct volume status - fix race condition when a unit is deleted after an RLL, and before we have gotten the LV_STATUS page of the unit. - In this case we will get a standard inquiry, rather than the desired page. This will result in a unit presented which no longer exists. - If we ask for LV_STATUS, insure we get LV_STATUS Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Dave Carroll Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit a9a681017c3b43b9d9754dd87bebe5e0e244fe08 Author: Dave Carroll Date: Fri Dec 7 16:29:37 2018 -0600 scsi: smartpqi: do not offline disks for transient did no connect conditions Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Dave Carroll Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit a91aaae0243b419e52e97990471208321222be33 Author: Ajish Koshy Date: Fri Dec 7 16:29:31 2018 -0600 scsi: smartpqi: allow for larger raid maps Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Dave Carroll Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Ajish Koshy Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 1e46731efd9c9322cb4699f845c739d2ea68555c Author: Mahesh Rajashekhara Date: Fri Dec 7 16:29:24 2018 -0600 scsi: smartpqi: check for null device pointers - wait on all outstanding I/O to complete before the device is removed. - check for null device pointers in IO entry/completion functions. Reviewed-by: Scott Teel Reviewed-by: Murthy Bhat Reviewed-by: Dave Carroll Reviewed-by: Kevin Barnett Signed-off-by: Mahesh Rajashekhara Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit c1b104755b0b11579e292aa153c0605264c81648 Author: Ajish Koshy Date: Fri Dec 7 16:29:18 2018 -0600 scsi: smartpqi: add support for huawei controllers Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Dave Carroll Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Ajish Koshy Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 62dc51fb946697c896e47df7187862c310a3d21c Author: Sagar Biradar Date: Fri Dec 7 16:29:12 2018 -0600 scsi: smartpqi: enhance numa node detection - set pci_dev->dev to 0 only if the node is NO_NUMA_NODE. If not, do not reset the value but retain it. Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Dave Carroll Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Sagar Biradar Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 2b447f811c1f7f30e4caa5a817d0c95d06aff874 Author: Dave Carroll Date: Fri Dec 7 16:29:05 2018 -0600 scsi: smartpqi: wake up drives after os resumes from suspend - set allow_restart option during scsi_device init. This allows the kernel to send a START/STOP Unit command to the drive if it encounters a 4/2 check condition in sense data. Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Kevin Barnett Signed-off-by: Dave Carroll Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 5995b236c10a0af748ae7f4e4819307cf6bc3140 Author: Murthy Bhat Date: Fri Dec 7 16:28:59 2018 -0600 scsi: smartpqi: fix disk name mount point - fix a formatting issue. Reviewed-by: Mahesh Rajashekhara Reviewed-by: Scott Teel Reviewed-by: Dave Carroll Reviewed-by: Kevin Barnett Signed-off-by: Murthy Bhat Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 84a77fefe0451bd9e6894362423d8fa6d14419ab Author: Murthy Bhat Date: Fri Dec 7 16:28:53 2018 -0600 scsi: smartpqi: add h3c ssid Reviewed-by: Scott Benesh Reviewed-by: Mahesh Rajashekhara Reviewed-by: Dave Carroll Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Murthy Bhat Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit cd128244162c8afbf50e93b88daa02b05faa4c0a Author: Dave Carroll Date: Fri Dec 7 16:28:47 2018 -0600 scsi: smartpqi: add sysfs attributes - add sysfs device attributes, unique_id, lunid and path_info. Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Dave Carroll Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 02133b68d51d09bd91b0d2c1fa5318e2f23e4559 Author: Dave Carroll Date: Fri Dec 7 16:28:41 2018 -0600 scsi: smartpqi: refactor sending controller raid requests Clean up the common code which creates a raid path request for the controller LUNID and sends it synchronously, into a common routine; Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Dave Carroll Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 171c28653a2d9201e130863eb2408f404e4d6ed7 Author: Dave Carroll Date: Fri Dec 7 16:28:35 2018 -0600 scsi: smartpqi: turn off lun data caching for ptraid - allow update the luns for PTRAID devices. Reviewed-by: Ajish Koshy Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Justin Lindley Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Dave Carroll Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit b2346b5030cf9458f30a84028d9fe904b8c942a7 Author: Mahesh Rajashekhara Date: Fri Dec 7 16:28:29 2018 -0600 scsi: smartpqi: correct host serial num for ssa Reviewed-by: Scott Benesh Reviewed-by: Ajish Koshy Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Dave Carroll Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Mahesh Rajashekhara Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit b6e2ef67ed8365d60a0cebc1313b57df8b9e909e Author: Dave Carroll Date: Fri Dec 7 16:28:23 2018 -0600 scsi: smartpqi: add no_write_same for logical volumes During slave_alloc, for logical volumes include no_write_same into the scsi_device structure. This will insure that WRITE_SAME will not be used for LD's. Reviewed-by: Ajish Koshy Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Justin Lindley Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Dave Carroll Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 3406384b76a77ea3b3bab7923c1a3bd4649318f5 Author: Mahesh Rajashekhara Date: Fri Dec 7 16:28:16 2018 -0600 scsi: smartpqi: Add retries for device reset Reviewed-by: Ajish Koshy Reviewed-by: Murthy Bhat Reviewed-by: Justin Lindley Reviewed-by: Scott Benesh Reviewed-by: Dave Carroll Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Mahesh Rajashekhara Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit b212c2510d7ca15af8758eade5e4002ed5267d1b Author: Kevin Barnett Date: Fri Dec 7 16:28:10 2018 -0600 scsi: smartpqi: add support for PQI Config Table handshake Add support for new IUs and parsing of the Firmware Features section of the PQI Config Table to implement the "handshake" between the driver and firmware to communicate firmware features supported and enabled by the driver. Reviewed-by: Ajish Koshy Reviewed-by: Mahesh Rajashekhara Reviewed-by: Murthy Bhat Reviewed-by: Justin Lindley Reviewed-by: Scott Teel Signed-off-by: Kevin Barnett Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen commit 9e1f03e4d318d3e49d4db1d711eb652db727b844 Author: James Smart Date: Thu Dec 13 15:17:58 2018 -0800 scsi: lpfc: Update lpfc version to 12.0.0.10 Update lpfc version to 12.0.0.10 Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 5021267af1327724a6f1859bb1594660a4c22bd3 Author: James Smart Date: Thu Dec 13 15:17:57 2018 -0800 scsi: lpfc: Adding ability to reset chip via pci bus reset This patch adds a "pci_bus_reset" option to the board_mode sysfs attribute. This option uses the pci_reset_bus() api to reset the PCIe link the adapter is on, which will reset the chip/adapter. Prior to issuing this option, all functions on the same chip must be placed in the offline state by the admin. After the reset, all of the instances may be brought online again. The primary purpose of this functionality is to support cases where firmware update required a chip reset but the admin did not want to reboot the machine in order to instantiate the firmware update. Sanity checks take place prior to the reset to ensure the adapter is the sole entity on the PCIe bus and that all functions are in the offline state. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 72ca6b2220ed24c0f7b0dd4e3617e82dcda60ef1 Author: James Smart Date: Thu Dec 13 15:17:56 2018 -0800 scsi: lpfc: Add log messages to aid in debugging fc4type discovery issues Current messages report generic actions (like send GID_FT), but misses reporting for what protocol type the action is taken. Revise the messages to reflect the FC4 protocol type being worked on. [mkp: typo] Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 00292e0306dc3b23e725acbc70fb0b2581b8b4b3 Author: James Smart Date: Thu Dec 13 15:17:55 2018 -0800 scsi: lpfc: Fix discovery failure when PLOGI is defered When a target's link dropped, an RSCN was received to communicate the change. The driver detected the loss of the target and issued and UNREG_RPI mailbox command. While that was being processed, another RSCN was received to communicate the port coming back. The driver deferred the PLOGI to the port until the mailbox command finishes. When the mailbox command completed it saw the pending port and called the routines to issue the PLOGI. However, it forgot to clear the UNREG_INP state flag, so the PLOGI xmt routine nooped the PLOGI request assuming it needed to wait for the mailbox command. At this point, login would never be re-attempted. Clear UNREG_INP before issuing the deferred PLOGI. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 529b3ddcfff580a2457eceeda9f248bc77c49246 Author: James Smart Date: Thu Dec 13 15:17:54 2018 -0800 scsi: lpfc: update fault value on successful trunk events. Currently, when a trunk link goes down due to some fault, the driver snapshots the fault code. If the link then comes back up, meaning there is no fault, the driver is not clearing the fault code so the sysfs link_state entry reports old/stale data. Revise the logic so that on successful link up the fault code is cleared. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit e817e5d7030c7fcc6e707dba7abe51ee5c47732f Author: James Smart Date: Thu Dec 13 15:17:53 2018 -0800 scsi: lpfc: Correct MDS loopback diagnostics support The existing MDS loopback diagnostics support processing received frames in the slowpath work thread. It caps the number of frames it will process at 64, before waiting for another event to indicate additional frame reception. The net-net is this results in very slow frame processing during loopback tests and sometimes orphans an io, causing the loopback test to report failure by the switch. Move MDS loopback frame processing out of the slow path worker thread and into the normal RQ processing routines. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 2977a09512c2867fba8b0e862cc96327dd93431d Author: James Smart Date: Thu Dec 13 15:17:52 2018 -0800 scsi: lpfc: Fix link state reporting for trunking when adapter is offline If the adapter is taken offline, the trunk link port attributes continue to report trunk links as up even though all links are down as the adapter is offline. Clear the trunk links state as part of taking the adapter offline. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 009b7156149ab370ebd3b7477aac15a0fd3550e9 Author: Colin Ian King Date: Sat Dec 15 14:28:09 2018 +0000 scsi: bfa: clean up a couple of indentation issues There is a break statement with an extra space that needs removed and a call to bfa_trc that is indented one level too much. Fix these. Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit efad04623068c5def4551847ad5a6852daf273f7 Author: Colin Ian King Date: Sat Dec 15 14:17:08 2018 +0000 scsi: 3w-xxxx: fix indentation issue, add missing tab There is a tab missing on a return statement, add the missing tab. Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 9934613edcb40b92a216122876cd3b7e76d08390 Author: Varun Prakash Date: Wed Dec 19 15:42:50 2018 +0530 scsi: csiostor: fix incorrect dma device in case of vport In case of ->vport_create() call scsi_add_host_with_dma() instead of scsi_add_host() to pass correct dma device. Signed-off-by: Varun Prakash Signed-off-by: Martin K. Petersen commit 34a3492171cc87d1c2a9e7c0fbf6bf4a0f4d57b0 Author: Christoph Hellwig Date: Wed Dec 19 08:34:55 2018 +0100 scsi: myrs: remove the dma_boundary_limit The old DAC960 driver was fine with merging over segment boundaries, so this new driver should be too. [mkp: typos] Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit c3d6189ffd4ee5c205cd7f79c7a1533e10a92b9e Author: Christoph Hellwig Date: Wed Dec 19 08:34:54 2018 +0100 scsi: myrb: remove the dma_boundary limit The old DAC960 driver was fine with merging over segment boundaries, so this new driver should be too. [mkp: typos] Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 7b9e2d348c2af201e70346cdae052f387f713c49 Author: Shivasharan S Date: Tue Dec 18 05:59:55 2018 -0800 scsi: megaraid_sas: driver version update Signed-off-by: Shivasharan S Signed-off-by: Martin K. Petersen commit 894169db12463cea08d0e2a9e35f42b291340e5a Author: Shivasharan S Date: Tue Dec 18 05:59:54 2018 -0800 scsi: megaraid_sas: Use 63-bit DMA addressing Although MegaRAID controllers support 64-bit DMA addressing, as per hardware design, DMA address with all 64-bits set (0xFFFFFFFF-FFFFFFFF) results in a firmware fault. Driver will set 63-bit DMA mask to ensure the above address will not be used. Cc: stable@vger.kernel.org Signed-off-by: Shivasharan S Signed-off-by: Martin K. Petersen commit 272652fcbf1adf6321efe288583fa4a30a15af31 Author: Shivasharan S Date: Mon Dec 17 00:47:40 2018 -0800 scsi: megaraid_sas: add retry logic in megasas_readl Due to hardware errata in Aero controllers, reads to certain fusion registers could intermittently return zero. This behavior is transient in nature and subsequent reads will return valid value. For Aero controllers, any calls to readl to read from certain registers will be retried for maximum three times, if read returns zero. Signed-off-by: Shivasharan S Signed-off-by: Martin K. Petersen commit de516379e85f51c57ee54b113dbb442e5a862cd8 Author: Shivasharan S Date: Mon Dec 17 00:47:39 2018 -0800 scsi: megaraid_sas: changes to function prototypes Instead of the register address, pass the instance pointer to clear_intr and read_fw_status_reg functions. This is done in preparation for adding adapter type based checks in these functions in later patches of this series. Signed-off-by: Shivasharan S Signed-off-by: Martin K. Petersen commit 154a7cde9a895d87ecc9807b34651021d3e6e8a7 Author: Shivasharan S Date: Mon Dec 17 00:47:38 2018 -0800 scsi: megaraid_sas: Introduce new Aero adapter type Identify all Aero controller PCI IDs with new adapter type. Signed-off-by: Shivasharan S Signed-off-by: Martin K. Petersen commit 630d42b70f5d5cdac94dc5d080fc6d389076bf6e Author: Shivasharan S Date: Mon Dec 17 00:47:37 2018 -0800 scsi: megaraid_sas: Fix Ventura series based checks In preparation for the new Aero series adapter type, all the places where we check adapter type for Ventura series needs to include any later adapter types. Signed-off-by: Shivasharan S Signed-off-by: Martin K. Petersen commit 23c3828aa2f84edec7020c7397a22931e7a879e1 Author: Stephan Günther Date: Sun Dec 16 13:08:21 2018 +0100 scsi: mpt3sas: fix memory ordering on 64bit writes With commit 09c2f95ad404 ("scsi: mpt3sas: Swap I/O memory read value back to cpu endianness"), 64bit writes in _base_writeq() were rewritten to use __raw_writeq() instad of writeq(). This introduced a bug apparent on powerpc64 systems such as the Raptor Talos II that causes the HBA to drop from the PCIe bus under heavy load and being reinitialized after a couple of seconds. It can easily be triggered on affacted systems by using something like fio --name=random-write --iodepth=4 --rw=randwrite --bs=4k --direct=0 \ --size=128M --numjobs=64 --end_fsync=1 fio --name=random-write --iodepth=4 --rw=randwrite --bs=64k --direct=0 \ --size=128M --numjobs=64 --end_fsync=1 a couple of times. In my case I tested it on both a ZFS raidz2 and a btrfs raid6 using LSI 9300-8i and 9400-8i controllers. The fix consists in resembling the write ordering of writeq() by adding a mandatory write memory barrier before device access and a compiler barrier afterwards. The additional MMIO barrier is superfluous. Signed-off-by: Stephan Günther Reported-by: Matt Corallo Acked-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 17b18eaa6f59044a5172db7d07149e31ede0f920 Author: Anatoliy Glagolev Date: Thu Dec 6 16:48:45 2018 -0700 scsi: qla2xxx: deadlock by configfs_depend_item The intent of invoking configfs_depend_item in commit 7474f52a82d51 ("tcm_qla2xxx: Perform configfs depend/undepend for base_tpg") was to prevent a physical Fibre Channel port removal when virtual (NPIV) ports announced through that physical port are active. The change does not work as expected: it makes enabled physical port dependent on target configfs subsystem (the port's parent), something the configfs guarantees anyway. Besides, scheduling work in a worker thread and waiting for the work's completion is not really a valid workaround for the requirement not to call configfs_depend_item from a configfs callback: the call occasionally deadlocks. Thus, removing configfs_depend_item calls does not break anything and fixes the deadlock problem. Signed-off-by: Anatoliy Glagolev Acked-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 754d5da63145852736f34cfc762164f5d8d6537b Author: David Ahern Date: Wed Dec 19 15:53:22 2018 -0800 neighbor: Initialize protocol when new pneigh_entry are created pneigh_lookup uses kmalloc versus kzalloc when new entries are allocated. Given that the newly added protocol field needs to be initialized. Fixes: df9b0e30d44c ("neighbor: Add protocol attribute") Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 9df95e8ec568f98d89fe2c72342714296ac6ce27 Author: Martin KaFai Lau Date: Wed Dec 19 13:30:54 2018 -0800 bpf: sparc64: Enable sparc64 jit to provide bpf_line_info This patch enables sparc64's bpf_int_jit_compile() to provide bpf_line_info by calling bpf_prog_fill_jited_linfo(). Signed-off-by: Martin KaFai Lau Acked-by: David S. Miller Signed-off-by: Daniel Borkmann commit 3f2eadb10886340f4d67fe683c2e53b4df005461 Author: Peter Oskolkov Date: Wed Dec 19 10:20:09 2018 -0800 selftests: net: refactor reuseport_addr_any test This patch refactors reuseport_add_any selftest a bit: - makes it more modular (eliminates several copy/pasted blocks); - skips DCCP tests if DCCP is not supported V2: added "Signed-off-by" tag. Signed-off-by: Peter Oskolkov Signed-off-by: David S. Miller commit 9c7f37e5ca14f5b04894b1b699a9903885cdafa6 Author: Andrew Lunn Date: Wed Dec 19 18:28:54 2018 +0100 net: dsa: mv88e6xxx: Add missing watchdog ops for 6320 family The 6320 family of switches uses the same watchdog registers as the 6390. Signed-off-by: Andrew Lunn Reviewed-by: Vivien Didelot Signed-off-by: David S. Miller commit dac9597606432574f3c64b68decaec3c56ca750f Merge: 24894bc6eabc4 22a3a5403bbef Author: David S. Miller Date: Wed Dec 19 16:24:59 2018 -0800 Merge branch 'mt2712' Biao Huang says: ==================== add ethernet binding and modify ethernet driver for mt2712 changes in v3: resend this series base on the latest net-next tree. changes in v2 as comments from Sean: 1. fix typo. 2. use capital letters for RMII/MII/RGMII in driver and bindings. v1: This new series is the result of discussion in: http://lkml.org/lkml/2018/12/13/1007 http://lkml.org/lkml/2018/12/14/53 1. ethernet binding file move to this series. 2. remove fine tune property in device tree 3. remove fine tune flow in ethernet driver 4. set rgmii timing according to the value in device tree, and don't care whether phy insert internal delay or not. ==================== Signed-off-by: David S. Miller commit 22a3a5403bbefd520e19bb251ce49ce705b1e5e4 Author: Biao Huang Date: Wed Dec 19 15:22:41 2018 +0800 net-next: stmmac: dwmac-mediatek: remove fine-tune property 1. remove fine-tune property and related setting to simplify the timing adjustment flow. 2. set timing value according to the value from device tree, and will not care whether PHY insert internal delay. Signed-off-by: Biao Huang Signed-off-by: David S. Miller commit a32ed90be22aa565cf623da5a211b4a968dec6e0 Author: Biao Huang Date: Wed Dec 19 15:22:40 2018 +0800 net-next: dt-binding: dwmac-mediatek: remove fine-tune property remove fine-tune property in device tree, modify the corresponding description in dt-binding. Signed-off-by: Biao Huang Signed-off-by: David S. Miller commit 6f1f78efbbdd2f65c25dafb4859001e0b1664be4 Merge: 9e88b9312acb9 e30f5640e3245 Author: Alexei Starovoitov Date: Wed Dec 19 15:42:55 2018 -0800 Merge branch 'line_info-check-for-ld_imm64' Martin KaFai Lau says: ==================== This series ensures the line_info (passed by the userspace during bpf_prog_load) cannot have its line_info.insn_off pointing to a zero bpf insn code. F.e. a broken userspace tool might generate a line_info.insn_off that points to the second 8 bytes of a BPF_LD_IMM64. The first patch is the kernel change. The second patch is a new test case. ==================== Acked-by: Yonghong Song Signed-off-by: Alexei Starovoitov commit e30f5640e32455e02ba08983ebe0b46054f1f6f0 Author: Martin KaFai Lau Date: Wed Dec 19 13:01:02 2018 -0800 bpf: Add BPF_LD_IMM64 to the line_info test This patch adds a BPF_LD_IMM64 case to the line_info test to ensure the kernel rejects linfo_info.insn_off pointing to the 2nd 8 bytes of the BPF_LD_IMM64. Signed-off-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov commit fdbaa0beb78b7c8847e261fe2c32816e9d1c54cc Author: Martin KaFai Lau Date: Wed Dec 19 13:01:01 2018 -0800 bpf: Ensure line_info.insn_off cannot point to insn with zero code This patch rejects a line_info if the bpf insn code referred by line_info.insn_off is 0. F.e. a broken userspace tool might generate a line_info.insn_off that points to the second 8 bytes of a BPF_LD_IMM64. Signed-off-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov commit bd1c24ccf9eb070510c5da2fe0b56899c9a52c96 Author: Devesh Sharma Date: Wed Dec 12 01:56:24 2018 -0800 RDMA/bnxt_re: Increase depth of control path command queue Increasing the depth of control path command queue to 8K entries to handle burst of commands. This feature needs support from FW and the driver/fw compatibility is checked from the interface version number. Signed-off-by: Devesh Sharma Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 2b827ea1926b5ad7ac3e9ba8651ff99181d6c7f9 Author: Selvin Xavier Date: Wed Dec 12 01:56:23 2018 -0800 RDMA/bnxt_re: Query HWRM Interface version from FW Get HWRM interface major, minor, build and patch version from FW for checking the FW/Driver compatibility. Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 8036e90f92aae2784b855a0007ae2d8154d28b3c Author: Parvi Kaustubhi Date: Tue Dec 11 14:15:42 2018 -0800 IB/usnic: Fix potential deadlock Acquiring the rtnl lock while holding usdev_lock could result in a deadlock. For example: usnic_ib_query_port() | mutex_lock(&us_ibdev->usdev_lock) | ib_get_eth_speed() | rtnl_lock() rtnl_lock() | usnic_ib_netdevice_event() | mutex_lock(&us_ibdev->usdev_lock) This commit moves the usdev_lock acquisition after the rtnl lock has been released. This is safe to do because usdev_lock is not protecting anything being accessed in ib_get_eth_speed(). Hence, the correct order of holding locks (rtnl -> usdev_lock) is not violated. Signed-off-by: Parvi Kaustubhi Signed-off-by: Jason Gunthorpe commit 50c582de1d39231af31c881a8444333bff6f11a8 Author: Gal Pressman Date: Wed Dec 12 11:09:08 2018 +0200 RDMA/bnxt_re: Make use of destroy AH sleepable flag When in a sleepable (non-atomic) context, wait for firmware completion instead of polling for it. Signed-off-by: Gal Pressman Acked-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 90e3edd8cca453c6042bb99eff3515cb70cfb2ba Author: Gal Pressman Date: Wed Dec 12 11:09:07 2018 +0200 RDMA/bnxt_re: Make use of create AH sleepable flag When in a sleepable (non-atomic) context, wait for firmware completion instead of polling for it. Signed-off-by: Gal Pressman Acked-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 2553ba217eea37dc6291635ecddb883fb5c36a8b Author: Gal Pressman Date: Wed Dec 12 11:09:06 2018 +0200 RDMA: Mark if destroy address handle is in a sleepable context Introduce a 'flags' field to destroy address handle callback and add a flag that marks whether the callback is executed in an atomic context or not. This will allow drivers to wait for completion instead of polling for it when it is allowed. Signed-off-by: Gal Pressman Signed-off-by: Jason Gunthorpe commit a691ffb46edd7cb12a17ff0965ab59dbc95f48de Author: wangyan Date: Thu Dec 13 09:10:14 2018 +0800 vhost: correct the related warning message Fixes: 'commit d588cf8f618d ("target: Fix se_tpg_tfo->tf_subsys regression + remove tf_subsystem")' 'commit cbbd26b8b1a6 ("[iov_iter] new primitives - copy_from_iter_full() and friends")' Signed-off-by: Yan Wang Reviewed-by: Jun Piao Signed-off-by: Michael S. Tsirkin commit 4b86713236e4bd6ea6c881a97711ae039fc4069b Author: Paolo Bonzini Date: Mon Dec 17 18:35:09 2018 +0100 vhost: split structs into a separate header file vhost structs are shared by vhost-kernel and vhost-user. Split them into a separate file to ease copying them into programs that implement either the server or the client side of vhost-user. Signed-off-by: Paolo Bonzini Signed-off-by: Michael S. Tsirkin commit e8d26f29b7c48aa037a4796e2aa878c58a04609c Author: Dongli Zhang Date: Mon Dec 10 08:54:34 2018 +0800 virtio: remove deprecated VIRTIO_PCI_CONFIG() VIRTIO_PCI_CONFIG() is deprecated. Use VIRTIO_PCI_CONFIG_OFF() instead. Signed-off-by: Dongli Zhang Signed-off-by: Michael S. Tsirkin commit 6db3d8dc5d73b269987fae60745bb20eae97af61 Author: Stefan Hajnoczi Date: Mon Nov 5 17:33:22 2018 +0000 vhost/vsock: switch to a mutex for vhost_vsock_hash Now that there are no more data path users of vhost_vsock_lock, it can be turned into a mutex. It's only used by .release() and in the .ioctl() path. Depends-on: <20181105103547.22018-1-stefanha@redhat.com> Suggested-by: Jason Wang Signed-off-by: Stefan Hajnoczi Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 1f23816b8eb8fdc39990abe166c10a18c16f6b21 Author: Changpeng Liu Date: Thu Nov 1 15:40:35 2018 -0700 virtio_blk: add discard and write zeroes support In commit 88c85538, "virtio-blk: add discard and write zeroes features to specification" (https://github.com/oasis-tcs/virtio-spec), the virtio block specification has been extended to add VIRTIO_BLK_T_DISCARD and VIRTIO_BLK_T_WRITE_ZEROES commands. This patch enables support for discard and write zeroes in the virtio-blk driver when the device advertises the corresponding features, VIRTIO_BLK_F_DISCARD and VIRTIO_BLK_F_WRITE_ZEROES. Signed-off-by: Changpeng Liu Signed-off-by: Daniel Verkamp Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi commit b090c4e3a07c33ffdf95fb7601551b38fc2a4bbb Author: Gal Pressman Date: Wed Dec 12 11:09:05 2018 +0200 RDMA: Mark if create address handle is in a sleepable context Introduce a 'flags' field to create address handle callback and add a flag that marks whether the callback is executed in an atomic context or not. This will allow drivers to wait for completion instead of polling for it when it is allowed. Signed-off-by: Gal Pressman Signed-off-by: Jason Gunthorpe commit 86d163dbfe2ac0b30fbb6e256301abbfa9e4549e Author: Darrick J. Wong Date: Tue Dec 18 14:32:31 2018 -0800 xfs: stringify scrub types in ftrace output Use __print_symbolic to print the scrub type in ftrace output. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen commit c494213f30080423b70b24b6af7f6da554d9390f Author: Darrick J. Wong Date: Tue Dec 18 14:32:31 2018 -0800 xfs: stringify btree cursor types in ftrace output Use __print_symbolic to print the btree type in ftrace output. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen commit 0357d21a6c9be2870904598b4767c7d424524849 Author: Darrick J. Wong Date: Tue Dec 18 14:32:30 2018 -0800 xfs: move XFS_INODE_FORMAT_STR mappings to libxfs Move XFS_INODE_FORMAT_STR to libxfs so that we don't forget to keep it updated, and add necessary TRACE_DEFINE_ENUM. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen commit 05c753c4cf53f51a7e35fcfe684500113cf1fd13 Author: Darrick J. Wong Date: Tue Dec 18 14:32:30 2018 -0800 xfs: move XFS_AG_BTREE_CMP_FORMAT_STR mappings to libxfs Move XFS_AG_BTREE_CMP_FORMAT_STR to libxfs so that we don't forget to keep it updated, and TRACE_DEFINE_ENUM the values while we're at it. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen commit 85f8dff00a3193fe5659aa4c91adde31723c0d3d Author: Darrick J. Wong Date: Tue Dec 18 14:32:29 2018 -0800 xfs: fix symbolic enum printing in ftrace output ftrace's __print_symbolic() has a (very poorly documented) requirement that any enum values used in the symbol to string translation table be wrapped in a TRACE_DEFINE_ENUM so that the enum value can be encoded in the ftrace ring buffer. Fix this unsatisfied requirement. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen commit 7af8150f9935634e3e0f47c14e049ff401c82fb4 Author: Darrick J. Wong Date: Tue Dec 18 14:32:29 2018 -0800 xfs: fix function pointer type in ftrace format Use %pS instead of %pF in ftrace strings so that we record the actual function address instead of the function descriptor. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen commit 24894bc6eabc43f55f5470767780ac07db18e797 Merge: 4ab0edecaf1d9 8deecf3557cca Author: David S. Miller Date: Wed Dec 19 13:37:34 2018 -0800 Merge branch 'neigh-get-support' Roopa Prabhu says: ==================== neigh get support This series adds support for neigh get similar to route and recently added fdb get. v2: fix key len check. and some other fixes ==================== Signed-off-by: David S. Miller commit 8deecf3557cca7d80fb5157f0858b738f8eebbc7 Author: Roopa Prabhu Date: Wed Dec 19 12:51:39 2018 -0800 selftests: rtnetlink.sh: add testcase for neigh get Signed-off-by: Roopa Prabhu Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 82cbb5c631a07b3aa6df6eab644d55da9de5a645 Author: Roopa Prabhu Date: Wed Dec 19 12:51:38 2018 -0800 neighbour: register rtnl doit handler this patch registers neigh doit handler. The doit handler returns a neigh entry given dst and dev. This is similar to route and fdb doit (get) handlers. Also moves nda_policy declaration from rtnetlink.c to neighbour.c Signed-off-by: Roopa Prabhu Reviewed-by: David Ahern Signed-off-by: David S. Miller commit e9f2e05a5f19ce2a21d79c765fd6bb7c03d4aaeb Merge: 8c5e14f438b8c 7aedd9d48f2a8 Author: Paolo Bonzini Date: Wed Dec 19 22:17:09 2018 +0100 Merge tag 'kvm-s390-next-4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD KVM: s390: Fixes for 4.21 Just two small fixes. commit 9e88b9312acb9b80554c48b58668fb144720333a Author: Ivan Babrou Date: Wed Dec 19 12:08:03 2018 -0800 tools: bpftool: do not force gcc as CC This allows transparent cross-compilation with CROSS_COMPILE by relying on 7ed1c1901fe5 ("tools: fix cross-compile var clobbering"). Signed-off-by: Ivan Babrou Signed-off-by: Daniel Borkmann commit e2ce3674883ecba2605370404208c9d4a07ae1c3 Author: Björn Töpel Date: Wed Dec 19 13:09:31 2018 +0100 xsk: simplify AF_XDP socket teardown Prior this commit, when the struct socket object was being released, the UMEM did not have its reference count decreased. Instead, this was done in the struct sock sk_destruct function. There is no reason to keep the UMEM reference around when the socket is being orphaned, so in this patch the xdp_put_mem is called in the xsk_release function. This results in that the xsk_destruct function can be removed! Note that, it still holds that a struct xsk_sock reference might still linger in the XSKMAP after the UMEM is released, e.g. if a user does not clear the XSKMAP prior to closing the process. This sock will be in a "released" zombie like state, until the XSKMAP is removed. Signed-off-by: Björn Töpel Signed-off-by: Daniel Borkmann commit 4ab0edecaf1d9a4acb5bddc4a869b0f7efda634a Merge: 055722716c396 489c25f9a375b Author: David S. Miller Date: Wed Dec 19 12:28:08 2018 -0800 Merge branch 'mlxsw-Make-driver-more-robust' Ido Schimmel says: ==================== mlxsw: Make driver more robust In recent months we fixed several bugs in the driver that could have been avoided by re-evaluating some of the involved code paths and by introducing relevant and comprehensive test cases. This patchset tries to do that by introducing a set of small and mostly non-functional changes in addition to a new test. I have further improvements in mind, but they can be done in a different set. Patch #1 makes sure we correctly sanitize upper devices of a VLAN interface. Patch #2 removes an unexpected behavior from the driver, in which routes configured on a VLAN interface will cease being offloaded after certain operations. Patch #3 is a small cleanup. Patch #4 simplifies the driver by removing reference counting from VLAN entries configured on a port. Patches #5-#6 simplify linking/unlinking from a bridge, especially when LAG and VLAN devices are involved. They make both operations symmetric even when ports are unlinked from a bridged LAG device. Patch #7-#9 make router interface (RIF) deletion more robust by removing reliance on device chain to indicate whether a NETDEV_DOWN event in the inet{,6}addr notification chains should be processed. This is due to the fact that IP addresses can be flushed from a netdev after it was unlinked from its lower device. Patch #10 adds a new test to for valid and invalid configurations over mlxsw ports. Some of the test cases are derived from recent fixes. I expect that more test cases will be added over time. ==================== Signed-off-by: David S. Miller commit 489c25f9a375ba1e780dcf445ca74f6b3766d1b5 Author: Ido Schimmel Date: Wed Dec 19 06:08:51 2018 +0000 selftests: mlxsw: Add rtnetlink tests Add a new test that is focused on rtnetlink configuration. Its purpose is to test valid and invalid (as deemed by mlxsw) configurations and make sure that they succeed / fail without producing a trace. Some of the test cases are derived from recent fixes in order to make sure that the fixed bugs are not introduced again. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit b61cd7c6f992cca57166d0cabe242c49b93609eb Author: Ido Schimmel Date: Wed Dec 19 06:08:50 2018 +0000 mlxsw: spectrum_router: Hold a reference on RIF's netdev Previous patches tried to make RIF deletion more robust and avoid use-after-free situations. As another precaution, hold a reference on a RIF's netdev and release it when the RIF is deleted. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 965fa8e600d28d98e7e0c7340517a9c139843ee3 Author: Ido Schimmel Date: Wed Dec 19 06:08:48 2018 +0000 mlxsw: spectrum_router: Make RIF deletion more robust In the past we had multiple instances where RIFs were not properly deleted. One of the reasons for leaking a RIF was that at the time when IP addresses were flushed from the respective netdev (prompting the destruction of the RIF), the netdev was no longer a mlxsw upper. This caused the inet{,6}addr notification blocks to ignore the NETDEV_DOWN event and leak the RIF. Instead of checking whether the netdev is our upper when an IP address is removed, we can instead check if the netdev has a RIF configured. To look up a RIF we need to access mlxsw private data, so the patch stores the notification blocks inside a mlxsw struct. This then allows us to use container_of() and extract the required private data. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 21ffedb6db5ac80b2081f425be358a976f5c14b7 Author: Ido Schimmel Date: Wed Dec 19 06:08:47 2018 +0000 mlxsw: spectrum_router: Propagate 'struct mlxsw_sp' further Next patch is going to make RIF deletion more robust by removing reliance on fragile mlxsw_sp_lower_get(). This is because a netdev is not necessarily our upper anymore when its IP addresses are flushed. The inet{,6}addr notification blocks are going to resolve 'struct mlxsw_sp' using container_of(), but the functions they call still use mlxsw_sp_lower_get(). As a preparation for the next patch, propagate 'struct mlxsw_sp' down to the functions called from the notification blocks and remove reliance on mlxsw_sp_lower_get(). Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit be2d6f421f680e01d58f7cd452646e0d8586d49b Author: Ido Schimmel Date: Wed Dec 19 06:08:45 2018 +0000 mlxsw: spectrum: Properly cleanup LAG uppers when removing port from LAG When a LAG device or a VLAN device on top of it is enslaved to a bridge, the driver propagates the CHANGEUPPER event to the LAG's slaves. This causes each physical port to increase the reference count of the internal representation of the bridge port by calling mlxsw_sp_port_bridge_join(). However, when a port is removed from a LAG, the corresponding leave() function is not called and the reference count is not decremented. This leads to ugly hacks such as mlxsw_sp_bridge_port_should_destroy() that try to understand if the bridge port should be destroyed even when its reference count is not 0. Instead, make sure that when a port is unlinked from a LAG it would see the same events as if the LAG (or its uppers) were unlinked from a bridge. The above is achieved by walking the LAG's uppers when a port is unlinked and calling mlxsw_sp_port_bridge_leave() for each upper that is enslaved to a bridge. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 635c8c8bba670db6b3b03890d4e24fc4b745aed7 Author: Ido Schimmel Date: Wed Dec 19 06:08:43 2018 +0000 mlxsw: spectrum: Remove reference count from VLAN entries Commit b3529af6bb0d ("spectrum: Reference count VLAN entries") started reference counting port-VLAN entries in a similar fashion to the 8021q driver. However, this is not actually needed and only complicates things. Instead, the driver should forbid the creation of a VLAN on a port if this VLAN already exists. This would also solve the issue fixed by the mentioned commit. Therefore, remove the get()/put() API and use create()/destroy() instead. One place that needs special attention is VLAN addition in a VLAN-aware bridge via switchdev operations. In case the VLAN flags (e.g., 'pvid') are toggled, then the VLAN entry already exists. To prevent the driver from wrongly returning EEXIST, the driver is changed to check in the prepare phase whether the entry already exists and only returns an error in case it is not associated with the correct bridge port. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit e149113a74c35f0a28d1bfe17d2505a03563c1d5 Author: Ido Schimmel Date: Wed Dec 19 06:08:41 2018 +0000 mlxsw: spectrum: Handle VLAN device unlinking In commit 993107fea5ee ("mlxsw: spectrum_switchdev: Fix VLAN device deletion via ioctl") I fixed a bug caused by the fact that the driver views differently the deletion of a VLAN device when it is deleted via an ioctl and netlink. Instead of relying on a specific order of events (device being unregistered vs. VLAN filter being updated), simply make sure that the driver performs the necessary cleanup when the VLAN device is unlinked, which always happens before the other two events. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit f1d7c33d6ab585aba831a73a322070eb89724072 Author: Ido Schimmel Date: Wed Dec 19 06:08:40 2018 +0000 mlxsw: spectrum_fid: Remove unused function This function is no longer used. Remove it. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 32fd4b49a372bee72aab82ebf8e866fc3756896c Author: Ido Schimmel Date: Wed Dec 19 06:08:38 2018 +0000 mlxsw: spectrum_router: Do not destroy RIFs based on FID's reference count Currently, when a RIF is constructed on top of a FID, the RIF increments the FID's reference count and the RIF is destroyed when the FID's reference count drops to 1. This effectively means that when no local ports are member in the FID, the FID is destroyed regardless if the router port is a member in the FID or not. The above can lead to the unexpected behavior in which routes using a VLAN interface as their nexthop device are no longer offloaded after the last local port leaves the corresponding VLAN (FID). Example: # ip -4 route show dev br0.10 192.0.2.0/24 proto kernel scope link src 192.0.2.1 offload # bridge vlan del vid 10 dev swp3 # ip -4 route show dev br0.10 192.0.2.0/24 proto kernel scope link src 192.0.2.1 After the patch, the route is offloaded before and after the VLAN is removed from local port 'swp3', as the RIF corresponding to 'br0.10' continues to exists. In order to remove RIFs' reliance on the underlying FID's reference count, we need to add a reference count to sub-port RIFs, which are RIFs that correspond to physical ports and their uppers (e.g., LAG devices). In this case, each {Port, VID} ('struct mlxsw_sp_port_vlan') needs to hold a reference on the RIF. For example: bond0.10 | bond0 | +-------+ | | swp1 swp2 Both {Port 1, VID 10} and {Port 2, VID 10} will hold a reference on the RIF corresponding to 'bond0.10'. When the last reference is dropped, the RIF will be destroyed. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 927d0ef10a1071fba491b4858267fbb87ff19ed1 Author: Ido Schimmel Date: Wed Dec 19 06:08:37 2018 +0000 mlxsw: spectrum: Sanitize VLAN interface's uppers Currently, only VRF and macvlan uppers are supported on top of VLAN device configured over a bridge, so make sure the driver forbids other uppers. Note that enslavement to a VRF is handled earlier in the notification block, so there is no need to check for a VRF upper here. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 5dabcd0456d7ee17c2c7a17d7c2305444d2b9639 Author: Bart Van Assche Date: Mon Dec 17 13:20:46 2018 -0800 RDMA/srpt: Add support for immediate data Modify allocation of the non-SRQ receive queues such that immediate data is aligned on a 512 byte boundary. That alignment is necessary to pass the immediate data without copying to the block layer. When receiving an SRP_CMD with immediate data, postpone the ib_post_recv() call until target_execute_cmd() has finished. See also srpt_release_cmd(). Cc: Sergey Gorenko Cc: Max Gurtovoy Cc: Laurence Oberman Signed-off-by: Bart Van Assche Signed-off-by: Doug Ledford commit 82305f8235622a97f29ff6e82cc97cab6ac543ea Author: Bart Van Assche Date: Mon Dec 17 13:20:45 2018 -0800 RDMA/srpt: Rework the srpt_alloc_srq() error path This patch does not change any functionality but makes the next patch easier to read. Cc: Sergey Gorenko Cc: Max Gurtovoy Cc: Laurence Oberman Signed-off-by: Bart Van Assche Signed-off-by: Doug Ledford commit 6feb64ffda7c8efc0ea25bc81866515ba80cdc04 Author: Bart Van Assche Date: Mon Dec 17 13:20:44 2018 -0800 RDMA/srpt: Remove driver version and release date Neither a driver version number nor a release data is useful in an upstream driver. Remove the word "InfiniBand" from the driver description because recently RoCE support has been added to this driver. Cc: Sergey Gorenko Cc: Max Gurtovoy Cc: Laurence Oberman Signed-off-by: Bart Van Assche Signed-off-by: Doug Ledford commit c4bbe911c2ac86180657014fce8919ea0921a35b Author: Bart Van Assche Date: Mon Dec 17 13:20:43 2018 -0800 RDMA/srpt: Make kernel-doc headers complete Add documentation for those structure members for which it is missing. Cc: Sergey Gorenko Cc: Max Gurtovoy Cc: Laurence Oberman Signed-off-by: Bart Van Assche Signed-off-by: Doug Ledford commit 75d79b801c5389928a05de6db117912a21190138 Author: Bart Van Assche Date: Mon Dec 17 13:20:42 2018 -0800 RDMA/srpt: Join split strings Make sure that long strings occur on a single line as required by the coding standard. Cc: Sergey Gorenko Cc: Max Gurtovoy Cc: Laurence Oberman Signed-off-by: Bart Van Assche Signed-off-by: Doug Ledford commit ffd5980695d165f0b811b5f57accb23fce5c33af Author: Bart Van Assche Date: Mon Dec 17 13:20:41 2018 -0800 RDMA/srpt: Improve coding style conformance Use tabs instead of spaces for indentation. Make sure that multi-line expressions have the operator at the end of a line instead of the start. Avoid a complaint about a missing space in a ternary expression by changing '(boolean) ? 1: 0' into 'boolean'. Cc: Sergey Gorenko Cc: Max Gurtovoy Cc: Laurence Oberman Signed-off-by: Bart Van Assche Signed-off-by: Doug Ledford commit ed041919f0d23c109d52cde8da6ddc211c52d67e Author: Bart Van Assche Date: Mon Dec 17 13:20:40 2018 -0800 RDMA/srpt: Fix a use-after-free in the channel release code This patch avoids that KASAN sporadically reports the following: BUG: KASAN: use-after-free in rxe_run_task+0x1e/0x60 [rdma_rxe] Read of size 1 at addr ffff88801c50d8f4 by task check/24830 CPU: 4 PID: 24830 Comm: check Not tainted 4.20.0-rc6-dbg+ #3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014 Call Trace: dump_stack+0x86/0xca print_address_description+0x71/0x239 kasan_report.cold.5+0x242/0x301 __asan_load1+0x47/0x50 rxe_run_task+0x1e/0x60 [rdma_rxe] rxe_post_send+0x4bd/0x8d0 [rdma_rxe] srpt_zerolength_write+0xe1/0x160 [ib_srpt] srpt_close_ch+0x8b/0xe0 [ib_srpt] srpt_set_enabled+0xe7/0x150 [ib_srpt] srpt_tpg_enable_store+0xc0/0x100 [ib_srpt] configfs_write_file+0x157/0x1d0 __vfs_write+0xd7/0x3d0 vfs_write+0x102/0x290 ksys_write+0xab/0x130 __x64_sys_write+0x43/0x50 do_syscall_64+0x71/0x210 entry_SYSCALL_64_after_hwframe+0x49/0xbe Allocated by task 13856: save_stack+0x43/0xd0 kasan_kmalloc+0xc7/0xe0 kasan_slab_alloc+0x11/0x20 kmem_cache_alloc+0x105/0x320 rxe_alloc+0xff/0x1f0 [rdma_rxe] rxe_create_qp+0x9f/0x160 [rdma_rxe] ib_create_qp+0xf5/0x690 [ib_core] rdma_create_qp+0x6a/0x140 [rdma_cm] srpt_cm_req_recv.cold.59+0x1588/0x237b [ib_srpt] srpt_rdma_cm_req_recv.isra.35+0x1d5/0x220 [ib_srpt] srpt_rdma_cm_handler+0x6f/0x100 [ib_srpt] cma_listen_handler+0x59/0x60 [rdma_cm] cma_ib_req_handler+0xd5b/0x2570 [rdma_cm] cm_process_work+0x2e/0x110 [ib_cm] cm_work_handler+0x2aae/0x502b [ib_cm] process_one_work+0x481/0x9e0 worker_thread+0x67/0x5b0 kthread+0x1cf/0x1f0 ret_from_fork+0x24/0x30 Freed by task 3440: save_stack+0x43/0xd0 __kasan_slab_free+0x139/0x190 kasan_slab_free+0xe/0x10 kmem_cache_free+0xbc/0x330 rxe_elem_release+0x66/0xe0 [rdma_rxe] rxe_destroy_qp+0x3f/0x50 [rdma_rxe] ib_destroy_qp+0x140/0x360 [ib_core] srpt_release_channel_work+0xdc/0x310 [ib_srpt] process_one_work+0x481/0x9e0 worker_thread+0x67/0x5b0 kthread+0x1cf/0x1f0 ret_from_fork+0x24/0x30 Cc: Sergey Gorenko Cc: Max Gurtovoy Cc: Laurence Oberman Cc: Signed-off-by: Bart Van Assche Signed-off-by: Doug Ledford commit 882981f4a4112b44376ba21aa4d82dbdd5d8f148 Author: Bart Van Assche Date: Mon Dec 17 13:20:39 2018 -0800 RDMA/srp: Add support for immediate data Request permission to send immediate data during login. If the SRP target grants this request, send the payload of write requests <= 8 KB as immediate data. Cc: Sergey Gorenko Cc: Max Gurtovoy Cc: Laurence Oberman Signed-off-by: Bart Van Assche Signed-off-by: Doug Ledford commit 513d5647116b2aaeb6d99471f70ab9c9f3f65663 Author: Bart Van Assche Date: Mon Dec 17 13:20:38 2018 -0800 RDMA/srp: Rework handling of the maximum information unit length Move the maximum initiator to target information unit length parameter from struct srp_target_port into struct srp_rdma_ch. This patch does not change any functionality but makes the next patch easier to read. Cc: Sergey Gorenko Cc: Max Gurtovoy Cc: Laurence Oberman Signed-off-by: Bart Van Assche Signed-off-by: Doug Ledford commit 4f6d498c360c31006dec8062ce3d4601e557e9df Author: Bart Van Assche Date: Mon Dec 17 13:20:37 2018 -0800 RDMA/srp: Move srp_rdma_ch.max_ti_iu_len declaration Since srp_rdma_ch.max_ti_iu_len is used in the hot path, move it to the section with data structure members used in the hot path. Cc: Sergey Gorenko Cc: Max Gurtovoy Cc: Laurence Oberman Signed-off-by: Bart Van Assche Signed-off-by: Doug Ledford commit 2ee00f6a98c36f7e4ba07cc33f24cc5a69060cc9 Author: Bart Van Assche Date: Mon Dec 17 13:20:36 2018 -0800 RDMA/srp: Propagate ib_post_send() failures to the SCSI mid-layer This patch avoids that the SCSI mid-layer keeps retrying forever if ib_post_send() fails. This was discovered while testing immediate data support and passing a too large num_sge value to ib_post_send(). Cc: Sergey Gorenko Cc: Max Gurtovoy Cc: Laurence Oberman Signed-off-by: Bart Van Assche Signed-off-by: Doug Ledford commit 482fffc43c032ec09dd9ee792a546b36e973dcef Author: Bart Van Assche Date: Mon Dec 17 13:20:35 2018 -0800 RDMA/srp: Handle large SCSI CDBs correctly Reserve additional space for CDBs that contain more than sixteen bytes and set the add_cdb_len field for such CDBs as required. From the SRP standard: "The ADDITIONAL CDB LENGTH field contains the length in dwords of the ADDITIONAL CDB field." Cc: Sergey Gorenko Cc: Max Gurtovoy Cc: Laurence Oberman Signed-off-by: Bart Van Assche Signed-off-by: Doug Ledford commit e37df2d5b569390e3b80ebed9a73fd5b9dcda010 Author: Bart Van Assche Date: Mon Dec 17 13:20:34 2018 -0800 RDMA/srp: Document srp_parse_in() arguments This patch avoids that a warning is reported when building with W=1. Cc: Sergey Gorenko Cc: Max Gurtovoy Cc: Laurence Oberman Signed-off-by: Bart Van Assche Signed-off-by: Doug Ledford commit 16d14e01b7a100911804768b3ae4df083da2b53d Author: Bart Van Assche Date: Mon Dec 17 13:20:33 2018 -0800 include/scsi/srp.h: Add support for immediate data Add constants and data structures to support immediate data. These changes conform to SRP2r04. Cc: Sergey Gorenko Cc: Max Gurtovoy Cc: Laurence Oberman Signed-off-by: Bart Van Assche Signed-off-by: Doug Ledford commit feafa20433466d6193d5686b188999391c873165 Author: Bart Van Assche Date: Mon Dec 17 13:20:32 2018 -0800 include/scsi/srp.h: Move response flag definitions into this file This patch moves all constants that come from the SRP standard into the include/scsi/srp.h header file. Cc: Sergey Gorenko Cc: Max Gurtovoy Cc: Laurence Oberman Signed-off-by: Bart Van Assche Signed-off-by: Doug Ledford commit 055722716c396ac1c7fd36a828250a78db1f22bc Author: Hoang Le Date: Wed Dec 19 11:42:19 2018 +0700 tipc: fix uninitialized value for broadcast retransmission When sending broadcast message on high load system, there are a lot of unnecessary packets restranmission. That issue was caused by missing in initial criteria for retransmission. To prevent this happen, just initialize this criteria for retransmission in next 10 milliseconds. Fixes: 31c4f4cc32f7 ("tipc: improve broadcast retransmission algorithm") Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Hoang Le Signed-off-by: David S. Miller commit 013dc9d55c2ee47bb4a509e10c5cad404059b686 Merge: 4a54877ee767f cf5f55f7f0139 Author: David S. Miller Date: Wed Dec 19 11:49:25 2018 -0800 Merge branch 'tipc-tracepoints' Tuong Lien says: ==================== tipc: tracepoints and trace_events in TIPC The patch series is the first step of introducing a tracing framework in TIPC, which will assist in collecting complete & plentiful data for post analysis, even in the case of a single failure occurrence e.g. when the failure is unreproducible. The tracing code in TIPC utilizes the powerful kernel tracepoints, trace events features along with particular dump functions to trace the TIPC object data and events (incl. bearer, link, socket, node, etc.). The tracing code should generate zero-load to TIPC when the trace events are not enabled. ==================== Signed-off-by: David S. Miller commit cf5f55f7f01397015dfa390256f2c20ceaabfcfb Author: Tuong Lien Date: Wed Dec 19 09:18:00 2018 +0700 tipc: add trace_events for tipc bearer The commit adds the new trace_event for TIPC bearer, L2 device event: trace_tipc_l2_device_event() Also, it puts the trace at the tipc_l2_device_event() function, then the device/bearer events and related info can be traced out during runtime when needed. Acked-by: Ying Xue Tested-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien Signed-off-by: David S. Miller commit eb18a510b5cd4daeb9736ad8db57a9fc49db185b Author: Tuong Lien Date: Wed Dec 19 09:17:59 2018 +0700 tipc: add trace_events for tipc node The commit adds the new trace_events for TIPC node object: trace_tipc_node_create() trace_tipc_node_delete() trace_tipc_node_lost_contact() trace_tipc_node_timeout() trace_tipc_node_link_up() trace_tipc_node_link_down() trace_tipc_node_reset_links() trace_tipc_node_fsm_evt() trace_tipc_node_check_state() Also, enables the traces for the following cases: - When a node is created/deleted; - When a node contact is lost; - When a node timer is timed out; - When a node link is up/down; - When all node links are reset; - When node state is changed; - When a skb comes and node state needs to be checked/updated. Acked-by: Ying Xue Tested-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien Signed-off-by: David S. Miller commit 01e661ebfbad40e6280fb8ec25f2861d39ba4387 Author: Tuong Lien Date: Wed Dec 19 09:17:58 2018 +0700 tipc: add trace_events for tipc socket The commit adds the new trace_events for TIPC socket object: trace_tipc_sk_create() trace_tipc_sk_poll() trace_tipc_sk_sendmsg() trace_tipc_sk_sendmcast() trace_tipc_sk_sendstream() trace_tipc_sk_filter_rcv() trace_tipc_sk_advance_rx() trace_tipc_sk_rej_msg() trace_tipc_sk_drop_msg() trace_tipc_sk_release() trace_tipc_sk_shutdown() trace_tipc_sk_overlimit1() trace_tipc_sk_overlimit2() Also, enables the traces for the following cases: - When user creates a TIPC socket; - When user calls poll() on TIPC socket; - When user sends a dgram/mcast/stream message. - When a message is put into the socket 'sk_receive_queue'; - When a message is released from the socket 'sk_receive_queue'; - When a message is rejected (e.g. due to no port, invalid, etc.); - When a message is dropped (e.g. due to wrong message type); - When socket is released; - When socket is shutdown; - When socket rcvq's allocation is overlimit (> 90%); - When socket rcvq + bklq's allocation is overlimit (> 90%); - When the 'TIPC_ERR_OVERLOAD/2' issue happens; Note: a) All the socket traces are designed to be able to trace on a specific socket by either using the 'event filtering' feature on a known socket 'portid' value or the sysctl file: /proc/sys/net/tipc/sk_filter The file determines a 'tuple' for what socket should be traced: (portid, sock type, name type, name lower, name upper) where: + 'portid' is the socket portid generated at socket creating, can be found in the trace outputs or the 'tipc socket list' command printouts; + 'sock type' is the socket type (1 = SOCK_TREAM, ...); + 'name type', 'name lower' and 'name upper' are the service name being connected to or published by the socket. Value '0' means 'ANY', the default tuple value is (0, 0, 0, 0, 0) i.e. the traces happen for every sockets with no filter. b) The 'tipc_sk_overlimit1/2' event is also a conditional trace_event which happens when the socket receive queue (and backlog queue) is about to be overloaded, when the queue allocation is > 90%. Then, when the trace is enabled, the last skbs leading to the TIPC_ERR_OVERLOAD/2 issue can be traced. The trace event is designed as an 'upper watermark' notification that the other traces (e.g. 'tipc_sk_advance_rx' vs 'tipc_sk_filter_rcv') or actions can be triggerred in the meanwhile to see what is going on with the socket queue. In addition, the 'trace_tipc_sk_dump()' is also placed at the 'TIPC_ERR_OVERLOAD/2' case, so the socket and last skb can be dumped for post-analysis. Acked-by: Ying Xue Tested-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien Signed-off-by: David S. Miller commit 26574db0c17fb29fac8b57f94ed1dfd46cc89887 Author: Tuong Lien Date: Wed Dec 19 09:17:57 2018 +0700 tipc: add trace_events for tipc link The commit adds the new trace_events for TIPC link object: trace_tipc_link_timeout() trace_tipc_link_fsm() trace_tipc_link_reset() trace_tipc_link_too_silent() trace_tipc_link_retrans() trace_tipc_link_bc_ack() trace_tipc_link_conges() And the traces for PROTOCOL messages at building and receiving: trace_tipc_proto_build() trace_tipc_proto_rcv() Note: a) The 'tipc_link_too_silent' event will only happen when the 'silent_intv_cnt' is about to reach the 'abort_limit' value (and the event is enabled). The benefit for this kind of event is that we can get an early indication about TIPC link loss issue due to timeout, then can do some necessary actions for troubleshooting. For example: To trigger the 'tipc_proto_rcv' when the 'too_silent' event occurs: echo 'enable_event:tipc:tipc_proto_rcv' > \ events/tipc/tipc_link_too_silent/trigger And disable it when TIPC link is reset: echo 'disable_event:tipc:tipc_proto_rcv' > \ events/tipc/tipc_link_reset/trigger b) The 'tipc_link_retrans' or 'tipc_link_bc_ack' event is useful to trace TIPC retransmission issues. In addition, the commit adds the 'trace_tipc_list/link_dump()' at the 'retransmission failure' case. Then, if the issue occurs, the link 'transmq' along with the link data can be dumped for post-analysis. These dump events should be enabled by default since it will only take effect when the failure happens. The same approach is also applied for the faulty case that the validation of protocol message is failed. Acked-by: Ying Xue Tested-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien Signed-off-by: David S. Miller commit b4b9771bcbbd5839b0f77aba55e2f85989ed6779 Author: Tuong Lien Date: Wed Dec 19 09:17:56 2018 +0700 tipc: enable tracepoints in tipc As for the sake of debugging/tracing, the commit enables tracepoints in TIPC along with some general trace_events as shown below. It also defines some 'tipc_*_dump()' functions that allow to dump TIPC object data whenever needed, that is, for general debug purposes, ie. not just for the trace_events. The following trace_events are now available: - trace_tipc_skb_dump(): allows to trace and dump TIPC msg & skb data, e.g. message type, user, droppable, skb truesize, cloned skb, etc. - trace_tipc_list_dump(): allows to trace and dump any TIPC buffers or queues, e.g. TIPC link transmq, socket receive queue, etc. - trace_tipc_sk_dump(): allows to trace and dump TIPC socket data, e.g. sk state, sk type, connection type, rmem_alloc, socket queues, etc. - trace_tipc_link_dump(): allows to trace and dump TIPC link data, e.g. link state, silent_intv_cnt, gap, bc_gap, link queues, etc. - trace_tipc_node_dump(): allows to trace and dump TIPC node data, e.g. node state, active links, capabilities, link entries, etc. How to use: Put the trace functions at any places where we want to dump TIPC data or events. Note: a) The dump functions will generate raw data only, that is, to offload the trace event's processing, it can require a tool or script to parse the data but this should be simple. b) The trace_tipc_*_dump() should be reserved for a failure cases only (e.g. the retransmission failure case) or where we do not expect to happen too often, then we can consider enabling these events by default since they will almost not take any effects under normal conditions, but once the rare condition or failure occurs, we get the dumped data fully for post-analysis. For other trace purposes, we can reuse these trace classes as template but different events. c) A trace_event is only effective when we enable it. To enable the TIPC trace_events, echo 1 to 'enable' files in the events/tipc/ directory in the 'debugfs' file system. Normally, they are located at: /sys/kernel/debug/tracing/events/tipc/ For example: To enable the tipc_link_dump event: echo 1 > /sys/kernel/debug/tracing/events/tipc/tipc_link_dump/enable To enable all the TIPC trace_events: echo 1 > /sys/kernel/debug/tracing/events/tipc/enable To collect the trace data: cat trace or cat trace_pipe > /trace.out & To disable all the TIPC trace_events: echo 0 > /sys/kernel/debug/tracing/events/tipc/enable To clear the trace buffer: echo > trace d) Like the other trace_events, the feature like 'filter' or 'trigger' is also usable for the tipc trace_events. For more details, have a look at: Documentation/trace/ftrace.txt MAINTAINERS | add two new files 'trace.h' & 'trace.c' in tipc Acked-by: Ying Xue Tested-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Tuong Lien Signed-off-by: David S. Miller commit 18f2c4fcebf2582f96cbd5f2238f4f354a0e4847 Author: Theodore Ts'o Date: Wed Dec 19 14:36:58 2018 -0500 ext4: check for shutdown and r/o file system in ext4_write_inode() If the file system has been shut down or is read-only, then ext4_write_inode() needs to bail out early. Also use jbd2_complete_transaction() instead of ext4_force_commit() so we only force a commit if it is needed. Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 8c5e14f438b8cee47ff01fc1cadd15e3eed44b59 Merge: 5132411985e14 8c33df1afd86c Author: Paolo Bonzini Date: Wed Dec 19 20:33:55 2018 +0100 Merge tag 'kvmarm-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm updates for 4.21 - Large PUD support for HugeTLB - Single-stepping fixes - Improved tracing - Various timer and vgic fixups commit 4a54877ee767fe70a6966352c788fc5f405aa3c6 Merge: 8239d5790481b 4165079ba328d Author: David S. Miller Date: Wed Dec 19 11:21:45 2018 -0800 Merge branch 'sk_buff-add-extension-infrastructure' Florian Westphal says: ==================== sk_buff: add extension infrastructure TL;DR: - objdiff shows no change if CONFIG_XFRM=n && BR_NETFILTER=n - small size reduction when one or both options are set - no changes in ipsec performance Changes since v1: - Allocate entire extension space from a kmem_cache. - Avoid atomic_dec_and_test operation on skb_ext_put() for refcnt == 1 case. (similar to kfree_skbmem() fclone_ref use). This adds an optional extension infrastructure, with ispec (xfrm) and bridge netfilter as first users. The third (future) user is Multipath TCP which is still out-of-tree. MPTCP needs to map logical mptcp sequence numbers to the tcp sequence numbers used by individual subflows. This DSS mapping is read/written from tcp option space on receive and written to tcp option space on transmitted tcp packets that are part of and MPTCP connection. Extending skb_shared_info or adding a private data field to skb fclones doesn't work for incoming skb, so a different DSS propagation method would be required for the receive side. mptcp has same requirements as secpath/bridge netfilter: 1. extension memory is released when the sk_buff is free'd. 2. data is shared after cloning an skb (clone inherits extension) 3. adding extension to an skb will COW the extension buffer if needed. Two new members are added to sk_buff: 1. 'active_extensions' byte (filling a hole), telling which extensions are available for this skb. This has two purposes. a) avoids the need to initialize the pointer. b) allows to "delete" an extension by clearing its bit value in ->active_extensions. While it would be possible to store the active_extensions byte in the extension struct instead of sk_buff, there is one problem with this: When an extension has to be disabled, we can always clear the bit in skb->active_extensions. But in case it would be stored in the extension buffer itself, we might have to COW it first, if we are dealing with a cloned skb. On kmalloc failure we would be unable to turn an extension off. 2. extension pointer, located at the end of the sk_buff. If the active_extensions byte is 0, the pointer is undefined, it is not initialized on skb allocation. This adds extra code to skb clone and free paths (to deal with refcount/free of extension area) but this replaces similar code that manages skb->nf_bridge and skb->sp structs in the followup patches of the series. It is possible to add support for extensions that are not preseved on clones/copies: 1. define a bitmask of all extensions that need copy/cow on clone 2. change __skb_ext_copy() to check ->active_extensions & SKB_EXT_PRESERVE_ON_CLONE 3. set clone->active_extensions to 0 if test is false. This isn't done here because all extensions that get added here need the copy/cow semantics. Last patch converts skb->sp, secpath information gets stored as new SKB_EXT_SEC_PATH, so the 'sp' pointer is removed from skbuff. Extra code added to skb clone and free paths (to deal with refcount/free of extension area) replaces the existing code that does the same for skb->nf_bridge and skb->secpath. I don't see any other in-tree users that could benefit from this infrastructure, it doesn't make sense to add an extension just for the sake of a single flag bit (like skb->nf_trace). Adding a new extension is a good fit if all of the following are true: 1. Data is related to the skb/packet aggregate 2. Data should be freed when the skb is free'd 3. Data is not going to be relevant/needed in normal case (udp, tcp, forwarding workloads, ...) 4. There are no fancy action(s) needed on clone/free, such as callbacks into kernel modules. ==================== Signed-off-by: David S. Miller commit 4165079ba328dd47262a2183049d3591f0a750b1 Author: Florian Westphal Date: Tue Dec 18 17:15:27 2018 +0100 net: switch secpath to use skb extension infrastructure Remove skb->sp and allocate secpath storage via extension infrastructure. This also reduces sk_buff by 8 bytes on x86_64. Total size of allyesconfig kernel is reduced slightly, as there is less inlined code (one conditional atomic op instead of two on skb_clone). No differences in throughput in following ipsec performance tests: - transport mode with aes on 10GB link - tunnel mode between two network namespaces with aes and null cipher Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit a84e3f533324e40e4a99f50dee2188bf140d8098 Author: Florian Westphal Date: Tue Dec 18 17:15:26 2018 +0100 xfrm: prefer secpath_set over secpath_dup secpath_set is a wrapper for secpath_dup that will not perform an allocation if the secpath attached to the skb has a reference count of one, i.e., it doesn't need to be COW'ed. Also, secpath_dup doesn't attach the secpath to the skb, it leaves this to the caller. Use secpath_set in places that immediately assign the return value to skb. This allows to remove skb->sp without touching these spots again. secpath_dup can eventually be removed in followup patch. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit a053c866496d0c3647727f6a282a1db3afea3ed7 Author: Florian Westphal Date: Tue Dec 18 17:15:25 2018 +0100 drivers: chelsio: use skb_sec_path helper reduce noise when skb->sp is removed later in the series. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 26912e3756d0a13b188142d1ba0ab279cd3b657a Author: Florian Westphal Date: Tue Dec 18 17:15:24 2018 +0100 xfrm: use secpath_exist where applicable Will reduce noise when skb->sp is removed later in this series. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 56d1ac3260dadfc66c81ef2689bd1a09b05731a2 Author: Florian Westphal Date: Tue Dec 18 17:15:23 2018 +0100 drivers: net: netdevsim: use skb_sec_path helper ... so this won't have to be changed when skb->sp goes away. v2: no changes, preserve ack. Acked-by: Shannon Nelson Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 6362a6a04031cacc8ff54b65b84385d9fbab853d Author: Florian Westphal Date: Tue Dec 18 17:15:22 2018 +0100 drivers: net: ethernet: mellanox: use skb_sec_path helper Will avoid touching this when sp pointer is removed from sk_buff struct. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 2fdb435bc0d7492b8137d4c9db6a465511154e29 Author: Florian Westphal Date: Tue Dec 18 17:15:21 2018 +0100 drivers: net: intel: use secpath helpers in more places Use skb_sec_path and secpath_exists helpers where possible. This reduces noise in followup patch that removes skb->sp pointer. v2: no changes, preseve acks from v1. Acked-by: Shannon Nelson Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 2294be0f11e22b6197d025e5d3ab42888879ec4e Author: Florian Westphal Date: Tue Dec 18 17:15:20 2018 +0100 net: use skb_sec_path helper in more places skb_sec_path gains 'const' qualifier to avoid xt_policy.c: 'skb_sec_path' discards 'const' qualifier from pointer target type same reasoning as previous conversions: Won't need to touch these spots anymore when skb->sp is removed. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 7af8f4ca314a592e2ba49cb5ea1de1325974998e Author: Florian Westphal Date: Tue Dec 18 17:15:19 2018 +0100 net: move secpath_exist helper to sk_buff.h Future patch will remove skb->sp pointer. To reduce noise in those patches, move existing helper to sk_buff and use it in more places to ease skb->sp replacement later. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit 0ca64da128b816b2826e9b469f47239c47f1df31 Author: Florian Westphal Date: Tue Dec 18 17:15:18 2018 +0100 xfrm: change secpath_set to return secpath struct, not error value It can only return 0 (success) or -ENOMEM. Change return value to a pointer to secpath struct. This avoids direct access to skb->sp: err = secpath_set(skb); if (!err) .. skb->sp-> ... Becomes: sp = secpath_set(skb) if (!sp) .. sp-> .. This reduces noise in followup patch which is going to remove skb->sp. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit de8bda1d22d38b7d5cd08b33f86efd94d4c86630 Author: Florian Westphal Date: Tue Dec 18 17:15:17 2018 +0100 net: convert bridge_nf to use skb extension infrastructure This converts the bridge netfilter (calling iptables hooks from bridge) facility to use the extension infrastructure. The bridge_nf specific hooks in skb clone and free paths are removed, they have been replaced by the skb_ext hooks that do the same as the bridge nf allocations hooks did. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit df5042f4c5b9326c593bf2e31ed859ebc3b4130a Author: Florian Westphal Date: Tue Dec 18 17:15:16 2018 +0100 sk_buff: add skb extension infrastructure This adds an optional extension infrastructure, with ispec (xfrm) and bridge netfilter as first users. objdiff shows no changes if kernel is built without xfrm and br_netfilter support. The third (planned future) user is Multipath TCP which is still out-of-tree. MPTCP needs to map logical mptcp sequence numbers to the tcp sequence numbers used by individual subflows. This DSS mapping is read/written from tcp option space on receive and written to tcp option space on transmitted tcp packets that are part of and MPTCP connection. Extending skb_shared_info or adding a private data field to skb fclones doesn't work for incoming skb, so a different DSS propagation method would be required for the receive side. mptcp has same requirements as secpath/bridge netfilter: 1. extension memory is released when the sk_buff is free'd. 2. data is shared after cloning an skb (clone inherits extension) 3. adding extension to an skb will COW the extension buffer if needed. The "MPTCP upstreaming" effort adds SKB_EXT_MPTCP extension to store the mapping for tx and rx processing. Two new members are added to sk_buff: 1. 'active_extensions' byte (filling a hole), telling which extensions are available for this skb. This has two purposes. a) avoids the need to initialize the pointer. b) allows to "delete" an extension by clearing its bit value in ->active_extensions. While it would be possible to store the active_extensions byte in the extension struct instead of sk_buff, there is one problem with this: When an extension has to be disabled, we can always clear the bit in skb->active_extensions. But in case it would be stored in the extension buffer itself, we might have to COW it first, if we are dealing with a cloned skb. On kmalloc failure we would be unable to turn an extension off. 2. extension pointer, located at the end of the sk_buff. If the active_extensions byte is 0, the pointer is undefined, it is not initialized on skb allocation. This adds extra code to skb clone and free paths (to deal with refcount/free of extension area) but this replaces similar code that manages skb->nf_bridge and skb->sp structs in the followup patches of the series. It is possible to add support for extensions that are not preseved on clones/copies. To do this, it would be needed to define a bitmask of all extensions that need copy/cow semantics, and change __skb_ext_copy() to check ->active_extensions & SKB_EXT_PRESERVE_ON_CLONE, then just set ->active_extensions to 0 on the new clone. This isn't done here because all extensions that get added here need the copy/cow semantics. v2: Allocate entire extension space using kmem_cache. Upside is that this allows better tracking of used memory, downside is that we will allocate more space than strictly needed in most cases (its unlikely that all extensions are active/needed at same time for same skb). The allocated memory (except the small extension header) is not cleared, so no additonal overhead aside from memory usage. Avoid atomic_dec_and_test operation on skb_ext_put() by using similar trick as kfree_skbmem() does with fclone_ref: If recount is 1, there is no concurrent user and we can free right away. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit c4b0e771f906f5beb7d90c3d28fe55ff9dbd038c Author: Florian Westphal Date: Tue Dec 18 17:15:15 2018 +0100 netfilter: avoid using skb->nf_bridge directly This pointer is going to be removed soon, so use the existing helpers in more places to avoid noise when the removal happens. Signed-off-by: Florian Westphal Signed-off-by: David S. Miller commit ec5b5ad6e272d8d6b92d1007f79574919862a2d2 Author: Alexander Shishkin Date: Wed Dec 19 17:19:22 2018 +0200 intel_th: msu: Fix an off-by-one in attribute store The 'nr_pages' attribute of the 'msc' subdevices parses a comma-separated list of window sizes, passed from userspace. However, there is a bug in the string parsing logic wherein it doesn't exclude the comma character from the range of characters as it consumes them. This leads to an out-of-bounds access given a sufficiently long list. For example: > # echo 8,8,8,8 > /sys/bus/intel_th/devices/0-msc0/nr_pages > ================================================================== > BUG: KASAN: slab-out-of-bounds in memchr+0x1e/0x40 > Read of size 1 at addr ffff8803ffcebcd1 by task sh/825 > > CPU: 3 PID: 825 Comm: npktest.sh Tainted: G W 4.20.0-rc1+ > Call Trace: > dump_stack+0x7c/0xc0 > print_address_description+0x6c/0x23c > ? memchr+0x1e/0x40 > kasan_report.cold.5+0x241/0x308 > memchr+0x1e/0x40 > nr_pages_store+0x203/0xd00 [intel_th_msu] Fix this by accounting for the comma character. Signed-off-by: Alexander Shishkin Fixes: ba82664c134ef ("intel_th: Add Memory Storage Unit driver") Cc: stable@vger.kernel.org # v4.4+ Signed-off-by: Greg Kroah-Hartman commit 4cdd41585c5196f75e1e496c4f64345b2c700e0b Author: Alexander Shishkin Date: Wed Dec 19 17:19:21 2018 +0200 stm class: Add a reference to the SyS-T document Commit 4cb3653df0cd ("stm class: Document the MIPI SyS-T protocol usage") added a document describing the SyS-T protocol usage, but forgot to add it to the directory index. Fix that. Signed-off-by: Alexander Shishkin Fixes: 4cb3653df0cd ("stm class: Document the MIPI SyS-T protocol usage") Signed-off-by: Greg Kroah-Hartman commit c18614a1a11276837bdd44403d84d207c9951538 Author: Alexander Shishkin Date: Wed Dec 19 17:19:20 2018 +0200 stm class: Fix a module refcount leak in policy creation error path Commit c7fd62bc69d0 ("stm class: Introduce framing protocol drivers") adds a bug into the error path of policy creation, that would do a module_put() on a wrong module, if one tried to create a policy for an stm device which already has a policy, using a different protocol. IOW, | mkdir /config/stp-policy/dummy_stm.0:p_basic.test | mkdir /config/stp-policy/dummy_stm.0:p_sys-t.test # puts "p_basic" | mkdir /config/stp-policy/dummy_stm.0:p_sys-t.test # "p_basic" -> -1 throws: | general protection fault: 0000 [#1] SMP PTI | CPU: 3 PID: 2887 Comm: mkdir | RIP: 0010:module_put.part.31+0xe/0x90 | Call Trace: | module_put+0x13/0x20 | stm_put_protocol+0x11/0x20 [stm_core] | stp_policy_make+0xf1/0x210 [stm_core] | ? __kmalloc+0x183/0x220 | ? configfs_mkdir+0x10d/0x4c0 | configfs_mkdir+0x169/0x4c0 | vfs_mkdir+0x108/0x1c0 | do_mkdirat+0xe8/0x110 | __x64_sys_mkdir+0x1b/0x20 | do_syscall_64+0x5a/0x140 | entry_SYSCALL_64_after_hwframe+0x44/0xa9 Correct this sad mistake by calling calling 'put' on the correct reference, which happens to match another error path in the same function, so we consolidate the two at the same time. Signed-off-by: Alexander Shishkin Fixes: c7fd62bc69d0 ("stm class: Introduce framing protocol drivers") Reported-by: Ammy Yi Cc: stable Signed-off-by: Greg Kroah-Hartman commit fde872682e175743e0c3ef939c89e3c6008a1529 Author: Theodore Ts'o Date: Wed Dec 19 14:07:58 2018 -0500 ext4: force inode writes when nfsd calls commit_metadata() Some time back, nfsd switched from calling vfs_fsync() to using a new commit_metadata() hook in export_operations(). If the file system did not provide a commit_metadata() hook, it fell back to using sync_inode_metadata(). Unfortunately doesn't work on all file systems. In particular, it doesn't work on ext4 due to how the inode gets journalled --- the VFS writeback code will not always call ext4_write_inode(). So we need to provide our own ext4_nfs_commit_metdata() method which calls ext4_write_inode() directly. Google-Bug-Id: 121195940 Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 74fbc7d371d9a438b8e39d926d9d5012d2f762c4 Author: Song Hongyan Date: Tue Dec 11 09:58:23 2018 +0800 HID: intel-ish-hid: add MSI interrupt support Now ish hid ipc only support sideband interrupt but on some platforms they use MSI interrupt. In order to make the interrupt type coverage all the scenario add single MSI interrupt support, it can match all interrupt types. Signed-off-by: Song Hongyan Acked-by: Srinivas Pandruvada Signed-off-by: Jiri Kosina commit 04d1532bd0b93cc4d0056f27da1591f086d341a6 Author: NeilBrown Date: Mon Dec 3 11:30:31 2018 +1100 SUNRPC discard cr_uid from struct rpc_cred. Just use ->cr_cred->fsuid directly. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 2edd8d746e51229705367528e95e5b49bccfa76e Author: NeilBrown Date: Mon Dec 3 11:30:31 2018 +1100 SUNRPC: simplify auth_unix. 1/ discard 'struct unx_cred'. We don't need any data that is not already in 'struct rpc_cred'. 2/ Don't keep these creds in a hash table. When a credential is needed, simply allocate it. When not needed, discard it. This can easily be faster than performing a lookup on a shared hash table. As the lookup can happen during write-out, use a mempool to ensure forward progress. This means that we cannot compare two credentials for equality by comparing the pointers, but we never do that anyway. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit d6efccd97e6de25e002d658593675ce8e07ceb8c Author: NeilBrown Date: Mon Dec 3 11:30:31 2018 +1100 SUNRPC: remove crbind rpc_cred operation This now always just does get_rpccred(), so we don't need an operation pointer to know to do that. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 89a4f758d9f55f197c2a461f61ffa4a75127b30d Author: NeilBrown Date: Mon Dec 3 11:30:31 2018 +1100 SUNRPC: remove generic cred code. This is no longer used. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit a52458b48af142bcc2b72fe810c0db20cfae7fdd Author: NeilBrown Date: Mon Dec 3 11:30:31 2018 +1100 NFS/NFSD/SUNRPC: replace generic creds with 'struct cred'. SUNRPC has two sorts of credentials, both of which appear as "struct rpc_cred". There are "generic credentials" which are supplied by clients such as NFS and passed in 'struct rpc_message' to indicate which user should be used to authorize the request, and there are low-level credentials such as AUTH_NULL, AUTH_UNIX, AUTH_GSS which describe the credential to be sent over the wires. This patch replaces all the generic credentials by 'struct cred' pointers - the credential structure used throughout Linux. For machine credentials, there is a special 'struct cred *' pointer which is statically allocated and recognized where needed as having a special meaning. A look-up of a low-level cred will map this to a machine credential. Signed-off-by: NeilBrown Acked-by: J. Bruce Fields Signed-off-by: Anna Schumaker commit 684f39b4cf5186bb0660e686f94296688b24fb32 Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 NFS: struct nfs_open_dir_context: convert rpc_cred pointer to cred. Use the common 'struct cred' to pass credentials for readdir. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit b68572e07c58324cb8c274f1d84a20cad479c2d3 Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 NFS: change access cache to use 'struct cred'. Rather than keying the access cache with 'struct rpc_cred', use 'struct cred'. Then use cred_fscmp() to compare credentials rather than comparing the raw pointer. A benefit of this approach is that in the common case we avoid the rpc_lookup_cred_nonblock() call which can be slow when the cred cache is large. This also keeps many fewer items pinned in the rpc cred cache, so the cred cache is less likely to get large. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 354698b7d47165ed2f52d6c2bf682096a4cd71d1 Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 SUNRPC: remove RPCAUTH_AUTH_NO_CRKEY_TIMEOUT This is no longer used. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit ddf529eeed59184c49dcad1633c11831f822bf6b Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 NFS: move credential expiry tracking out of SUNRPC into NFS. NFS needs to know when a credential is about to expire so that it can modify write-back behaviour to finish the write inside the expiry time. It currently uses functions in SUNRPC code which make use of a fairly complex callback scheme and flags in the generic credientials. As I am working to discard the generic credentials, this has to change. This patch moves the logic into NFS, in part by finding and caching the low-level credential in the open_context. We then make direct cred-api calls on that. This makes the code much simpler and removes a dependency on generic rpc credentials. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 1de7eea92946d7b581a8cd26084410913c80e594 Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 SUNRPC: add side channel to use non-generic cred for rpc call. The credential passed in rpc_message.rpc_cred is always a generic credential except in one instance. When gss_destroying_context() calls rpc_call_null(), it passes a specific credential that it needs to destroy. In this case the RPC acts *on* the credential rather than being authorized by it. This special case deserves explicit support and providing that will mean that rpc_message.rpc_cred is *always* generic, allowing some optimizations. So add "tk_op_cred" to rpc_task and "rpc_op_cred" to the setup data. Use this to pass the cred down from rpc_call_null(), and have rpcauth_bindcred() notice it and bind it in place. Credit to kernel test robot for finding a bug in earlier version of this patch. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit a68a72e135ef55bce136a0b604413fd6b0f6d3fc Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 SUNRPC: introduce RPC_TASK_NULLCREDS to request auth_none In almost all cases the credential stored in rpc_message.rpc_cred is a "generic" credential. One of the two expections is when an AUTH_NULL credential is used such as for RPC ping requests. To improve consistency, don't pass an explicit credential in these cases, but instead pass NULL and set a task flag, similar to RPC_TASK_ROOTCREDS, which requests that NULL credentials be used by default. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 5e16923b432bfe79fdfb7cd95ed8e63f6438b663 Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 NFS/SUNRPC: don't lookup machine credential until rpcauth_bindcred(). When NFS creates a machine credential, it is a "generic" credential, not tied to any auth protocol, and is really just a container for the princpal name. This doesn't get linked to a genuine credential until rpcauth_bindcred() is called. The lookup always succeeds, so various places that test if the machine credential is NULL, are pointless. As a step towards getting rid of generic credentials, this patch gets rid of generic machine credentials. The nfs_client and rpc_client just hold a pointer to a constant principal name. When a machine credential is wanted, a special static 'struct rpc_cred' pointer is used. rpcauth_bindcred() recognizes this, finds the principal from the client, and binds the correct credential. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit ecd5f97e1c7cd6124e3c3053beb5f2239aeacf8e Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 SUNRPC: discard RPC_DO_ROOTOVERRIDE() it is never used. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit f15e1e8bc6427e4a0d38290937ccbfec1d1a2c44 Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 NFSv4: don't require lock for get_renew_cred or get_machine_cred This lock is no longer necessary. If nfs4_get_renew_cred() needs to hunt through the open-state creds for a user cred, it still takes the lock to stablize the rbtree, but otherwise there are no races. Note that this completely removes the lock from nfs4_renew_state(). It appears that the original need for the locking here was removed long ago, and there is no longer anything to protect. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit a534ecb013bfc58a7f03653c7f2976bc341da98f Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 NFSv4: add cl_root_cred for use when machine cred is not available. NFSv4 state management tries a root credential when no machine credential is available, as can happen with kerberos. It does this by replacing the cl_machine_cred with a root credential. This means that any user of the machine credential needs to take a lock while getting a reference to the machine credential, which is a little cumbersome. So introduce an explicit cl_root_cred, and never free either credential until client shutdown. This means that no locking is needed to reference these credentials. Future patches will make use of this. This is only a temporary addition. both cl_machine_cred and cl_root_cred will disappear later in the series. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 1a80810fbf238e6dbaaaa5262a76d328ace21376 Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 SUNRPC: remove machine_cred field from struct auth_cred The cred is a machine_cred iff ->principal is set, so there is no need for the extra flag. There is one case which deserves some explanation. nfs4_root_machine_cred() calls rpc_lookup_machine_cred() with a NULL principal name which results in not getting a machine credential, but getting a root credential instead. This appears to be what is expected of the caller, and is clearly the result provided by both auth_unix and auth_gss which already ignore the flag. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 8276c902bbe95d628f48a7fdc13c71e265992085 Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 SUNRPC: remove uid and gid from struct auth_cred Use cred->fsuid and cred->fsgid instead. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit fc0664fd9bccafb00bd2dfe0d5218147994f81ee Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 SUNRPC: remove groupinfo from struct auth_cred. We can use cred->groupinfo (from the 'struct cred') instead. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 97f68c6b02e0225b38d327103c59cfe2ab5ecda7 Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 SUNRPC: add 'struct cred *' to auth_cred and rpc_cred The SUNRPC credential framework was put together before Linux has 'struct cred'. Now that we have it, it makes sense to use it. This first step just includes a suitable 'struct cred *' pointer in every 'struct auth_cred' and almost every 'struct rpc_cred'. The rpc_cred used for auth_null has a NULL 'struct cred *' as nothing else really makes sense. For rpc_cred, the pointer is reference counted. For auth_cred it isn't. struct auth_cred are either allocated on the stack, in which case the thread owns a reference to the auth, or are part of 'struct generic_cred' in which case gc_base owns the reference, and "acred" shares it. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit f06bc03339ad4c1baa964a5f0606247ac1c3c50b Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 cred: allow get_cred() and put_cred() to be given NULL. It is common practice for helpers like this to silently, accept a NULL pointer. get_rpccred() and put_rpccred() used by NFS act this way and using the same interface will ease the conversion for NFS, and simplify the resulting code. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit a6d8e7637faac93f362b694311bff64d5a8c701e Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 cred: export get_task_cred(). There is no reason that modules should not be able to use this, and NFS will need it when converted to use 'struct cred'. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 97d0fb239c041f5f99655af74812c3ab75cc4346 Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 cred: add get_cred_rcu() Sometimes we want to opportunistically get a ref to a cred in an rcu_read_lock protected section. get_task_cred() does this, and NFS does as similar thing with its own credential structures. To prepare for NFS converting to use 'struct cred' more uniformly, define get_cred_rcu(), and use it in get_task_cred(). Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit d89b22d46a40da3a1630ecea111beaf3ef10bc21 Author: NeilBrown Date: Mon Dec 3 11:30:30 2018 +1100 cred: add cred_fscmp() for comparing creds. NFS needs to compare to credentials, to see if they can be treated the same w.r.t. filesystem access. Sometimes an ordering is needed when credentials are used as a key to an rbtree. NFS currently has its own private credential management from before 'struct cred' existed. To move it over to more consistent use of 'struct cred' we need a comparison function. This patch adds that function. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 8e2e5b7c492639109b1137c286dbad529c2b35e1 Author: Ben Dooks Date: Wed Nov 28 15:05:58 2018 +0000 SUNRPC: allow /proc entries without CONFIG_SUNRPC_DEBUG If we want /proc/sys/sunrpc the current kernel also drags in other debug features which we don't really want. Instead, we should always show the following entries: /proc/sys/sunrpc/udp_slot_table_entries /proc/sys/sunrpc/tcp_slot_table_entries /proc/sys/sunrpc/tcp_max_slot_table_entries /proc/sys/sunrpc/min_resvport /proc/sys/sunrpc/max_resvport /proc/sys/sunrpc/tcp_fin_timeout Signed-off-by: Ben Dooks Signed-off-by: Thomas Preston Signed-off-by: Anna Schumaker commit ac0aa5e843ca06ae55886dbbd2a1032d9b78b6bc Author: Pavel Tikhomirov Date: Wed Nov 14 11:12:05 2018 +0300 nfs: fix comment to nfs_generic_pg_test which does the opposite Please see comment to filelayout_pg_test for reference. To: Trond Myklebust Cc: Anna Schumaker Cc: linux-nfs@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Pavel Tikhomirov Signed-off-by: Anna Schumaker commit 069d5bf5ec2650cfabc4bea9f6d779094a80b400 Author: Olga Kornievskaia Date: Fri Oct 26 16:16:58 2018 -0400 NFSv4: cleanup remove unused nfs4_xdev_fs_type commit e8f25e6d6d19 "NFS: Remove the NFS v4 xdev mount function" removed the last use of this. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit c9e585ebdc28a334b8100e560c9aaad6d4525a6e Author: Doug Ledford Date: Wed Dec 19 13:43:17 2018 -0500 IB/mlx5: Fix compile issue when ODP disabled When CONFIG_INFINIBAND_ON_DEMAND_PAGING is not enabled, we were getting build failures for defined but not used code. Fix that. Fixes: 813e90b1aeaa ("IB/mlx5: Add advise_mr() support") Signed-off-by: Jason Gunthorpe Signed-off-by: Doug Ledford commit 308144ce8e51bb6f9bed0ff0e72e7864f5f405f3 Author: Andrei.Stefanescu@microchip.com Date: Mon Dec 17 11:44:59 2018 +0000 regulator: mcp16502: code cleanup This patch does the following: - align parameter with parenthesis - fix compile error If CONFIG_SUSPEND is not set the dummy pm_ops callbacks are named mcp16502_suspend and mcp16502_resume instead of mcp16502_suspend_noirq and mcp16502_resume_noirq. Excerpt from compile log (kbuild test robot): In file included from include/linux/device.h:23:0, from include/linux/gpio/driver.h:5, from include/asm-generic/gpio.h:13, from include/linux/gpio.h:62, from drivers/regulator/mcp16502.c:11: >> drivers/regulator/mcp16502.c:527:32: error: 'mcp16502_suspend_noirq' undeclared here (not in a function); did you mean 'mcp16502_suspend'? SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mcp16502_suspend_noirq, >> drivers/regulator/mcp16502.c:528:10: error: 'mcp16502_resume_noirq' undeclared here (not in a function); did you mean 'mcp16502_suspend_noirq'? mcp16502_resume_noirq) vim +527 drivers/regulator/mcp16502.c 524 525 #ifdef CONFIG_PM 526 static const struct dev_pm_ops mcp16502_pm_ops = { > 527 SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(mcp16502_suspend_noirq, > 528 mcp16502_resume_noirq) 529 }; 530 #endif 531 static const struct i2c_device_id mcp16502_i2c_id[] = { 532 { "mcp16502", 0 }, 533 { } 534 }; 535 MODULE_DEVICE_TABLE(i2c, mcp16502_i2c_id); 536 Signed-off-by: Andrei Stefanescu Signed-off-by: Mark Brown commit 58331d618bd9ced88a21a9b68c7743b84c2f4803 Merge: 9b268ebe25cd6 c82ea33ead188 Author: Mark Brown Date: Wed Dec 19 18:38:33 2018 +0000 Merge remote-tracking branch 'regmap/topic/irq' into regmap-next commit 9b268ebe25cd649c8760c19dc8b7bda606bfba22 Merge: 7566ec393f416 580d48573c432 Author: Mark Brown Date: Wed Dec 19 18:38:31 2018 +0000 Merge branch 'regmap-4.21' into regmap-next commit c82ea33ead18801605b236523f21e5c893c7c253 Author: Bartosz Golaszewski Date: Wed Dec 19 12:18:05 2018 +0100 regmap: irq: add an option to clear status registers on unmask Some interrupt controllers whose interrupts are acked on read will set the status bits for masked interrupts without changing the state of the IRQ line. Some chips have an additional "feature" where if those set bits are not cleared before unmasking their respective interrupts, the IRQ line will change the state and we'll interpret this as an interrupt although it actually fired when it was masked. Add a new field to the irq chip struct that tells the regmap irq chip code to always clear the status registers before actually changing the irq mask values. Signed-off-by: Bartosz Golaszewski Signed-off-by: Mark Brown commit 8239d5790481bf2e4e09e202bfd4a8a5ea8ca3a1 Merge: 7b98f63ea777d 610febc68ab79 Author: David S. Miller Date: Wed Dec 19 10:37:23 2018 -0800 Merge branch 'dpaa2-eth-add-QBMAN-statistics' Ioana Ciornei says: ==================== dpaa2-eth: add QBMAN statistics This patch set adds ethtool statistics for pending frames/bytes in Rx/Tx conf FQs and number of buffers in pool. The first patch adds support for the query APIs in the DPIO driver while the latter actually exposes the statistics through ethtool. ==================== Signed-off-by: David S. Miller commit 610febc68ab79863eccaf829946a3d9278666772 Author: Ioana Radulescu Date: Tue Dec 18 15:23:01 2018 +0000 dpaa2-eth: Add QBMAN related stats Add statistics for pending frames in Rx/Tx conf FQs and number of buffers in pool. Available through ethtool -S. Signed-off-by: Ioana Radulescu Signed-off-by: Ioana ciornei Signed-off-by: David S. Miller commit e80081c34b03587cf6e89c0a1ea16c71b40bccca Author: Roy Pledge Date: Tue Dec 18 15:23:01 2018 +0000 soc: fsl: dpio: Add BP and FQ query APIs Add FQ (Frame Queue) and BP (Buffer Pool) query APIs that users of QBMan can invoke to see the status of the queues and pools that they are using. Signed-off-by: Roy Pledge Signed-off-by: Ioana Radulescu Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 1c2928e3e3212252b505b746ec10951027a95813 Author: Matti Vaittinen Date: Tue Dec 18 13:59:31 2018 +0200 regmap: regmap-irq/gpio-max77620: add level-irq support Add level active IRQ support to regmap-irq irqchip. Change breaks existing regmap-irq type setting. Convert the existing drivers which use regmap-irq with trigger type setting (gpio-max77620) to work with this new approach. So we do not magically support level-active IRQs on gpio-max77620 - but add support to the regmap-irq for chips which support them =) We do not support distinguishing situation where HW supports rising and falling edge detection but not both. Separating this would require inventing yet another flags for IRQ types. Signed-off-by: Matti Vaittinen Signed-off-by: Mark Brown commit 7b98f63ea777d90abaca41beadf71e3f62d180e0 Author: Raju Lakkaraju Date: Tue Dec 18 14:57:56 2018 +0530 net: phy: mscc: Fix the VSC 8531/41 Chip Init sequence - Turn on Broadcast writes - UNH 1.8.1 clear bias for UNH 1000BT distortion - UNH 1.8.7 optimize pre-emphasis for 100BasTx UNH 100W fix - Enable Token-ring during 'Coma Mode' Signed-off-by: Raju Lakkaraju Signed-off-by: David S. Miller commit 78e6fbf321a9b4cb46b17d83f25abcd318859c70 Author: Wei Yongjun Date: Tue Dec 18 07:10:21 2018 +0000 regulator: act8945a-regulator: make symbol act8945a_pm static Fixes the following sparse warning: drivers/regulator/act8945a-regulator.c:340:1: warning: symbol 'act8945a_pm' was not declared. Should it be static? Fixes: 7482d6ecc68e ("regulator: act8945a-regulator: Implement PM functionalities") Signed-off-by: Wei Yongjun Signed-off-by: Mark Brown commit 84267d1b18abee0c141553396f52a23db71660d3 Author: Matti Vaittinen Date: Tue Dec 18 12:58:13 2018 +0200 regmap: regmap-irq: Remove default irq type setting from core The common code should not set IRQ type. Read HW defaults to the cache at startup instead of forcing type to EDGE_BOTH. If default setting is needed this should be done via normal mechanisms or by chip specific code if normal mechanisms are not suitable for some reason. Common regmap-irq code should not have defaults hard-coded but keep the HW/boot defaults untouched. Signed-off-by: Matti Vaittinen Tested-by: Bartosz Golaszewski Signed-off-by: Mark Brown commit 8c33df1afd86c611da8473dc6fc5f3af3dabe984 Author: Marc Zyngier Date: Wed Dec 19 08:31:54 2018 +0000 arm: KVM: Add S2_PMD_{MASK,SIZE} constants They were missing, and it turns out that we do need them now. Acked-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 58466766cd35754a061414c0c93225db2962948e Author: Marc Zyngier Date: Wed Dec 19 08:28:38 2018 +0000 arm/arm64: KVM: Add ARM_EXCEPTION_IS_TRAP macro 32 and 64bit use different symbols to identify the traps. 32bit has a fine grained approach (prefetch abort, data abort and HVC), while 64bit is pretty happy with just "trap". This has been fine so far, except that we now need to decode some of that in tracepoints that are common to both architectures. Introduce ARM_EXCEPTION_IS_TRAP which abstracts the trap symbols and make the tracepoint use it. Acked-by: Christoffer Dall Signed-off-by: Marc Zyngier commit df655b75c43fba0f2621680ab261083297fd6d16 Author: Will Deacon Date: Thu Dec 13 16:06:14 2018 +0000 arm64: KVM: Avoid setting the upper 32 bits of VTCR_EL2 to 1 Although bit 31 of VTCR_EL2 is RES1, we inadvertently end up setting all of the upper 32 bits to 1 as well because we define VTCR_EL2_RES1 as signed, which is sign-extended when assigning to kvm->arch.vtcr. Lucky for us, the architecture currently treats these upper bits as RES0 so, whilst we've been naughty, we haven't set fire to anything yet. Cc: Cc: Marc Zyngier Cc: Christoffer Dall Signed-off-by: Will Deacon Signed-off-by: Marc Zyngier commit 6794ad5443a2118243e13879f94228524a1a2b92 Author: Christoffer Dall Date: Fri Nov 2 08:53:22 2018 +0100 KVM: arm/arm64: Fix unintended stage 2 PMD mappings There are two things we need to take care of when we create block mappings in the stage 2 page tables: (1) The alignment within a PMD between the host address range and the guest IPA range must be the same, since otherwise we end up mapping pages with the wrong offset. (2) The head and tail of a memory slot may not cover a full block size, and we have to take care to not map those with block descriptors, since we could expose memory to the guest that the host did not intend to expose. So far, we have been taking care of (1), but not (2), and our commentary describing (1) was somewhat confusing. This commit attempts to factor out the checks of both into a common function, and if we don't pass the check, we won't attempt any PMD mappings for neither hugetlbfs nor THP. Note that we used to only check the alignment for THP, not for hugetlbfs, but as far as I can tell the check needs to be applied to both scenarios. Cc: Ralph Palutke Cc: Lukas Braun Reported-by: Lukas Braun Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 107352a24900fb458152b92a4e72fbdc83fd5510 Author: Marc Zyngier Date: Tue Dec 18 14:59:09 2018 +0000 arm/arm64: KVM: vgic: Force VM halt when changing the active state of GICv3 PPIs/SGIs We currently only halt the guest when a vCPU messes with the active state of an SPI. This is perfectly fine for GICv2, but isn't enough for GICv3, where all vCPUs can access the state of any other vCPU. Let's broaden the condition to include any GICv3 interrupt that has an active state (i.e. all but LPIs). Cc: stable@vger.kernel.org Reviewed-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 599d79dcd18fa0f88ae15b7042c9d6b011a678b2 Author: Marc Zyngier Date: Tue Dec 4 10:44:22 2018 +0000 arm64: KVM: Add trapped system register access tracepoint We're pretty blind when it comes to system register tracing, and rely on the ESR value displayed by kvm_handle_sys, which isn't much. Instead, let's add an actual name to the sysreg entries, so that we can finally print it as we're about to perform the access itself. The new tracepoint is conveniently called kvm_sys_access. Signed-off-by: Marc Zyngier commit da6f16662a6eba3de0d1a39f3b8913d38754bb2b Author: Christoffer Dall Date: Thu Nov 29 12:20:01 2018 +0100 KVM: arm64: Make vcpu const in vcpu_read_sys_reg vcpu_read_sys_reg should not be modifying the VCPU structure. Eventually, to handle EL2 sysregs for nested virtualization, we will call vcpu_read_sys_reg from places that have a const vcpu pointer, which will complain about the lack of the const modifier on the read path. Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 6e14ef1d12dc26ab4f6bef9d47e6906002f0a1ba Author: Christoffer Dall Date: Tue Dec 11 09:54:11 2018 +0100 KVM: arm/arm64: arch_timer: Simplify kvm_timer_vcpu_terminate kvm_timer_vcpu_terminate can only be called in two scenarios: 1. As part of cleanup during a failed VCPU create 2. As part of freeing the whole VM (struct kvm refcount == 0) In the first case, we cannot have programmed any timers or mapped any IRQs, and therefore we do not have to cancel anything or unmap anything. In the second case, the VCPU will have gone through kvm_timer_vcpu_put, which will have canceled the emulated physical timer's hrtimer, and we do not need to that here as well. We also do not care if the irq is recorded as mapped or not in the VGIC data structure, because the whole VM is going away. That leaves us only with having to ensure that we cancel the bg_timer if we were blocking the last time we called kvm_timer_vcpu_put(). Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 8a411b060f820140e9894239fde5819bb213bef0 Author: Christoffer Dall Date: Tue Nov 27 13:48:08 2018 +0100 KVM: arm/arm64: Remove arch timer workqueue The use of a work queue in the hrtimer expire function for the bg_timer is a leftover from the time when we would inject interrupts when the bg_timer expired. Since we are no longer doing that, we can instead call kvm_vcpu_wake_up() directly from the hrtimer function and remove all workqueue functionality from the arch timer code. Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 71a7e47f39a2fb971ef9934e98ba089581eff641 Author: Christoffer Dall Date: Mon Dec 3 21:31:24 2018 +0100 KVM: arm/arm64: Fixup the kvm_exit tracepoint The kvm_exit tracepoint strangely always reported exits as being IRQs. This seems to be because either the __print_symbolic or the tracepoint macros use a variable named idx. Take this chance to update the fields in the tracepoint to reflect the concepts in the arm64 architecture that we pass to the tracepoint and move the exception type table to the same location and header files as the exits code. We also clear out the exception code to 0 for IRQ exits (which translates to UNKNOWN in text) to make it slighyly less confusing to parse the trace output. Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 9009782a4937ad0f4a4be6945080d7fa77fa4092 Author: Christoffer Dall Date: Sat Dec 1 13:21:47 2018 -0800 KVM: arm/arm64: vgic: Consider priority and active state for pending irq When checking if there are any pending IRQs for the VM, consider the active state and priority of the IRQs as well. Otherwise we could be continuously scheduling a guest hypervisor without it seeing an IRQ. Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit c23b2e6fc4ca346018618266bcabd335c0a8a49e Author: Gustavo A. R. Silva Date: Wed Dec 12 14:11:23 2018 -0600 KVM: arm/arm64: vgic: Fix off-by-one bug in vgic_get_irq() When using the nospec API, it should be taken into account that: "...if the CPU speculates past the bounds check then * array_index_nospec() will clamp the index within the range of [0, * size)." The above is part of the header for macro array_index_nospec() in linux/nospec.h Now, in this particular case, if intid evaluates to exactly VGIC_MAX_SPI or to exaclty VGIC_MAX_PRIVATE, the array_index_nospec() macro ends up returning VGIC_MAX_SPI - 1 or VGIC_MAX_PRIVATE - 1 respectively, instead of VGIC_MAX_SPI or VGIC_MAX_PRIVATE, which, based on the original logic: /* SGIs and PPIs */ if (intid <= VGIC_MAX_PRIVATE) return &vcpu->arch.vgic_cpu.private_irqs[intid]; /* SPIs */ if (intid <= VGIC_MAX_SPI) return &kvm->arch.vgic.spis[intid - VGIC_NR_PRIVATE_IRQS]; are valid values for intid. Fix this by calling array_index_nospec() macro with VGIC_MAX_PRIVATE + 1 and VGIC_MAX_SPI + 1 as arguments for its parameter size. Fixes: 41b87599c743 ("KVM: arm/arm64: vgic: fix possible spectre-v1 in vgic_get_irq()") Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva [dropped the SPI part which was fixed separately] Signed-off-by: Marc Zyngier commit 8a363970d1dc38c4ec4ad575c862f776f468d057 Author: Theodore Ts'o Date: Wed Dec 19 12:29:13 2018 -0500 ext4: avoid declaring fs inconsistent due to invalid file handles If we receive a file handle, either from NFS or open_by_handle_at(2), and it points at an inode which has not been initialized, and the file system has metadata checksums enabled, we shouldn't try to get the inode, discover the checksum is invalid, and then declare the file system as being inconsistent. This can be reproduced by creating a test file system via "mke2fs -t ext4 -O metadata_csum /tmp/foo.img 8M", mounting it, cd'ing into that directory, and then running the following program. #define _GNU_SOURCE #include struct handle { struct file_handle fh; unsigned char fid[MAX_HANDLE_SZ]; }; int main(int argc, char **argv) { struct handle h = {{8, 1 }, { 12, }}; open_by_handle_at(AT_FDCWD, &h.fh, O_RDONLY); return 0; } Google-Bug-Id: 120690101 Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit a805622a757b6d7f65def4141d29317d8e37b8a1 Author: Theodore Ts'o Date: Wed Dec 19 12:28:13 2018 -0500 ext4: include terminating u32 in size of xattr entries when expanding inodes In ext4_expand_extra_isize_ea(), we calculate the total size of the xattr header, plus the xattr entries so we know how much of the beginning part of the xattrs to move when expanding the inode extra size. We need to include the terminating u32 at the end of the xattr entries, or else if there is uninitialized, non-zero bytes after the xattr entries and before the xattr values, the list of xattr entries won't be properly terminated. Reported-by: Steve Graham Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit d82b51c855a20eb456ac09f2f40ea98312373263 Author: Pierre-Louis Bossart Date: Sat Dec 15 14:07:23 2018 -0600 ALSA: HD-Audio: SKL+: force HDaudio legacy or SKL+ driver selection For HDaudio and Skylake drivers, add module parameter "pci_binding" When pci_binding == 0 (AUTO), the PCI class/subclass info is used to select drivers based on the presence of the DSP. pci_binding == 1 (LEGACY) forces the use of the HDAudio legacy driver, even if the DSP is present. pci_binding == 2 (ASOC) forces the use of the ASOC driver. The information on the DSP presence is bypassed. The value for the module parameter needs to be identical for both drivers. This parameter is intended as a back-up solution if the automatic detection fails or when the DSP usage fails. Such cases should be reported on the alsa-devel mailing list for analysis. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Takashi Iwai commit c337104b1a16becc486fdc95d544c835b17021db Author: Pierre-Louis Bossart Date: Sat Dec 15 14:07:22 2018 -0600 ALSA: HD-Audio: SKL+: abort probe if DSP is present and Skylake driver selected Now that the SST/Skylake driver supports per platform selectors, we can add logic to automatically select the right driver. If the Skylake driver is selected for a specific platform, and the DSP is detected at run-time based on the PCI class/subclass/prog-if information, the legacy HDaudio driver aborts the probe. This will result in a single driver probing and remove the need for modprobe blacklists. Follow-up patches will add a module parameter to bypass the logic if this automatic detection fails, or if the Skylake driver is unable to actually support the platform (firmware authentication, missing topology file, hardware issue, etc). The same mechanism will be used to conflicts generated by the same PCI ID being registered by both legacy HDAuudio and SOF drivers for Intel platforms. In other words SOF will not require changes to the HDaudio legacy. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Takashi Iwai commit 18d43c9b88eb335440c5e769eb6c2d5bc908dc61 Author: Keyon Jie Date: Tue Dec 11 15:30:27 2018 -0600 ALSA: HDA: export process_unsol_events() The SOF implementation does not rely on the hdac_bus library, however for HDMI and HDaudio codec support it does need to deal with unsolicited events. Instead of re-inventing the wheel, export this symbol to reuse this part of the library directly. Signed-off-by: Keyon Jie Signed-off-by: Pierre-Louis Bossart Signed-off-by: Takashi Iwai commit 6c503d0d88db9d57c1dc4c87175c94766b6a6c61 Author: Christoph Hellwig Date: Sun Dec 16 10:23:28 2018 +0100 sparc/iommu: fix ->map_sg return value Just decrementing the sz value will lead to an incorrect return value. Instead of just introducing a local variable switch to the standard for_each_sg helper and standard naming of the arguments. Fixes: ce65d36f3e ("sparc: remove the sparc32_dma_ops indirection") Reported-by: Guenter Roeck Signed-off-by: Christoph Hellwig Acked-by: Sam Ravnborg commit 1e2934ad7f93476e92039d4b8914d9f71789448f Author: Christoph Hellwig Date: Sun Dec 16 10:20:04 2018 +0100 sparc/io-unit: fix ->map_sg return value Just decrementing the sz value will lead to an incorrect return value. Instead of just introducing a local variable switch to the standard for_each_sg helper and standard naming of the arguments. Fixes: ce65d36f3e ("sparc: remove the sparc32_dma_ops indirection") Reported-by: Guenter Roeck Signed-off-by: Christoph Hellwig Acked-by: Sam Ravnborg commit 9ab91e7c5c514b675470d9b57393cbe455722060 Author: Christoph Hellwig Date: Fri Dec 14 15:18:08 2018 +0100 arm64: default to the direct mapping in get_arch_dma_ops Otherwise the direct mapping won't work at all given that a NULL dev->dma_ops causes a fallback. Note that we already explicitly set dev->dma_ops to dma_dummy_ops for dma-incapable devices, so this fallback should not be needed anyway. Fixes: 356da6d0cd ("dma-mapping: bypass indirect calls for dma-direct") Signed-off-by: Christoph Hellwig Reported-by: Marek Szyprowski Tested-by: Marek Szyprowski Reviewed-by: Robin Murphy commit 2b3c5a99d5f314960e00950c1782eac9361de30f Author: Firoz Khan Date: Wed Nov 14 10:02:10 2018 +0530 sh: generate uapi header and syscall table header files System call table generation script must be run to gener- ate unistd_32.h and syscall_table.h files. This patch will have changes which will invokes the script. This patch will generate unistd_32.h and syscall_table.h files by the syscall table generation script invoked by sh/Makefile and the generated files against the removed files must be identical. The generated uapi header file will be included in uapi/- asm/unistd.h and generated system call table header file will be included by kernel/syscall_32.S file. Signed-off-by: Firoz Khan Signed-off-by: Arnd Bergmann commit a0239c8eb9363d4c2c6d6411bff4e3ea744e3164 Author: Firoz Khan Date: Thu Nov 1 19:18:49 2018 +0530 sh: add system call table generation support The system call tables are in different format in all architecture and it will be difficult to manually add, modify or delete the syscall table entries in the res- pective files. To make it easy by keeping a script and which will generate the uapi header and syscall table file. This change will also help to unify the implemen- tation across all architectures. The system call table generation script is added in kernel/syscalls directory which contain the scripts to generate both uapi header file and system call table files. The syscall.tbl will be input for the scripts. syscall.tbl contains the list of available system calls along with system call number and corresponding entry point. Add a new system call in this architecture will be possible by adding new entry in the syscall.tbl file. Adding a new table entry consisting of: - System call number. - ABI. - System call name. - Entry point name. syscallhdr.sh and syscalltbl.sh will generate uapi header unistd_32.h and syscall_table.h files respectively. Both .sh files will parse the content syscall.tbl to generate the header and table files. unistd_32.h will be included by uapi/asm/unistd.h and syscall_table.h is included by kernel/syscall_32.S - the real system call table. Please note, this support is only available for 32-bit kernel, not 64-bit kernel. As I came across the 64-bit kernel is not active for long time. ARM, s390 and x86 architecuture does have similar support. I leverage their implementation to come up with a generic solution. Signed-off-by: Firoz Khan Signed-off-by: Arnd Bergmann commit 8a79633b4928cbb7cb575aa62dda0c49d37c2387 Author: Firoz Khan Date: Wed Nov 14 10:02:08 2018 +0530 sh: add __NR_syscalls along with NR_syscalls NR_syscalls macro holds the number of system call exist in sh architecture. We have to change the value of NR- _syscalls, if we add or delete a system call. One of the patch in this patch series has a script which will generate a uapi header based on syscall.tbl file. The syscall.tbl file contains the total number of system calls information. So we have two option to update NR_sy- scalls value. 1. Update NR_syscalls in asm/unistd.h manually by count- ing the no.of system calls. No need to update NR_sys- calls until we either add a new system call or delete existing system call. 2. We can keep this feature it above mentioned script, that will count the number of syscalls and keep it in a generated file. In this case we don't need to expli- citly update NR_syscalls in asm/unistd.h file. The 2nd option will be the recommended one. For that, I added the __NR_syscalls macro in uapi/asm/unistd_32/64.h along with NR_syscalls which is moved to asm/unistd.h. The macro __NR_syscalls also added for making the name convention same across all architecture. While __NR_sys- calls isn't strictly part of the uapi, having it as part of the generated header to simplifies the implementation. We also need to enclose this macro with #ifdef __KERNEL__ to avoid side effects. Signed-off-by: Firoz Khan Signed-off-by: Arnd Bergmann commit 29d3c047b7038d7efce4f279e4d4165d69f6ccb9 Merge: 5a862f86b8e86 1629db9c75342 Author: David S. Miller Date: Wed Dec 19 08:41:45 2018 -0800 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next Johan Hedberg says: ==================== pull request: bluetooth-next 2018-12-19 Here's the main bluetooth-next pull request for 4.21: - Multiple fixes & improvements for Broadcom-based controllers - New USB ID for an Intel controller - Support for new Broadcom controller variants - Use DEFINE_SHOW_ATTRIBUTE to simplify debugfs code - Eliminate confusing "last event is not cmd complete" warning message - Added vendor suspend/resume support for H:5 (3-Wire UART) controllers - Various other smaller improvements & fixes Please let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller commit 5a862f86b8e86562fc8532160c5530a13e1e944b Merge: 33f18c96afdf4 d359bbce0601c Author: David S. Miller Date: Wed Dec 19 08:36:18 2018 -0800 Merge tag 'mac80211-next-for-davem-2018-12-19' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg says: ==================== This time we have too many changes to list, highlights: * virt_wifi - wireless control simulation on top of another network interface * hwsim configurability to test capabilities similar to real hardware * various mesh improvements * various radiotap vendor data fixes in mac80211 * finally the nl_set_extack_cookie_u64() we talked about previously, used for * peer measurement APIs, right now only with FTM (flight time measurement) for location * made nl80211 radio/interface announcements more complete * various new HE (802.11ax) things: updates, TWT support, ... ==================== Signed-off-by: David S. Miller commit 3a762de55b4ede47a5369f57d0f92979738be638 Author: Ming Lei Date: Thu Dec 20 00:29:15 2018 +0800 block: save irq state in blkg_lookup_create() blkg_lookup_create() may be called from pool_map() in which irq state is saved, so we have to do that in blkg_lookup_create(). Otherwise, the following lockdep warning can be triggered: [ 104.258537] ================================ [ 104.259129] WARNING: inconsistent lock state [ 104.259725] 4.20.0-rc6+ #545 Not tainted [ 104.260268] -------------------------------- [ 104.260865] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. [ 104.261727] swapper/49/0 [HC0[0]:SC1[1]:HE0:SE0] takes: [ 104.262444] 00000000db365b5d (&(&pool->lock)->rlock#3){+.?.}, at: thin_endio+0xcf/0x2a3 [dm_thin_pool] [ 104.263747] {SOFTIRQ-ON-W} state was registered at: [ 104.264417] _raw_spin_unlock_irq+0x29/0x4c [ 104.265014] blkg_lookup_create+0xdc/0xe6 [ 104.265609] bio_associate_blkg_from_css+0xd3/0x13f [ 104.266312] bio_associate_blkg+0x15a/0x1bb [ 104.266913] pool_map+0xe8/0x103 [dm_thin_pool] [ 104.267572] __map_bio+0x98/0x29c [dm_mod] [ 104.268162] __split_and_process_non_flush+0x29e/0x306 [dm_mod] [ 104.269003] __split_and_process_bio+0x16a/0x25b [dm_mod] [ 104.269971] __dm_make_request.isra.14+0xdc/0x124 [dm_mod] [ 104.270973] generic_make_request+0x3f5/0x68b [ 104.271676] process_prepared_mapping+0x166/0x1ef [dm_thin_pool] [ 104.272531] schedule_zero+0x239/0x273 [dm_thin_pool] [ 104.273245] process_cell+0x60c/0x6f1 [dm_thin_pool] [ 104.273967] do_worker+0x60c/0xca8 [dm_thin_pool] [ 104.274635] process_one_work+0x4eb/0x834 [ 104.275203] worker_thread+0x318/0x484 [ 104.275740] kthread+0x1d1/0x1e1 [ 104.276203] ret_from_fork+0x3a/0x50 [ 104.276714] irq event stamp: 170003 [ 104.277201] hardirqs last enabled at (170002): [] _raw_spin_unlock_irqrestore+0x44/0x6b [ 104.278535] hardirqs last disabled at (170003): [] _raw_spin_lock_irqsave+0x20/0x55 [ 104.280273] softirqs last enabled at (169978): [] irq_enter+0x4c/0x73 [ 104.281617] softirqs last disabled at (169979): [] irq_exit+0x7e/0x11d [ 104.282744] [ 104.282744] other info that might help us debug this: [ 104.283640] Possible unsafe locking scenario: [ 104.283640] [ 104.284452] CPU0 [ 104.284803] ---- [ 104.285150] lock(&(&pool->lock)->rlock#3); [ 104.285762] [ 104.286130] lock(&(&pool->lock)->rlock#3); [ 104.286750] [ 104.286750] *** DEADLOCK *** [ 104.286750] [ 104.287564] no locks held by swapper/49/0. [ 104.288129] [ 104.288129] stack backtrace: [ 104.288738] CPU: 49 PID: 0 Comm: swapper/49 Not tainted 4.20.0-rc6+ #545 [ 104.289700] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.10.2-2.fc27 04/01/2014 [ 104.290858] Call Trace: [ 104.291204] [ 104.291502] dump_stack+0x9a/0xe6 [ 104.291968] mark_lock+0x56c/0x7a6 [ 104.292442] ? check_usage_backwards+0x209/0x209 [ 104.293086] __lock_acquire+0x400/0x15bf [ 104.293662] ? check_chain_key+0x150/0x1aa [ 104.294236] lock_acquire+0x1a6/0x1e3 [ 104.294768] ? thin_endio+0xcf/0x2a3 [dm_thin_pool] [ 104.295444] ? _raw_spin_unlock_irqrestore+0x44/0x6b [ 104.296143] ? process_prepared_discard_fail+0x36/0x36 [dm_thin_pool] [ 104.297031] _raw_spin_lock_irqsave+0x46/0x55 [ 104.297659] ? thin_endio+0xcf/0x2a3 [dm_thin_pool] [ 104.298335] thin_endio+0xcf/0x2a3 [dm_thin_pool] [ 104.298997] ? process_prepared_discard_fail+0x36/0x36 [dm_thin_pool] [ 104.299886] ? check_flags+0x20a/0x20a [ 104.300408] ? lock_acquire+0x1a6/0x1e3 [ 104.300954] ? process_prepared_discard_fail+0x36/0x36 [dm_thin_pool] [ 104.301865] clone_endio+0x1bb/0x22d [dm_mod] [ 104.302491] ? disable_write_zeroes+0x20/0x20 [dm_mod] [ 104.303200] ? bio_disassociate_blkg+0xc6/0x15f [ 104.303836] ? bio_endio+0x2b2/0x2da [ 104.304349] clone_endio+0x1f3/0x22d [dm_mod] [ 104.304978] ? disable_write_zeroes+0x20/0x20 [dm_mod] [ 104.305709] ? bio_disassociate_blkg+0xc6/0x15f [ 104.306333] ? bio_endio+0x2b2/0x2da [ 104.306853] clone_endio+0x1f3/0x22d [dm_mod] [ 104.307476] ? disable_write_zeroes+0x20/0x20 [dm_mod] [ 104.308185] ? bio_disassociate_blkg+0xc6/0x15f [ 104.308817] ? bio_endio+0x2b2/0x2da [ 104.309319] blk_update_request+0x2de/0x4cc [ 104.309927] blk_mq_end_request+0x2a/0x183 [ 104.310498] blk_done_softirq+0x16a/0x1a6 [ 104.311051] ? blk_softirq_cpu_dead+0xe2/0xe2 [ 104.311653] ? __lock_is_held+0x2a/0x87 [ 104.312186] __do_softirq+0x250/0x4e8 [ 104.312705] irq_exit+0x7e/0x11d [ 104.313157] call_function_single_interrupt+0xf/0x20 [ 104.313860] [ 104.314163] RIP: 0010:native_safe_halt+0x2/0x3 [ 104.314792] Code: 63 02 df f0 83 44 24 fc 00 48 89 df e8 cc 3f 7a ff 48 8b 03 a8 08 74 0b 65 81 25 9d 31 45 7e ff ff ff 7f 5b 5d 41 5c c3 fb f4 f4 c3 0f 1f 44 00 00 41 56 41 55 41 54 55 53 e8 a2 0d 5c ff e8 [ 104.317339] RSP: 0018:ffff888106c9fdc0 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff04 [ 104.318390] RAX: 1ffff11020d92100 RBX: 0000000000000000 RCX: ffffffff81159ac7 [ 104.319366] RDX: 1ffffffff05d5e69 RSI: 0000000000000007 RDI: ffff888106c90d1c [ 104.320339] RBP: 0000000000000000 R08: dffffc0000000000 R09: 0000000000000001 [ 104.321313] R10: ffffed1025d57ba0 R11: ffffed1025d57b9f R12: 1ffff11020d93fbf [ 104.322328] R13: 0000000000000031 R14: ffff888106c90040 R15: 0000000000000000 [ 104.323307] ? lockdep_hardirqs_on+0x26b/0x278 [ 104.323927] default_idle+0xd9/0x1a8 [ 104.324427] do_idle+0x162/0x2b2 [ 104.324891] ? arch_cpu_idle_exit+0x28/0x28 [ 104.325467] ? mark_held_locks+0x28/0x7f [ 104.326031] ? _raw_spin_unlock_irqrestore+0x44/0x6b [ 104.326719] cpu_startup_entry+0x1d/0x1f [ 104.327261] start_secondary+0x2cb/0x308 [ 104.327806] ? set_cpu_sibling_map+0x8a3/0x8a3 [ 104.328421] secondary_startup_64+0xa4/0xb0 Fixes: b978962ad4f7f9 ("blkcg: update blkg_lookup_create() to do locking") Cc: Mike Snitzer Cc: Dennis Zhou Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit dbe3ece1287dafe4113c64ada3113c39f344c64a Author: Jens Axboe Date: Wed Dec 19 09:13:34 2018 -0700 dm: don't reuse bio for flushes DM currently has a statically allocated bio that it uses to issue empty flushes. It doesn't submit this bio, it just uses it for maintaining state while setting up clones. Multiple users can access this bio at the same time. This wasn't previously an issue, even if it was a bit iffy, but with the blkg associations it can become one. We setup the blkg association, then clone bio's and submit, then remove the blkg assocation again. But since we can have multiple tasks doing this at the same time, against multiple blkg's, then we can either lose references to a blkg, or put it twice. The latter causes complaints on the percpu ref being <= 0 when released, and can cause use-after-free as well. Ming reports that xfstest generic/475 triggers this: ------------[ cut here ]------------ percpu ref (blkg_release) <= 0 (0) after switching to atomic WARNING: CPU: 13 PID: 0 at lib/percpu-refcount.c:155 percpu_ref_switch_to_atomic_rcu+0x2c9/0x4a0 Switch to just using an on-stack bio for this, and get rid of the embedded bio. Fixes: 5cdf2e3fea5e ("blkcg: associate blkg when associating a device") Reported-by: Ming Lei Tested-by: Ming Lei Reviewed-by: Mike Snitzer Signed-off-by: Jens Axboe commit 499aeb45b2e225e423ef333ec68bd9b33a42c8be Merge: cd19181bf9ad4 604c01d567cb9 Author: Jens Axboe Date: Wed Dec 19 08:08:41 2018 -0700 Merge branch 'nvme-4.21' of git://git.infradead.org/nvme into for-4.21/block Pull last batch of NVMe updates for 4.21 from Christoph: "This contains a series from Sagi to restore poll support for nvme-rdma, a new tracepoint from yupeng and various fixes." * 'nvme-4.21' of git://git.infradead.org/nvme: nvme-pci: trace SQ status on completions nvme-rdma: implement polling queue map nvme-fabrics: allow user to pass in nr_poll_queues nvme-fabrics: allow nvmf_connect_io_queue to poll nvme-core: optionally poll sync commands block: make request_to_qc_t public nvme-tcp: fix spelling mistake "attepmpt" -> "attempt" nvme-tcp: fix endianess annotations nvmet-tcp: fix endianess annotations nvme-pci: refactor nvme_poll_irqdisable to make sparse happy nvme-pci: only set nr_maps to 2 if poll queues are supported nvmet: use a macro for default error location nvmet: fix comparison of a u16 with -1 commit 57ce8ba0fd3a95bf29ed741df1c52bd591bf43ff Author: Geert Uytterhoeven Date: Mon Dec 3 13:20:47 2018 +0100 openrisc: Fix broken paths to arch/or32 OpenRISC was mainlined as "openrisc", not "or32". vmlinux.lds is generated from vmlinux.lds.S. Signed-off-by: Geert Uytterhoeven Signed-off-by: Stafford Horne commit 4f4b374332ec0ae9c738ff8ec9bed5cd97ff9adc Author: Daniel Vetter Date: Wed Dec 19 13:39:09 2018 +0100 sysfs: Disable lockdep for driver bind/unbind files This is the much more correct fix for my earlier attempt at: https://lkml.org/lkml/2018/12/10/118 Short recap: - There's not actually a locking issue, it's just lockdep being a bit too eager to complain about a possible deadlock. - Contrary to what I claimed the real problem is recursion on kn->count. Greg pointed me at sysfs_break_active_protection(), used by the scsi subsystem to allow a sysfs file to unbind itself. That would be a real deadlock, which isn't what's happening here. Also, breaking the active protection means we'd need to manually handle all the lifetime fun. - With Rafael we discussed the task_work approach, which kinda works, but has two downsides: It's a functional change for a lockdep annotation issue, and it won't work for the bind file (which needs to get the errno from the driver load function back to userspace). - Greg also asked why this never showed up: To hit this you need to unregister a 2nd driver from the unload code of your first driver. I guess only gpus do that. The bug has always been there, but only with a recent patch series did we add more locks so that lockdep built a chain from unbinding the snd-hda driver to the acpi_video_unregister call. Full lockdep splat: [12301.898799] ============================================ [12301.898805] WARNING: possible recursive locking detected [12301.898811] 4.20.0-rc7+ #84 Not tainted [12301.898815] -------------------------------------------- [12301.898821] bash/5297 is trying to acquire lock: [12301.898826] 00000000f61c6093 (kn->count#39){++++}, at: kernfs_remove_by_name_ns+0x3b/0x80 [12301.898841] but task is already holding lock: [12301.898847] 000000005f634021 (kn->count#39){++++}, at: kernfs_fop_write+0xdc/0x190 [12301.898856] other info that might help us debug this: [12301.898862] Possible unsafe locking scenario: [12301.898867] CPU0 [12301.898870] ---- [12301.898874] lock(kn->count#39); [12301.898879] lock(kn->count#39); [12301.898883] *** DEADLOCK *** [12301.898891] May be due to missing lock nesting notation [12301.898899] 5 locks held by bash/5297: [12301.898903] #0: 00000000cd800e54 (sb_writers#4){.+.+}, at: vfs_write+0x17f/0x1b0 [12301.898915] #1: 000000000465e7c2 (&of->mutex){+.+.}, at: kernfs_fop_write+0xd3/0x190 [12301.898925] #2: 000000005f634021 (kn->count#39){++++}, at: kernfs_fop_write+0xdc/0x190 [12301.898936] #3: 00000000414ef7ac (&dev->mutex){....}, at: device_release_driver_internal+0x34/0x240 [12301.898950] #4: 000000003218fbdf (register_count_mutex){+.+.}, at: acpi_video_unregister+0xe/0x40 [12301.898960] stack backtrace: [12301.898968] CPU: 1 PID: 5297 Comm: bash Not tainted 4.20.0-rc7+ #84 [12301.898974] Hardware name: Hewlett-Packard HP EliteBook 8460p/161C, BIOS 68SCF Ver. F.01 03/11/2011 [12301.898982] Call Trace: [12301.898989] dump_stack+0x67/0x9b [12301.898997] __lock_acquire+0x6ad/0x1410 [12301.899003] ? kernfs_remove_by_name_ns+0x3b/0x80 [12301.899010] ? find_held_lock+0x2d/0x90 [12301.899017] ? mutex_spin_on_owner+0xe4/0x150 [12301.899023] ? find_held_lock+0x2d/0x90 [12301.899030] ? lock_acquire+0x90/0x180 [12301.899036] lock_acquire+0x90/0x180 [12301.899042] ? kernfs_remove_by_name_ns+0x3b/0x80 [12301.899049] __kernfs_remove+0x296/0x310 [12301.899055] ? kernfs_remove_by_name_ns+0x3b/0x80 [12301.899060] ? kernfs_name_hash+0xd/0x80 [12301.899066] ? kernfs_find_ns+0x6c/0x100 [12301.899073] kernfs_remove_by_name_ns+0x3b/0x80 [12301.899080] bus_remove_driver+0x92/0xa0 [12301.899085] acpi_video_unregister+0x24/0x40 [12301.899127] i915_driver_unload+0x42/0x130 [i915] [12301.899160] i915_pci_remove+0x19/0x30 [i915] [12301.899169] pci_device_remove+0x36/0xb0 [12301.899176] device_release_driver_internal+0x185/0x240 [12301.899183] unbind_store+0xaf/0x180 [12301.899189] kernfs_fop_write+0x104/0x190 [12301.899195] __vfs_write+0x31/0x180 [12301.899203] ? rcu_read_lock_sched_held+0x6f/0x80 [12301.899209] ? rcu_sync_lockdep_assert+0x29/0x50 [12301.899216] ? __sb_start_write+0x13c/0x1a0 [12301.899221] ? vfs_write+0x17f/0x1b0 [12301.899227] vfs_write+0xb9/0x1b0 [12301.899233] ksys_write+0x50/0xc0 [12301.899239] do_syscall_64+0x4b/0x180 [12301.899247] entry_SYSCALL_64_after_hwframe+0x49/0xbe [12301.899253] RIP: 0033:0x7f452ac7f7a4 [12301.899259] 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 aa f0 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 [12301.899273] RSP: 002b:00007ffceafa6918 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [12301.899282] RAX: ffffffffffffffda RBX: 000000000000000d RCX: 00007f452ac7f7a4 [12301.899288] RDX: 000000000000000d RSI: 00005612a1abf7c0 RDI: 0000000000000001 [12301.899295] RBP: 00005612a1abf7c0 R08: 000000000000000a R09: 00005612a1c46730 [12301.899301] R10: 000000000000000a R11: 0000000000000246 R12: 000000000000000d [12301.899308] R13: 0000000000000001 R14: 00007f452af4a740 R15: 000000000000000d Looking around I've noticed that usb and i2c already handle similar recursion problems, where a sysfs file can unbind the same type of sysfs somewhere else in the hierarchy. Relevant commits are: commit 356c05d58af05d582e634b54b40050c73609617b Author: Alan Stern Date: Mon May 14 13:30:03 2012 -0400 sysfs: get rid of some lockdep false positives commit e9b526fe704812364bca07edd15eadeba163ebfb Author: Alexander Sverdlin Date: Fri May 17 14:56:35 2013 +0200 i2c: suppress lockdep warning on delete_device Implement the same trick for driver bind/unbind. v2: Put the macro into bus.c (Greg). Reviewed-by: Rafael J. Wysocki Cc: Ramalingam C Cc: Arend van Spriel Cc: Andy Shevchenko Cc: Geert Uytterhoeven Cc: Bartosz Golaszewski Cc: Heikki Krogerus Cc: Vivek Gautam Cc: Joe Perches Signed-off-by: Daniel Vetter Signed-off-by: Greg Kroah-Hartman commit b30204640192234d18f9168f19f9cd693485b86d Author: Tom Roeder Date: Tue Dec 18 14:49:07 2018 -0800 scripts: add a tool to produce a compile_commands.json file The LLVM/Clang project provides many tools for analyzing C source code. Many of these tools are based on LibTooling (https://clang.llvm.org/docs/LibTooling.html), which depends on a database of compiler flags. The standard container for this database is compile_commands.json, which consists of a list of JSON objects, each with "directory", "file", and "command" fields. Some build systems, like cmake or bazel, produce this compilation information directly. Naturally, Makefiles don't. However, the kernel makefiles already create ..o.cmd files that contain all the information needed to build a compile_commands.json file. So, this commit adds scripts/gen_compile_commands.py, which recursively searches through a directory for ..o.cmd files and extracts appropriate compile commands from them. It writes a compile_commands.json file that LibTooling-based tools can use. By default, gen_compile_commands.py starts its search in its working directory and (over)writes compile_commands.json in the working directory. However, it also supports --output and --directory flags for out-of-tree use. Note that while gen_compile_commands.py enables the use of clang-based tools, it does not require the kernel to be compiled with clang. E.g., the following sequence of commands produces a compile_commands.json file that works correctly with LibTooling. make defconfig make scripts/gen_compile_commands.py Also note that this script is written to work correctly in both Python 2 and Python 3, so it does not specify the Python version in its first line. For an example of the utility of this script: after running gen_compile_commands.json on the latest kernel version, I was able to use Vim + the YouCompleteMe pluging + clangd to automatically jump to definitions and declarations. Obviously, cscope and ctags provide some of this functionality; the advantage of supporting LibTooling is that it opens the door to many other clang-based tools that understand the code directly and do not rely on regular expressions and heuristics. Tested: Built several recent kernel versions and ran the script against them, testing tools like clangd (for editor/LSP support) and clang-check (for static analysis). Also extracted some test .cmd files from a kernel build and wrote a test script to check that the script behaved correctly with all permutations of the --output and --directory flags. Signed-off-by: Tom Roeder Signed-off-by: Masahiro Yamada commit 9cf6533e8060d3896b88ea14b27f620e6504b84b Author: Wandrille RONCE Date: Wed Dec 19 14:52:44 2018 +0100 ALSA: hda/realtek: Enable audio jacks of ASUS UX391UA with ALC294 By default, there is no sound on Asus UX391UA on Linux. This patch adds sound support on Asus UX391UA. Tested working by three different users. The problem has also been described at https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1784485 Signed-off-by: Wandrille RONCE Cc: Signed-off-by: Takashi Iwai commit 1629db9c75342325868243d6bca5853017d91cf8 Author: Johan Hedberg Date: Tue Nov 27 11:37:46 2018 +0200 Bluetooth: Fix unnecessary error message for HCI request completion In case a command which completes in Command Status was sent using the hci_cmd_send-family of APIs there would be a misleading error in the hci_get_cmd_complete function, since the code would be trying to fetch the Command Complete parameters when there are none. Avoid the misleading error and silently bail out from the function in case the received event is a command status. Signed-off-by: Johan Hedberg Acked-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 644b2e97405b0b74845e1d3c2b4fe4c34858062b Author: Takashi Sakamoto Date: Wed Dec 19 20:00:42 2018 +0900 ALSA: bebob: fix model-id of unit for Apogee Ensemble This commit fixes hard-coded model-id for an unit of Apogee Ensemble with a correct value. This unit uses DM1500 ASIC produced ArchWave AG (formerly known as BridgeCo AG). I note that this model supports three modes in the number of data channels in tx/rx streams; 8 ch pairs, 10 ch pairs, 18 ch pairs. The mode is switched by Vendor-dependent AV/C command, like: $ cd linux-firewire-utils $ ./firewire-request /dev/fw1 fcp 0x00ff000003dbeb0600000000 (8ch pairs) $ ./firewire-request /dev/fw1 fcp 0x00ff000003dbeb0601000000 (10ch pairs) $ ./firewire-request /dev/fw1 fcp 0x00ff000003dbeb0602000000 (18ch pairs) When switching between different mode, the unit disappears from IEEE 1394 bus, then appears on the bus with different combination of stream formats. In a mode of 18 ch pairs, available sampling rate is up to 96.0 kHz, else up to 192.0 kHz. $ ./hinawa-config-rom-printer /dev/fw1 { 'bus-info': { 'adj': False, 'bmc': True, 'chip_ID': 21474898341, 'cmc': True, 'cyc_clk_acc': 100, 'generation': 2, 'imc': True, 'isc': True, 'link_spd': 2, 'max_ROM': 1, 'max_rec': 512, 'name': '1394', 'node_vendor_ID': 987, 'pmc': False}, 'root-directory': [ ['HARDWARE_VERSION', 19], [ 'NODE_CAPABILITIES', { 'addressing': {'64': True, 'fix': True, 'prv': False}, 'misc': {'int': False, 'ms': False, 'spt': True}, 'state': { 'atn': False, 'ded': False, 'drq': True, 'elo': False, 'init': False, 'lst': True, 'off': False}, 'testing': {'bas': False, 'ext': False}}], ['VENDOR', 987], ['DESCRIPTOR', 'Apogee Electronics'], ['MODEL', 126702], ['DESCRIPTOR', 'Ensemble'], ['VERSION', 5297], [ 'UNIT', [ ['SPECIFIER_ID', 41005], ['VERSION', 65537], ['MODEL', 126702], ['DESCRIPTOR', 'Ensemble']]], [ 'DEPENDENT_INFO', [ ['SPECIFIER_ID', 2037], ['VERSION', 1], [(58, 'IMMEDIATE'), 16777159], [(59, 'IMMEDIATE'), 1048576], [(60, 'IMMEDIATE'), 16777159], [(61, 'IMMEDIATE'), 6291456]]]]} Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 5ae4f61f012a097df93de2285070ec8e34716d29 Author: Gustavo A. R. Silva Date: Tue Dec 18 11:52:16 2018 -0600 ALSA: emu10k1: Fix potential Spectre v1 vulnerabilities ipcm->substream is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: sound/pci/emu10k1/emufx.c:1031 snd_emu10k1_ipcm_poke() warn: potential spectre issue 'emu->fx8010.pcm' [r] (local cap) sound/pci/emu10k1/emufx.c:1075 snd_emu10k1_ipcm_peek() warn: potential spectre issue 'emu->fx8010.pcm' [r] (local cap) Fix this by sanitizing ipcm->substream before using it to index emu->fx8010.pcm Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit 0b84304ef5da92add8dc75a1b07879c5374cdb05 Author: Gustavo A. R. Silva Date: Tue Dec 18 11:18:34 2018 -0600 ALSA: rme9652: Fix potential Spectre v1 vulnerability info->channel is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: sound/pci/rme9652/hdsp.c:4100 snd_hdsp_channel_info() warn: potential spectre issue 'hdsp->channel_map' [r] (local cap) Fix this by sanitizing info->channel before using it to index hdsp->channel_map Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. Also, notice that I refactored the code a bit in order to get rid of the following checkpatch warning: ERROR: do not use assignment in if condition FILE: sound/pci/rme9652/hdsp.c:4103: if ((mapped_channel = hdsp->channel_map[info->channel]) < 0) [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Cc: stable@vger.kernel.org Signed-off-by: Gustavo A. R. Silva Signed-off-by: Takashi Iwai commit 8c32d47b151b675291ca4278bfce0ec3eb46fad8 Author: Yangtao Li Date: Fri Nov 30 21:49:51 2018 -0500 HID: debug: Change to use DEFINE_SHOW_ATTRIBUTE macro Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Jiri Kosina commit a8da3c7873ea57acb8f9cea58c0af477522965aa Author: Alexander Shiyan Date: Wed Dec 19 14:19:20 2018 +0300 serial: max310x: Fix tx_empty() callback Function max310x_tx_empty() accesses the IRQSTS register, which is cleared by IC when reading, so if there is an interrupt status, we will lose it. This patch implement the transmitter check only by the current FIFO level. Signed-off-by: Alexander Shiyan Signed-off-by: Greg Kroah-Hartman commit 22bba80500fdf624a7cfbb65fdfa97a038ae224d Author: Jonathan Bakker Date: Wed Dec 19 12:22:28 2018 +0100 Bluetooth: hci_bcm: Handle specific unknown packets after firmware loading The Broadcom controller on aries S5PV210 boards sends out a couple of unknown packets after the firmware is loaded. This will cause logging of errors such as: Bluetooth: hci0: Frame reassembly failed (-84) This is probably also the case with other boards, as there are related Android userspace patches for custom ROMs such as https://review.lineageos.org/#/c/LineageOS/android_system_bt/+/142721/ Since this appears to be intended behaviour, treated them as diagnostic packets. Note that this is another variant of commit 01d5e44ace8a ("Bluetooth: hci_bcm: Handle empty packet after firmware loading") Signed-off-by: Jonathan Bakker Signed-off-by: Paweł Chmiel Signed-off-by: Marcel Holtmann commit e3ca60d06cf37ea57d77eb834dca418f9c2dea81 Author: Paweł Chmiel Date: Wed Dec 19 12:22:46 2018 +0100 Bluetooth: btbcm: Add entry for BCM4329B1 UART bluetooth This patch adds the device ID for the BCM 4329 combo module used in the Samsung Aries based phones (Galaxy S and it's variants). ``` [ 11.508980] Bluetooth: hci0: BCM: chip id 41 [ 11.518975] Bluetooth: hci0: BCM: features 0x04 [ 11.550132] Bluetooth: hci0: BCM4329B1 [ 11.557046] Bluetooth: hci0: BCM4329B1 (002.002.023) build 0000 [ 13.737071] Bluetooth: hci0: BCM4329B1 (002.002.023) build 0744 ``` Output from hciconfig ``` hci0: Type: Primary Bus: UART BD Address: 43:29:B1:55:00:00 ACL MTU: 1021:6 SCO MTU: 64:1 UP RUNNING RX bytes:1675 acl:0 sco:0 events:145 errors:0 TX bytes:20426 acl:0 sco:0 commands:146 errors:0 Features: 0xbf 0xfe 0x8f 0xfe 0x9b 0xff 0x79 0x83 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 Link policy: RSWITCH SNIFF Link mode: SLAVE ACCEPT Name: 'aries' Class: 0x000000 Service Classes: Unspecified Device Class: Miscellaneous, HCI Version: 2.1 (0x4) Revision: 0x2e8 LMP Version: 2.1 (0x4) Subversion: 0x4217 Manufacturer: Broadcom Corporation (15) ``` Signed-off-by: Paweł Chmiel Signed-off-by: Marcel Holtmann commit 966e927bf8cc6a44f8b72582a1d6d3ffc73b12ad Author: Kangjie Lu Date: Tue Dec 18 23:04:13 2018 -0600 drivers/regulator: fix a missing check of return value If palmas_smps_read() fails, we should not use the read data in "reg" which may contain random value. The fix inserts a check for the return value of palmas_smps_read(): If it fails, we return the error code upstream and stop using "reg". Signed-off-by: Kangjie Lu Signed-off-by: Mark Brown commit fa89a4593b927b3f59c3b69379f31d3b22272e4e Author: YueHaibing Date: Wed Dec 19 14:45:09 2018 +0800 xfrm6_tunnel: Fix spi check in __xfrm6_tunnel_alloc_spi gcc warn this: net/ipv6/xfrm6_tunnel.c:143 __xfrm6_tunnel_alloc_spi() warn: always true condition '(spi <= 4294967295) => (0-u32max <= u32max)' 'spi' is u32, which always not greater than XFRM6_TUNNEL_SPI_MAX because of wrap around. So the second forloop will never reach. Signed-off-by: YueHaibing Signed-off-by: Steffen Klassert commit cc4acb1b6a86563ef5b6dc7c35d99f66d7b82557 Author: YueHaibing Date: Wed Dec 19 01:12:20 2018 +0000 xfrm: policy: remove set but not used variable 'priority' Fixes gcc '-Wunused-but-set-variable' warning: net/xfrm/xfrm_policy.c: In function 'xfrm_policy_lookup_bytype': net/xfrm/xfrm_policy.c:2079:6: warning: variable 'priority' set but not used [-Wunused-but-set-variable] It not used since commit 6be3b0db6db8 ("xfrm: policy: add inexact policy search tree infrastructure") Signed-off-by: YueHaibing Acked-by: Florian Westphal Signed-off-by: Steffen Klassert commit 75dfa87035f9a2659dd0c48af6b4d9899e79cdc9 Author: Patrick Havelange Date: Wed Dec 19 11:43:23 2018 +0100 EDAC, fsl_ddr: Add LS1021A to the list of supported hardware The Freescale ddr driver also works on the LS1021A board. Signed-off-by: Patrick Havelange Signed-off-by: Borislav Petkov Cc: Mauro Carvalho Chehab Cc: York Sun Cc: arnout.vandecappelle@essensium.com Cc: linux-edac Cc: matthew.weber@rockwellcollins.com Cc: patrick.havelange@essensium.com Link: https://lkml.kernel.org/r/20181219104323.10324-1-patrick.havelange@essensium.com commit bd2bcaa565a2c07dd0492f6172f3ab6ad27c1acc Merge: 615740fd6b0c4 2e64d317e197e Author: Thomas Gleixner Date: Wed Dec 19 11:34:49 2018 +0100 Merge branch 'clockevents/4.21' of http://git.linaro.org/people/daniel.lezcano/linux into timers/core Pull clockevents/source update from Daniel Lezcano: - Add dt-bindings for RDA8810PL SoC (Manivannan Sadhasivam) commit c410abbbacb9b378365ba17a30df08b4b9eec64f Author: Dou Liyang Date: Tue Dec 4 23:51:21 2018 +0800 genirq/affinity: Add is_managed to struct irq_affinity_desc Devices which use managed interrupts usually have two classes of interrupts: - Interrupts for multiple device queues - Interrupts for general device management Currently both classes are treated the same way, i.e. as managed interrupts. The general interrupts get the default affinity mask assigned while the device queue interrupts are spread out over the possible CPUs. Treating the general interrupts as managed is both a limitation and under certain circumstances a bug. Assume the following situation: default_irq_affinity = 4..7 So if CPUs 4-7 are offlined, then the core code will shut down the device management interrupts because the last CPU in their affinity mask went offline. It's also a limitation because it's desired to allow manual placement of the general device interrupts for various reasons. If they are marked managed then the interrupt affinity setting from both user and kernel space is disabled. That limitation was reported by Kashyap and Sumit. Expand struct irq_affinity_desc with a new bit 'is_managed' which is set for truly managed interrupts (queue interrupts) and cleared for the general device interrupts. [ tglx: Simplify code and massage changelog ] Reported-by: Kashyap Desai Reported-by: Sumit Saxena Signed-off-by: Dou Liyang Signed-off-by: Thomas Gleixner Cc: linux-pci@vger.kernel.org Cc: shivasharan.srikanteshwara@broadcom.com Cc: ming.lei@redhat.com Cc: hch@lst.de Cc: bhelgaas@google.com Cc: douliyang1@huawei.com Link: https://lkml.kernel.org/r/20181204155122.6327-3-douliyangs@gmail.com commit bec04037e4e484f41ee4d9409e40616874169d20 Author: Dou Liyang Date: Tue Dec 4 23:51:20 2018 +0800 genirq/core: Introduce struct irq_affinity_desc The interrupt affinity management uses straight cpumask pointers to convey the automatically assigned affinity masks for managed interrupts. The core interrupt descriptor allocation also decides based on the pointer being non NULL whether an interrupt is managed or not. Devices which use managed interrupts usually have two classes of interrupts: - Interrupts for multiple device queues - Interrupts for general device management Currently both classes are treated the same way, i.e. as managed interrupts. The general interrupts get the default affinity mask assigned while the device queue interrupts are spread out over the possible CPUs. Treating the general interrupts as managed is both a limitation and under certain circumstances a bug. Assume the following situation: default_irq_affinity = 4..7 So if CPUs 4-7 are offlined, then the core code will shut down the device management interrupts because the last CPU in their affinity mask went offline. It's also a limitation because it's desired to allow manual placement of the general device interrupts for various reasons. If they are marked managed then the interrupt affinity setting from both user and kernel space is disabled. To remedy that situation it's required to convey more information than the cpumasks through various interfaces related to interrupt descriptor allocation. Instead of adding yet another argument, create a new data structure 'irq_affinity_desc' which for now just contains the cpumask. This struct can be expanded to convey auxilliary information in the next step. No functional change, just preparatory work. [ tglx: Simplified logic and clarified changelog ] Suggested-by: Thomas Gleixner Suggested-by: Bjorn Helgaas Signed-off-by: Dou Liyang Signed-off-by: Thomas Gleixner Cc: linux-pci@vger.kernel.org Cc: kashyap.desai@broadcom.com Cc: shivasharan.srikanteshwara@broadcom.com Cc: sumit.saxena@broadcom.com Cc: ming.lei@redhat.com Cc: hch@lst.de Cc: douliyang1@huawei.com Link: https://lkml.kernel.org/r/20181204155122.6327-2-douliyangs@gmail.com commit c2899c3470de04823870b28646981695c0046efe Author: Thomas Gleixner Date: Tue Dec 18 16:06:53 2018 +0100 genirq/affinity: Remove excess indentation Plus other coding style issues which stood out while staring at that code. Signed-off-by: Thomas Gleixner commit 7e6d5cd88a6f4961ed2968799ef98528c13ac5f8 Author: Kunihiko Hayashi Date: Fri Dec 7 09:53:12 2018 +0900 PCI: uniphier: Add UniPhier PCIe host controller support This introduces specific glue layer for UniPhier platform to support PCIe host controller that is based on the DesignWare PCIe core, and this driver supports Root Complex (host) mode. Signed-off-by: Kunihiko Hayashi Signed-off-by: Lorenzo Pieralisi commit db67cdb04234899d0c1a734beef4bfea4c38efef Author: Kunihiko Hayashi Date: Fri Dec 7 09:53:11 2018 +0900 dt-bindings: PCI: Add UniPhier PCIe host controller description Add DT bindings for PCIe controller implemented in UniPhier SoCs when configured in Root Complex (host) mode. This controller is based on the DesignWare PCIe core. Signed-off-by: Kunihiko Hayashi Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit 9c0ef6d34fdbfb4f948b96d7611f0fd47649044e Author: Yue Wang Date: Tue Dec 18 16:04:46 2018 +0800 PCI: amlogic: Add the Amlogic Meson PCIe controller driver The Amlogic Meson PCIe host controller is based on the Synopsys DesignWare PCI core. This patch adds the driver support for Meson PCIe controller. Link: https://lore.kernel.org/linux-pci/20181218224708.GB22610@google.com/ Signed-off-by: Yue Wang Signed-off-by: Hanjie Lin [lorenzo.pieralisi@arm.com: updated coding/comment style] Signed-off-by: Lorenzo Pieralisi commit 7cd2103911018ecc6f3d2e6239ab5e00fb684d76 Author: Yue Wang Date: Tue Dec 18 16:04:45 2018 +0800 dt-bindings: PCI: meson: add DT bindings for Amlogic Meson PCIe controller The Amlogic Meson PCIe host controller is based on the Synopsys DesignWare PCI core. This patch adds documentation for the DT bindings in Meson PCIe controller. Signed-off-by: Yue Wang Signed-off-by: Hanjie Lin Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit a88c4736ea36396f4a7b1460202a8caa434238db Author: Fabrizio Castro Date: Wed Dec 19 10:06:25 2018 +0000 dt-bindings: serial: sh-sci: Document r8a774c0 bindings RZ/G2E (R8A774C0) SoC also has the R-Car Gen3 compatible SCIF and HSCIF ports, so document the SoC specific bindings. Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Reviewed-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit 6c4d975812677fdacfe657b8a1fae11de2fb4a37 Author: Fabrizio Castro Date: Wed Dec 19 10:06:24 2018 +0000 dt-bindings: serial: sh-sci: Document r8a774a1 bindings RZ/G2M (R8A774A1) SoC also has the R-Car Gen3 compatible SCIF and HSCIF ports, so document the SoC specific bindings. While at it, update the RZ/G1 and RZ/G2 family specific strings description as outdated. Signed-off-by: Fabrizio Castro Reviewed-by: Biju Das Reviewed-by: Rob Herring Reviewed-by: Simon Horman Signed-off-by: Greg Kroah-Hartman commit 2e64d317e197ec390e3914773489fcade7bbbf15 Author: Manivannan Sadhasivam Date: Mon Dec 10 23:05:44 2018 +0530 dt-bindings: timer: Document RDA8810PL SoC timer Document RDA Micro RDA8810PL SoC timer. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Rob Herring Signed-off-by: Daniel Lezcano commit ac8b6f148fc97e9e10b48bd337ef571b1d1136aa Author: Amanoel Dawod Date: Wed Dec 5 18:56:37 2018 -0500 Fonts: New Terminus large console font This patch adds an option to compile-in a high resolution and large Terminus (ter16x32) bitmap console font for use with HiDPI and Retina screens. The font was convereted from standard Terminus ter-i32b.psf (size 16x32) with the help of psftools and minor hand editing deleting useless characters. This patch is non-intrusive, no options are enabled by default so most users won't notice a thing. I am placing my changes under the GPL 2.0 just as source Terminus font. Signed-off-by: Amanoel Dawod Signed-off-by: Greg Kroah-Hartman commit 1de24f362f32b1d290385558b4f94990e36f670e Author: Daniel Bovensiepen Date: Thu Dec 6 15:52:43 2018 +0000 staging: android: ashmem: doc: Fix spelling Fixed spelling in comment section. Signed-off-by: Daniel Bovensiepen Acked-by: Joel Fernandes (Google) Signed-off-by: Greg Kroah-Hartman commit fdfaef212694a139ebd5119f9a07f2e8e24be8a6 Author: Sudip Mukherjee Date: Fri Dec 7 14:27:34 2018 +0000 char: lp: use new parport device model Modify lp driver to use the new parallel port device model. Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman commit e379c1a46068969a2b822a15dbc9a37577e1e04f Author: Sudip Mukherjee Date: Fri Dec 7 14:27:33 2018 +0000 char: lp: properly count the lp devices When the parallel port is usb based and the lp attaches to it based on LP_PARPORT_AUTO, we do get /dev/lp0 and when we remove the usb device /dev/lp0 is unregistered. If we now reconnect the usb device we get our /dev/lp0 back. But if we now disconnect and reconnect eight times we donot get any lp device and dmesg shows: lp: ignoring parallel port (max. 8) Decrement the lp_count when the device detaches as this represents the number of lp devices connected to the system. Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman commit dc34da42860d8ce01f64ac11752eecccf53c1a6c Author: Sudip Mukherjee Date: Fri Dec 7 14:27:32 2018 +0000 char: lp: use first unused lp number while registering When the parallel port is usb based and the lp attaches to it based on LP_PARPORT_AUTO, we do get /dev/lp0 and when we remove the usb device /dev/lp0 is unregistered. But if we now reconnect the usb device we get /dev/lp1, another disconnection and reconnection and we get /dev/lp2. Use the port number array to find the first unused lp number and use that to register the lp device with the parallel port. Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman commit d6318c0e8318c200aa95b50769d3635907381c08 Author: Sudip Mukherjee Date: Fri Dec 7 14:27:31 2018 +0000 char: lp: detach the device when parallel port is removed When the parallel port is usb based and the lp attaches to it, we do get /dev/lp0, but when we remove the usb device and the parallel port is gone, we are still left with /dev/lp0. Unregister the device properly in the detach routine based on the port number it has connected to. Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman commit 0edf39d2c7dbb4947358dd102b6ff35eaaa92d68 Author: Sudip Mukherjee Date: Fri Dec 7 14:27:30 2018 +0000 char: lp: introduce list to save port number When we are registering lp in LP_PARPORT_AUTO mode, we are not keeping any record of the parallel port number to which lp is connecting. Add an array to save the port number to it. Signed-off-by: Sudip Mukherjee Signed-off-by: Greg Kroah-Hartman commit 2e79c1874968b8fdbf578a2a364ec9b6263c77ca Author: YueHaibing Date: Mon Dec 10 15:25:13 2018 +0800 bus: qcom: remove duplicated include from qcom-ebi2.c Remove duplicated include. Signed-off-by: YueHaibing Acked-by: Linus Walleij Signed-off-by: Greg Kroah-Hartman commit d32dcc6c6970667e438e2b1fec92816d98dcb29f Author: Yangtao Li Date: Sat Dec 15 03:45:26 2018 -0500 PM / Domains: remove define_genpd_open_function() and define_genpd_debugfs_fops() We already have the DEFINE_SHOW_ATTRIBUTE, There is no need to define such a macro, so remove define_genpd_open_function and define_genpd_debugfs_fops. Convert them to DEFINE_SHOW_ATTRIBUTE. Signed-off-by: Yangtao Li Acked-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 8234f6734c5d74ac794e5517437f51c57d65f865 Author: Vincent Guittot Date: Fri Dec 14 15:22:25 2018 +0100 PM-runtime: Switch autosuspend over to using hrtimers PM-runtime uses the timer infrastructure for autosuspend. This implies that the minimum time before autosuspending a device is in the range of 1 tick included to 2 ticks excluded -On arm64 this means between 4ms and 8ms with default jiffies configuration -And on arm, it is between 10ms and 20ms These values are quite high for embedded systems which sometimes want the duration to be in the range of 1 ms. It is possible to switch autosuspend over to using hrtimers to get finer granularity for short durations and take advantage of slack to retain some margins and get long timeouts with minimum wakeups. On an arm64 platform that uses 1ms for autosuspending timeout of its GPU, idle power is reduced by 10% with hrtimer. The latency impact on arm64 hikey octo cores is: - mark_last_busy: from 1.11 us to 1.25 us - rpm_suspend: from 15.54 us to 15.38 us [Only the code path of rpm_suspend() that starts hrtimer has been measured.] arm64 image (arm64 default defconfig) decreases by around 3KB with following details: $ size vmlinux-timer text data bss dec hex filename 12034646 6869268 386840 19290754 1265a82 vmlinux $ size vmlinux-hrtimer text data bss dec hex filename 12030550 6870164 387032 19287746 1264ec2 vmlinux The latency impact on arm 32bits snowball dual cores is : - mark_last_busy: from 0.31 us usec to 0.77 us - rpm_suspend: from 6.83 us to 6.67 usec The increase of the image for snowball platform that I used for testing performance impact, is neglictable (244B). $ size vmlinux-timer text data bss dec hex filename 7157961 2119580 264120 9541661 91981d build-ux500/vmlinux size vmlinux-hrtimer text data bss dec hex filename 7157773 2119884 264248 9541905 919911 vmlinux-hrtimer And arm 32bits image (multi_v7_defconfig) increases by around 1.7KB with following details: $ size vmlinux-timer text data bss dec hex filename 13304443 6803420 402768 20510631 138f7a7 vmlinux $ size vmlinux-hrtimer text data bss dec hex filename 13304299 6805276 402768 20512343 138fe57 vmlinux Signed-off-by: Vincent Guittot Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 8995fa1e1c9bcb76d407b860770e640b60ed8c76 Author: Wen Yang Date: Mon Dec 10 19:36:07 2018 +0800 VMCI: Use memdup_user() rather than duplicating its implementation Reuse existing functionality from memdup_user() instead of keeping duplicate source code. This issue was detected by using the Coccinelle software. Signed-off-by: Wen Yang CC: Arnd Bergmann CC: Greg Kroah-Hartman CC: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit f88fd666051b08eb3f3118e2dd8508bf0247af4c Author: Rob Herring Date: Wed Dec 5 13:50:19 2018 -0600 char/rtc: 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. The open coded iterating thru the child node names is converted to use for_each_child_of_node() instead. Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit 15b3048aeed8bf8232156456c884ae94ed52d6cd Author: Wenwen Wang Date: Tue Dec 4 09:16:41 2018 -0600 misc: mic: fix a DMA pool free failure In _scif_prog_signal(), a DMA pool is allocated if the MIC Coprocessor is not X100, i.e., the boolean variable 'x100' is false. This DMA pool will be freed eventually through the callback function scif_prog_signal_cb() with the parameter of 'status', which actually points to the start of DMA pool. Specifically, in scif_prog_signal_cb(), the 'ep' field and the 'src_dma_addr' field of 'status' are used to free the DMA pool by invoking dma_pool_free(). Given that 'status' points to the start address of the DMA pool, both 'status->ep' and 'status->src_dma_addr' are in the DMA pool. And so, the device has the permission to access them. Even worse, a malicious device can modify them. As a result, dma_pool_free() will not succeed. To avoid the above issue, this patch introduces a new data structure, i.e., scif_cb_arg, to store the arguments required by the call back function. A variable 'cb_arg' is allocated in _scif_prog_signal() to pass the arguments. 'cb_arg' will be freed after dma_pool_free() in scif_prog_signal_cb(). Signed-off-by: Wenwen Wang Signed-off-by: Greg Kroah-Hartman commit afdd273e269ca8dee3c70c150d96b4de4f83d39e Author: Chen-Yu Tsai Date: Mon Dec 17 12:04:48 2018 +0800 ARM: dts: sunxi: Enable Broadcom-based Bluetooth for multiple boards This patch adds the Bluetooth node, and the underlying UART node if it's missing, to the board device tree file for several boards. The LPO clock is also added to the WiFi side's power sequencing node if it's missing, to correctly represent the shared connections. There is also a PCM connection for Bluetooth, but this is not covered in this patch. These boards all have a WiFi+BT module from AMPAK, which contains one or two Broadcom chips, depending on the model. The older AP6210 contains two, while the newer AP6212 and AP6330 contain just one, as they use two-in-one combo chips. The Bluetooth side of the module is always connected to a UART on the same pingroup as the SDIO pins for the WiFi side, in a 4 wire configuration. Power to the VBAT and VDDIO pins are provided either by the PMIC, using one or several of its regulator outputs, or other fixed regulators on the board. The VBAT and VDDIO pins are shared with the WiFi side, which would correspond to vmmc-supply and vqmmc-supply in the mmc host node. A clock output from the SoC or the external X-Powers RTC provides the LPO low power clock at 32.768 kHz. All the boards covered in this patch are ones that do not require extra changes to the SoC's dtsi file. For the remaining boards that I have worked on, properties or device nodes for the LPO clock's source are missing. For the Cubietruck, the LPO clock is fed from CLK_OUT_A, which needs to be muxed on pin PI12. This can be represented in multiple ways. This patch puts the pinctrl property in the pin controller node. This is due to limitations in Linux, where pinmux settings, even the same one, can not be shared by multiple devices. Thus we cannot put it in both the WiFi and Bluetooth device nodes. Putting it the CCU node is another option, but Linux's CCU driver does not handle pinctrl. Also the pin controller is guaranteed to be initialized after the CCU, when clocks are available. And any other devices that use muxed pins are guaranteed to be initialized after the pin controller. Thus having the CLK_OUT_A pinmux reference be in the pin controller node is a good choice without having to deal with implementation issues. Acked-by: Maxime Ripard Signed-off-by: Chen-Yu Tsai commit c266a2b4407af7a6fc39f449782aa5c0be48be5a Author: Chen-Yu Tsai Date: Mon Dec 17 12:04:49 2018 +0800 arm64: dts: allwinner: a64: bananapi-m64: Add Bluetooth device node The AP6212 is based on the Broadcom BCM43430 or BCM43438. The WiFi side identifies as BCM43430, while the Bluetooth side identifies as BCM43438. The Bluetooth side is connected to UART1 in a 4 wire configuration. Same as the WiFi side, due to being the same chip and package, DLDO2 provides overall power via VBAT, and DLDO4 provides I/O power via VDDIO. The RTC clock output provides the LPO low power clock at 32.768 kHz. This patch enables Bluetooth on this board, and also adds the missing LPO clock on the WiFi side. There is also a PCM connection for Bluetooth, but this is not covered here. Acked-by: Maxime Ripard Signed-off-by: Chen-Yu Tsai commit b9d93594c7679c108ea41dec731df6f986786a19 Author: Dan Carpenter Date: Fri Dec 7 09:00:46 2018 +0300 ptp: fix an IS_ERR() vs NULL check We recently modified pps_register_source() to return error pointers instead of NULL but it seems like there was a merge issue and part of the commit was lost. Anyway, the ptp_clock_register() function needs to be updated to check for IS_ERR() as well. Fixes: 3b1ad360acad ("pps: using ERR_PTR instead of NULL while pps_register_source fails") Signed-off-by: Dan Carpenter Acked-by: Richard Cochran Signed-off-by: Greg Kroah-Hartman commit b7b69fb840f50d7037b3ab0fd95a3a89086c8fad Author: Maxime Ripard Date: Fri Dec 14 10:55:38 2018 +0100 ARM: dts: suniv: Fix improper bindings include patch The clock and reset bindings are going through different trees, and while the patch doesn't contain any value defined in that header, it still includes those files and result in a build breakage when building the DT without the matching clock and reset patches applied. Signed-off-by: Maxime Ripard Signed-off-by: Chen-Yu Tsai commit 5215b2e952f3f94d74cac1a59494eb8ac647e216 Author: jjian zhou Date: Tue Dec 18 20:33:18 2018 +0800 mmc: mediatek: Add MMC_CAP_SDIO_IRQ support This patch enables support SDIO IRQs. It enables MMC_CAP_SDIO_IRQ & MMC_CAP2_SDIO_IRQ_NOTHREAD and implement the ->ack_sdio_irq callback. Signed-off-by: Jjian Zhou Signed-off-by: Chaotian Jing Signed-off-by: Yong Mao Signed-off-by: Ulf Hansson commit fdd669684655c07dacbdb0d753fd13833de69a33 Author: Christian Borntraeger Date: Wed Dec 12 14:45:18 2018 +0100 genwqe: Fix size check Calling the test program genwqe_cksum with the default buffer size of 2MB triggers the following kernel warning on s390: WARNING: CPU: 30 PID: 9311 at mm/page_alloc.c:3189 __alloc_pages_nodemask+0x45c/0xbe0 CPU: 30 PID: 9311 Comm: genwqe_cksum Kdump: loaded Not tainted 3.10.0-957.el7.s390x #1 task: 00000005e5d13980 ti: 00000005e7c6c000 task.ti: 00000005e7c6c000 Krnl PSW : 0704c00180000000 00000000002780ac (__alloc_pages_nodemask+0x45c/0xbe0) R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 EA:3 Krnl GPRS: 00000000002932b8 0000000000b73d7c 0000000000000010 0000000000000009 0000000000000041 00000005e7c6f9b8 0000000000000001 00000000000080d0 0000000000000000 0000000000b70500 0000000000000001 0000000000000000 0000000000b70528 00000000007682c0 0000000000277df2 00000005e7c6f9a0 Krnl Code: 000000000027809e: de7195001000 ed 1280(114,%r9),0(%r1) 00000000002780a4: a774fead brc 7,277dfe #00000000002780a8: a7f40001 brc 15,2780aa >00000000002780ac: 92011000 mvi 0(%r1),1 00000000002780b0: a7f4fea7 brc 15,277dfe 00000000002780b4: 9101c6b6 tm 1718(%r12),1 00000000002780b8: a784ff3a brc 8,277f2c 00000000002780bc: a7f4fe2e brc 15,277d18 Call Trace: ([<0000000000277df2>] __alloc_pages_nodemask+0x1a2/0xbe0) [<000000000013afae>] s390_dma_alloc+0xfe/0x310 [<000003ff8065f362>] __genwqe_alloc_consistent+0xfa/0x148 [genwqe_card] [<000003ff80658f7a>] genwqe_mmap+0xca/0x248 [genwqe_card] [<00000000002b2712>] mmap_region+0x4e2/0x778 [<00000000002b2c54>] do_mmap+0x2ac/0x3e0 [<0000000000292d7e>] vm_mmap_pgoff+0xd6/0x118 [<00000000002b081c>] SyS_mmap_pgoff+0xdc/0x268 [<00000000002b0a34>] SyS_old_mmap+0x8c/0xb0 [<000000000074e518>] sysc_tracego+0x14/0x1e [<000003ffacf87dc6>] 0x3ffacf87dc6 turns out the check in __genwqe_alloc_consistent uses "> MAX_ORDER" while the mm code uses ">= MAX_ORDER". Fix genwqe. Cc: stable@vger.kernel.org Signed-off-by: Christian Borntraeger Signed-off-by: Frank Haverkamp Signed-off-by: Greg Kroah-Hartman commit e121a833745b4708b660e3fe6776129c2956b041 Author: Rafael J. Wysocki Date: Thu Dec 13 19:27:47 2018 +0100 driver core: Add missing dev->bus->need_parent_lock checks __device_release_driver() has to check dev->bus->need_parent_lock before dropping the parent lock and acquiring it again as it may attempt to drop a lock that hasn't been acquired or lock a device that shouldn't be locked and create a lock imbalance. Fixes: 8c97a46af04b (driver core: hold dev's parent lock when needed) Signed-off-by: Rafael J. Wysocki Cc: stable Reviewed-by: Daniel Vetter Signed-off-by: Greg Kroah-Hartman commit d359bbce0601c6a19203a4b813a7e3910fcba282 Author: Ilan Peer Date: Sat Dec 15 11:03:25 2018 +0200 mac80211: Properly access radiotap vendor data The radiotap vendor data might be placed after some other radiotap elements, and thus when accessing it, need to access the correct offset in the skb data. Fix the code accordingly. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 93bc8ac49e82a329160604556b805b7fa614ff9e Author: Johannes Berg Date: Sat Dec 15 11:03:16 2018 +0200 cfg80211: fix ieee80211_get_vht_max_nss() Fix two bugs in ieee80211_get_vht_max_nss(): * the spec says we should round down (reported by Nissim) * there's a double condition, the first one is wrong, supp_width == 0 / ext_nss_bw == 2 is valid in 80+80 (found by smatch) Fixes: b0aa75f0b1b2 ("ieee80211: add new VHT capability fields/parsing") Reported-by: Nissim Bendanan Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 3ad20fe393b31025bebfc2d76964561f65df48aa Author: Christian Brauner Date: Fri Dec 14 13:11:14 2018 +0100 binder: implement binderfs As discussed at Linux Plumbers Conference 2018 in Vancouver [1] this is the implementation of binderfs. /* Abstract */ binderfs is a backwards-compatible filesystem for Android's binder ipc mechanism. Each ipc namespace will mount a new binderfs instance. Mounting binderfs multiple times at different locations in the same ipc namespace will not cause a new super block to be allocated and hence it will be the same filesystem instance. Each new binderfs mount will have its own set of binder devices only visible in the ipc namespace it has been mounted in. All devices in a new binderfs mount will follow the scheme binder%d and numbering will always start at 0. /* Backwards compatibility */ Devices requested in the Kconfig via CONFIG_ANDROID_BINDER_DEVICES for the initial ipc namespace will work as before. They will be registered via misc_register() and appear in the devtmpfs mount. Specifically, the standard devices binder, hwbinder, and vndbinder will all appear in their standard locations in /dev. Mounting or unmounting the binderfs mount in the initial ipc namespace will have no effect on these devices, i.e. they will neither show up in the binderfs mount nor will they disappear when the binderfs mount is gone. /* binder-control */ Each new binderfs instance comes with a binder-control device. No other devices will be present at first. The binder-control device can be used to dynamically allocate binder devices. All requests operate on the binderfs mount the binder-control device resides in. Assuming a new instance of binderfs has been mounted at /dev/binderfs via mount -t binderfs binderfs /dev/binderfs. Then a request to create a new binder device can be made as illustrated in [2]. Binderfs devices can simply be removed via unlink(). /* Implementation details */ - dynamic major number allocation: When binderfs is registered as a new filesystem it will dynamically allocate a new major number. The allocated major number will be returned in struct binderfs_device when a new binder device is allocated. - global minor number tracking: Minor are tracked in a global idr struct that is capped at BINDERFS_MAX_MINOR. The minor number tracker is protected by a global mutex. This is the only point of contention between binderfs mounts. - struct binderfs_info: Each binderfs super block has its own struct binderfs_info that tracks specific details about a binderfs instance: - ipc namespace - dentry of the binder-control device - root uid and root gid of the user namespace the binderfs instance was mounted in - mountable by user namespace root: binderfs can be mounted by user namespace root in a non-initial user namespace. The devices will be owned by user namespace root. - binderfs binder devices without misc infrastructure: New binder devices associated with a binderfs mount do not use the full misc_register() infrastructure. The misc_register() infrastructure can only create new devices in the host's devtmpfs mount. binderfs does however only make devices appear under its own mountpoint and thus allocates new character device nodes from the inode of the root dentry of the super block. This will have the side-effect that binderfs specific device nodes do not appear in sysfs. This behavior is similar to devpts allocated pts devices and has no effect on the functionality of the ipc mechanism itself. [1]: https://goo.gl/JL2tfX [2]: program to allocate a new binderfs binder device: #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include int main(int argc, char *argv[]) { int fd, ret, saved_errno; size_t len; struct binderfs_device device = { 0 }; if (argc < 2) exit(EXIT_FAILURE); len = strlen(argv[1]); if (len > BINDERFS_MAX_NAME) exit(EXIT_FAILURE); memcpy(device.name, argv[1], len); fd = open("/dev/binderfs/binder-control", O_RDONLY | O_CLOEXEC); if (fd < 0) { printf("%s - Failed to open binder-control device\n", strerror(errno)); exit(EXIT_FAILURE); } ret = ioctl(fd, BINDER_CTL_ADD, &device); saved_errno = errno; close(fd); errno = saved_errno; if (ret < 0) { printf("%s - Failed to allocate new binder device\n", strerror(errno)); exit(EXIT_FAILURE); } printf("Allocated new binder device with major %d, minor %d, and " "name %s\n", device.major, device.minor, device.name); exit(EXIT_SUCCESS); } Cc: Martijn Coenen Cc: Greg Kroah-Hartman Signed-off-by: Christian Brauner Acked-by: Todd Kjos Signed-off-by: Greg Kroah-Hartman commit 80cd795630d6526ba729a089a435bf74a57af927 Author: Todd Kjos Date: Fri Dec 14 15:58:21 2018 -0800 binder: fix use-after-free due to ksys_close() during fdget() 44d8047f1d8 ("binder: use standard functions to allocate fds") exposed a pre-existing issue in the binder driver. fdget() is used in ksys_ioctl() as a performance optimization. One of the rules associated with fdget() is that ksys_close() must not be called between the fdget() and the fdput(). There is a case where this requirement is not met in the binder driver which results in the reference count dropping to 0 when the device is still in use. This can result in use-after-free or other issues. If userpace has passed a file-descriptor for the binder driver using a BINDER_TYPE_FDA object, then kys_close() is called on it when handling a binder_ioctl(BC_FREE_BUFFER) command. This violates the assumptions for using fdget(). The problem is fixed by deferring the close using task_work_add(). A new variant of __close_fd() was created that returns a struct file with a reference. The fput() is deferred instead of using ksys_close(). Fixes: 44d8047f1d87a ("binder: use standard functions to allocate fds") Suggested-by: Al Viro Signed-off-by: Todd Kjos Cc: stable Signed-off-by: Greg Kroah-Hartman commit efc38dd7d5fa5c8cdd0c917c5d00947aa0539443 Author: Johannes Berg Date: Sat Dec 15 11:03:12 2018 +0200 mac80211: fix radiotap vendor presence bitmap handling Due to the alignment handling, it actually matters where in the code we add the 4 bytes for the presence bitmap to the length; the first field is the timestamp with 8 byte alignment so we need to add the space for the extra vendor namespace presence bitmap *before* we do any alignment for the fields. Move the presence bitmap length accounting to the right place to fix the alignment for the data properly. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 385e89d5b20f5a7c33fd7c1904da0e6a8e1b366f Author: Christophe Leroy Date: Wed Nov 28 17:21:10 2018 +0000 powerpc/mm: add exec protection on powerpc 603 The 603 doesn't have a HASH table, TLB misses are handled by software. It is then possible to generate page fault when _PAGE_EXEC is not set like in nohash/32. There is one "reserved" PTE bit available, this patch uses it for _PAGE_EXEC. In order to support it, set_pte_filter() and set_access_flags_filter() are made common, and the handling is made dependent on MMU_FTR_HPTE_TABLE Signed-off-by: Christophe Leroy Reviewed-by: Aneesh Kumar K.V Signed-off-by: Michael Ellerman commit badb9687cec50bdba59746532de1969d6d26f3a7 Author: Christophe Leroy Date: Mon Dec 10 12:23:05 2018 +0000 powerpc/mm: define an empty slice_init_new_context_exec() Define slice_init_new_context_exec() at all time to avoid Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 05a4ab823983d9136a460b7b5e0d49ee709a6f86 Author: Christophe Leroy Date: Mon Dec 10 06:50:09 2018 +0000 powerpc/uaccess: fix warning/error with access_ok() With the following piece of code, the following compilation warning is encountered: if (_IOC_DIR(ioc) != _IOC_NONE) { int verify = _IOC_DIR(ioc) & _IOC_READ ? VERIFY_WRITE : VERIFY_READ; if (!access_ok(verify, ioarg, _IOC_SIZE(ioc))) { drivers/platform/test/dev.c: In function 'my_ioctl': drivers/platform/test/dev.c:219:7: warning: unused variable 'verify' [-Wunused-variable] int verify = _IOC_DIR(ioc) & _IOC_READ ? VERIFY_WRITE : VERIFY_READ; This patch fixes it by referencing 'type' in the macro allthough doing nothing with it. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit c62ce9ef97ba8af4120c766c32e230215dd4df04 Author: Christophe Leroy Date: Tue Dec 4 17:59:15 2018 +0000 powerpc: remove remaining bits from CONFIG_APUS commit f21f49ea639a ("[POWERPC] Remove the dregs of APUS support from arch/powerpc") removed CONFIG_APUS, but forgot to remove the logic which adapts tophys() and tovirt() for it. This patch removes the last stale pieces. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 32c8c4c621897199e690760c2d57054f8b84b6e6 Author: Christophe Leroy Date: Fri Nov 16 17:31:08 2018 +0000 powerpc/xmon: fix dump_segments() mfsrin() takes segment num from bits 31-28 (IBM bits 0-3). Signed-off-by: Christophe Leroy [mpe: Clarify bit numbering] Signed-off-by: Michael Ellerman commit 0ed5b55884f8b1fa368454d47cc6ecf9790b8b99 Author: Christophe Leroy Date: Tue Nov 27 17:38:16 2018 +0000 powerpc/8xx: add exception frame marker This patch adds STACK_FRAME_REGS_MARKER in the stack at exception entry in order to see interrupts in call traces as below: [ 0.013964] Call Trace: [ 0.014014] [c0745db0] [c007a9d4] tick_periodic.constprop.5+0xd8/0x104 (unreliable) [ 0.014086] [c0745dc0] [c007aa20] tick_handle_periodic+0x20/0x9c [ 0.014181] [c0745de0] [c0009cd0] timer_interrupt+0xa0/0x264 [ 0.014258] [c0745e10] [c000e484] ret_from_except+0x0/0x14 [ 0.014390] --- interrupt: 901 at console_unlock.part.7+0x3f4/0x528 [ 0.014390] LR = console_unlock.part.7+0x3f0/0x528 [ 0.014455] [c0745ee0] [c0050334] console_unlock.part.7+0x114/0x528 (unreliable) [ 0.014542] [c0745f30] [c00524e0] register_console+0x3d8/0x44c [ 0.014625] [c0745f60] [c0675aac] cpm_uart_console_init+0x18/0x2c [ 0.014709] [c0745f70] [c06614f4] console_init+0x114/0x1cc [ 0.014795] [c0745fb0] [c0658b68] start_kernel+0x300/0x3d8 [ 0.014864] [c0745ff0] [c00022cc] start_here+0x44/0x98 Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit e93ba1b7eb5b188c749052df7af1c90821c5f320 Author: Christophe Leroy Date: Fri Nov 16 17:27:42 2018 +0000 powerpc/book3s/32: fix number of bats in p/v_block_mapped() This patch fixes the loop in p_block_mapped() and v_block_mapped() to scan the entire bat_addrs[] array. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 712877f8740471d96f703647d813d8a74fccc816 Author: Christophe Leroy Date: Fri Nov 16 17:08:03 2018 +0000 powerpc/mm: Eliminate not possible mmu features at compile time Depending on the CONFIG selected, many of the MMU features are not possible. Lets only get the possible ones in MMU_FTRS_POSSIBLE. This allows gcc to get rid at compile time of code related to not possible features. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 8a01960fb5bd95b920657133de52259227ee6ad7 Author: Christophe Leroy Date: Fri Nov 9 17:33:32 2018 +0000 powerpc/smp: Use code patching to restore reset vector Instead of hardcoding reset vector restore, use patch_instruction() Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 6c16816b91a64a33033930fbe2ae3f02e012d8bd Author: Christophe Leroy Date: Fri Nov 9 17:33:30 2018 +0000 powerpc/44x: use patch_sites for TLB handlers patching Use patch sites and associated helpers to manage TLB handlers patching instead of hardcoding. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit d16952a629129ce3f20ff7299de87c4d63b27a30 Author: Christophe Leroy Date: Fri Nov 9 17:33:28 2018 +0000 powerpc/signal: Use code patching instead of hardcoding Instead of hardcoding code modifications, use code patching functions. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 002cdfc2c78642deef24a77fab400a7f88781266 Author: Christophe Leroy Date: Fri Nov 9 17:33:26 2018 +0000 powerpc/8xx: use modify_instruction_site() Instead of hardcoding the TLB handlers patching, use the newly created modify_instruction_site() helper. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 9efc74ff52952c854f4a1a3c1bc8cd82df6b9c9e Author: Christophe Leroy Date: Fri Nov 9 17:33:24 2018 +0000 powerpc/book3s/32: Use patch_site to patch hash functions Use patch_sites and the new modify_instruction_site() function instead of hardcoding hash functions patching. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 4a3a224c5ae31fc9dc86bc9d8011f6bdc0e0c48d Author: Christophe Leroy Date: Fri Nov 9 17:33:22 2018 +0000 powerpc/book3s/32: Use MMU_FTR_HPTE_TABLE in head_32.S Instead of manually patching a blr at hash_page() entry in MMU_init_hw(), this patch adds a features section in head_32.S Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 04b0a72f2807ba40b155fc1689e38569779527ca Author: Christophe Leroy Date: Fri Nov 9 17:33:20 2018 +0000 powerpc/32: use patch_site_addr() in machine_init() Use patch_site_addr() instead of hardcoding the address calculation in machine_init() Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 36b08b431e2e282f78d09921ca55652d2c55eee5 Author: Christophe Leroy Date: Fri Nov 9 17:33:17 2018 +0000 powerpc: add modify_instruction() and modify_instruction_site() Add two helpers to avoid hardcoding of instructions modifications. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 45090c26614fe991d9d5a2cd08e65c4d6680549a Author: Christophe Leroy Date: Fri Nov 9 17:33:15 2018 +0000 powerpc: simplify patch_instruction_site() and patch_branch_site() Using patch_site_addr() helper, patch_instruction_site() and patch_branch_site() can be simplified and inlined. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 584dbc7727a22459dfcb6e4c9faef6467d08ab5e Author: Christophe Leroy Date: Thu Oct 18 05:22:06 2018 +0000 powerpc/mm: remove unused variable In file included from ./include/linux/hugetlb.h:445:0, from arch/powerpc/kernel/setup-common.c:37: ./arch/powerpc/include/asm/hugetlb.h: In function ‘huge_ptep_clear_flush’: ./arch/powerpc/include/asm/hugetlb.h:154:8: error: variable ‘pte’ set but not used [-Werror=unused-but-set-variable] Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 6bf752daca07c85c181159f75dcf65b12056883b Author: Christophe Leroy Date: Wed Dec 19 07:09:39 2018 +0000 powerpc: implement CONFIG_DEBUG_VIRTUAL This patch implements CONFIG_DEBUG_VIRTUAL to warn about incorrect use of virt_to_phys() and page_to_phys() Below is the result of test_debug_virtual: [ 1.438746] WARNING: CPU: 0 PID: 1 at ./arch/powerpc/include/asm/io.h:808 test_debug_virtual_init+0x3c/0xd4 [ 1.448156] CPU: 0 PID: 1 Comm: swapper Not tainted 4.20.0-rc5-00560-g6bfb52e23a00-dirty #532 [ 1.457259] NIP: c066c550 LR: c0650ccc CTR: c066c514 [ 1.462257] REGS: c900bdb0 TRAP: 0700 Not tainted (4.20.0-rc5-00560-g6bfb52e23a00-dirty) [ 1.471184] MSR: 00029032 CR: 48000422 XER: 20000000 [ 1.477811] [ 1.477811] GPR00: c0650ccc c900be60 c60d0000 00000000 006000c0 c9000000 00009032 c7fa0020 [ 1.477811] GPR08: 00002400 00000001 09000000 00000000 c07b5d04 00000000 c00037d8 00000000 [ 1.477811] GPR16: 00000000 00000000 00000000 00000000 c0760000 c0740000 00000092 c0685bb0 [ 1.477811] GPR24: c065042c c068a734 c0685b8c 00000006 00000000 c0760000 c075c3c0 ffffffff [ 1.512711] NIP [c066c550] test_debug_virtual_init+0x3c/0xd4 [ 1.518315] LR [c0650ccc] do_one_initcall+0x8c/0x1cc [ 1.523163] Call Trace: [ 1.525595] [c900be60] [c0567340] 0xc0567340 (unreliable) [ 1.530954] [c900be90] [c0650ccc] do_one_initcall+0x8c/0x1cc [ 1.536551] [c900bef0] [c0651000] kernel_init_freeable+0x1f4/0x2cc [ 1.542658] [c900bf30] [c00037ec] kernel_init+0x14/0x110 [ 1.547913] [c900bf40] [c000e1d0] ret_from_kernel_thread+0x14/0x1c [ 1.553971] Instruction dump: [ 1.556909] 3ca50100 bfa10024 54a5000e 3fa0c076 7c0802a6 3d454000 813dc204 554893be [ 1.564566] 7d294010 7d294910 90010034 39290001 <0f090000> 7c3e0b78 955e0008 3fe0c062 [ 1.572425] ---[ end trace 6f6984225b280ad6 ]--- [ 1.577467] PA: 0x09000000 for VA: 0xc9000000 [ 1.581799] PA: 0x061e8f50 for VA: 0xc61e8f50 Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman commit 604c01d567cb9ee7d19dc598272cb90ab6229a8a Author: yupeng Date: Tue Dec 18 17:59:53 2018 +0100 nvme-pci: trace SQ status on completions Export the disk name, queue id, sq_head, sq_tail to a trace event in completion handling. Usage example: cd /sys/kernel/debug/tracing/events/nvme/nvme_sq echo 'disk=="nvme1n1"' > filter echo 1 > enable cat /sys/kernel/debug/tracing/trace_pipe Signed-off-by: yupeng Reviewed-by: Sagi Grimberg Reviewed-by: Keith Busch [hch: slight formatting tweaks, use standard nvme tracepoint conventions] Signed-off-by: Christoph Hellwig wip commit 0fe6dc4d689286ef81fbc2f4833398fac89d798e Author: Michael Straube Date: Tue Dec 18 19:34:51 2018 +0100 staging: rtl8188eu: cleanup brace coding style issues Cleanup brace coding style issues reported by checkpatch. ERROR: space required before the open brace '{' WARNING: braces {} are not necessary for single statement blocks CHECK: Unbalanced braces around else statement Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 241e15dbfc9fe40a8ae1f046fa8a96e839a71161 Author: Michael Straube Date: Tue Dec 18 19:34:50 2018 +0100 staging: rtl8188eu: add spaces around '&' in rtw_mlme_ext.c Add spaces around '&' to follow kernel coding style. Reported by checkpatch. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit e54a823e90fe9a49cd6573dda99440045c164851 Author: Michael Straube Date: Tue Dec 18 19:34:49 2018 +0100 staging: rtl8188eu: change return type of is_basicrate() to bool The function is_basicrate() returns true or false, so change the return type from int to bool. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 79ebad324b487729d4aabddcb81e80c94b6f11c3 Author: Michael Straube Date: Tue Dec 18 19:34:48 2018 +0100 staging: rtl8188eu: simplify null array initializations Simplfy initialization of null arrays to improve readability and save some lines. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit b7d54304d92facd3df766d1a1aa283379d719d96 Author: Michael Straube Date: Tue Dec 18 19:34:47 2018 +0100 staging: rtl8188eu: change order of declarations to improve readability Change the order of array declarations in rtw_mlme_ext.c to improve readability. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 7a6394398f4e2305ca91020683080e4da5dbbaca Author: Michael Straube Date: Tue Dec 18 19:34:46 2018 +0100 staging: rtl8188eu: make some arrays static in rtw_mlme_ext.c Make some arrays that are only used in rtw_mlme_ext.c static and remove the corresponding extern declarations from rtw_mlme_ext.h. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 03449acb77fd8bdfb8b7101a2eb429b1cffe67c2 Author: Michael Straube Date: Tue Dec 18 19:34:45 2018 +0100 staging: rtl8188eu: constify some arrays The values of these arrays in rtw_mlme_ext.c and rtw_wlan_util.c are never changed, so make them const. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 0ef9f86b935274a00d781a0245cb16d62eda501a Author: Michael Straube Date: Tue Dec 18 19:34:44 2018 +0100 staging: rtl8188eu: convert unsigned char arrays to u8 Change the type of some arrays from unsigned char to u8. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 55fc57809a2b741a6b2a0779bb9544f60f410b71 Author: Michael Straube Date: Tue Dec 18 19:34:43 2018 +0100 staging: rtl8188eu: remove redundant declaration in rtw_mlme_ext.c The array REALTEK_96B_IE is already declared in rtw_mlme.h, so remove the declaration in rtw_mlme_ext.c. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 4f1a961ae15cb416219ed5488627490f3f0ff358 Author: Michael Straube Date: Tue Dec 18 19:34:42 2018 +0100 staging: rtl8188eu: remove unused arrays WFD_OUI and WMM_INFO_OUI The arrays WFD_OUI and WMM_INFO_OUI are not used anywhere, so remove them. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 25c641ec2aa1b6952f6e1e193a9ecb65c88db89c Author: Michael Straube Date: Tue Dec 18 19:34:41 2018 +0100 staging: rtl8188eu: remove unnecessary parentheses in rtw_mlme_ext.c Remove unnecessary parentheses, most of them reported by checkpatch. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 011844addf0f6c272133c680ebf0406f47cfd09b Author: Michael Straube Date: Tue Dec 18 19:34:40 2018 +0100 staging: rtl8188eu: remove unnecessary comments in rtw_mlme_ext.c Remove comments from 'endif's where the corresponding 'if' is just a few lines above to improve readability. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 7acaed81abe13a279b375cfd2a863223baa97e55 Author: Michael Straube Date: Tue Dec 18 19:34:39 2018 +0100 staging: rtl8188eu: add blank line after declarations Add a missing blank line after declarations in rtw_mlme_ext.c. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit f20ac243ff745f0e8a4d125ad9dcf50640b73fb7 Author: Michael Straube Date: Tue Dec 18 19:34:38 2018 +0100 staging: rtl8188eu: remove blank lines between declarations Remove blank lines between declarations in rtw_mlme_ext.c. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 83691365f1845754251e25619bae185f96279005 Author: Michael Straube Date: Tue Dec 18 19:34:37 2018 +0100 staging: rtl8188eu: remove commented declarations in rtw_mlme_ext.c Remove unused/commented declarations. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 1673616a006aa04758c17ad78f6d5286d6eed091 Author: Michael Straube Date: Tue Dec 18 19:34:36 2018 +0100 staging: rtl8188eu: replace tabs with spaces in rtw_mlme_ext.c Replace tabs with spaces where appropriate. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit 502b90d4c68751bc0635f997fd33e92a57d250cf Author: Michael Straube Date: Tue Dec 18 19:34:35 2018 +0100 staging: rtl8188eu: cleanup declarations in rtw_mlme_ext.c Replace tabs with spaces and/or remove spaces in declarations. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit b57f944785c5764725a7a6eff548a70bafb41a2a Author: YueHaibing Date: Tue Dec 18 22:28:21 2018 +0800 staging: fbtft: fix strncmp() size warning strncmp() stops comparing when either the end of one of the first two arguments is reached or when 'n' characters have been compared, whichever comes first.That means that strncmp(s1, s2, n) is equivalent to strcmp(s1, s2) if n exceeds the length of s1 or the length of s2. This patch avoids that the following warning is reported by smatch: drivers/staging/fbtft/fbtft_device.c:1458 fbtft_device_init() error: strncmp() '"list"' too small (5 vs 32) Signed-off-by: YueHaibing Signed-off-by: Greg Kroah-Hartman commit a86028f8e3eea59517cb47895faad04b6ae8d8e1 Author: Colin Ian King Date: Tue Dec 18 11:35:52 2018 +0000 staging: most: sound: replace snprintf with strscpy Using snprintf without a format specifier is potentially risky if the string device_name contains format specifiers. Replace this with the safer and more efficient strscpy. Cleans up clang warning: drivers/staging/most/sound/sound.c:673:41: warning: format string is not a string literal (potentially insecure) [-Wformat-security] Signed-off-by: Colin Ian King Signed-off-by: Greg Kroah-Hartman commit 9d84d3e6bd6871a0c410fc1c0571fa025236bf7e Author: Aisheng Dong Date: Mon Dec 17 15:00:51 2018 +0000 dt-bindings: serial: lpuart: add imx8qxp compatible string Add imx8qxp compatible string Cc: Mark Rutland Cc: linux-serial@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: Greg Kroah-Hartman Reviewed-by: Rob Herring Signed-off-by: Dong Aisheng Signed-off-by: Greg Kroah-Hartman commit 260683137ab5276113fc322fdbbc578024185fee Author: Nava kishore Manne Date: Tue Dec 18 13:18:42 2018 +0100 serial: uartps: Fix interrupt mask issue to handle the RX interrupts properly This patch Correct the RX interrupt mask value to handle the RX interrupts properly. Fixes: c8dbdc842d30 ("serial: xuartps: Rewrite the interrupt handling logic") Signed-off-by: Nava kishore Manne Cc: stable Signed-off-by: Michal Simek Signed-off-by: Greg Kroah-Hartman commit 32cf21ac4edd6c0d5b9614368a83bcdc68acb031 Author: Michal Simek Date: Tue Dec 18 13:18:41 2018 +0100 serial: uartps: Fix error path when alloc failed When cdns_uart_console allocation failed there is a need to also clear ID from ID list. Fixes: ae1cca3fa347 ("serial: uartps: Change uart ID port allocation") Signed-off-by: Michal Simek Signed-off-by: Greg Kroah-Hartman commit 82b1b2ec5d4057af11395ac03209884369418a0d Author: Shubhrajyoti Datta Date: Tue Dec 18 13:18:40 2018 +0100 serial: uartps: Check if the device is a console While checking for console_suspend_enabled also check if the device is a console. Signed-off-by: Shubhrajyoti Datta Signed-off-by: Michal Simek Signed-off-by: Greg Kroah-Hartman commit 86df8dd147233fd1705b9f7a8541d1501d4c5295 Author: Shubhrajyoti Datta Date: Tue Dec 18 13:18:39 2018 +0100 serial: uartps: Add the device_init_wakeup Initialise the device wakeup. The device_init_wakeup is needed for the wakeup to work by default. Uart can be configured as the primary wakeup source so it is good to enable wakeup by default. The same functionality is enabled also by 8250_omap, atmel_serial, omap-serial and stm32-usart. Signed-off-by: Shubhrajyoti Datta Signed-off-by: Michal Simek Signed-off-by: Greg Kroah-Hartman commit c85400f886e3d41e69966470879f635a2b50084c Author: Jia-Ju Bai Date: Tue Dec 18 20:04:25 2018 +0800 usb: r8a66597: Fix a possible concurrency use-after-free bug in r8a66597_endpoint_disable() The function r8a66597_endpoint_disable() and r8a66597_urb_enqueue() may be concurrently executed. The two functions both access a possible shared variable "hep->hcpriv". This shared variable is freed by r8a66597_endpoint_disable() via the call path: r8a66597_endpoint_disable kfree(hep->hcpriv) (line 1995 in Linux-4.19) This variable is read by r8a66597_urb_enqueue() via the call path: r8a66597_urb_enqueue spin_lock_irqsave(&r8a66597->lock) init_pipe_info enable_r8a66597_pipe pipe = hep->hcpriv (line 802 in Linux-4.19) The read operation is protected by a spinlock, but the free operation is not protected by this spinlock, thus a concurrency use-after-free bug may occur. To fix this bug, the spin-lock and spin-unlock function calls in r8a66597_endpoint_disable() are moved to protect the free operation. Signed-off-by: Jia-Ju Bai Cc: stable Signed-off-by: Greg Kroah-Hartman commit c710d0bb76ff0795d8b6c1cda1e01e6e1e661a4a Author: Kyle Tso Date: Mon Dec 17 21:22:13 2018 +0800 usb: typec: tcpm: Extend the matching rules on PPS APDO selection Current matching rules ensure that the voltage range of selected Source Capability is entirely within the range defined in one of the Sink Capabilities. This is reasonable but not practical because Sink may not support wide range of voltage when sinking power while Source could advertise its capabilities in relatively wider range. For example, a Source PDO advertising 3.3V-11V@3A (9V Prog of Fixed Nominal Voltage) will not be selected if the Sink requires 5V-12V@3A PPS power. However, the Sink could work well if the requested voltage range in RDOs is 5V-11V@3A. Currently accepted: |--------- source -----| |----------- sink ---------------| Currently not accepted: |--------- source -----| |----------- sink ---------------| |--------- source -----| |----------- sink ---------------| |--------- source -----------------| |------ sink -------| To improve the usability, change the matching rules to what listed below: a. The Source PDO is selectable if any portion of the voltage range overlaps one of the Sink PDO's voltage range. b. The maximum operational voltage will be the lower one between the selected Source PDO and the matching Sink PDO. c. The maximum power will be the maximum operational voltage times the maximum current defined in the selected Source PDO d. Select the Source PDO with the highest maximum power Signed-off-by: Kyle Tso Acked-by: Adam Thomson Reviewed-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman commit 28ce553985fa23815d942e8ad4294dec30645e5b Author: Heikki Krogerus Date: Tue Dec 18 13:53:08 2018 +0300 usb: typec: Improve Alt Mode documentation Adding the document to the usb index file and fixing a few references. Also, exposing the code examples as "literal blocks" so they are more easy to read. Signed-off-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman commit 2da711bcebe81209a9f2f90e145600eb1bae2b71 Author: Raghuram Hegde Date: Wed Dec 19 11:42:18 2018 +0530 Bluetooth: btusb: Add support for Intel bluetooth device 8087:0029 Include the new USB product ID for Intel Bluetooth device 22260 family(CcPeak) The /sys/kernel/debug/usb/devices portion for this device is: T: Bus=01 Lev=01 Prnt=01 Port=02 Cnt=02 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 2.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=8087 ProdID=0029 Rev= 0.01 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: Marcel Holtmann commit 33f18c96afdf4da20014f834874e2820ee880cde Author: Heiner Kallweit Date: Wed Dec 19 00:43:58 2018 +0100 net: ethernet: don't set phylib state CHANGELINK in drivers After phy_start() phylib takes care of all needed actions, including aneg settings and checking link state. There's no need to set state PHY_CHANGELINK in drivers. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 2acc7957dbc354f3349261c2ebc6f56aff5829e7 Author: Leon Romanovsky Date: Thu Dec 6 14:40:11 2018 +0200 net/mlx5: Add shared Q counter bits Updated HW specification file with needed bits to allow sharing of Q counters between DEVX contexts and kernel. Signed-off-by: Leon Romanovsky commit 624b66f8c9945504232c253e64f7c28e5a5c04d6 Author: Alexandre Belloni Date: Tue Dec 18 15:25:39 2018 +0100 MAINTAINERS: Add a maintainer for Microsemi switches Microsemi has been bought by Microchip and Microchip is supporting those switches. Signed-off-by: Alexandre Belloni Acked-by: Woojung Huh Signed-off-by: David S. Miller commit 5679ee784c89793537d233022b55a331a64aed9d Author: Zhenbo Gao Date: Tue Dec 18 17:43:52 2018 +0800 tipc: handle broadcast NAME_DISTRIBUTOR packet when receiving it NAME_DISTRIBUTOR messages are transmitted through unicast link on TIPC 2.0, by contrast, the messages are delivered through broadcast link on TIPC 1.7. But at present, NAME_DISTRIBUTOR messages received by broadcast link cannot be handled in tipc_rcv() until an unicast message arrives, which may lead to a significant delay to update name table. To avoid this delay, we will also deal with broadcast NAME_DISTRIBUTOR message on broadcast receive path. Signed-off-by: Zhenbo Gao Reviewed-by: Ying Xue Signed-off-by: David S. Miller commit 935b8a59ac80bf3d3caae6460fb95d028f7c92c8 Author: Heiner Kallweit Date: Mon Dec 17 23:43:25 2018 +0100 net: phy: remove unused code in phy_probe 3c1bcc8614db ("net: ethernet: Convert phydev advertize and supported from u32 to link mode") left some unused code in phy_probe(), remove it. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 38417468d4f05cfed62fca8f407d2df0cbe3fcc8 Author: Christoph Hellwig Date: Thu Dec 13 16:17:10 2018 +0100 scsi: block: remove the cluster flag Now that the the SCSI layer replaced the use of the cluster flag with segment size limits and the DMA boundary we can remove the cluster flag from the block layer. Signed-off-by: Christoph Hellwig Reviewed-by: Jens Axboe Signed-off-by: Martin K. Petersen commit d6a9000b81befd436fe4bcdae76322928bda724c Author: Xiang Chen Date: Mon Dec 17 22:40:07 2018 +0800 scsi: hisi_sas: Add support for DIF feature for v2 hw For v3 hw, we support DIF operation for SAS, but not SATA. In addition, DIF CRC16 is supported. This patchset adds the SW support for the described features. The main components are as follows: - Get protection mask from module param - Fill PI fields - Fill related to DIF in DQ and protection iu memories Signed-off-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 4e87eb2f46ea547d12a276b2e696ab934d16cfb6 Author: Ewan D. Milne Date: Thu Dec 13 15:25:16 2018 -0500 scsi: lpfc: do not set queue->page_count to 0 if pc_sli4_params.wqpcnt is invalid Certain older adapters such as the OneConnect OCe10100 may not have a valid wqpcnt value. In this case, do not set queue->page_count to 0 in lpfc_sli4_queue_alloc() as this will prevent the driver from initializing. Fixes: 895427bd01 ("scsi: lpfc: NVME Initiator: Base modifications") Cc: stable@vger.kernel.org # 4.11+ Signed-off-by: Ewan D. Milne Reviewed-by: Laurence Oberman Tested-by: Laurence Oberman Signed-off-by: Martin K. Petersen commit 4af14d113bcf95c12d1462ba623b7e7117bd3fb3 Author: Christoph Hellwig Date: Thu Dec 13 16:17:09 2018 +0100 scsi: remove the use_clustering flag The same effects can be achieved by setting the dma_boundary to PAGE_SIZE - 1 and the max_segment_size to PAGE_SIZE, so shift those settings into the drivers. Note that in many cases the setting might be bogus, but this keeps the status quo. [mkp: fix myrs and myrb] Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 1c3726ad30938725a53f471d7967abfd6838330f Author: Christoph Hellwig Date: Thu Dec 13 16:17:08 2018 +0100 scsi: mac53c94: remove DISABLE_CLUSTERING mac53c94 has no limitations on crossing pages for segments. Just make the 65535 byte segment size limit explicit, even if it matches the current block layer limit. Signed-off-by: Christoph Hellwig Tested-by: Paul Mackerras Signed-off-by: Martin K. Petersen commit 5bd6cd54bd01171176e8be510d429720a3fd2dce Author: Christoph Hellwig Date: Thu Dec 13 16:17:07 2018 +0100 scsi: mesh: remove DISABLE_CLUSTERING mesh has no limitations on crossing pages for segments. Just make the 65535 byte segment size limit explicit, even if it matches the current block layer limit. Signed-off-by: Christoph Hellwig Tested-by: Paul Mackerras Signed-off-by: Martin K. Petersen commit e08ea3009f539e62280eca98a70b5d26d29b62cf Author: Christoph Hellwig Date: Thu Dec 13 16:17:06 2018 +0100 scsi: xen-scsifront: remove DISABLE_CLUSTERING There is no such limitation in the protocol or implementation, so remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Signed-off-by: Martin K. Petersen commit 7b44047bce9c9d2c5020f5fb3dc94dd7b88cc355 Author: Christoph Hellwig Date: Thu Dec 13 16:17:05 2018 +0100 scsi: powertec: remove the explicit use_clustering setting This driver already sets the dma_boundary to PAGE_SIZE - 1, which has the same result. Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 736c23d6caa5a1383391e1d45537829cebf92257 Author: Christoph Hellwig Date: Thu Dec 13 16:17:04 2018 +0100 scsi: cumana_2: remove the explicit use_clustering setting This driver already sets the dma_boundary to PAGE_SIZE - 1, which has the same result. Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 50c2e9107f176a82e14567b39c5d0f2a208cc82c Author: Christoph Hellwig Date: Thu Dec 13 16:17:03 2018 +0100 scsi: introduce a max_segment_size host_template parameters This allows the host driver to indicate the maximum supported segment size in a nice an easy way, so that the driver doesn't have to worry about DMA-layer imposed limitations. Signed-off-by: Christoph Hellwig Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 2a3d4eb8e228061c09d5ca8bf39e7f00c2091213 Author: Christoph Hellwig Date: Thu Dec 13 16:17:02 2018 +0100 scsi: flip the default on use_clustering Most SCSI drivers want to enable "clustering", that is merging of segments so that they might span more than a single page. Remove the ENABLE_CLUSTERING define, and require drivers to explicitly set DISABLE_CLUSTERING to disable this feature. Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 4dd4130a722fb046e941010cf5576aed252bb58a Author: Christoph Hellwig Date: Thu Dec 13 16:17:01 2018 +0100 scsi: make sure all drivers set the use_clustering flag A few drivers were not setting the use_clustering flag at all and thus default to disable. Fix them up to explicitly set this field in preparation for additional cleanups. Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 8b2db98e814a5ec45e8800fc22ca9000ae0a517b Author: Wei Yongjun Date: Mon Dec 17 12:19:53 2018 +0000 scsi: target/core: Use kmem_cache_free() instead of kfree() memory allocated by kmem_cache_alloc() should be freed using kmem_cache_free(), not kfree(). Fixes: ad669505c4e9 ("scsi: target/core: Make sure that target_wait_for_sess_cmds() waits long enough") Signed-off-by: Wei Yongjun Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c29d7d10cd1ed04eb2fa6baef8af65f1fded6ea6 Author: Bart Van Assche Date: Fri Dec 14 09:35:11 2018 -0800 scsi: virtio_scsi: Remove per-target data because it is no longer used Commit b5b6e8c8d3b4 ("scsi: virtio_scsi: fix IO hang caused by automatic irq vector affinity") removed all virtio_scsi hostdata users. Since the SCSI host data is no longer used, also remove the host data itself. Cc: Paolo Bonzini Cc: Christoph Hellwig Cc: Ming Lei Cc: Hannes Reinecke Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Reviewed-by: Ming Lei Signed-off-by: Martin K. Petersen commit e00b64f7c54c4cbd88143bbd43e7c3d61a090e5c Author: Shamir Rabinovitch Date: Mon Dec 17 17:15:18 2018 +0200 RDMA: Cleanup undesired pd->uobject usage Drivers should be using udata to determine if a method is invoked from user space or kernel space. A pd does not necessarily say a different objects is kernel or user. Transforming the tests to use udata eliminates a large number of uobject references from the drivers. Signed-off-by: Shamir Rabinovitch Signed-off-by: Jason Gunthorpe commit 6c86bc23421ec7949d91b359d831bf8fcfa80ce5 Merge: a26d94bff4d5a ff9b85de5d5d2 Author: David S. Miller Date: Tue Dec 18 16:44:45 2018 -0800 Merge tag 'mlx5-uplink-rep-2018-12-15' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed: ==================== mlx5-uplink-rep-2018-12-15 Or Gerlitz says: This series is essentially a cleanup to align with the rest of the NIC switchdev drivers and make us more robust and clear/n: currently the PF netdev serves as the mlx5 e-switch uplink netdev representor when going into switchdev mode and back as plain NIC netdev when going out. This causes some irregularities and misc troubles. Move to use dedicated uplink rep, as we have for the VF vports. The uplink rep netdev does has sysfs link and supports the sriov vf mac ndo, these two are in use by libvirt and other orchestrators, It also has richer ethtool support to allow controlling the port link & mtu along with supporting dcb and plugging into the mlx5 lag logic. ==================== Signed-off-by: David S. Miller commit a26d94bff4d5af7c9bf5d5e779282e2258966ec3 Author: YueHaibing Date: Mon Dec 17 17:46:23 2018 +0800 net: bridge: remove unneeded variable 'err' function br_multicast_toggle now always return 0, so the variable 'err' is unneeded. Also cleanup dead branch in br_changelink. Signed-off-by: YueHaibing Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 8937388acb09d6bf0f263fa8551d3e2b4e84de25 Author: YueHaibing Date: Mon Dec 17 17:27:16 2018 +0800 qlcnic: remove set but not used variables 'op, cmd_op' Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c:1070:5: warning: variable 'op' set but not used [-Wunused-but-set-variable] drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c:1342:5: warning: variable 'cmd_op' set but not used [-Wunused-but-set-variable] 'op' never used since introduction in commit 7cb03b2347d5 ("qlcnic: Support VF-PF communication channel commands.") 'cmd_op' not used since commit 6226204bcf20 ("qlcnic: Fix operation type and command type.") Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit 8589086f4efd5756d20cedd844b865e5d20164ec Author: Hans de Goede Date: Tue Oct 30 14:17:23 2018 +0100 Bluetooth: hci_h5: Turn off RTL8723BS on suspend, reprobe on resume On many devices the RTL8723BS device gets reset during suspend/resume, causing it to lose its firmware and all state. Testing has shown it drops back to communicating at 115200 bps and sends sync-request packages, indicating it has been fully reset. This commit fixes this by queueing a reprobe on resume. This mirrors how USB RTL BT devices, which have the same problem, are handled in the btusb driver, there we set the USB_QUIRK_RESET_RESUME for all RTL devices, which also causes a reprobe on resume. The only difference is that here we need to do the reprobe ourselves. Since we are doing a full reprobe on resume now, we can also turn off the device on suspend to save power while suspended. Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit 28a75e4c813c7ae7de5b4baf4c29369769247cc6 Author: Hans de Goede Date: Tue Oct 30 14:17:22 2018 +0100 Bluetooth: hci_h5: Add suspend / resume ops Add support for vendor specific suspend / resume callbacks. Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit 76c43ae84e3f455e0b460ed0c43799e018d09ee9 Author: Yonghong Song Date: Tue Dec 18 13:43:58 2018 -0800 bpf: log struct/union attribute for forward type Current btf internal verbose logger logs fwd type as [2] FWD A type_id=0 where A is the type name. Commit 9d5f9f701b18 ("bpf: btf: fix struct/union/fwd types with kind_flag") introduced kind_flag which can be used to distinguish whether a forward type is a struct or union. Also, "type_id=0" does not carry any meaningful information for fwd type as btf_type.type = 0 is simply enforced during btf verification and is not used anywhere else. This commit changed the log to [2] FWD A struct if kind_flag = 0, or [2] FWD A union if kind_flag = 1. Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 7086b36b8080e6252162cf5d681f521738e7ced5 Author: Colin Ian King Date: Tue Oct 30 11:34:19 2018 +0000 Bluetooth: hci_intel: clean an indentation issue, remove extraneous spaces Trivial fix to clean up an indentation issue, remove spaces Signed-off-by: Colin Ian King Signed-off-by: Marcel Holtmann commit 75edd1f2f916f06248cd6a6e8ea706b44431d3eb Author: Colin Ian King Date: Fri Nov 9 13:27:36 2018 +0000 Bluetooth: clean an indentation issue, remove extraneous space Trivial fix to clean up an indentation issue Signed-off-by: Colin Ian King Signed-off-by: Marcel Holtmann commit cba736465e5cbae22027789de748b8500e647555 Author: Balakrishna Godavarthi Date: Thu Nov 22 18:20:47 2018 +0530 Bluetooth: hci_serdev: Remove setting of HCI_QUIRK_RESET_ON_CLOSE. HCI_QUIRK_RESET_ON_CLOSE quirk is required for BT v1.0 based devices, to send a reset command to the chip during hci device close. Serdev architecture is used for the latest BT chips, which doesn't require to send the reset command during close. If still chips required reset command during close, it would be better enabling it in the vendor probes or in proto setup. Signed-off-by: Balakrishna Godavarthi Signed-off-by: Marcel Holtmann commit dff6d593b10fc04a24e07650c459947e9d6ff3c3 Author: Andrea Parri Date: Tue Nov 27 12:22:25 2018 +0100 Bluetooth: Remove unnecessary smp_mb__after_atomic() barriers The barriers are redundant because atomic_test_and_clear_bit() already provides the required full ordering for the cases in question (that is, when the bit is cleared). Signed-off-by: Andrea Parri Signed-off-by: Marcel Holtmann commit dd4bfda9cfd1b0b4aad8760fc027cc81e0c6787f Merge: 0bae2d4d62d52 945a47d87cee2 Author: Daniel Borkmann Date: Wed Dec 19 00:27:24 2018 +0100 Merge branch 'bpf-sk-msg-size-member' John Fastabend says: ==================== This adds a size field to the sk_msg_md data structure used by SK_MSG programs. Without this in the zerocopy case and in the copy case where multiple iovs are in use its difficult to know how much data can be pulled in. The normal method of reading data and data_end only give the current contiguous buffer. BPF programs can attempt to pull in extra data but have to guess if it exists. This can result in multiple "guesses" its much better if we know upfront the size of the sk_msg. ==================== Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit 0697607acab976723bf67de95d7b87167c30abf8 Author: Chen-Yu Tsai Date: Mon Dec 17 12:04:47 2018 +0800 Bluetooth: btbcm: Add default address for BCM43430A0 The BCM43430A0 has the default MAC address 43:43:A0:12:1F:AC if none is given. This address was found when enabling Bluetooth on a bunch of boards with the AMPAK AP6210 module, all sharing the same address. It also contains the sequence 4343A0, which is suspicious as that is also the name the chip identifies itself as. Add this to the list of default MAC addresses and leave it to the user to configure a valid one. Signed-off-by: Chen-Yu Tsai Signed-off-by: Marcel Holtmann commit 66904555191cbcefa8aa552df018b4f56d94e3ae Author: Chen-Yu Tsai Date: Mon Dec 17 12:04:46 2018 +0800 Bluetooth: hci_bcm: Add compatible string for BCM4330 The BCM4330 chip is a 802.11 a/b/g/n + Bluetooth 4.0 + HS controller. This patch adds a compatible string match to the serdev driver for the Bluetooth part of the chip. Signed-off-by: Chen-Yu Tsai Signed-off-by: Marcel Holtmann commit 92ffe0db3c858ca568cf480899396e63344eab86 Author: Maxime Ripard Date: Mon Dec 17 12:04:45 2018 +0800 Bluetooth: hci_bcm: Add BCM20702A1 variant The BCM20702A1 chip is a single-chip Bluetooth 4.0 controller and transceiver. It is found in the AMPAK AP6210 WiFi+BT package. Signed-off-by: Maxime Ripard Tested-by: Ondrej Jirman Signed-off-by: Chen-Yu Tsai Signed-off-by: Marcel Holtmann commit 91927a9b351f9779e323be1fb4e219a5951b1649 Author: Chen-Yu Tsai Date: Mon Dec 17 12:04:44 2018 +0800 Bluetooth: hci_bcm: Wait for device to come out of reset after power on The datasheets for BCM20702 and BCM43438 both have power up time sequence graphs, however they are slightly different. Both chips also have an internal power-on-reset, which holds the chip in reset for a short time after the regulators are enabled. For the BCM20702, the time period from when the regulators are enabled, until the chip settles and comes out of sleep state, is 6564 ~ 8171 us. For the BCM43438, the graph only shows the time period from when the regulators are enabled until the chip responds by driving the host's CTS line low, assuming the host has already driven its RTS line low. This is shown to be 6.5 sleep cycles, with the sleep clock at 32.768 kHz. This is around 2 ms. Wait a full 10 ms after the regulators are enabled to account for signal rising times. Tested-by: Ondrej Jirman Signed-off-by: Chen-Yu Tsai Signed-off-by: Marcel Holtmann commit 75d11676dccb643de1e850c8a29f5e9aa58157c0 Author: Chen-Yu Tsai Date: Mon Dec 17 12:04:43 2018 +0800 Bluetooth: hci_bcm: Add support for regulator supplies The Broadcom Bluetooth chips have two power inputs, VBAT and VDDIO. The former provides overall power for the chip, while the latter powers the I/O pins and buffers. Model these two as regulator supplies, and let the driver manage them in the same way as it does the clock supply. Tested-by: Ondrej Jirman Signed-off-by: Chen-Yu Tsai Signed-off-by: Marcel Holtmann commit 90bc07cc59ac32f37d6de78a501246575c8866bf Author: Chen-Yu Tsai Date: Mon Dec 17 12:04:42 2018 +0800 Bluetooth: hci_bcm: Add support for LPO clock The Broadcom Bluetooth controllers support a secondary LPO clock at 32.768 kHz. This external clock provides low power timing, and also a way to detect the frequency of the main reference clock. On many designs without NVRAM and a non-default reference clock, this must be used or the controller will not function correctly. Tested-by: Ondrej Jirman Signed-off-by: Chen-Yu Tsai Signed-off-by: Marcel Holtmann commit 55dbfcd0f621a745acfd8e3221c41be181b5b128 Author: Chen-Yu Tsai Date: Mon Dec 17 12:04:41 2018 +0800 Bluetooth: hci_bcm: Use "txco" and "extclk" to get clock reference Originally the device tree binding only specified one clock reference, with the name "extclk". The driver simply retrieves the clock without bothering to specify a name. Since we added a second clock to the binding, we need to fetch the clocks by name now. First we try the new name "txco", then fall back to the old name "extclk", and finally try retrieving a clock without using any name, to cover any instances where a bad device tree or firmware worked by accident. In the last case, we should take care that we don't get the same clock twice when we add support for the "lpo" clock. Tested-by: Ondrej Jirman Signed-off-by: Chen-Yu Tsai Signed-off-by: Marcel Holtmann commit 8c08947b7c4f4496e7c23be970121280fcb6cbf5 Author: Chen-Yu Tsai Date: Mon Dec 17 12:04:40 2018 +0800 Bluetooth: hci_bcm: Simplify clk_get error handling The driver currently checks the clk pointer for an error condition, as returned by clk_get, before every invocation of the clk consumer API. This is redundant if the goal is simply to ignore the errors, thereby making the clk optional. The clk consumer API already checks if the pointer is NULL or not. Simplify the code a bit by assigning NULL to the clk pointer if the error condition is one we want to ignore, which is every error except deferred probing. Tested-by: Ondrej Jirman Signed-off-by: Chen-Yu Tsai Signed-off-by: Marcel Holtmann commit 28ac03b9ac3f784c2f048a910c8d0a7a87483b66 Author: Chen-Yu Tsai Date: Mon Dec 17 12:04:39 2018 +0800 Bluetooth: hci_bcm: Handle deferred probing for the clock supply On some systems that actually have the bluetooth controller wired up with an extra clock signal, it's possible the bluetooth controller probes before the clock provider. clk_get would return a defer probe error, which was not handled by this driver. Handle this properly, so that these systems can work reliably. Tested-by: Ondrej Jirman Signed-off-by: Chen-Yu Tsai Signed-off-by: Marcel Holtmann commit 31f20f5f6d14ffe8d9a87c0ef58ee7ed72a3db63 Author: Chen-Yu Tsai Date: Mon Dec 17 12:04:38 2018 +0800 dt-bindings: net: broadcom-bluetooth: Add BCM4330 compatible string The BCM4330 is a 802.11 a/b/g/n WiFi + Bluetooth 4.0 chip from Broadcom. It is found in the Ampak AP6330 WiFi+BT module. The partiular one I have identifies as BCM4330B1 for Bluetooth and BCM4330/4 for WiFi. It is unclear if the AP6330 module uses this revision of the BCM4330, or if there are multiple revisions. The module does not have revision markings. This patch elects to use just BCM4330 for the compatible string. Reviewed-by: Rob Herring Signed-off-by: Chen-Yu Tsai Signed-off-by: Marcel Holtmann commit bfbc47bd5901168f0fdb337e9be1759bedf8ff4e Author: Chen-Yu Tsai Date: Mon Dec 17 12:04:37 2018 +0800 dt-bindings: net: broadcom-bluetooth: Add BCM20702A1 compatible string The BCM20702A1 is a Bluetooth 4.0 chip from Broadcom. It is found in the Ampak AP6210 WiFi+BT module, identified from the read verbose config info command response. However the Bluetooth firmware provided by vendors uses the name BCM20710. This patch elects to use the chip ID returned by the chip for the compatible string. Reviewed-by: Rob Herring Tested-by: Ondrej Jirman Signed-off-by: Chen-Yu Tsai Signed-off-by: Marcel Holtmann commit 061a8aaf4c0f2885f1fa1dd6bf8ea27ab5059fa9 Author: Chen-Yu Tsai Date: Mon Dec 17 12:04:36 2018 +0800 dt-bindings: net: broadcom-bluetooth: Add VBAT and VDDIO supplies The Broadcom Bluetooth chips have two power inputs, VBAT and VDDIO. The former provides overall power for the chip, while the latter powers the I/O pins and buffers. This patch adds properties for the two so we can describe the power supply relationships. Reviewed-by: Rob Herring Tested-by: Ondrej Jirman Signed-off-by: Chen-Yu Tsai Signed-off-by: Marcel Holtmann commit 6ae81eebdef97109c32e545e90865bc5b14178f1 Author: Chen-Yu Tsai Date: Mon Dec 17 12:04:35 2018 +0800 dt-bindings: net: broadcom-bluetooth: Fix external clock names The Broadcom Bluetooth controllers can take up to two external clocks: an external frequency reference, substituting the main crystal, and a LPO clock at 32.768 kHz substituting the internal LPO clock. In particular, the external LPO clock must be used when the controller does not have NVRAM connected, and the main reference frequency is not the default 20 MHz. This is described in detail in the datasheet. The original "extclk" clock name is ambiguous as to which of these it refers to, and some designs might even require both. This patch deprecates the existing name, and adds "txco" and "lpo". Tested-by: Ondrej Jirman Signed-off-by: Chen-Yu Tsai Signed-off-by: Marcel Holtmann commit 8e2924e383b714748e5891ac9ff2f5c945666891 Author: Yangtao Li Date: Mon Nov 5 09:56:19 2018 -0500 Bluetooth: Change to use DEFINE_SHOW_ATTRIBUTE macro Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Reviewed-by: Kees Cook Signed-off-by: Marcel Holtmann commit f79ba4300202210eb10b3d41f70ef2b8538fa5c4 Author: Yangtao Li Date: Sat Dec 15 02:22:17 2018 -0500 6lowpan: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Marcel Holtmann commit 945a47d87cee24a95e11fdc0cd868b872f9b9616 Author: John Fastabend Date: Sun Dec 16 15:47:06 2018 -0800 bpf: sk_msg, add tests for size field This adds tests to read the size field to test_verifier. Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann commit 584e46813e689ff1a348343b73122c43d81d0ef7 Author: John Fastabend Date: Sun Dec 16 15:47:05 2018 -0800 bpf: add tools lib/include support sk_msg_md size field Add the size field to sk_msg_md for tools. Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann commit 3bdbd0228e7555ec745e08469b98e5a0966409d6 Author: John Fastabend Date: Sun Dec 16 15:47:04 2018 -0800 bpf: sockmap, metadata support for reporting size of msg This adds metadata to sk_msg_md for BPF programs to read the sk_msg size. When the SK_MSG program is running under an application that is using sendfile the data is not copied into sk_msg buffers by default. Rather the BPF program uses sk_msg_pull_data to read the bytes in. This avoids doing the costly memcopy instructions when they are not in fact needed. However, if we don't know the size of the sk_msg we have to guess if needed bytes are available by doing a pull request which may fail. By including the size of the sk_msg BPF programs can check the size before issuing sk_msg_pull_data requests. Additionally, the same applies for sendmsg calls when the application provides multiple iovs. Here the BPF program needs to pull in data to update data pointers but its not clear where the data ends without a size parameter. In many cases "guessing" is not easy to do and results in multiple calls to pull and without bounded loops everything gets fairly tricky. Clean this up by including a u32 size field. Note, all writes into sk_msg_md are rejected already from sk_msg_is_valid_access so nothing additional is needed there. Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann commit c2c2ce1e9623fdce429c7df84ee8564074d84846 Author: Yongqiang Sun Date: Fri Dec 7 10:38:05 2018 -0500 drm/amd/display: Optimize passive update planes. [Why] passive update planes still spends a litte more time on some cases. [How] Remove unnecessary trace which involving in some register read. Disable debug output for release build. Signed-off-by: Yongqiang Sun Reviewed-by: Tony Cheng Acked-by: Leo Li Signed-off-by: Alex Deucher commit 1ae62f3114a95982f2f4cbe5c7bd14b81233597a Author: Wenjing Liu Date: Mon Dec 3 17:26:15 2018 -0500 drm/amd/display: verify lane status before exiting verify link cap [why] DP LL CTS1.4 4.3.2.1 test failure. [how] The failure is caused by not handling DP link loss hpd short pusle during set mode. The change is to read link status before set mode link training. If link is lost, re-verify link caps. Signed-off-by: Wenjing Liu Reviewed-by: Jun Lei Acked-by: Leo Li Signed-off-by: Alex Deucher commit fd0853567cdf2eeddf22ba9021deedf6b1f90f7a Author: SivapiriyanKumarasamy Date: Thu Nov 29 07:18:29 2018 -0500 drm/amd/display: Fix bug with not updating VSP infoframe [WHY] Currently, when the VSP infopacket is rebuilt in DM, it is not updated when being programmed in encoder. [HOW] Add new VSP case for update_info_frame Signed-off-by: SivapiriyanKumarasamy Reviewed-by: Anthony Koo Acked-by: Krunoslav Kovac Acked-by: Leo Li Signed-off-by: Alex Deucher commit bd4905a9583c760da31ded7256dca6f71483c3dc Author: Paul Hsieh Date: Thu Nov 22 18:43:45 2018 +0800 drm/amd/display: Add retry to read ddc_clock pin [WHY] On customer board, there is one pluse (1v , < 1ms) on DDC_CLK pin when plug / unplug DP cable. Driver will read it and config DP to HDMI/DVI dongle. [HOW] If there is a real dongle, DDC_CLK should be always pull high. Try to read again to recovery this special case. Retry times = 3. Need additional 3ms to detect DP passive dongle(3 failures) Signed-off-by: Paul Hsieh Reviewed-by: Eric Yang Acked-by: Leo Li Signed-off-by: Alex Deucher commit 80adaebd2d411b7d6872a097634848a71eb13d20 Author: Eric Yang Date: Fri Nov 23 05:55:20 2018 -0500 drm/amd/display: Don't skip link training for empty dongle [Why] Skipping initial link training will result in no verified link cap for mode enumeration. Some versions of the BIOS seem to have PHY programming sequence issue as well if initial link training is skipped, resulting in a softlock in BIOS command table. [How] Identify the empty dongle hotplug case, and still do initial link training. Signed-off-by: Eric Yang Reviewed-by: Tony Cheng Acked-by: Leo Li Signed-off-by: Alex Deucher commit 0a6414e75d231ee1bb7ffb2f5eb246b682a884cd Author: Dale Zhao Date: Thu Nov 22 17:13:46 2018 +0800 drm/amd/display: Wait edp HPD to high in detect_sink [Why] In 99% user case, edp will be post by vbios. In 1% / current case: Lenovo don't light up edp panel in vbios post stage, vbios won't be lit up. Thus in dal when we init DCN 10 hw, we power up edp, then we start detect_sink, but internal time is too short, when we detect it, HPD is still low, so we don't detect the edp, and edp shows black. [How] When we init hw, we wait edp HPD to high after power up edp. Signed-off-by: Dale Zhao Reviewed-by: Eric Yang Acked-by: Leo Li Signed-off-by: Alex Deucher commit 6fd3583b92318d6d8367cc3f325a81a222cdbc55 Author: Dmytro Laktyushkin Date: Mon Nov 19 16:25:23 2018 -0500 drm/amd/display: fix surface update sequence An earlier change added update of interdependent dlg/ttu params for pipes not being updated in the current call. The code fails to check if the other pipes are actually active yet causing an assert. This change adds a check for surface presence on the pipes before updating the interdepenednt params. Signed-off-by: Dmytro Laktyushkin Reviewed-by: Nikola Cornij Acked-by: Leo Li Signed-off-by: Alex Deucher commit 12750d1647f118496f1da727146f255f5e44d500 Author: Eric Yang Date: Thu Nov 22 02:07:06 2018 -0500 drm/amd/display: fix YCbCr420 blank color [Why] YCbCr420 packing format uses two chanels for luma, and 1 channel for both chroma component. Our previous implementation did not account for this and results in every other pixel having very high luma value, showing greyish color instead of black. YCbCr444 = ; ..... YCbCr420 = ; ..... [How] Program the second channel with the black color value for luma as well. Signed-off-by: Eric Yang Reviewed-by: Hugo Hu Acked-by: Leo Li Signed-off-by: Alex Deucher commit d71589f290a13bc2aa0d3d847aa8991d815d2f9e Author: David Francis Date: Wed Nov 21 10:44:07 2018 -0500 drm/amd/display: Warn instead of error on REG_WAIT timeout [Why] DC warns when a REG_WAIT takes a while and full-on errors with stack dump on REG_WAIT timeout. Most of the time it isn't a real issue. [How] Make DC cool its jets - taking a while is a debug message (because it is not something that normal users should need to be aware of), and timeouts are warnings (because it technically shouldn't happen, but it's not a big deal if it does) Signed-off-by: David Francis Reviewed-by: Harry Wentland Acked-by: Leo Li Signed-off-by: Alex Deucher commit 3a3cd1dfaf161ccbbf6d35ee92985d1b0285951e Author: Dmytro Laktyushkin Date: Mon Oct 22 14:41:40 2018 -0400 drm/amd/display: move AYCrCb8888 format to video section This is a dual channel format and should be treated like other video formats Signed-off-by: Dmytro Laktyushkin Reviewed-by: Eric Bernstein Acked-by: Leo Li Signed-off-by: Alex Deucher commit d3302424e04d0c5ed478d80c0ff53783091f31f4 Author: Harry Wentland Date: Tue Dec 4 14:10:58 2018 -0500 drm/amd/display: Don't log error if we have no connectors [Why] In certain configurations, such as PX configs or some Vega20 parts DC gets created without connectors. [How] Drop the dm_error print when no connectors. Signed-off-by: Harry Wentland Reviewed-by: Nicholas Kazlauskas Acked-by: Leo Li Signed-off-by: Alex Deucher commit 809c67059162e7ba85c61a83ad7547b4ffbb1e6e Author: Arnd Bergmann Date: Sun Dec 16 20:48:21 2018 +0100 test_rhashtable: remove semaphore usage This is one of only two files that initialize a semaphore to a negative value. We don't really need the two semaphores here at all, but can do the same thing in more conventional and more effient way, by using a single waitqueue and an atomic thread counter. This gets us a little bit closer to eliminating classic semaphores from the kernel. It also fixes a corner case where we fail to continue after one of the threads fails to start up. An alternative would be to use a split kthread_create()+wake_up_process() and completely eliminate the separate synchronization. Acked-by: Phil Sutter Signed-off-by: Arnd Bergmann Acked-by: Herbert Xu Signed-off-by: David S. Miller commit fa7b28c11bbf389617327ad4dd69bbbbbc16a8b4 Author: Heiner Kallweit Date: Sun Dec 16 19:18:26 2018 +0100 net: phy: print stack trace in phy_error So far phy_error() silently stops the PHY state machine. If the network driver doesn't inform about a MDIO error then the user may wonder why his network is down. Let's print the stack trace to facilitate search for the root cause of the error. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 2b3e88ea65287ba738a798622405b15344871085 Author: Heiner Kallweit Date: Sun Dec 16 18:30:14 2018 +0100 net: phy: improve phy state checking Add helpers phy_is_started() and __phy_is_started() to avoid open-coded checks whether PHY has been started. To make the check easier move PHY_HALTED before PHY_UP in enum phy_state. Further improvements: phy_start_aneg(): Return -EBUSY and print warning if function is called from a non-started state (DOWN, READY, HALTED). Better check because function is exported and drivers may use it incorrectly. phy_interrupt(): Return IRQ_NONE also if state is DOWN or READY. We should never receive an interrupt in one of these states, but better play safe. phy_stop(): Just return and print a warning if PHY is in a non-started state. This warning should help to identify drivers with unbalanced calls to phy_start() / phy_stop(). phy_state_machine(): Schedule state machine run only if PHY is in a started state. E.g. if state is READY we don't need the state machine, it will be started by phy_start(). v2: - don't use __func__ within phy_warn_state v3: - use WARN() instead of printing error message to facilitate debugging Signed-off-by: Heiner Kallweit Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 72a8f089c382c078f8c7c1c759cb726de80d4284 Author: Borislav Petkov Date: Tue Dec 18 19:25:46 2018 +0100 x86/mce: Restore MCE injector's module name It was mce-inject.ko but it turned into inject.ko since the containing source file got renamed. Restore it. Fixes: 21afaf181362 ("x86/mce: Streamline MCE subsystem's naming") Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Cc: linux-edac Cc: Tony Luck Link: https://lkml.kernel.org/r/20181218182546.GA21386@zn.tnic commit 2429f13870d3d2abbe200807d0462272e16ec830 Author: Heiner Kallweit Date: Sun Dec 16 15:00:40 2018 +0100 net: fec: remove workaround to restart phylib state machine on MDIO timeout There's a workaround to restart the phylib state machine in case of a MDIO access timeout. Seems it was introduced to deal with the consequences of a too small MDIO timeout. See also commit message of c3b084c24c8a ("net: fec: Adjust ENET MDIO timeouts") which increased the timeout value later. Due to the later timeout value fix it seems to be safe to remove the workaround. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit 3379b3bfb71de154f44bca297f3aa039c5b12852 Author: Colin Ian King Date: Sun Dec 16 13:33:15 2018 +0000 bonding: fix indentation issues, remove extra spaces There are two statements that are indented too much by one space each, fix these. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit 0bae2d4d62d523f06ff1a8e88ce38b45400acd28 Author: Jiong Wang Date: Sat Dec 15 03:34:40 2018 -0500 bpf: correct slot_type marking logic to allow more stack slot sharing Verifier is supposed to support sharing stack slot allocated to ptr with SCALAR_VALUE for privileged program. However this doesn't happen for some cases. The reason is verifier is not clearing slot_type STACK_SPILL for all bytes, it only clears part of them, while verifier is using: slot_type[0] == STACK_SPILL as a convention to check one slot is ptr type. So, the consequence of partial clearing slot_type is verifier could treat a partially overridden ptr slot, which should now be a SCALAR_VALUE slot, still as ptr slot, and rejects some valid programs. Before this patch, test_xdp_noinline.o under bpf selftests, bpf_lxc.o and bpf_netdev.o under Cilium bpf repo, when built with -mattr=+alu32 are rejected due to this issue. After this patch, they all accepted. There is no processed insn number change before and after this patch on Cilium bpf programs. Reviewed-by: Jakub Kicinski Signed-off-by: Jiong Wang Reviewed-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov commit 2849dd8bc72b62a315854863c84c523176bd55ce Author: Taniya Das Date: Fri Dec 14 09:40:24 2018 +0530 cpufreq: qcom-hw: Add support for QCOM cpufreq HW driver The CPUfreq HW present in some QCOM chipsets offloads the steps necessary for changing the frequency of CPUs. The driver implements the cpufreq driver interface for this hardware engine. Signed-off-by: Saravana Kannan Signed-off-by: Taniya Das Reviewed-by: Stephen Boyd Tested-by: Stephen Boyd Acked-by: Viresh Kumar Tested-by: Amit Kucheria Signed-off-by: Rafael J. Wysocki commit 0a3b0c7f979563c97a136c51e43ef724121e83ed Author: Taniya Das Date: Fri Dec 14 09:40:23 2018 +0530 dt-bindings: cpufreq: Introduce QCOM cpufreq firmware bindings Add QCOM cpufreq firmware device bindings for Qualcomm Technology Inc's SoCs. This is required for managing the cpu frequency transitions which are controlled by the hardware engine. Signed-off-by: Taniya Das Reviewed-by: Stephen Boyd Acked-by: Viresh Kumar Tested-by: Amit Kucheria Reviewed-by: Rob Herring Signed-off-by: Rafael J. Wysocki commit 1c01a45a86ed6991953e74be63b6a7e33b387954 Author: Leo Li Date: Wed Oct 31 17:07:41 2018 -0400 drm/amd/display: Add functionality to get XGMI SS info [Why] When XGMI is enabled, the DP reference clock needs to be adjusted according to the XGMI spread spectrum percentage and mode. But first, we need the ability to fetch this info. [How] Within the BIOS parser, Read from vBIOS when XGMI SS info is requested. In addition, diags build uses include_legacy/atomfirmware.h for the smu_info_v3_3 table headers. Update that as well. Signed-off-by: Leo Li Reviewed-by: Nicholas Kazlauskas Acked-by: Tony Cheng Signed-off-by: Alex Deucher commit b8b6ce89016485cb92fdf2f527b40249aefbc470 Author: Leo Li Date: Wed Oct 31 16:56:54 2018 -0400 drm/amd/display: Add DCE_VERSION_12_1 enum for Vega 20 [Why] We'll need a way to differentiate Vega 20 in DC [How] Add a DCE_VERSION_12_1 enum, which will be returned as the DC version if the ASIC used is a Vega 20. Signed-off-by: Leo Li Reviewed-by: David Francis Signed-off-by: Alex Deucher commit f569da8c994c2254a106bdb537aa271399e288ec Author: Marco Felsch Date: Tue Dec 18 16:52:39 2018 +0100 device property: fix fwnode_graph_get_next_endpoint() documentation Sync documentation with code. Fixes: 07bb80d40b0e (device property: Add support for remote endpoints) Signed-off-by: Marco Felsch Acked-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit 180db303ff466a3887c841e805568b92233e2d0e Author: Nicholas Kazlauskas Date: Wed Dec 5 12:08:56 2018 -0500 drm/amd/display: Add below the range support for FreeSync [Why] When the flip-rate is below the minimum supported variable refresh rate range for the monitor the front porch wait will timeout and be frequently misaligned resulting in stuttering and/or flickering. The FreeSync module can still maintain a smooth and flicker free image when the monitor has a refresh rate range such that the maximum refresh > 2 * minimum refresh by utilizing low framerate compensation, "below the range". [How] Hook up the pre-flip and post-flip handlers from the FreeSync module. These adjust the minimum/maximum vrr range to duplicate frames when appropriate by tracking flip timestamps. Signed-off-by: Nicholas Kazlauskas Acked-by: Leo Li Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 8cd61c313d8b5a813a38b615796ea50563f3afae Author: Roman Li Date: Tue Nov 20 16:50:29 2018 -0500 drm/amd/display: Raise dispclk value for Polaris [Why] The visual corruption due to low display clock value observed on some systems [How] There was earlier patch for dspclk: 'drm/amd/display: Raise dispclk value for dce_update_clocks' Adding +15% workaround also to to dce112_update_clocks Signed-off-by: Roman Li Reviewed-by: Leo Li Signed-off-by: Alex Deucher commit 77acd1cd912987ffd62dad6a09275a1fb406f0c2 Author: Nicholas Kazlauskas Date: Fri Dec 14 12:26:58 2018 -0500 drm/amd/display: Skip fast cursor updates for fb changes [Why] The behavior of drm_atomic_helper_cleanup_planes differs depending on whether the commit was asynchronous or not. When it's called from amdgpu_dm_atomic_commit_tail during a typical atomic commit the plane state has been swapped so it calls cleanup_fb on the old plane state. However, in the asynchronous commit codepath the call to drm_atomic_helper_commit also calls dm_plane_helper_cleanup_fb after atomic_async_update has been called. Since the plane state is updated in place and has not been swapped the cleanup_fb call affects the new plane state. This results in a use after free for the given sequence: - Fast update, fb1 pin/ref, fb1 unpin/unref - Fast update, fb2 pin/ref, fb2 unpin/unref - Slow update, fb1 pin/ref, fb2 unpin/unref - Fast update, fb2 pin/ref -> use after free. bug [How] Disallow framebuffer changes in the fast path. Since this includes a NULL framebuffer, this means that only framebuffers that have been previously pin+ref at least once will be used, preventing a use after free. This has a significant throughput reduction for cursor updates where the framebuffer changes. For most desktop usage this isn't a problem, but it does introduce performance regressions for two specific IGT tests: - cursor-vs-flip-toggle - cursor-vs-flip-varying-size Fixes: 2cc751931afc ("drm/amd/display: Add fast path for cursor plane updates") Signed-off-by: Nicholas Kazlauskas Reviewed-by: Andrey Grodzovsky Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 379c237e392e4cec09ff5853b5c0724a1e5d51b0 Author: Evan Quan Date: Mon Dec 17 17:51:22 2018 +0800 drm/amdgpu: correct the return value for error case It should not return 0 for error case as '0' is actually a special value for index. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit e98bdb8061305ec00ca9c11231a606e849477bc8 Author: Felix Kuehling Date: Fri Dec 14 11:57:02 2018 -0500 drm/amdkfd: Fix handling of return code of dma_buf_get On errors, dma_buf_get returns a negative error code, rather than NULL. Reported-by: Dan Carpenter Signed-off-by: Felix Kuehling Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 7ab3f021bbc8078e7fbd1d06b6b3105dc010dc0e Author: James Zhu Date: Mon Dec 17 08:35:05 2018 -0500 drm/amdgpu:Improves robustness of SOC15_WAIT_ON_RREG If register value is updating, reset timeout counter. It improves robustness of SOC15_WAIT_ON_RREG. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 9194fb22ddd8e178e4e83e656b0c2346124ba9ec Author: James Zhu Date: Wed Dec 12 14:57:12 2018 -0500 drm/amdgpu/vcn:Remove bit 31 for scratch2 to indicate the WA is active Remove bit 31 for scratch2 to indicate the Hardware bug work around is active. Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit 12e8b30186b9682dc7e267ab988652b74abfa081 Author: James Zhu Date: Wed Dec 12 14:53:12 2018 -0500 drm/amdgpu/vcn:Scan enc/jpeg fences to init dpg pause new state Scan enc/jpeg fences to init dpg pause new state in begin use. It will help set dpg mode to desire state actively. Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit 8411f7dc5f61be650b6a26736cea5b1c318fc1f3 Author: James Zhu Date: Wed Dec 12 14:50:03 2018 -0500 drm/amdgpu/vcn:Always check all vcn ring status during dpg mode stop Always check all vcn ring status during dpg mode stop, it will help identify which vcn ring may cause the issue. Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit e0d460a4d2d160afbfad4ac2b9acd17ccb3d110b Author: James Zhu Date: Wed Dec 12 14:48:33 2018 -0500 drm/amdgpu/vcn:Update ring point to JPEG before init JPEG wptr It is a bug fix. Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit af8d70375d562034d375ca7a8b08997422223258 Author: Shamir Rabinovitch Date: Mon Dec 17 17:15:16 2018 +0200 RDMA/restrack: Resource-tracker should not use uobject pointers Having uobject pointer embedded in ib core objects is not aligned with a future shared ib_x model. The resource tracker only does this to keep track of user/kernel objects - track this directly instead. Signed-off-by: Shamir Rabinovitch Signed-off-by: Jason Gunthorpe commit 5d65cab6c614f95549b19416b2aad824c6d9283a Author: James Zhu Date: Wed Dec 12 14:46:10 2018 -0500 drm/amdgpu/vcn:Always gate vcn block during hw finishing Under Dynamic Power Gate mode, UVD_STATUS needn't be checked. Signed-off-by: James Zhu Acked-by: Leo Liu Signed-off-by: Alex Deucher commit f9872f100aefd3b80eb4a61dbea326ee28cdc94a Author: James Zhu Date: Mon Dec 3 22:04:28 2018 -0500 drm/amdgpu/vcn: Update vcn.cur_state during suspend Replace vcn_v1_0_stop with vcn_v1_0_set_powergating_state during suspend, to keep adev->vcn.cur_state update. It will fix VCN S3 hung issue. Signed-off-by: James Zhu Reviewed-by: Leo Liu Signed-off-by: Alex Deucher commit 813e90b1aeaa550641332625174d57edb15bc8bd Author: Moni Shoua Date: Tue Dec 11 13:37:53 2018 +0200 IB/mlx5: Add advise_mr() support The verb advise_mr() is used to give advice to the kernel about an address range that belongs to a MR. Implement the verb and register it on the device. The current implementation supports the only known advice to date, prefetch. Signed-off-by: Moni Shoua Reviewed-by: Guy Levi Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit ad8a4496757f6f7344011a20a07195bd27e3989c Author: Moni Shoua Date: Tue Dec 11 13:37:52 2018 +0200 IB/uverbs: Add support to advise_mr Add new ioctl method for the MR object - ADVISE_MR. This command can be used by users to give an advice or directions to the kernel about an address range that belongs to memory regions. A new ib_device callback, advise_mr(), is introduced here to suupport the new command. This command takes the following arguments: - pd: The protection domain to which all memory regions belong - advice: The type of the advice * IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH - Pre-fetch a range of an on-demand paging MR * IB_UVERBS_ADVISE_MR_ADVICE_PREFETCH_WRITE - Pre-fetch a range of an on-demand paging MR with write intention - flags: The properties of the advice * IB_UVERBS_ADVISE_MR_FLAG_FLUSH - Operation must end before return to the caller - sg_list: The list of memory ranges - num_sge: The number of memory ranges in the list - attrs: More attributes to be parsed by the provider Signed-off-by: Moni Shoua Reviewed-by: Guy Levi Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit cbfdd442c43eab8c62bf2ea5127511cd39e9046d Author: Moni Shoua Date: Tue Dec 11 13:37:51 2018 +0200 IB/uverbs: Add helper to get array size from ptr attribute When the parser of an ioctl command has the knowledge that a ptr attribute in a bundle represents an array of structures, it is useful for it to know the number of elements in the array. This is done by dividing the attribute length with the element size. Signed-off-by: Moni Shoua Reviewed-by: Guy Levi Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit a38d1107f937ca95dcf820161ef44ea683d6a0b1 Author: Matt Mullins Date: Wed Dec 12 16:42:37 2018 -0800 bpf: support raw tracepoints in modules Distributions build drivers as modules, including network and filesystem drivers which export numerous tracepoints. This enables bpf(BPF_RAW_TRACEPOINT_OPEN) to attach to those tracepoints. Signed-off-by: Matt Mullins Acked-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov commit bbc13cda37711eb7baa4091017887a57074f5410 Author: Parav Pandit Date: Fri Nov 30 13:16:48 2018 +0200 RDMA/uverbs: Add an ioctl method to destroy an object Add an ioctl method to destroy the PD, MR, MW, AH, flow, RWQ indirection table and XRCD objects by handle which doesn't require any output response during destruction. Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 615740fd6b0c44e6ba1beaa87ddbdf7ead57ecf4 Merge: 07daef8b41e0d 7f83a1327962b Author: Thomas Gleixner Date: Tue Dec 18 22:57:38 2018 +0100 Merge branch 'clockevents/4.21' of http://git.linaro.org/people/daniel.lezcano/linux into timers/core Pull clocksource/event changes from Daniel Lezcano: - Add the sched_clock for the arc timer (Alexey Brodkin) - Change the file timer names for riscv, rockchip, tegra20, sun4i and meson6 (Daniel Lezcano) - Add the DT bindings for r8a7796, r8a77470 and r8a774a1 (Biju Das) - Remove the early platform driver registration for timer-ti-dm (Bartosz Golaszewski) - Provide the sched_clock for the riscv timer (Anup Patel) - Add support for ARM64 for the imx-gpt and convert the imx-tpm to the timer-of API (Anson Huang) - Remove useless irq protection for the imx-gpt (Clément Péron) - Remove a duplicate function name for the vt8500 (Dan Carpenter) - Remove obsolete inclusion of for the tegra20 (Geert Uytterhoeven) - Demote the prcmu and the custom sched_clock for the dbx500 and the ux500 (Linus Walleij) - Add a new timer clock for the RDA8810PL (Manivannan Sadhasivam) - Rename the macro to stick to the register name and add the delay timer (Martin Blumenstingl) - Switch the bcm2835 to the SPDX identifier (Stefan Wahren) - Fix the interrupt register access on the fttmr010 (Tao Ren) - Add missing of_node_put in the initialization path on the integrator-ap (Yangtao Li) commit 149d3845f4a548dbc83932fab3491aeb0b070b3a Author: Jason Gunthorpe Date: Fri Nov 30 13:16:47 2018 +0200 RDMA/uverbs: Add a method to introspect handles in a context Introduce a helper function gather_objects_handle() to copy object handles under a spin lock. Expose these objects handles via the uverbs ioctl interface. Signed-off-by: Jason Gunthorpe Signed-off-by: Parav Pandit Signed-off-by: Leon Romanovsky commit 3c3d71013c7655b9cc4043c9f8845f0c4402d71d Author: Alexandre Belloni Date: Tue Dec 18 22:42:23 2018 +0100 rtc: pcf2123: Add Microcrystal rv2123 Add a compatible string for Microcrystal rv2123 as the reset procedure seem to be differing. However, the current driver works just fine. Signed-off-by: Alexandre Belloni commit a26944149374c19d92f785108b6980f2e54bb517 Author: Alexandre Belloni Date: Tue Dec 18 22:15:58 2018 +0100 rtc: class: reimplement devm_rtc_device_register Implement devm_rtc_device_register using devm_rtc_allocate_device and __rtc_register_device so there is only one path left to register rtc devices. Also mark it as deprecated so new drivers will hopefully use devm_rtc_allocate_device and rtc_register_device that are less race prone and allow avoiding the 2038, 2070, 2100 and 2106 bugs properly. Signed-off-by: Alexandre Belloni commit 9a03201170d3de1da47c1b7e2d514e0b15477881 Author: Alexandre Belloni Date: Tue Dec 18 22:11:26 2018 +0100 rtc: enforce rtc_timer_init private_data type All the remaining users of rtc_timers are passing the rtc_device as private data. Enforce that and rename private_data to rtc. Suggested-by: Arnd Bergmann Signed-off-by: Alexandre Belloni commit ffe1c5a2d4271a0e04e2576ab0a53ac09a14e065 Author: Marek Vasut Date: Fri Dec 7 18:40:53 2018 +0100 rtc: abx80x: Implement RTC_VL_READ,CLR ioctls Implement standard ioctls for polling the battery status and clearing the battery low indication from userspace. Signed-off-by: Marek Vasut Cc: Alexandre Belloni Signed-off-by: Alexandre Belloni commit 350b4c8ac1b4c07909ab7f8ad4303fff2505ab7c Author: Yuval Shaia Date: Tue Dec 11 10:36:47 2018 +0200 IB/mlx4: Utilize macro to calculate SQ spare size The macro MLX4_IB_SQ_HEADROOM calculates the spare room needed to be left. Use it instead of hard-coding the HW prefetch size. Signed-off-by: Yuval Shaia Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 7f83a1327962b9b3712866db8cbafbdee239cce4 Author: Manivannan Sadhasivam Date: Mon Dec 10 23:05:46 2018 +0530 clocksource/drivers/rda: Add clock driver for RDA8810PL SoC Add clock driver for RDA Micro RDA8810PL SoC supporting OSTIMER and HWTIMER. RDA8810PL has two independent timers: OSTIMER (56 bit) and HWTIMER (64 bit). Each timer provides optional interrupt support. In this driver, OSTIMER is used for clockevents and HWTIMER is used for clocksource. Signed-off-by: Andreas Färber Signed-off-by: Manivannan Sadhasivam Signed-off-by: Daniel Lezcano commit adab4ec3c2341d0939a3a83b81320a934c64c3e2 Author: Daniel Lezcano Date: Sun Dec 9 17:40:14 2018 +0100 clocksource/drivers/meson6: Change name meson6_timer timer-meson6 In order to unify the names in this directory, let's rename the driver to be prefixed with timer-* Signed-off-by: Daniel Lezcano commit 493d09b7a7f5b23f176b00f944ad77e9e0c84672 Author: Daniel Lezcano Date: Sun Dec 9 17:38:54 2018 +0100 clocksource/drivers/sun4i: Change name sun4i_timer to timer-sun4i In order to unify the names in this directory, let's rename the driver to be prefixed with timer-* Signed-off-by: Daniel Lezcano commit f155ae2c35c9ea8ce52f3ac670ced0eb23eded19 Author: Daniel Lezcano Date: Sun Dec 9 17:37:13 2018 +0100 clocksource/drivers/tegra20: Change name tegra20_timer to timer-tegra20 In order to unify the names in this directory, let's rename the driver to be prefixed with timer-* Signed-off-by: Daniel Lezcano commit 2d3bc644dd161c6c3e92dac74a4112c0411d4698 Author: Daniel Lezcano Date: Sun Dec 9 17:35:44 2018 +0100 clocksource/drivers/rockchip: Change name rockchip_timer to timer-rockchip In order to unify the names in this directory, let's rename the driver to be prefixed with timer-* Signed-off-by: Daniel Lezcano commit 3d42b32b1d6bdee161f6d629fc850fdf0c0fb2a1 Author: Daniel Lezcano Date: Sun Dec 9 17:34:04 2018 +0100 clocksource/drivers/riscv: Change name riscv_timer to timer-riscv In order to unify the names in this directory, let's rename the driver to be prefixed with timer-* Reviewed-by: Palmer Dabbelt Signed-off-by: Daniel Lezcano commit 92e0d143fdef1faa7560c93fb0d6cd6c61da88ee Author: Anup Patel Date: Tue Dec 4 15:59:52 2018 +0530 clocksource/drivers/riscv_timer: Provide the sched_clock Currently, we don't have a sched_clock registered for RISC-V systems. This means Linux time keeping will use jiffies (running at HZ) as the default sched_clock. To avoid this, we explicity provide sched_clock using RISC-V rdtime instruction (similar to riscv_timer clocksource). Signed-off-by: Anup Patel Reviewed-by: Palmer Dabbelt Signed-off-by: Daniel Lezcano commit 4f352d1fc5a8d3220e29766a26172eff34867014 Author: Anson Huang Date: Fri Dec 7 06:05:36 2018 +0000 clocksource/drivers/timer-imx-tpm: Specify clock name for timer-of i.MX TPM needs "ipg" clock for register access and "per" clock for timer function, the driver gets "ipg" clock by searching the clock name, but timer-of initialization will get first clock in device tree TPM node since no clock name specified in of_clk, that means the "per" clock MUST be the first clock entry in device tree TPM node, this patch specifies clock name for of_clk to avoid this restriction, it makes TPM driver work properly with different sequence of clock entries in device tree TPM node. Signed-off-by: Anson Huang Signed-off-by: Daniel Lezcano commit 86fe57fc47b17b3528fa5497fc57e158d846c4ea Author: Tao Ren Date: Wed Oct 3 14:53:50 2018 -0700 clocksource/drivers/fttmr010: Fix invalid interrupt register access TIMER_INTR_MASK register (Base Address of Timer + 0x38) is not designed for masking interrupts on ast2500 chips, and it's not even listed in ast2400 datasheet, so it's not safe to access TIMER_INTR_MASK on aspeed chips. Similarly, TIMER_INTR_STATE register (Base Address of Timer + 0x34) is not interrupt status register on ast2400 and ast2500 chips. Although there is no side effect to reset the register in fttmr010_common_init(), it's just misleading to do so. Besides, "count_down" is renamed to "is_aspeed" in "fttmr010" structure, and more comments are added so the code is more readble. Signed-off-by: Tao Ren Reviewed-by: Linus Walleij Signed-off-by: Daniel Lezcano commit 5eb73c831171115d3b4347e1e7124a5a35d8086c Author: Yangtao Li Date: Sun Nov 25 00:00:49 2018 -0500 clocksource/drivers/integrator-ap: Add missing of_node_put() The function of_find_node_by_path() acquires a reference to the node returned by it and that reference needs to be dropped by its caller. integrator_ap_timer_init_of() doesn't do that. The pri_node and the sec_node are used as an identifier to compare against the current node, so we can directly drop the refcount after getting the node from the path as it is not used as pointer. By dropping the refcount right after getting it, a single variable is needed instead of two. Fix this by use a single variable and drop the refcount right after of_find_node_by_path(). Signed-off-by: Yangtao Li Signed-off-by: Daniel Lezcano commit 64db8bb157cb8108ae017f00c2d47f03d4ebe8a6 Author: Stefan Wahren Date: Sat Nov 10 16:28:39 2018 +0100 clocksource/drivers/bcm2835: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Also drop the FSF address. Cc: Simon Arlott Signed-off-by: Stefan Wahren Reviewed-by: Eric Anholt Acked-by: Daniel Lezcano Signed-off-by: Daniel Lezcano commit e5a805202c8ebb3b27cd8ad1b227158ae9cb9464 Author: Biju Das Date: Mon Nov 19 16:14:13 2018 +0000 dt-bindings: timer: renesas, cmt: Document r8a774a1 CMT support Document SoC specific bindings for RZ/G2M (r8a774a1) SoC. Signed-off-by: Biju Das Reviewed-by: Simon Horman Signed-off-by: Daniel Lezcano commit 3825603a8076738d95b430d36896a760d7fc4909 Author: Anson Huang Date: Tue Nov 6 05:15:58 2018 +0000 clocksource/drivers/timer-imx-tpm: Convert the driver to timer-of Convert the driver to use the timer_of helpers. This allows to handle timer base, clock and irq using common timer_of driver and it simplifies the code. Signed-off-by: Anson Huang Signed-off-by: Daniel Lezcano commit bf287607c80f24387fedb431a346dc67f25be12c Author: Alexey Brodkin Date: Mon Nov 19 14:29:17 2018 +0300 clocksource/drivers/arc_timer: Utilize generic sched_clock It turned out we used to use default implementation of sched_clock() from kernel/sched/clock.c which was as precise as 1/HZ, i.e. by default we had 10 msec granularity of time measurement. Now given ARC built-in timers are clocked with the same frequency as CPU cores we may get much higher precision of time tracking. Thus we switch to generic sched_clock which really reads ARC hardware counters. This is especially helpful for measuring short events. That's what we used to have: ------------------------------>8------------------------ $ perf stat /bin/sh -c /root/lmbench-master/bin/arc/hello > /dev/null Performance counter stats for '/bin/sh -c /root/lmbench-master/bin/arc/hello': 10.000000 task-clock (msec) # 2.832 CPUs utilized 1 context-switches # 0.100 K/sec 1 cpu-migrations # 0.100 K/sec 63 page-faults # 0.006 M/sec 3049480 cycles # 0.305 GHz 1091259 instructions # 0.36 insn per cycle 256828 branches # 25.683 M/sec 27026 branch-misses # 10.52% of all branches 0.003530687 seconds time elapsed 0.000000000 seconds user 0.010000000 seconds sys ------------------------------>8------------------------ And now we'll see: ------------------------------>8------------------------ $ perf stat /bin/sh -c /root/lmbench-master/bin/arc/hello > /dev/null Performance counter stats for '/bin/sh -c /root/lmbench-master/bin/arc/hello': 3.004322 task-clock (msec) # 0.865 CPUs utilized 1 context-switches # 0.333 K/sec 1 cpu-migrations # 0.333 K/sec 63 page-faults # 0.021 M/sec 2986734 cycles # 0.994 GHz 1087466 instructions # 0.36 insn per cycle 255209 branches # 84.947 M/sec 26002 branch-misses # 10.19% of all branches 0.003474829 seconds time elapsed 0.003519000 seconds user 0.000000000 seconds sys ------------------------------>8------------------------ Note how much more meaningful is the second output - time spent for execution pretty much matches number of cycles spent (we're runnign @ 1GHz here). Signed-off-by: Alexey Brodkin Cc: Daniel Lezcano Cc: Vineet Gupta Cc: Thomas Gleixner Cc: stable@vger.kernel.org Acked-by: Vineet Gupta Signed-off-by: Daniel Lezcano commit 2bbaf54216448486def1153486778a975a73041d Author: Biju Das Date: Fri Oct 26 09:36:13 2018 +0100 dt-bindings: timer: renesas, cmt: Document r8a77470 CMT support Document SoC specific compatible strings for r8a77470. No driver change is needed as the fallback strings will activate the right code. Signed-off-by: Biju Das Reviewed-by: Fabrizio Castro Reviewed-by: Simon Horman Reviewed-by: Rob Herring Signed-off-by: Daniel Lezcano commit f9135ffa8a272bde9928e75ce14d02d4496159ae Author: Biju Das Date: Fri Oct 26 09:01:44 2018 +0100 dt-bindings: timer: renesas, cmt: Document r8a7796 CMT support Document SoC specific bindings for R-Car M3-W (r8a7796) SoC. Signed-off-by: Biju Das Reviewed-by: Fabrizio Castro Reviewed-by: Simon Horman Reviewed-by: Rob Herring Signed-off-by: Daniel Lezcano commit ec3372f28f7bf589388780df5eda945d4cdd7c4b Author: Clément Péron Date: Mon Nov 5 15:15:11 2018 +0100 clocksource/drivers/imx-gpt: Remove unnecessary irq protection shutdown and oneshot are already protected against irq interruptions Signed-off-by: Clément Péron Signed-off-by: Daniel Lezcano commit df181e38281602bb404c5c8158a87317274dc653 Author: Anson Huang Date: Mon Nov 5 01:10:27 2018 +0000 clocksource/drivers/imx-gpt: Add support for ARM64 This patch allows building and compile-testing the i.MX GPT driver also for ARM64. The delay_timer is only supported on ARMv7. Signed-off-by: Anson Huang Signed-off-by: Daniel Lezcano commit fa83c6f45aa560f814adfdf1a0bf523c1157dfe1 Author: Martin Blumenstingl Date: Thu Nov 15 23:46:57 2018 +0100 clocksource/drivers/meson6_timer: Implement the ARM delay timer Implement an ARM delay timer to be used for udelay(). This allows us to skip the delay loop calibration at boot. With this patch udelay() is now independent of CPU frequency changes. This is a good thing on Meson8, Meson8b and Meson8m2 because changing the CPU frequency requires running the CPU clock off the XTAL while changing the PLL or it's dividers. After changing the CPU clocks we need to wait a few usecs for the clock to become stable. So having an udelay() implementation that doesn't depend on the CPU frequency is beneficial. Suggested-by: Jianxin Pan Signed-off-by: Martin Blumenstingl Signed-off-by: Daniel Lezcano commit bed8fc137e20df7dabcaff0bf2bfe494766aa556 Author: Martin Blumenstingl Date: Thu Nov 15 23:46:56 2018 +0100 clocksource/drivers/meson6_timer: Use register names from the datasheet This makes the driver use the names from S805 datasheet for the preprocessor #defines. This makes it easier to spot that the driver currently only supports Timer A (as clockevent with interrupt support) and Timer E (as clocksource without interrupts). Timer B, C and D (which are similar to Timer A) are currently not supported by the driver. While here, this also removes the internal "CED_ID" and "CSD_ID" defines which are used to identify the timer. These IDs are not described in the datasheet and thus make it harder to compare the code to what's written in the datasheet. Signed-off-by: Martin Blumenstingl Signed-off-by: Daniel Lezcano commit 7b59263801077e480be79e5f9a3a3bcdefeb05b8 Author: Geert Uytterhoeven Date: Thu Nov 15 11:00:37 2018 +0100 clockevents/drivers/tegra20: Remove obsolete inclusion of As of commit da4a686a2cfb077a ("ARM: smp_twd: convert to use CLKSRC_OF init"), this header file is no longer used. Signed-off-by: Geert Uytterhoeven Acked-by: Thierry Reding Signed-off-by: Daniel Lezcano commit 63136299721b4bfbd51ddd41181ab3a5897958bb Author: Bartosz Golaszewski Date: Wed Nov 14 10:53:12 2018 +0100 clocksource/drivers/timer-ti-dm: Remove the early platform driver registration This driver is no longer used as an early platform driver. Remove the registration macro. Signed-off-by: Bartosz Golaszewski Signed-off-by: Daniel Lezcano commit 85b6fcadcf6626ad520376eacfb2b77090e782ab Author: Linus Walleij Date: Thu Nov 15 14:32:03 2018 +0100 clocksource/drivers/ux500: Drop Ux500 custom SCHED_CLOCK The two drivers used for Ux500 sched_clock use two Kconfig symbols to select which of the two gets used as sched_clock. This isn't right: the workaround is trying to make sure that the NONSTOP timer is used for sched_clock in order to keep that clock ticking consistently over a suspend/resume cycle. (Otherwise sched_clock simply stops during suspend and continues after resume). This will notably affect any timetstamped debug prints, so that they show the absolute number of seconds since the system was booted and does not loose wall-clock time during suspend and resume as if time stood still. The real way to fix this problem is to make sched_clock take advantage of any NONSTOP clock source on the system and adjust accordingly, not to try to work around this by using a different sched_clock depending on what system we are compiling for. This can solve the problem for everyone instead of providing a local solution. Cc: Baolin Wang Signed-off-by: Linus Walleij Signed-off-by: Daniel Lezcano commit bc0750e464d41e1234f56471b8f626b8d945b1a8 Author: Linus Walleij Date: Thu Nov 15 14:32:02 2018 +0100 clocksource/drivers/dbx500: Demote dbx500 PRCMU clocksource Demote the DBx500 PRCMU clocksource to quality 100 and mark it as NONSTOP so it will still be used for timekeeping across suspend/resume. The Nomadik MTU timer which has higher precision will be used when the system is up and running, thanks to the recent changes properly utilizing the suspend clocksources. This was discussed back in 2011 when the driver was written, but the infrastructure was not available upstream to use this timer properly. Now the infrastructure is there, so let's finalize the work. Cc: Baolin Wang Signed-off-by: Linus Walleij Reviewed-by: Baolin Wang Signed-off-by: Daniel Lezcano commit 30a85eb64347ef16aefba3aa96cb7f2c1615290a Author: Dan Carpenter Date: Sat Oct 13 13:22:22 2018 +0300 clocksource/drivers/timer-vt8500: Remove duplicate function name We print the function name twice in a row in the error message so I've removed one. Signed-off-by: Dan Carpenter Signed-off-by: Daniel Lezcano commit e9dfa53a399545056cf97cf8c996d71dcebb4d7e Author: Dan Carpenter Date: Mon Dec 17 10:08:15 2018 +0300 RDMA/hns: Fix an error code in hns_roce_create_srq() The function accidentally returns success on this error path. Fixes: c7bcb13442e1 ("RDMA/hns: Add SRQ support for hip08 kernel mode") Signed-off-by: Dan Carpenter Acked-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit 5050ae5fa3d54c8e83e1e447cc7e3591110a7f57 Author: Dan Carpenter Date: Mon Dec 17 10:05:36 2018 +0300 IB/qib: Fix an error code in qib_sdma_verbs_send() We accidentally return success on this error path. Fixes: f931551bafe1 ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters") Signed-off-by: Dan Carpenter Signed-off-by: Jason Gunthorpe commit be5914c124bc3179536e5c4598f59aeb4b880517 Author: Parav Pandit Date: Tue Dec 18 14:16:00 2018 +0200 RDMA/core: Delete RoCE GID in hw when corresponding IP is deleted Currently a RoCE GID entry is removed from the hardware when all references to the GID entry drop to zero. This is a change in behavior from before the fixed patch. The GID entry should be removed from the hardware when GID entry deletion is requested. This allows the driver terminate ongoing traffic through the RoCE GID. While a GID is deleted from the hardware, GID slot in the software GID cache is not freed. GID slot is freed once all references of such GID are dropped. This continue to ensure that such GID slot of hardware is not allocated to new GID entry allocation request. It is allocated once all references to GID entry drop. This approach allows drivers to put a tombestone of some kind on the HW GID index to block the traffic. Fixes: b150c3862d21 ("IB/core: Introduce GID entry reference counts") Signed-off-by: Parav Pandit Reviewed-by: Mark Bloch Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit ac2f7e623d47fd68d2517f191696fbc96a5d7270 Author: Gal Pressman Date: Tue Dec 18 17:57:32 2018 +0200 RDMA/mlx5: Fix function name typo 'fileds' -> 'fields' Fix typo in 'set_mr_fileds' -> 'set_mr_fields'. Signed-off-by: Gal Pressman Signed-off-by: Jason Gunthorpe commit b81a327dbc0d07c219ac48b7daf155ea6a51672b Author: Kamal Heib Date: Tue Dec 18 22:55:07 2018 +0200 RDMA/i40iw: Make sure to initialize ib_device_ops The initialization of the ib_device_ops was dropped by mistake when rebasing the ib_device_ops series, this patch fixes that. Fixes: 15644f57cb66 ("RDMA/i40iw: Initialize ib_device_ops struct") Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 8e3b688301863fba914883e3531b406c68cb7501 Author: Leon Romanovsky Date: Wed Dec 12 19:45:53 2018 +0200 RDMA/mlx5: Delete unreachable handle_atomic code by simplifying SW completion Handle atomic was left as unimplemented from 2013, remove the code till this part will be developed. Remove the dead code by simplifying SW completion logic which is supposed to be the same for send and receive paths. Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Reported-by: Stephen Rothwell Signed-off-by: Leon Romanovsky Tested-by: Stephen Rothwell # compile tested Signed-off-by: Jason Gunthorpe commit a01aa7680e3dea204c64bb245dc7a6c46e2e15f9 Merge: 77c7a7b3e7da2 af854724e51e4 Author: David S. Miller Date: Tue Dec 18 12:01:02 2018 -0800 Merge branch 'hns3-next' Peng Li says: ==================== net: hns3: code optimizations & bugfixes for HNS3 driver This patchset includes bugfixes and code optimizations for the HNS3 ethernet controller driver ==================== Signed-off-by: David S. Miller commit af854724e51e4047f534ac6d19b3ef9fb3c35c49 Author: Yunsheng Lin Date: Tue Dec 18 19:37:59 2018 +0800 net: hns3: fix a SSU buffer checking bug When caculating the SSU buffer, it first allocate tx and rx private buffer, then the remaining buffer is for rx shared buffer. The remaining buffer size should be at least bigger than or equal to the shared_std, which is the minimum shared buffer size required by the driver, but currently if the remaining buffer size is equal to the shared_std, it returns failure, which causes SSU buffer allocation failure problem. This patch fixes this problem by rounding up shared_std before checking the the remaining buffer size bigger than or equal to the shared_std. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: David S. Miller commit b9a400ac295728b2d47445e09814e1880409b311 Author: Yunsheng Lin Date: Tue Dec 18 19:37:58 2018 +0800 net: hns3: aligning buffer size in SSU to 256 bytes The hardware expects the buffer size set to SSU is aligned to 256 bytes, this patch aligns the buffer size to 256 byte using roundup or rounddown function. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 368686be234daf365ef184a6ee1c4a6c18ede3b1 Author: Yunsheng Lin Date: Tue Dec 18 19:37:57 2018 +0800 net: hns3: getting tx and dv buffer size through firmware This patch adds support of getting tx and dv buffer size through firmware, because different version of hardware requires different size of tx and dv buffer. This patch also add dv_buf_size to tc' private buffer size even if pfc is not enable for the tc. Signed-off-by: Yunsheng Lin Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 0ad5ea5dbd6cb1e62bac547db5e61bab15af4f44 Author: Peng Li Date: Tue Dec 18 19:37:56 2018 +0800 net: hns3: synchronize speed and duplex from phy when phy link up Driver calls phy_connect_direct and registers hclge_mac_adjust_link to synchronize mac speed and duplex from phy. It is better to synchronize mac speed and duplex from phy when phy link up. Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 8362089d787724bb252f13f942921051943369c7 Author: Fuyun Liang Date: Tue Dec 18 19:37:55 2018 +0800 net: hns3: remove 1000M/half support of phy Our phy does not support 1000M/half, this patch removes 1000M/half from PHY_SUPPORTED_FEATURES. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 7445565cd064679421e3cf4d440589ee723f6c08 Author: Peng Li Date: Tue Dec 18 19:37:54 2018 +0800 net: hns3: update coalesce param per second coalesce param updates every 100 napi times, it may update a little late if ping test after a high rate flow, may over napi poll is called 100 times as ping test sends packets every second. This patch updates coalesce param every second, instead with every 100 napi times. It can not update the param 100% in time, but the lag time is very short. Signed-off-by: Peng Li Signed-off-by: David S. Miller commit ae6017a71115ebc4e5c1a3f0f451319ab3f5c447 Author: Huazhong Tan Date: Tue Dec 18 19:37:53 2018 +0800 net: hns3: fix incomplete uninitialization of IRQ in the hns3_nic_uninit_vector_data() In the hns3_nic_uninit_vector_data(), the procedure of uninitializing the tqp_vector's IRQ has not set affinity_notify to NULL and changes its init flag. This patch fixes it. And for simplificaton, local variable tqp_vector is used instead of priv->tqp_vector[i]. Fixes: 424eb834a9be ("net: hns3: Unified HNS3 {VF|PF} Ethernet Driver for hip08 SoC") Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit b51c366df70da0100193d13975980f1990a2d47b Author: Huazhong Tan Date: Tue Dec 18 19:37:52 2018 +0800 net: hns3: remove unnecessary configuration recapture while resetting When doing reset, it is unnecessary to get the hardware's default configuration again, otherwise, the user's configuration will be overwritten. Fixes: 4ed340ab8f49 ("net: hns3: Add reset process in hclge_main") Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit b644a8d4cb18305d31383188da75615490b2c6ef Author: Huazhong Tan Date: Tue Dec 18 19:37:51 2018 +0800 net: hns3: update some variables while hclge_reset()/hclgevf_reset() done When hclge_reset() completes successfully, it should update the last_reset_time, set reset_fail_cnt to 0, and set reset_type of hnae3_ae_dev to HNAE3_NONE_RESET. Also when hclgevf_reset() completes successfully, it should update the last_reset_time, and set reset_type of hnae3_ae_dev to HNAE3_NONE_RESET. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit 531eba0fe2b5172ed0ab1cc6a311b2b6b9e6b402 Author: Huazhong Tan Date: Tue Dec 18 19:37:50 2018 +0800 net: hns3: fix napi_disable not return problem While doing DOWN, the calling of napi_disable() may not return, since the napi_complete() in the hns3_nic_common_poll() will never be called when HNS3_NIC_STATE_DOWN is set. So we need to call napi_complete() before checking HNS3_NIC_STETE_DOWN. Fixes: ff0699e04b97 ("net: hns3: stop napi polling when HNS3_NIC_STATE_DOWN is set") Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit e3338205f0c700caae52a36cd0e3a815e6efd281 Author: Huazhong Tan Date: Tue Dec 18 19:37:49 2018 +0800 net: hns3: uninitialize pci in the hclgevf_uninit In the hclgevf_pci_reset(), it only uninitialize and initialize the msi, so if the initialization fails, hclgevf_uninit_hdev() does not need to uninitialize the msi, but needs to uninitialize the pci, otherwise it will cause pci resource not free. Fixes: 862d969a3a4d ("net: hns3: do VF's pci re-initialization while PF doing FLR") Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit cda69d244585bc4497d3bb878c22fe2b6ad647c1 Author: Huazhong Tan Date: Tue Dec 18 19:37:48 2018 +0800 net: hns3: fix error handling int the hns3_get_vector_ring_chain When hns3_get_vector_ring_chain() failed in the hns3_nic_init_vector_data(), it should do the error handling instead of return directly. Also, cur_chain should be freed instead of chain and head->next should be set to NULL in error handling of hns3_get_vector_ring_chain. This patch fixes them. Fixes: 73b907a083b8 ("net: hns3: bugfix for buffer not free problem during resetting") Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: David S. Miller commit c6d6e9b0f6b4201c77f2cea3964dd122697e3543 Author: Jaegeuk Kim Date: Tue Dec 18 09:25:37 2018 -0800 dm: do not allow readahead to limit IO size Update DM to set the bdi's io_pages. This fixes reads to be capped at the device's max request size (even if user's read IO exceeds the established readahead setting). Fixes: 9491ae4a ("mm: don't cap request size based on read-ahead setting") Cc: stable@vger.kernel.org Reviewed-by: Jens Axboe Signed-off-by: Jaegeuk Kim Signed-off-by: Mike Snitzer commit 89a0948984896352cac1ebe079cb3d64d6c3adc6 Author: Arnaldo Carvalho de Melo Date: Tue Dec 18 12:53:06 2018 -0300 tools uapi asm: Update asm-generic/unistd.h copy To get the change in: b7d624ab4312 ("asm-generic: unistd.h: fixup broken macro include.") That doesn't imply in any changes in the tools. This silences the following perf build warning: 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 Cc: Adrian Hunter Cc: Arnd Bergmann Cc: Guo Ren Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-2e7xwm5i2qcc88jp2lyawdyd@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit bc055c54b887961bc3545c54e61c844fd4499c2b Author: Arnaldo Carvalho de Melo Date: Tue Dec 18 12:39:08 2018 -0300 perf symbols: Relax checks on perf-PID.map ownership Those are simple enough, and usually not produced by root, instead by whatever user is running java, rust, Node.js JIT code that end up generating those /tmp/perf-PID.map for resolution of symbols in the anonymous executable maps. Having to use --force to resolve symbols in 'perf top' is a distraction, as recently I experienced when node.js symbols were not being resolved by 'perf top'. Acked-by: Ingo Molnar Cc: Adrian Hunter Cc: Frederic Weisbecker Cc: Hítalo Silva Cc: Jiri Olsa Cc: Namhyung Kim Cc: Pekka Enberg Cc: Peter Zijlstra Link: https://lkml.kernel.org/n/tip-tk2jgo2v4v2yjuj28axbpppo@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 42337cb768ad9536150603b206acd6bbd320e75e Author: Arnaldo Carvalho de Melo Date: Tue Dec 18 11:54:31 2018 -0300 perf trace: Wire up the fadvise 'advice' table generator That ends up generating this: $ cat /tmp/build/perf/trace/beauty/generated/fadvise_advice_array.c static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-zwbslubagram8a8zdc003u8h@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 069c1c6cc3646454f9c8e83084a25f8eb8cab7ae Author: Arnaldo Carvalho de Melo Date: Tue Dec 18 11:49:58 2018 -0300 perf beauty: Add generator for fadvise64's 'advice' arg constants $ tools/perf/trace/beauty/fadvise.sh static const char *fadvise_advices[] = { [0] = "NORMAL", [1] = "RANDOM", [2] = "SEQUENTIAL", [3] = "WILLNEED", [4] = "DONTNEED", [5] = "NOREUSE", }; $ This has a hack wrt the s390 difference. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-tb7jguv01u8p570piq13eioh@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f9cdd63e79946d2f635d5c23d76811c2d710aa5c Author: Arnaldo Carvalho de Melo Date: Tue Dec 18 16:15:53 2018 -0300 tools headers uapi: Grab a copy of fadvise.h Will be used to generate the string table for fadvise64's 'advice' argument. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-muswpnft8q9krktv052yrgsc@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit a66313408a08a9758e3007fe9a6cfe47b0dec88b Author: Arnaldo Carvalho de Melo Date: Tue Dec 18 11:25:08 2018 -0300 perf beauty mmap: Print mmap's 'offset' arg in hexadecimal Also to make it match 'strace' output, for regression testing. Both now produce this option, when 'perf trace' uses a .perfconfig asking for the strace like output: mmap(0x7faf66e6a000, 1363968, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x7faf66e6a000 Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-27qhouo1kaac2iyl85nfnsf5@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 1355e09ab04bc583df9c4b2b68d445c535c8b66b Author: Arnaldo Carvalho de Melo Date: Tue Dec 18 11:22:34 2018 -0300 perf beauty mmap: Print PROT_READ before PROT_EXEC to match strace output Helps with comparing 'strace' and 'perf trace' output, for mutual regression testing. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-va0qe95xbhep5hy52aq5qe0v@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit fb7068e73d2c24ba381938004ed0f285341ef1ba Author: Arnaldo Carvalho de Melo Date: Tue Dec 18 11:05:56 2018 -0300 perf trace beauty: Beautify arch_prctl()'s arguments This actually so far, AFAIK is available only in x86, so the code was put in place with x86 prefixes, in arches where it is not available it will just not be called, so no further mechanisms are needed at this time. Later, when other arches wire this up, we'll just look at the uname (live sessions) or perf_env data in the perf.data header to auto-wire the right beautifier. With this the output is the same as produced by 'strace' when used with the following ~/.perfconfig: # cat ~/.perfconfig [llvm] dump-obj = true [trace] add_events = /home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o show_zeros = yes show_duration = no no_inherit = yes show_timestamp = no show_arg_names = no args_alignment = -40 show_prefix = yes # And, on fedora 29, since the string tables are generated from the kernel sources, we don't know about 0x3001, just like strace: --- /tmp/strace 2018-12-17 11:22:08.707586721 -0300 +++ /tmp/trace 2018-12-18 11:11:32.037512729 -0300 @@ -1,49 +1,49 @@ -arch_prctl(0x3001 /* ARCH_??? */, 0x7ffc8a92dc80) = -1 EINVAL (Invalid argument) +arch_prctl(0x3001 /* ARCH_??? */, 0x7ffe4eb93ae0) = -1 EINVAL (Invalid argument) -arch_prctl(ARCH_SET_FS, 0x7faf6700f540) = 0 +arch_prctl(ARCH_SET_FS, 0x7fb507364540) = 0 And that seems to be related to the CET/Shadow Stack feature, that userland in Fedora 29 (glibc 2.28) are querying the kernel about, that 0x3001 seems to be ARCH_CET_STATUS, I'll check the situation and test with a fedora 29 kernel to see if the other codes are used. A diff that ignores the different pointers for different runs needs to be put in place in the upcoming regression tests comparing 'perf trace's output to strace's. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-73a9prs8ktkrt97trtdmdjs8@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 9614b8d697350d529743702f095b3db3f6d5a889 Author: Arnaldo Carvalho de Melo Date: Tue Dec 18 10:54:19 2018 -0300 perf trace: When showing string prefixes show prefix + ??? for unknown entries To match 'strace' output, like in: arch_prctl(0x3001 /* ARCH_??? */, 0x7ffc8a92dc80) = -1 EINVAL (Invalid argument) Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-kx59j2dk5l1x04ou57mt99ck@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 1f2d085e0f25a40eeb0ac032fd399be94f866adb Author: Arnaldo Carvalho de Melo Date: Tue Dec 18 10:25:28 2018 -0300 perf trace: Move strarrays to beauty.h for further reuse We'll use it in the upcoming arch_prctl() 'code' arg beautifier. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-6e4tj2fjen8qa73gy4u49vav@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 40714e8b37723c31aa1b48dd2f346c3827059957 Author: Arnaldo Carvalho de Melo Date: Mon Dec 17 17:00:14 2018 -0300 perf beauty: Wire up the x86_arch prctl code table generator $ cat /tmp/build/perf/trace/beauty/generated/x86_arch_prctl_code_array.c #define x86_arch_prctl_codes_1_offset 0x1001 static const char *x86_arch_prctl_codes_1[] = { [0x1001 - 0x1001]= "SET_GS", [0x1002 - 0x1001]= "SET_FS", [0x1003 - 0x1001]= "GET_FS", [0x1004 - 0x1001]= "GET_GS", [0x1011 - 0x1001]= "GET_CPUID", [0x1012 - 0x1001]= "SET_CPUID", }; #define x86_arch_prctl_codes_2_offset 0x2001 static const char *x86_arch_prctl_codes_2[] = { [0x2001 - 0x2001]= "MAP_VDSO_X32", [0x2002 - 0x2001]= "MAP_VDSO_32", [0x2003 - 0x2001]= "MAP_VDSO_64", }; $ Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-3r9blij6n8wdlsyd5dujx86r@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit ff4cb769bc2dcc9a74a1c29e403bcfaf789365ef Author: Arnaldo Carvalho de Melo Date: Mon Dec 17 16:11:37 2018 -0300 perf beauty: Add a string table generator for x86's 'arch_prctl' codes $ tools/perf/trace/beauty/x86_arch_prctl.sh #define x86_arch_prctl_codes_1_offset 0x1001 static const char *x86_arch_prctl_codes_1[] = { [0x1001 - 0x1001]= "SET_GS", [0x1002 - 0x1001]= "SET_FS", [0x1003 - 0x1001]= "GET_FS", [0x1004 - 0x1001]= "GET_GS", [0x1011 - 0x1001]= "GET_CPUID", [0x1012 - 0x1001]= "SET_CPUID", }; #define x86_arch_prctl_codes_2_offset 0x2001 static const char *x86_arch_prctl_codes_2[] = { [0x2001 - 0x2001]= "MAP_VDSO_X32", [0x2002 - 0x2001]= "MAP_VDSO_32", [0x2003 - 0x2001]= "MAP_VDSO_64", }; $ Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-w0fux1psivphhx6rve8kn3vq@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit c22e2683c0cbfb8dcac84529d29386b094cd78cf Author: Arnaldo Carvalho de Melo Date: Mon Dec 17 16:15:27 2018 -0300 tools include arch: Grab a copy of x86's prctl.h We need it to generate the tables for the 'code' arch_prctl's syscall argument. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-vu890pi18fpd4eyz61cazckj@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit ce05539f20b337221d3310baf73b45317dab067c Author: Arnaldo Carvalho de Melo Date: Mon Dec 17 12:21:09 2018 -0300 perf trace: Show NULL when syscall pointer args are 0 Matching strace's output format. The 'format' file for the syscall tracepoints have an indication if the arg is a pointer, with some exceptions like 'mmap' that has its first arg as an 'unsigned long', so use a heuristic using the argument name, i.e. if it contains the 'addr' substring, format it with the pointer formatter. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-ddghemr8qrm6i0sb8awznbze@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2c83dfae021306d528b21dceb8d128ca16524c5a Author: Arnaldo Carvalho de Melo Date: Mon Dec 17 12:06:34 2018 -0300 perf trace: Enclose the errno strings with () To match strace, now both emit the same line for calls like: access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-krxl6klsqc9qyktoaxyih942@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit c48ee107bb387f76b089e0c30e1fed26e8d921f0 Author: Arnaldo Carvalho de Melo Date: Mon Dec 17 11:59:35 2018 -0300 perf augmented_raw_syscalls: Copy 'access' arg as well This will all come from userspace, but to test the changes to make 'perf trace' output similar to strace's, do this one more now manually. To update the precompiled augmented_raw_syscalls.o binary I just run: # perf record -e ~acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.c sleep 1 LLVM: dumping /home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.022 MB perf.data ] # Because to have augmented_raw_syscalls to be always used and a fast startup and remove the need to have the llvm toolchain installed, I'm using: # perf config | grep add_events trace.add_events=/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o # So when doing changes to augmented_raw_syscals.c one needs to rebuild the .o file. This will be done automagically later, i.e. have a 'make' behaviour of recompiling when the .c gets changed. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-lw3i2atyq8549fpqwmszn3qp@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4b8a240ed5e0a4e6b53c994ddfcff86a06879a66 Author: Arnaldo Carvalho de Melo Date: Mon Dec 17 11:48:46 2018 -0300 perf trace: Add alignment spaces after the closing parens To use strace's style, helping in comparing the output of 'perf trace' with the one from 'strace', to help in upcoming regression tests. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-mw6peotz4n84rga0fk78buff@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4785860e04bc8d7e244b25257168e1cf8a5529ab Author: Jason Gunthorpe Date: Fri Nov 30 13:06:21 2018 +0200 RDMA/uverbs: Implement an ioctl that can call write and write_ex handlers Now that the handlers do not process their own udata we can make a sensible ioctl that wrappers them. The ioctl follows the same format as the write_ex() and has the user explicitly specify the core and driver in/out opaque structures and a command number. This works for all forms of write commands. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky Signed-off-by: Doug Ledford commit 601d66d43309534eb7a268bdc42c205521014645 Author: Arnaldo Carvalho de Melo Date: Mon Dec 17 11:55:57 2018 -0300 perf trace beauty: Print O_RDONLY when (flags & O_ACCMODE) == 0 And there are more flags, to match strace's output. openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 Also to help with regression tests. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-ofovpmvdli3bwch30936xn7t@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit c65c83ffe904590162bd762be185ac4d53ce5a85 Author: Arnaldo Carvalho de Melo Date: Fri Dec 14 17:06:47 2018 -0300 perf trace: Allow asking for not suppressing common string prefixes So far we've been suppressing common stuff such as "MAP_" in the mmap flags, showing "SHARED" instead of "MAP_SHARED", allow for those prefixes (and a few suffixes) to be shown: # trace -e *map,open*,*seek sleep 1 openat("/etc/ld.so.cache", CLOEXEC) = 3 mmap(0, 109093, READ, PRIVATE, 3, 0) = 0x7ff61c695000 openat("/lib64/libc.so.6", CLOEXEC) = 3 lseek(3, 792, SET) = 792 mmap(0, 8192, READ|WRITE, PRIVATE|ANONYMOUS) = 0x7ff61c693000 lseek(3, 792, SET) = 792 lseek(3, 864, SET) = 864 mmap(0, 1857568, READ, PRIVATE|DENYWRITE, 3, 0) = 0x7ff61c4cd000 mmap(0x7ff61c4ef000, 1363968, EXEC|READ, PRIVATE|FIXED|DENYWRITE, 3, 139264) = 0x7ff61c4ef000 mmap(0x7ff61c63c000, 311296, READ, PRIVATE|FIXED|DENYWRITE, 3, 1503232) = 0x7ff61c63c000 mmap(0x7ff61c689000, 24576, READ|WRITE, PRIVATE|FIXED|DENYWRITE, 3, 1814528) = 0x7ff61c689000 mmap(0x7ff61c68f000, 14368, READ|WRITE, PRIVATE|FIXED|ANONYMOUS) = 0x7ff61c68f000 munmap(0x7ff61c695000, 109093) = 0 openat("/usr/lib/locale/locale-archive", CLOEXEC) = 3 mmap(0, 217749968, READ, PRIVATE, 3, 0) = 0x7ff60f523000 # # vim ~/.perfconfig # # perf config llvm.dump-obj=true trace.add_events=/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o trace.show_zeros=yes trace.show_duration=no trace.no_inherit=yes trace.show_timestamp=no trace.show_arg_names=no trace.args_alignment=0 trace.string_quote=" trace.show_prefix=yes # # # trace -e *map,open*,*seek sleep 1 openat(AT_FDCWD, "/etc/ld.so.cache", O_CLOEXEC) = 3 mmap(0, 109093, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7ebbe59000 openat(AT_FDCWD, "/lib64/libc.so.6", O_CLOEXEC) = 3 lseek(3, 792, SEEK_SET) = 792 mmap(0, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS) = 0x7f7ebbe57000 lseek(3, 792, SEEK_SET) = 792 lseek(3, 864, SEEK_SET) = 864 mmap(0, 1857568, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f7ebbc91000 mmap(0x7f7ebbcb3000, 1363968, PROT_EXEC|PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 139264) = 0x7f7ebbcb3000 mmap(0x7f7ebbe00000, 311296, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 1503232) = 0x7f7ebbe00000 mmap(0x7f7ebbe4d000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 1814528) = 0x7f7ebbe4d000 mmap(0x7f7ebbe53000, 14368, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS) = 0x7f7ebbe53000 munmap(0x7f7ebbe59000, 109093) = 0 openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_CLOEXEC) = 3 mmap(0, 217749968, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7eaece7000 # Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-mtn1i4rjowjl72trtnbmvjd4@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2e3d7fac9db5e80d1cc26bb1453b85245c26d657 Author: Arnaldo Carvalho de Melo Date: Fri Dec 14 15:08:40 2018 -0300 perf trace: Add a prefix member to the strarray class So that the user, in an upcoming patch, can select printing it to get the full string as used in the source code, not one with a common prefix chopped off so as to make the output more compact. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-zypczc88gzbmeqx7b372s138@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 721f5326fb35dcba18ee4d9ef2b32394f86d403e Author: Arnaldo Carvalho de Melo Date: Fri Dec 14 14:02:03 2018 -0300 perf trace: Enclose strings with double quotes To match 'strace' output, helping with upcoming regression tests comparing both outputs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-jab52t1dcuh6vlztqle9g7u9@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 9ed45d59aeae2211933b032acc4e5b40a1a2fcd3 Author: Arnaldo Carvalho de Melo Date: Fri Dec 14 13:40:49 2018 -0300 perf trace: Make the alignment of the syscall args be configurable Since the start 'perf trace' aligns the parens enclosing the list of syscall args to align the syscall results, allow this to be configurable, keeping the default of 70. Using: # perf config llvm.dump-obj=true trace.add_events=/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o trace.show_zeros=yes trace.show_duration=no trace.no_inherit=yes trace.show_timestamp=no trace.show_arg_names=no trace.args_alignment=0 # trace -e open*,close,*sleep sleep 1 openat(CWD, /etc/ld.so.cache, CLOEXEC) = 3 close(3) = 0 openat(CWD, /lib64/libc.so.6, CLOEXEC) = 3 close(3) = 0 openat(CWD, /usr/lib/locale/locale-archive, CLOEXEC) = 3 close(3) = 0 nanosleep(0x7ffc00de66f0, 0) = 0 close(1) = 0 close(2) = 0 # Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-r8cbhoz1lr5npq9tutpvoigr@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f366d3854ec0fec0f9949dac46431598614a956b Merge: ccec4a4a4f27b b422847877e35 Author: Boris Brezillon Date: Tue Dec 18 20:00:52 2018 +0100 Merge tag 'spi-nor/for-4.21' of git://git.infradead.org/linux-mtd into mtd/next Core changes: - Parse the 4BAIT SFDP section - Add a bunch of SPI NOR entries to the flash_info table - Add the concept of SFDP fixups and use it to fix a bug on MX25L25635F - A bunch of minor cleanups/comestic changes commit ccec4a4a4f27b22e51ec6a143319db49b7570581 Merge: 7677ea0e8843e 732774437ae01 Author: Boris Brezillon Date: Tue Dec 18 19:59:16 2018 +0100 Merge tag 'nand/for-4.21' of git://git.infradead.org/linux-mtd into mtd/next NAND core changes: - kernel-doc miscellaneous fixes. - Third batch of fixes/cleanup to the raw NAND core impacting various controller drivers (ams-delta, marvell, fsmc, denali, tegra, vf610): * Stopping to pass mtd_info objects to internal functions * Reorganizing code to avoid forward declarations * Dropping useless test in nand_legacy_set_defaults() * Moving nand_exec_op() to internal.h * Adding nand_[de]select_target() helpers * Passing the CS line to be selected in struct nand_operation * Making ->select_chip() optional when ->exec_op() is implemented * Deprecating the ->select_chip() hook * Moving the ->exec_op() method to nand_controller_ops * Moving ->setup_data_interface() to nand_controller_ops * Deprecating the dummy_controller field * Fixing JEDEC detection * Providing a helper for polling GPIO R/B pin Raw NAND chip drivers changes: - Macronix: * Flagging 1.8V AC chips with a broken GET_FEATURES(TIMINGS) Raw NAND controllers drivers changes: - Ams-delta: * Fixing the error path * SPDX tag added * May be compiled with COMPILE_TEST=y * Conversion to ->exec_op() interface * Dropping .IOADDR_R/W use * Use GPIO API for data I/O - Denali: * Removing denali_reset_banks() * Removing ->dev_ready() hook * Including instead of * Changes to comply with the above fixes/cleanup done in the core. - FSMC: * Adding an SPDX tag to replace the license text * Making conversion from chip to fsmc consistent * Fixing unchecked return value in fsmc_read_page_hwecc * Changes to comply with the above fixes/cleanup done in the core. - Marvell: * Preventing timeouts on a loaded machine (fix) * Changes to comply with the above fixes/cleanup done in the core. - OMAP2: * Pass the parent of pdev to dma_request_chan() (fix) - R852: * Use generic DMA API - sh_flctl: * Converting to SPDX identifiers - Sunxi: * Write pageprog related opcodes to the right register: WCMD_SET (fix) - Tegra: * Stop implementing ->select_chip() - VF610: * Adding an SPDX tag to replace the license text * Changes to comply with the above fixes/cleanup done in the core. - Various trivial/spelling/coding style fixes. SPI-NAND drivers changes: - Removing the depreacated mt29f_spinand driver from staging. - Adding support for: * Toshiba TC58CVG2S0H * GigaDevice GD5FxGQ4xA * Winbond W25N01GV commit a9d25bde1e9b24161dd798e1d23eb7eb9674012a Author: Nick Bowler Date: Mon Dec 17 09:35:27 2018 -0800 xfs: Fix x32 ioctls when cmd numbers differ from ia32. Several ioctl structs change size between native 32-bit (ia32) and x32 applications, because x32 follows the native 64-bit (amd64) integer alignment rules and uses 64-bit time_t. In these instances, the ioctl number changes so userspace simply gets -ENOTTY. This scenario can be handled by simply adding more cases. Looking at the different ioctls implemented here: - All the ones marked 'No size or alignment issue on any arch' should presumably all be fine. - All the ones under BROKEN_X86_ALIGNMENT are different under integer alignment rules. Since x32 matches amd64 here, we just need both sets of cases handled. - XFS_IOC_SWAPEXT has both integer alignment differences and time_t differences. Since x32 matches amd64 here, we need to add a case which calls the native implementation. - The remaining ioctls have neither 64-bit integers nor time_t, so x32 matches ia32 here and no change is required at this level. The bulkstat ioctl implementations have some pointer chasing which is handled separately. Signed-off-by: Nick Bowler Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 7ca860e3c1a74ad6bd8949364073ef1044cad758 Author: Nick Bowler Date: Mon Dec 17 09:35:27 2018 -0800 xfs: Fix bulkstat compat ioctls on x32 userspace. The bulkstat family of ioctls are problematic on x32, because there is a mixup of native 32-bit and 64-bit conventions. The xfs_fsop_bulkreq struct contains pointers and 32-bit integers so that matches the native 32-bit layout, and that means the ioctl implementation goes into the regular compat path on x32. However, the 'ubuffer' member of that struct in turn refers to either struct xfs_inogrp or xfs_bstat (or an array of these). On x32, those structures match the native 64-bit layout. The compat implementation writes out the 32-bit version of these structures. This is not the expected format for x32 userspace, causing problems. Fortunately the functions which actually output these xfs_inogrp and xfs_bstat structures have an easy way to select which output format is required, so we just need a little tweak to select the right format on x32. Signed-off-by: Nick Bowler Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit c456d64449efe37da50832b63d91652a85ea1d20 Author: Nick Bowler Date: Mon Dec 17 09:35:27 2018 -0800 xfs: Align compat attrlist_by_handle with native implementation. While inspecting the ioctl implementations, I noticed that the compat implementation of XFS_IOC_ATTRLIST_BY_HANDLE does not do exactly the same thing as the native implementation. Specifically, the "cursor" does not appear to be written out to userspace on the compat path, like it is on the native path. This adjusts the compat implementation to copy out the cursor just like the native implementation does. The attrlist cursor does not require any special compat handling. This fixes xfstests xfs/269 on both IA-32 and x32 userspace, when running on an amd64 kernel. Signed-off-by: Nick Bowler Fixes: 0facef7fb053b ("xfs: in _attrlist_by_handle, copy the cursor back to userspace") Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 74694bcbdf7e28a5ad548cdda9ac56d30be00d13 Author: Heinz Mauelshagen Date: Tue Dec 18 17:35:41 2018 +0100 dm raid: fix false -EBUSY when handling check/repair message Sending a check/repair message infrequently leads to -EBUSY instead of properly identifying an active resync. This occurs because raid_message() is testing recovery bits in a racy way. Fix by calling decipher_sync_action() from raid_message() to properly identify the idle state of the RAID device. Signed-off-by: Heinz Mauelshagen Signed-off-by: Mike Snitzer commit ff3730a497cd636e53d4cac5cbb9652b76de9ef5 Merge: c5f48c0a7aa1a fb94109b764e7 Author: Thomas Gleixner Date: Tue Dec 18 18:37:27 2018 +0100 Merge tag 'irqchip-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core Pull irqchip updates from Marc Zyngier: - A bunch of new irqchip drivers (RDA8810PL, Madera, imx-irqsteer) - Updates for new (and old) platforms (i.MX8MQ, F1C100s) - A number of SPDX cleanups - A workaround for a very broken GICv3 implementation - A platform-msi fix - Various cleanups commit 41c4f85cdac280d356df1f483000ecec4a8868be Author: Javier Barrio Date: Thu Dec 13 01:06:29 2018 +0100 quota: Lock s_umount in exclusive mode for Q_XQUOTA{ON,OFF} quotactls. Commit 1fa5efe3622db58cb8c7b9a50665e9eb9a6c7e97 (ext4: Use generic helpers for quotaon and quotaoff) made possible to call quotactl(Q_XQUOTAON/OFF) on ext4 filesystems with sysfile quota support. This leads to calling dquot_enable/disable without s_umount held in excl. mode, because quotactl_cmd_onoff checks only for Q_QUOTAON/OFF. The following WARN_ON_ONCE triggers (in this case for dquot_enable, ext4, latest Linus' tree): [ 117.807056] EXT4-fs (dm-0): mounted filesystem with ordered data mode. Opts: quota,prjquota [...] [ 155.036847] WARNING: CPU: 0 PID: 2343 at fs/quota/dquot.c:2469 dquot_enable+0x34/0xb9 [ 155.036851] Modules linked in: quota_v2 quota_tree ipv6 af_packet joydev mousedev psmouse serio_raw pcspkr i2c_piix4 intel_agp intel_gtt e1000 ttm drm_kms_helper drm agpgart fb_sys_fops syscopyarea sysfillrect sysimgblt i2c_core input_leds kvm_intel kvm irqbypass qemu_fw_cfg floppy evdev parport_pc parport button crc32c_generic dm_mod ata_generic pata_acpi ata_piix libata loop ext4 crc16 mbcache jbd2 usb_storage usbcore sd_mod scsi_mod [ 155.036901] CPU: 0 PID: 2343 Comm: qctl Not tainted 4.20.0-rc6-00025-gf5d582777bcb #9 [ 155.036903] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014 [ 155.036911] RIP: 0010:dquot_enable+0x34/0xb9 [ 155.036915] Code: 41 56 41 55 41 54 55 53 4c 8b 6f 28 74 02 0f 0b 4d 8d 7d 70 49 89 fc 89 cb 41 89 d6 89 f5 4c 89 ff e8 23 09 ea ff 85 c0 74 0a <0f> 0b 4c 89 ff e8 8b 09 ea ff 85 db 74 6a 41 8b b5 f8 00 00 00 0f [ 155.036918] RSP: 0018:ffffb09b00493e08 EFLAGS: 00010202 [ 155.036922] RAX: 0000000000000001 RBX: 0000000000000008 RCX: 0000000000000008 [ 155.036924] RDX: 0000000000000001 RSI: 0000000000000002 RDI: ffff9781b67cd870 [ 155.036926] RBP: 0000000000000002 R08: 0000000000000000 R09: 61c8864680b583eb [ 155.036929] R10: ffffb09b00493e48 R11: ffffffffff7ce7d4 R12: ffff9781b7ee8d78 [ 155.036932] R13: ffff9781b67cd800 R14: 0000000000000004 R15: ffff9781b67cd870 [ 155.036936] FS: 00007fd813250b88(0000) GS:ffff9781ba000000(0000) knlGS:0000000000000000 [ 155.036939] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 155.036942] CR2: 00007fd812ff61d6 CR3: 000000007c882000 CR4: 00000000000006b0 [ 155.036951] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 155.036953] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 155.036955] Call Trace: [ 155.037004] dquot_quota_enable+0x8b/0xd0 [ 155.037011] kernel_quotactl+0x628/0x74e [ 155.037027] ? do_mprotect_pkey+0x2a6/0x2cd [ 155.037034] __x64_sys_quotactl+0x1a/0x1d [ 155.037041] do_syscall_64+0x55/0xe4 [ 155.037078] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 155.037105] RIP: 0033:0x7fd812fe1198 [ 155.037109] Code: 02 77 0d 48 89 c1 48 c1 e9 3f 75 04 48 8b 04 24 48 83 c4 50 5b c3 48 83 ec 08 49 89 ca 48 63 d2 48 63 ff b8 b3 00 00 00 0f 05 <48> 89 c7 e8 c1 eb ff ff 5a c3 48 63 ff b8 bb 00 00 00 0f 05 48 89 [ 155.037112] RSP: 002b:00007ffe8cd7b050 EFLAGS: 00000206 ORIG_RAX: 00000000000000b3 [ 155.037116] RAX: ffffffffffffffda RBX: 00007ffe8cd7b148 RCX: 00007fd812fe1198 [ 155.037119] RDX: 0000000000000000 RSI: 00007ffe8cd7cea9 RDI: 0000000000580102 [ 155.037121] RBP: 00007ffe8cd7b0f0 R08: 000055fc8eba8a9d R09: 0000000000000000 [ 155.037124] R10: 00007ffe8cd7b074 R11: 0000000000000206 R12: 00007ffe8cd7b168 [ 155.037126] R13: 000055fc8eba8897 R14: 0000000000000000 R15: 0000000000000000 [ 155.037131] ---[ end trace 210f864257175c51 ]--- and then the syscall proceeds without s_umount locking. This patch locks the superblock ->s_umount sem. in exclusive mode for all Q_XQUOTAON/OFF quotactls too in addition to Q_QUOTAON/OFF. AFAICT, other than ext4, only xfs and ocfs2 are affected by this change. The VFS will now call in xfs_quota_* functions with s_umount held, which wasn't the case before. This looks good to me but I can not say for sure. Ext4 and ocfs2 where already beeing called with s_umount exclusive via quota_quotaon/off which is basically the same. Signed-off-by: Javier Barrio Signed-off-by: Jan Kara commit 58f9d806d16a38ed3bae11e2ada83393436a4956 Author: Oleksandr Andrushchenko Date: Fri Nov 30 09:42:05 2018 +0200 ALSA: xen-front: Use Xen common shared buffer implementation Use page directory based shared buffer implementation now available as common code for Xen frontend drivers. Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Takashi Iwai Signed-off-by: Boris Ostrovsky commit 5641f19bdfc4193f1c2d5a829896c25dd5c0ec3d Author: Oleksandr Andrushchenko Date: Fri Nov 30 09:42:04 2018 +0200 drm/xen-front: Use Xen common shared buffer implementation Use page directory based shared buffer implementation now available as common code for Xen frontend drivers. Remove flushing of shared buffer on page flip as this workaround needs a proper fix. Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Noralf Trønnes Signed-off-by: Boris Ostrovsky commit b3383974fee272ad0d444a2d083f456879447cd8 Author: Oleksandr Andrushchenko Date: Fri Nov 30 09:42:03 2018 +0200 xen: Introduce shared buffer helpers for page directory... based frontends. Currently the frontends which implement similar code for sharing big buffers between frontend and backend are para-virtualized DRM and sound drivers. Both define the same way to share grant references of a data buffer with the corresponding backend with little differences. Move shared code into a helper module, so there is a single implementation of the same functionality for all. This patch introduces code which is used by sound and display frontend drivers without functional changes with the intention to remove shared code from the corresponding drivers. Signed-off-by: Oleksandr Andrushchenko Acked-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit 6ab7d47bcbf0144a8cb81536c2cead4cde18acfe Author: Dennis Zhou Date: Tue Dec 18 08:42:27 2018 -0800 percpu: convert spin_lock_irq to spin_lock_irqsave. From Michael Cree: "Bisection lead to commit b38d08f3181c ("percpu: restructure locking") as being the cause of lockups at initial boot on the kernel built for generic Alpha. On a suggestion by Tejun Heo that: So, the only thing I can think of is that it's calling spin_unlock_irq() while irq handling isn't set up yet. Can you please try the followings? 1. Convert all spin_[un]lock_irq() to spin_lock_irqsave/unlock_irqrestore()." Fixes: b38d08f3181c ("percpu: restructure locking") Reported-and-tested-by: Michael Cree Acked-by: Tejun Heo Signed-off-by: Dennis Zhou commit ff8519f9e91170cd24ed503aa77d144e71bd4d92 Author: Sagi Grimberg Date: Fri Dec 14 11:06:10 2018 -0800 nvme-rdma: implement polling queue map When passed with nr_poll_queues setup additional queues with cq polling context IB_POLL_DIRECT (no interrupts) and make sure to set QUEUE_FLAG_POLL on the connect_q. In addition add the third queue mapping for polling queues. nvmf connect on this queue is polled for like all other requests so make nvmf_connect_io_queue poll for polling queues. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 89d43802b0e7298bc0b464bdb5fff864074e2218 Author: Sagi Grimberg Date: Fri Dec 14 11:06:09 2018 -0800 nvme-fabrics: allow user to pass in nr_poll_queues This argument will specify how many polling I/O queues to connect when creating the controller. These I/O queues will host I/O that is set with REQ_HIPRI. Reviewed-by: Steve Wise Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 26c682274e0a7d055e123499eac8ec39d0e04283 Author: Sagi Grimberg Date: Fri Dec 14 11:06:08 2018 -0800 nvme-fabrics: allow nvmf_connect_io_queue to poll Preparation for polling support for fabrics. Polling support means that our completion queues are not generating any interrupts which means we need to poll for the nvmf io queue connect as well. Reviewed by Steve Wise Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 6287b51c77e6d8f05f772931cf51d80e81651a9f Author: Sagi Grimberg Date: Fri Dec 14 11:06:07 2018 -0800 nvme-core: optionally poll sync commands Pass poll bool to indicate that we need it to poll. This prepares us for polling support in nvmf since connect is an I/O that will be queued and has to be polled in order to complete. If poll is passed, we call nvme_execute_rq_polled which sends the requests and polls for its completion. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 7b7ab780a048699d2b9f416bf2d5c089d8d1028c Author: Sagi Grimberg Date: Fri Dec 14 11:06:06 2018 -0800 block: make request_to_qc_t public block consumers will need it for polling requests that are sent with blk_execute_rq_nowait. Also, get rid of blk_tag_to_qc_t and open-code it instead. Reviewed-by: Jens Axboe Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 56a77d26d6316a3936497236c7e3a6a98fad950c Author: Colin Ian King Date: Fri Dec 14 11:42:43 2018 +0000 nvme-tcp: fix spelling mistake "attepmpt" -> "attempt" There is a spelling mistake in a dev_info message, fix it. Signed-off-by: Colin Ian King Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit a7273d40232fbc1f89212b973d588aeaa61161b2 Author: Christoph Hellwig Date: Thu Dec 13 09:46:59 2018 +0100 nvme-tcp: fix endianess annotations Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg commit f4d10b5c85b5f118c6e55288afd053f5c8c5fc98 Author: Christoph Hellwig Date: Thu Dec 13 09:41:15 2018 +0100 nvmet-tcp: fix endianess annotations Signed-off-by: Christoph Hellwig Acked-by: Sagi Grimberg commit 91a509f8b7a8a518723e1755b876b46c537baaef Author: Christoph Hellwig Date: Thu Dec 13 09:48:00 2018 +0100 nvme-pci: refactor nvme_poll_irqdisable to make sparse happy By duplicating the nvme_process_cq in both branches we keep the sparse lock context checking happy, so do it. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg commit ed92ad37e88555864f1f830db4037b9535b3392c Author: Christoph Hellwig Date: Fri Dec 14 14:06:59 2018 +0100 nvme-pci: only set nr_maps to 2 if poll queues are supported The block layer now enables polling support on a queue if nr_maps includes the poll map, so we should only set that if we actually support poll queues. Fixes: 6544d229bf ("block: enable polling by default if a poll map is initalized") Signed-off-by: Christoph Hellwig Reviewed-by: Jens Axboe Reviewed-by: Sagi Grimberg commit 5698b805fbf09a5dfa60829f5a179c0568a8dc3b Author: Chaitanya Kulkarni Date: Mon Dec 17 18:35:29 2018 -0800 nvmet: use a macro for default error location This patch defines a new macro NVMET_NO_ERROR_LOC to represent the default error location value in the nvme-error-log-page. This is a pure cleanup patch and it does not change any functionality. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 66c6afbd7321983be4c4160aff4d79e52af84a60 Author: Colin Ian King Date: Fri Dec 14 18:31:21 2018 +0000 nvmet: fix comparison of a u16 with -1 Currently the u16 req->error_loc is being compared to -1 which will always be false. Fix this by casting -1 to u16 to fix this. Detected by clang: warning: result of comparison of constant -1 with expression of type 'u16' (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare] Fixes: 76574f37bf4c ("nvmet: add interface to update error-log page") Signed-off-by: Colin Ian King Signed-off-by: Christoph Hellwig commit 77c7a7b3e7da2c97c182c7e57a16d16c6b555c24 Merge: b12c97d45cd06 77990464bb39e Author: David S. Miller Date: Tue Dec 18 08:49:48 2018 -0800 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 2018-12-18 1) Add xfrm policy selftest scripts. From Florian Westphal. 2) Split inexact policies into four different search list classes and use the rbtree infrastructure to store/lookup the policies. This is to improve the policy lookup performance after the flowcache removal. Patches from Florian Westphal. 3) Various coding style fixes, from Colin Ian King. 4) Fix policy lookup logic after adding the inexact policy search tree infrastructure. From Florian Westphal. 5) Remove a useless remove BUG_ON from xfrm6_dst_ifdown. From Li RongQing. 6) Use the correct policy direction for lookups on hash rebuilding. From Florian Westphal. Please pull or let me know if there are problems. ==================== Signed-off-by: David S. Miller commit bc0205612bbd4dd4026d4ba6287f5643c37366ec Author: Bob Peterson Date: Tue Dec 18 08:29:32 2018 -0600 gfs2: take jdata unstuff into account in do_grow Before this patch, function do_grow would not reserve enough journal blocks in the transaction to unstuff jdata files while growing them. This patch adds the logic to add one more block if the file to grow is jdata. Signed-off-by: Bob Peterson Reviewed-by: Andreas Gruenbacher commit fb94109b764e7676fa63834b9033ba97175877a0 Author: Benjamin Gaignard Date: Mon Dec 17 15:22:14 2018 +0100 irqchip/stm32: protect configuration registers with hwspinlock If a hwspinlock is defined in device tree use it to protect configuration registers. Do not request for hwspinlock during the exti driver init since the hwspinlock driver is not probed yet at that stage and the exti driver does not support deferred probe. Instead of this, postpone the hwspinlock request at the first time the hwspinlock is actually needed. Use the hwspin_trylock_raw() API which is the most appropriated here Indeed: - hwspin_lock_() calls are under spin_lock protection (chip_data->rlock or gc->lock). - the _timeout() API relies on jiffies count which won't work if IRQs are disabled which is the case here (a large part of the IRQ setup is done atomically (see irq/manage.c)) As a consequence implement the retry/timeout lock from here. And since all of this is done atomically, reduce the timeout delay to 1 ms. Signed-off-by: Benjamin Gaignard Signed-off-by: Fabien Dessenne Signed-off-by: Marc Zyngier commit 897898a69451dc31950d200c0fcdba24428a6482 Author: Benjamin Gaignard Date: Mon Dec 17 15:22:13 2018 +0100 dt-bindings: interrupt-controller: stm32: Document hwlock properties Add hwlocks as optional property Reviewed-by: Rob Herring Signed-off-by: Benjamin Gaignard Signed-off-by: Marc Zyngier commit 0136afa08967f6e160b9b4e85a7a70e4180a8333 Author: Lucas Stach Date: Mon Dec 17 15:01:20 2018 +0100 irqchip: Add driver for imx-irqsteer controller The irqsteer block is a interrupt multiplexer/remapper found on the i.MX8 line of SoCs. Signed-off-by: Fugang Duan Signed-off-by: Lucas Stach Signed-off-by: Marc Zyngier commit ff63495eff8139af1d33e9733d74b399fc8a84e7 Author: Lucas Stach Date: Mon Dec 17 15:01:19 2018 +0100 dt-bindings/irq: Add binding for Freescale IRQSTEER multiplexer This adds the DT binding for the Freescale IRQSTEER interrupt multiplexer found in the i.MX8 familiy SoCs. Reviewed-by: Rob Herring Signed-off-by: Lucas Stach Signed-off-by: Marc Zyngier commit 584923efe91f29b01697b6cd7519c92bde9e11da Merge: 663546903c835 f5a4c76ad7de9 Author: Rafael J. Wysocki Date: Tue Dec 18 16:32:12 2018 +0100 Merge branch 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux Pull turbostat utility updates for v4.21 from Len Brown: "A couple of random fixes that were sitting in the queue." * 'turbostat' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: tools/power turbostat: consolidate duplicate model numbers tools/power turbostat: fix goldmont C-state limit decoding tools/power turbostat: reduce debug output tools/power turbosat: fix AMD APIC-id output commit 875736bb3f3ded168469f6a14df7a938416a99d5 Author: Jens Axboe Date: Tue Nov 20 20:06:23 2018 -0700 aio: abstract out io_event filler helper Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 88a6f18b950e2e4dce57d31daa151105f4f3dcff Author: Jens Axboe Date: Sat Nov 24 14:46:14 2018 -0700 aio: split out iocb copy from io_submit_one() In preparation of handing in iocbs in a different fashion as well. Also make it clear that the iocb being passed in isn't modified, by marking it const throughout. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 71ebc6fef0f53459f37fb39e1466792232fa52ee Author: Jens Axboe Date: Sat Nov 24 21:33:09 2018 -0700 aio: use iocb_put() instead of open coding it Replace the percpu_ref_put() + kmem_cache_free() with a call to iocb_put() instead. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit a79d40e9b0f309dcddc4e0bf5b64e51e28153e55 Author: Jens Axboe Date: Tue Dec 4 09:45:32 2018 -0700 aio: only use blk plugs for > 2 depth submissions Plugging is meant to optimize submission of a string of IOs, if we don't have more than 2 being submitted, don't bother setting up a plug. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 2bc4ca9bb600cbe36941da2b2a67189fc4302a04 Author: Jens Axboe Date: Tue Dec 4 09:44:49 2018 -0700 aio: don't zero entire aio_kiocb aio_get_req() It's 192 bytes, fairly substantial. Most items don't need to be cleared, especially not upfront. Clear the ones we do need to clear, and leave the other ones for setup when the iocb is prepared and submitted. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 432c79978c33ecef91b1b04cea6936c20810da29 Author: Christoph Hellwig Date: Mon Nov 19 15:57:42 2018 -0700 aio: separate out ring reservation from req allocation This is in preparation for certain types of IO not needing a ring reserveration. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit bc9bff61624ac33b7c95861abea1af24ee7a94fc Author: Jens Axboe Date: Tue Nov 6 14:27:13 2018 -0700 aio: use assigned completion handler We know this is a read/write request, but in preparation for having different kinds of those, ensure that we call the assigned handler instead of assuming it's aio_complete_rq(). Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 4b9254328254bed12a4ac449cdff2c332e630837 Merge: 1a9430db2835c cd19181bf9ad4 Author: Jens Axboe Date: Tue Dec 18 08:29:53 2018 -0700 Merge branch 'for-4.21/block' into for-4.21/aio * for-4.21/block: (351 commits) blk-mq: enable IO poll if .nr_queues of type poll > 0 blk-mq: change blk_mq_queue_busy() to blk_mq_queue_inflight() blk-mq: skip zero-queue maps in blk_mq_map_swqueue block: fix blk-iolatency accounting underflow blk-mq: fix dispatch from sw queue block: mq-deadline: Fix write completion handling nvme-pci: don't share queue maps blk-mq: only dispatch to non-defauly queue maps if they have queues blk-mq: export hctx->type in debugfs instead of sysfs blk-mq: fix allocation for queue mapping table blk-wbt: export internal state via debugfs blk-mq-debugfs: support rq_qos block: update sysfs documentation block: loop: check error using IS_ERR instead of IS_ERR_OR_NULL in loop_add() aoe: add __exit annotation block: clear REQ_HIPRI if polling is not supported blk-mq: replace and kill blk_mq_request_issue_directly blk-mq: issue directly with bypass 'false' in blk_mq_sched_insert_requests blk-mq: refactor the code of issue request directly block: remove the bio_integrity_advance export ... commit 9d6dc178f0c9e40e61f45d2ac86baa8ad77cb052 Author: Arnaldo Carvalho de Melo Date: Fri Dec 14 11:32:02 2018 -0300 perf trace: Allow suppressing the syscall argument names To show just the values: Default: # trace -e open*,close,*sleep sleep 1 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: CLOEXEC ) = 3 close(fd: 3 ) = 0 openat(dfd: CWD, filename: /lib64/libc.so.6, flags: CLOEXEC ) = 3 close(fd: 3 ) = 0 openat(dfd: CWD, filename: /usr/lib/locale/locale-archive, flags: CLOEXEC) = 3 close(fd: 3 ) = 0 nanosleep(rqtp: 0x7ffc0c4ea0d0, rmtp: 0 ) = 0 close(fd: 1 ) = 0 close(fd: 2 ) = 0 # Remove it: # perf config trace.show_arg_names=no # trace -e open*,close,*sleep sleep 1 openat(CWD, /etc/ld.so.cache, CLOEXEC ) = 3 close(3 ) = 0 openat(CWD, /lib64/libc.so.6, CLOEXEC ) = 3 close(3 ) = 0 openat(CWD, /usr/lib/locale/locale-archive, CLOEXEC ) = 3 close(3 ) = 0 nanosleep(0x7ffced3a8c40, 0 ) = 0 close(1 ) = 0 close(2 ) = 0 # Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-ta9tbdwgodpw719sr2bjm8eb@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit b036146fd0f99209e87877115d090c69da2ab747 Author: Arnaldo Carvalho de Melo Date: Fri Dec 14 11:17:19 2018 -0300 perf trace: Allow configuring if the syscall start timestamp should be printed # trace -e open*,close,*sleep sleep 1 0.000 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: CLOEXEC ) = 3 0.016 close(fd: 3 ) = 0 0.024 openat(dfd: CWD, filename: /lib64/libc.so.6, flags: CLOEXEC ) = 3 0.074 close(fd: 3 ) = 0 0.235 openat(dfd: CWD, filename: /usr/lib/locale/locale-archive, flags: CLOEXEC) = 3 0.251 close(fd: 3 ) = 0 0.285 nanosleep(rqtp: 0x7ffd68e6d620, rmtp: 0 ) = 0 1000.386 close(fd: 1 ) = 0 1000.395 close(fd: 2 ) = 0 # # perf config trace.show_timestamp=no # trace -e open*,close,*sleep sleep 1 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: CLOEXEC ) = 3 close(fd: 3 ) = 0 openat(dfd: CWD, filename: /lib64/libc.so.6, flags: CLOEXEC ) = 3 close(fd: 3 ) = 0 openat(dfd: CWD, filename: , flags: CLOEXEC ) = 3 close(fd: 3 ) = 0 nanosleep(rqtp: 0x7fffa79c38e0, rmtp: 0 ) = 0 close(fd: 1 ) = 0 close(fd: 2 ) = 0 # Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-mjjnicy48367jah6ls4k0nk8@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d32de87e734191698dd1834146ee65ebd0f5e240 Author: Arnaldo Carvalho de Melo Date: Fri Dec 14 11:06:16 2018 -0300 perf trace: Allow configuring default for perf_event_attr.inherit I.f. if children should inherit the parent perf_event configuration, i.e. if we should trace children as well or just the parent. The default is to follow children, to disable this and have a behaviour similar to strace, set this config option or use the --no_inherit 'perf trace' option. E.g.: Default: # perf config trace.no_inherit # trace -e clone,*sleep time sleep 1 0.000 time/21107 clone(clone_flags: CHILD_CLEARTID|CHILD_SETTID|0x11, newsp: 0, child_tidptr: 0x7f7b8f9ae810) = 21108 (time) ? time/21108 ... [continued]: clone() 0.691 sleep/21108 nanosleep(rqtp: 0x7ffed01d0540, rmtp: 0 ) = 0 0.00user 0.00system 0:01.00elapsed 0%CPU (0avgtext+0avgdata 1988maxresident)k 0inputs+0outputs (0major+76minor)pagefaults 0swaps # Disable it: # trace -e clone,*sleep time sleep 1 0.000 clone(clone_flags: CHILD_CLEARTID|CHILD_SETTID|0x11, newsp: 0, child_tidptr: 0x7ff41e100810) = 21414 (time) 0.00user 0.00system 0:01.00elapsed 0%CPU (0avgtext+0avgdata 1964maxresident)k 0inputs+0outputs (0major+76minor)pagefaults 0swaps # Notice that since there is just one thread, the "comm/TID" column is suppressed. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-thd8s16pagyza71ufi5vjlan@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 41e0d040c475251eea14c8b92ea3a01c5e269856 Author: Arnaldo Carvalho de Melo Date: Fri Dec 14 10:29:44 2018 -0300 perf config: Show the configuration when no arguments are provided More convenient thah having to recall what letter is about showing/listing/dumping the configuration, i.e. no arguments means -l/--list: # perf config llvm.dump-obj=true trace.default_events=/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o trace.show_zeros=yes trace.show_duration=no # perf config -l llvm.dump-obj=true trace.default_events=/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o trace.show_zeros=yes trace.show_duration=no # perf config -h Usage: perf config [] [options] [section.name[=value] ...] -l, --list show current config variables --system use system config file --user use user config file # Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Taeung Song Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-z2n63avz6tliqb5gmu4l1dti@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 42e4a52d01d087e7ce069049799e3e336eaec101 Author: Arnaldo Carvalho de Melo Date: Fri Dec 14 10:22:18 2018 -0300 perf trace: Allow configuring if the syscall duration should be printed # perf config trace.show_duration=no # perf config -l | grep trace trace.default_events=/home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o trace.show_zeros=true trace.show_duration=no # trace -e *sleep sleep 1 0.000 sleep/8729 nanosleep(rqtp: 0x7ffcb0b4c940, rmtp: 0) = 0 # perf config trace.show_duration=yes # trace -e *sleep sleep 1 0.000 (1000.212 ms): sleep/8735 nanosleep(rqtp: 0x7ffca15fa770, rmtp: 0) = 0 # Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-2c7h1m8fhzb9puxtj9nlevi8@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit e7c634fcc6ff921d725ba988cdb198ca8b59a39f Author: Arnaldo Carvalho de Melo Date: Fri Dec 14 10:12:09 2018 -0300 perf trace: Allow configuring if zeroed syscall args should be printed The default so far, since we show argument names followed by its values, was to make the output more compact by suppressing most zeroed args. Make this configurable so that users can choose what best suit their needs. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-q0gxws02ygodh94o0hzim5xd@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit ac96287cae0851797262da37347b83797db931b3 Author: Arnaldo Carvalho de Melo Date: Thu Dec 13 17:30:20 2018 -0300 perf trace: Allow specifying a set of events to add in perfconfig To add augmented_raw_syscalls to the events speficied by the user, or be the only one if no events were specified by the user, one can add this to perfconfig: # cat ~/.perfconfig [trace] add_events = /home/acme/git/perf/tools/perf/examples/bpf/augmented_raw_syscalls.o # I.e. pre-compile the augmented_raw_syscalls.c BPF program and make it always load, this way: # perf trace -e open* cat /etc/passwd > /dev/null 0.000 ( 0.013 ms): cat/31557 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: CLOEXEC) = 3 0.035 ( 0.007 ms): cat/31557 openat(dfd: CWD, filename: /lib64/libc.so.6, flags: CLOEXEC) = 3 0.353 ( 0.009 ms): cat/31557 openat(dfd: CWD, filename: /usr/lib/locale/locale-archive, flags: CLOEXEC) = 3 0.424 ( 0.006 ms): cat/31557 openat(dfd: CWD, filename: /etc/passwd) = 3 # Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-0lgj7vh64hg3ce44gsmvj7ud@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4623ce405d0871e648ba72fdb9c561016e2cc41d Author: Arnaldo Carvalho de Melo Date: Thu Dec 13 15:05:43 2018 -0300 perf augmented_raw_syscalls: Do not include stdio.h We're not using that puts() thing, and thus we don't need to define the __bpf_stdout__ map, reducing the setup time. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-3452xgatncpil7v22minkwbo@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 7100b12cf474f575658e6e4a834f0e8a0b3c9867 Author: Leo Yan Date: Tue Dec 11 15:38:28 2018 +0800 perf cs-etm: Generate branch sample for exception packet The exception packet appears as one element with 'elem_type' == OCSD_GEN_TRC_ELEM_EXCEPTION or OCSD_GEN_TRC_ELEM_EXCEPTION_RET, which is present for exception entry and exit respectively. The decoder sets the packet fields 'packet->exc' and 'packet->exc_ret' to indicate the exception packets; but exception packets don't have a dedicated sample type and shares the same sample type CS_ETM_RANGE with normal instruction packets. As a result, the exception packets are taken as normal instruction packets and this introduces confusion in mixing different packet types. Furthermore, these instruction range packets will be processed for branch samples only when 'packet->last_instr_taken_branch' is true, otherwise they will be omitted, this can introduce a mess for exception and exception returning due to not having the complete address range info for context switching. To process exception packets properly, this patch introduces two new sample types: CS_ETM_EXCEPTION and CS_ETM_EXCEPTION_RET; these two types of packets will be handled by cs_etm__exception(). The function cs_etm__exception() forces setting the previous CS_ETM_RANGE packet flag 'prev_packet->last_instr_taken_branch' to true, this matches well with the program flow when the exception is trapped from user space to kernel space, no matter if the most recent flow has branch taken or not; this is also safe for returning to user space after exception handling. After exception packets have their own sample type, the packet fields 'packet->exc' and 'packet->exc_ret' aren't needed anymore, so remove them. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mike Leach Cc: Namhyung Kim Cc: Robert Walker Cc: coresight ml Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1544513908-16805-9-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 02e7e2509e939b50f4f1b14c08b97f60256df3ea Author: Leo Yan Date: Tue Dec 11 15:38:27 2018 +0800 perf cs-etm: Treat EO_TRACE element as trace discontinuity If the decoder outputs an EO_TRACE element, it means the end of the trace buffer; this is a discontinuity and in this case the end of trace data needs to be saved. This patch generates a CS_ETM_DISCONTINUITY packet for the EO_TRACE element hereby flushing the end of trace data in cs-etm.c. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mike Leach Cc: Namhyung Kim Cc: Robert Walker Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1544513908-16805-8-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 37bb37168dc1b1f5e3ac791aeecd14ef980764fd Author: Leo Yan Date: Tue Dec 11 15:38:26 2018 +0800 perf cs-etm: Treat NO_SYNC element as trace discontinuity The CoreSight tracer driver might insert barrier packets between different buffers, thus the decoder can spot the boundaries based on the barrier packet; it is possible for the decoder to hit a barrier packet and emit a NO_SYNC element, then the decoder will find a periodic synchronisation point inside that next trace block that starts the trace again but does not have the TRACE_ON element as indicator - usually because this trace block has wrapped the buffer so we have lost the original point when the trace was enabled. In the first case it causes the insertion of a OCSD_GEN_TRC_ELEM_NO_SYNC in the middle of the tracing stream, but as we were not handling the NO_SYNC element properly this ends up making users miss the discontinuity indications. Though OCSD_GEN_TRC_ELEM_NO_SYNC is different from CS_ETM_TRACE_ON when output from the decoder, both indicate that the trace data is discontinuous; this patch treats OCSD_GEN_TRC_ELEM_NO_SYNC as a trace discontinuity and generates a CS_ETM_DISCONTINUITY packet for it, so cs-etm can handle the discontinuity for this case, finally it saves the last trace data for the previous trace block and restart samples for the new block. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mike Leach Cc: Namhyung Kim Cc: Robert Walker Cc: coresight ml Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1544513908-16805-7-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 49ccf87bfb9e8517ab2f019e95845760c4c3a562 Author: Leo Yan Date: Tue Dec 11 15:38:25 2018 +0800 perf cs-etm: Rename CS_ETM_TRACE_ON to CS_ETM_DISCONTINUITY TRACE_ON element is used at the beginning of trace, it also can be appeared in the middle of trace data to indicate discontinuity; for example, it's possible to see multiple TRACE_ON elements in the trace stream if the trace is being limited by address range filtering. Furthermore, except TRACE_ON element is for discontinuity, NO_SYNC and EO_TRACE also can be used to indicate discontinuity, though they are used for different scenarios for which the trace is interrupted. This patch renames sample type CS_ETM_TRACE_ON to CS_ETM_DISCONTINUITY, firstly the new name describes more closely the purpose of the packet; secondly this is a preparation for other output elements which also cause the trace discontinuity thus they can share the same one packet type. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mike Leach Cc: Namhyung Kim Cc: Robert Walker Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1544513908-16805-6-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit cfc1d4276b0453a752d8b31daf34f7f2dbd55e82 Author: Leo Yan Date: Tue Dec 11 15:38:24 2018 +0800 perf cs-etm: Refactor enumeration cs_etm_sample_type The values in enumeration cs_etm_sample_type are defined with setting bit N for each packet type, this is not suggested in the usual case. This patch refactor cs_etm_sample_type by converting from bit shifting values to continuous numbers. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mike Leach Cc: Namhyung Kim Cc: Robert Walker Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1544513908-16805-5-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit cee7a6a212ddb514d6e2ac1f9733501c43d63d0a Author: Leo Yan Date: Tue Dec 11 15:38:23 2018 +0800 perf cs-etm: Remove unused 'trace_on' in cs_etm_decoder cs_etm_decoder::trace_on is being assigned when TRACE_ON or NO_SYNC element is coming, but it is never used hence it is redundant and can be removed. So let's remove 'trace_on' field from cs_etm_decoder struct. Suggested-by: Mathieu Poirier Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Robert Walker Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1544513908-16805-4-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 24fff5eb2b937951af5dce6cdb7a1e679ac8e751 Author: Leo Yan Date: Tue Dec 11 15:38:22 2018 +0800 perf cs-etm: Avoid stale branch samples when flush packet At the end of trace buffer handling, function cs_etm__flush() is invoked to flush any remaining branch stack entries. As a side effect, it also generates branch sample, because the 'etmq->packet' doesn't contains any new coming packet but point to one stale packet after packets swapping, so it wrongly makes synthesize branch samples with stale packet info. We could review below detailed flow which causes issue: Packet1: start_addr=0xffff000008b1fbf0 end_addr=0xffff000008b1fbfc Packet2: start_addr=0xffff000008b1fb5c end_addr=0xffff000008b1fb6c step 1: cs_etm__sample(): sample: ip=(0xffff000008b1fbfc-4) addr=0xffff000008b1fb5c step 2: flush packet in cs_etm__run_decoder(): cs_etm__run_decoder() `-> err = cs_etm__flush(etmq, false); sample: ip=(0xffff000008b1fb6c-4) addr=0xffff000008b1fbf0 Packet1 and packet2 are two continuous packets, when packet2 is the new coming packet, cs_etm__sample() generates branch sample for these two packets and use [packet1::end_addr - 4 => packet2::start_addr] as branch jump flow, thus we can see the first generated branch sample in step 1. At the end of cs_etm__sample() it swaps packets so 'etm->prev_packet'= packet2 and 'etm->packet'=packet1, so far it's okay for branch sample. If packet2 is the last one packet in trace buffer, even there have no any new coming packet, cs_etm__run_decoder() invokes cs_etm__flush() to flush branch stack entries as expected, but it also generates branch samples by taking 'etm->packet' as a new coming packet, thus the branch jump flow is as [packet2::end_addr - 4 => packet1::start_addr]; this is the second sample which is generated in step 2. So actually the second sample is a stale sample and we should not generate it. This patch introduces a new function cs_etm__end_block(), at the end of trace block this function is invoked to only flush branch stack entries and thus can avoid to generate branch sample for stale packet. Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mike Leach Cc: Namhyung Kim Cc: Robert Walker Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1544513908-16805-3-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 43fd56669c28cd354e9228bdb58e4bca1c1a8b66 Author: Leo Yan Date: Tue Dec 11 15:38:21 2018 +0800 perf cs-etm: Correct packets swapping in cs_etm__flush() The structure cs_etm_queue uses 'prev_packet' to point to previous packet, this can be used to combine with new coming packet to generate samples. In function cs_etm__flush() it swaps packets only when the flag 'etm->synth_opts.last_branch' is true, this means that it will not swap packets if without option '--itrace=il' to generate last branch entries; thus for this case the 'prev_packet' doesn't point to the correct previous packet and the stale packet still will be used to generate sequential sample. Thus if dump trace with 'perf script' command we can see the incorrect flow with the stale packet's address info. This patch corrects packets swapping in cs_etm__flush(); except using the flag 'etm->synth_opts.last_branch' it also checks the another flag 'etm->sample_branches', if any flag is true then it swaps packets so can save correct content to 'prev_packet'. Finally this can fix the wrong program flow dumping issue. The patch has a minor refactoring to use 'etm->synth_opts.last_branch' instead of 'etmq->etm->synth_opts.last_branch' for condition checking, this is consistent with that is done in cs_etm__sample(). Signed-off-by: Leo Yan Reviewed-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mike Leach Cc: Namhyung Kim Cc: Robert Walker Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1544513908-16805-2-git-send-email-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit bbab50dda724309eccec92132d3f36cb262e8728 Author: Arnaldo Carvalho de Melo Date: Wed Dec 12 16:54:09 2018 -0300 perf trace: Switch to using a struct for the aumented_raw_syscalls syscalls map values We'll start adding more perf-syscall stuff, so lets do this prep step so that the next ones are just about adding more fields. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-vac4sn1ns1vj4y07lzj7y4b8@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 27f2992e7bb12ca28e886e48838ba740d2eb95f4 Author: Arnaldo Carvalho de Melo Date: Wed Dec 12 16:46:13 2018 -0300 perf augmented_syscalls: Switch to using a struct for the syscalls map values We'll start adding more perf-syscall stuff, so lets do this prep step so that the next ones are just about adding more fields. Run it with the .c file once to cache the .o file: # trace --filter-pids 2834,2199 -e openat,augmented_raw_syscalls.c LLVM: dumping augmented_raw_syscalls.o 0.000 ( 0.021 ms): tmux: server/4952 openat(dfd: CWD, filename: /proc/5691/cmdline ) = 11 349.807 ( 0.040 ms): DNS Res~er #39/11082 openat(dfd: CWD, filename: /etc/hosts, flags: CLOEXEC ) = 44 4988.759 ( 0.052 ms): gsd-color/2431 openat(dfd: CWD, filename: /etc/localtime ) = 18 4988.976 ( 0.029 ms): gsd-color/2431 openat(dfd: CWD, filename: /etc/localtime ) = 18 ^C[root@quaco bpf]# From now on, we can use just the newly built .o file, skipping the compilation step for a faster startup: # trace --filter-pids 2834,2199 -e openat,augmented_raw_syscalls.o 0.000 ( 0.046 ms): DNS Res~er #39/11088 openat(dfd: CWD, filename: /etc/hosts, flags: CLOEXEC ) = 44 1946.408 ( 0.190 ms): systemd/1 openat(dfd: CWD, filename: /proc/1071/cgroup, flags: CLOEXEC ) = 20 1946.792 ( 0.215 ms): systemd/1 openat(dfd: CWD, filename: /proc/954/cgroup, flags: CLOEXEC ) = 20 ^C# Now on to do the same in the builtin-trace.c side of things. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-k8mwu04l8es29rje5loq9vg7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 61d007138a44dc69265cf948eadd1759edbd3875 Author: Arnaldo Carvalho de Melo Date: Wed Dec 12 15:31:28 2018 -0300 perf bpf: Move perf_event_output() from stdio.h to bpf.h So that we don't always carry that __bpf_output__ map, leaving that to the scripts wanting to use that facility. 'perf trace' will be changed to look if that map is present and only setup the bpf-output events if so. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-azwys8irxqx9053vpajr0k5h@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit b27b38ed9427b32e0194e03281e3a79dd49887b2 Author: Arnaldo Carvalho de Melo Date: Wed Dec 12 13:39:24 2018 -0300 perf trace: Implement syscall filtering in augmented_syscalls Just another map, this time an BPF_MAP_TYPE_ARRAY, stating with one bool per syscall, stating if it should be filtered or not. So, with a pre-built augmented_raw_syscalls.o file, we use: # perf trace -e open*,augmented_raw_syscalls.o 0.000 ( 0.016 ms): DNS Res~er #37/29652 openat(dfd: CWD, filename: /etc/hosts, flags: CLOEXEC ) = 138 187.039 ( 0.048 ms): gsd-housekeepi/2436 openat(dfd: CWD, filename: /etc/fstab, flags: CLOEXEC ) = 11 187.348 ( 0.041 ms): gsd-housekeepi/2436 openat(dfd: CWD, filename: /proc/self/mountinfo, flags: CLOEXEC ) = 11 188.793 ( 0.036 ms): gsd-housekeepi/2436 openat(dfd: CWD, filename: /proc/self/mountinfo, flags: CLOEXEC ) = 11 189.803 ( 0.029 ms): gsd-housekeepi/2436 openat(dfd: CWD, filename: /proc/self/mountinfo, flags: CLOEXEC ) = 11 190.774 ( 0.027 ms): gsd-housekeepi/2436 openat(dfd: CWD, filename: /proc/self/mountinfo, flags: CLOEXEC ) = 11 284.620 ( 0.149 ms): DataStorage/3076 openat(dfd: CWD, filename: /home/acme/.mozilla/firefox/ina67tev.default/SiteSecurityServiceState.txt, flags: CREAT|TRUNC|WRONLY, mode: IRUGO|IWUSR|IWGRP) = 167 ^C# What is it that this gsd-housekeeping thingy needs to open /proc/self/mountinfo four times periodically? :-) This map will be extended to tell per-syscall parameters, i.e. how many bytes to copy per arg, using the function signature to get the types and then the size of those types, via BTF. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-cy222g9ucvnym3raqvxp0hpg@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 0df50e0b0e0f315c0d5e2ce8556aafe1403b4a4b Author: Arnaldo Carvalho de Melo Date: Wed Dec 12 13:47:40 2018 -0300 perf trace: Avoid using raw_syscalls in duplicity with eBPF augmentation So when we do something like: # perf trace -e open*,augmented_raw_syscalls.o We need to set trace->trace_syscalls because there is logic that use that when mixing strace-like output with other events, such as scheduler tracepoints, but with that set we ended up having multiple raw_syscalls:sys_{enter,exit} setup, which garbled the output, so check if trace->augmented_raw_syscalls is set and avoid the two extra tracepoints. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-kjmnbrlgu0c38co1ye8egbsb@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 246fbe03edaab9dfa5bd1f0e223c7c960d987982 Author: Arnaldo Carvalho de Melo Date: Wed Dec 12 11:06:53 2018 -0300 perf trace: Rename set_ev_qualifier_filter to clarify its a tracepoint filter Rename it to trace__set_ev_qualifier_tp_filter(), as this just sets up tracepoint filters on the raw_syscalls:sys_{enter,exit} tracepoints, and since we're going to do the same for the augmented_raw_syscalls codepath, when used, rename it to clarify. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-8bjsul8x7osw7nxjodnyfn14@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 3f643937aaab04881236b5aabec00f9802c1eda8 Author: Jiri Olsa Date: Wed Dec 12 14:29:40 2018 +0100 perf tools: Link libperf-jvmti.so with LDFLAGS variable So we could propagate distro flags into libperf-jvmti.so library. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20181212132940.840-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 41fa483aeee567cc34f9fc4c2e7035f2df25299d Author: Jiri Olsa Date: Wed Dec 12 10:12:14 2018 +0100 tools lib traceevent: Use LDFLAGS in the build commands So that the user can specify outside LDFLAGS values. Keeping the CFLAGS in there as well, so we don't break existing scripts. Signed-off-by: Jiri Olsa Acked-by: Steven Rostedt (VMware) Cc: Herton Krzesinski Cc: Tzvetomir Stoyanov (VMware) Link: http://lkml.kernel.org/r/20181212091214.GC17489@krava Signed-off-by: Arnaldo Carvalho de Melo commit 866053bb644f754d1a93aaa9db9998fecf7a8978 Author: Arnaldo Carvalho de Melo Date: Tue Dec 11 16:43:40 2018 -0300 perf tools: Cast off_t to s64 to avoid warning on bionic libc To avoid this warning: CC /tmp/build/perf/util/s390-cpumsf.o util/s390-cpumsf.c: In function 's390_cpumsf_samples': util/s390-cpumsf.c:508:3: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'off_t' [-Wformat=] pr_err("[%#08" PRIx64 "] Invalid AUX trailer entry TOD clock base\n", ^ Now the various Android cross toolchains used in the perf tools container test builds are all clean and we can remove this: export EXTRA_MAKE_ARGS="WERROR=0" Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Thomas Richter Link: https://lkml.kernel.org/n/tip-5rav4ccyb0sjciysz2i4p3sx@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d7a8c4a6a055097a67ccfa3ca7c9ff1b64603a70 Author: Arnaldo Carvalho de Melo Date: Tue Dec 11 16:31:19 2018 -0300 perf tools: Add missing open_memstream() prototype for systems lacking it There are systems such as the Android NDK API level 24 has the open_memstream() function but doesn't provide a prototype, adding noise to the build: builtin-timechart.c: In function 'cat_backtrace': builtin-timechart.c:486:2: warning: implicit declaration of function 'open_memstream' [-Wimplicit-function-declaration] FILE *f = open_memstream(&p, &p_len); ^ builtin-timechart.c:486:2: warning: nested extern declaration of 'open_memstream' [-Wnested-externs] builtin-timechart.c:486:12: warning: initialization makes pointer from integer without a cast FILE *f = open_memstream(&p, &p_len); ^ Define a LACKS_OPEN_MEMSTREAM_PROTOTYPE define so that code needing that can get a prototype. Checked in the bionic git repo to be available since level 23: https://android.googlesource.com/platform/bionic/+/master/libc/include/stdio.h#241 FILE* open_memstream(char** __ptr, size_t* __size_ptr) __INTRODUCED_IN(23); Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-343ashae97e5bq6vizusyfno@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 0afcf29bab35d3785204cd9bd51693b231ad7181 Author: Arnaldo Carvalho de Melo Date: Tue Dec 11 16:11:54 2018 -0300 perf header: Fix up argument to ctime() Reducing this noise when cross building to the Android NDK: util/header.c: In function 'perf_header__fprintf_info': util/header.c:2710:45: warning: pointer targets in passing argument 1 of 'ctime' differ in signedness [-Wpointer-sign] fprintf(fp, "# captured on : %s", ctime(&st.st_ctime)); ^ In file included from util/../perf.h:5:0, from util/evlist.h:11, from util/header.c:22: /opt/android-ndk-r15c/platforms/android-26/arch-arm/usr/include/time.h:81:14: note: expected 'const time_t *' but argument is of type 'long unsigned int *' extern char* ctime(const time_t*) __LIBC_ABI_PUBLIC__; ^ Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-6bz74zp080yhmtiwb36enso9@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 748fe0889c1ff12d378946bd5326e8ee8eacf5cf Author: Arnaldo Carvalho de Melo Date: Tue Dec 11 15:48:47 2018 -0300 perf tools: Add missing sigqueue() prototype for systems lacking it There are systems such as the Android NDK API level 24 has the sigqueue() function but doesn't provide a prototype, adding noise to the build: util/evlist.c: In function 'perf_evlist__prepare_workload': util/evlist.c:1494:4: warning: implicit declaration of function 'sigqueue' [-Wimplicit-function-declaration] if (sigqueue(getppid(), SIGUSR1, val)) ^ util/evlist.c:1494:4: warning: nested extern declaration of 'sigqueue' [-Wnested-externs] Define a LACKS_SIGQUEUE_PROTOTYPE define so that code needing that can get a prototype. Checked in the bionic git repo to be available since level 23: https://android.googlesource.com/platform/bionic/+/master/libc/include/signal.h#123 int sigqueue(pid_t __pid, int __signal, const union sigval __value) __INTRODUCED_IN(23); Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-lmhpev1uni9kdrv7j29glyov@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit ece9804985b57e1ccd83b1fb6288520955a29d51 Author: Arnaldo Carvalho de Melo Date: Tue Dec 11 15:00:52 2018 -0300 tools lib subcmd: Don't add the kernel sources to the include path At some point we decided not to directly include kernel sources files when building tools/perf/, but when tools/lib/subcmd/ was forked from tools/perf it somehow ended up adding it via these two lines in its Makefile: CFLAGS += -I$(srctree)/include/uapi CFLAGS += -I$(srctree)/include As $(srctree) points to the kernel sources. Removing those lines and keeping just: CFLAGS += -I$(srctree)/tools/include/ Is enough to build tools/perf and tools/objtool. This fixes the build when building from the sources in environments such as the Android NDK crossbuilding from a fedora:26 system: subcmd-util.h:11:15: error: expected ',' or ';' before 'void' static inline void report(const char *prefix, const char *err, va_list params) ^ In file included from /git/perf/include/uapi/linux/stddef.h:2:0, from /git/perf/include/uapi/linux/posix_types.h:5, from /opt/android-ndk-r12b/platforms/android-24/arch-arm/usr/include/sys/types.h:36, from /opt/android-ndk-r12b/platforms/android-24/arch-arm/usr/include/unistd.h:33, from run-command.c:2: subcmd-util.h:18:17: error: '__no_instrument_function__' attribute applies only to functions The /opt/android-ndk-r12b/platforms/android-24/arch-arm/usr/include/sys/types.h file that includes linux/posix_types.h ends up getting the one in the kernel sources causing the breakage. Fix it. Test built tools/objtool/ too. Reported-by: Jiri Olsa Tested-by: Jiri Olsa Cc: Adrian Hunter Cc: Josh Poimboeuf Cc: Namhyung Kim Fixes: 4b6ab94eabe4 ("perf subcmd: Create subcmd library") Link: https://lkml.kernel.org/n/tip-5lhaoecrj12t0bqwvpiu14sm@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 436651caa1ca3fd1d61e8daaff57453881f35a14 Author: Arnaldo Carvalho de Melo Date: Tue Dec 11 11:19:23 2018 -0300 perf trace beauty: renameat's newdirfd may also be AT_FDCWD Noticed while working on renameat2. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-8omchrcjcvlwoxxv6wrjehfh@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit ca7ff2c8e7add62b661c414257e7ef12cd40a950 Author: Arnaldo Carvalho de Melo Date: Tue Dec 11 10:39:30 2018 -0300 perf trace: Beautify renameat2's flags argument # strace -e renameat2 -f perf trace -e rename* mv c /tmp strace: Process 10824 attached [pid 10824] renameat2(AT_FDCWD, "c", AT_FDCWD, "/tmp", RENAME_NOREPLACE) = -1 EXDEV (Invalid cross-device link) [pid 10824] renameat2(AT_FDCWD, "c", AT_FDCWD, "/tmp/c", RENAME_NOREPLACE) = -1 EEXIST (File exists) 1.857 ( 0.008 ms): mv/10824 renameat2(olddfd: CWD, oldname: 0x7ffc72ff3d81, newdfd: CWD, newname: 0x7ffc72ff3d83, flags: NOREPLACE) = -1 EXDEV Invalid cross-device link 2.002 ( 0.006 ms): mv/10824 renameat2(olddfd: CWD, oldname: 0x7ffc72ff3d81, newdfd: CWD, newname: 0x55ad609efcc0, flags: NOREPLACE) = -1 EEXIST File exists mv: 'c' and '/tmp/c' are the same file [pid 10824] +++ exited with 1 +++ --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=10824, si_uid=0, si_status=1, si_utime=0, si_stime=0} --- +++ exited with 0 +++ # Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-glyt6nzlt1yx56m5bshy6g83@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 5a1cb7edfbf6ee8087b75d32461775501213a8e9 Author: Arnaldo Carvalho de Melo Date: Tue Dec 11 10:26:13 2018 -0300 perf beauty: Wire up the renameat flags table generator to the Makefile Now when we run 'make -C tools/perf O=/tmp/build/perf' we end up with: $ cat /tmp/build/perf/trace/beauty/generated/rename_flags_array.c static const char *rename_flags[] = { [0 + 1] = "NOREPLACE", [1 + 1] = "EXCHANGE", [2 + 1] = "WHITEOUT", }; $ Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-4fad4xahrn04y06o0lc49clm@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit bdc2a9d64a4c4c77c63ce2561bd644d233fcb1fc Author: Arnaldo Carvalho de Melo Date: Tue Dec 11 10:16:42 2018 -0300 perf beauty: Add a string table generator for renameat2's flags constants Using the already copied tools/include/uapi/linux/fs.h file: $ tools/perf/trace/beauty/rename_flags.sh static const char *rename_flags[] = { [0 + 1] = "NOREPLACE", [1 + 1] = "EXCHANGE", [2 + 1] = "WHITEOUT", }; $ Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-ta2jbh03spkymp4sbdh489g8@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 84a835412cdc36f3821a1daa10853f9c9aa3fc7c Author: Arnaldo Carvalho de Melo Date: Tue Dec 11 09:53:21 2018 -0300 perf trace beauty: Beautify renameat2's fd arg wrt AT_FDCWD Just like is done with the 'renameat' syscall. # strace -e renameat2 -f perf trace -e rename* mv c /tmp [pid 12334] renameat2(AT_FDCWD, "c", AT_FDCWD, "/tmp", RENAME_NOREPLACE) = -1 EXDEV (Invalid cross-device link) [pid 12334] renameat2(AT_FDCWD, "c", AT_FDCWD, "/tmp/c", RENAME_NOREPLACE) = -1 EEXIST (File exists) 1.947 ( 0.007 ms): mv/12334 renameat2(olddfd: CWD, oldname: 0x7ffce8b7fd81, newdfd: CWD, newname: 0x7ffce8b7fd83, flags: 1) = -1 EXDEV Invalid cross-device link 2.073 ( 0.009 ms): mv/12334 renameat2(olddfd: CWD, oldname: 0x7ffce8b7fd81, newdfd: CWD, newname: 0x55ce7f0a1cc0, flags: 1mv: ) = -1 EEXIST File exists'c' and '/tmp/c' are the same file # Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-8q9l92eh9eee3y2bwyqku3tc@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit a761a8d102e2a6edfef3ad5bb22baeb715f93abd Author: Arnaldo Carvalho de Melo Date: Mon Dec 10 16:27:33 2018 -0300 perf trace: Allow selecting use the use of the ordered_events code I was trigger happy on this one, as using ordered_events as implemented by Jiri for use with the --block code under discussion on lkml incurs in delaying processing to form batches that then get ordered and then printed. With 'perf trace' we want to process the events as they go, without that delay, and doing it that way works well for the common case which is to trace a thread or a workload started by 'perf trace'. So revert back to not using ordered_events but add an option to select that mode so that users can experiment with their particular use case to see if works better, i.e. if the added delay is not a problem and the ordering helps. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-8ki7sld6rusnjhhtaly26i5o@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 7ba61524fa0337a919b2ec5fcce26db23c611ca7 Author: Arnaldo Carvalho de Melo Date: Mon Dec 10 16:09:51 2018 -0300 perf trace: Rename delivery functions to ease making ordered_events selectable Just hide a bit more how events gets delivered, hiding ordered_events details from the main loop. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lkml.kernel.org/n/tip-lxwwf3238ta4neq2zh1y1h45@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f024cf085c423bac7512479f45c34ee9a24af7ce Author: Steven Rostedt (VMware) Date: Mon Dec 10 13:45:22 2018 -0500 tools lib traceevent: Fix processing of dereferenced args in bprintk events In the case that a bprintk event has a dereferenced pointer that is stored as a string, and there's more values to process (more args), the arg was not updated to point to the next arg after processing the dereferenced pointer, and it screwed up what was to be displayed. Signed-off-by: Steven Rostedt (VMware) Cc: Jiri Olsa Cc: Namhyung Kim Cc: linux-trace-devel@vger.kernel.org Cc: stable@vger.kernel.org Fixes: 37db96bb49629 ("tools lib traceevent: Handle new pointer processing of bprint strings") Link: http://lkml.kernel.org/r/20181210134522.3f71e2ca@gandalf.local.home Signed-off-by: Arnaldo Carvalho de Melo commit 51433ead1460fb3f46e1c34f68bb22fd2dd0f5d0 Author: Michael Petlan Date: Mon Dec 10 11:00:04 2018 -0500 perf stat: Avoid segfaults caused by negated options Some 'perf stat' options do not make sense to be negated (event, cgroup), some do not have negated path implemented (metrics). Due to that, it is better to disable the "no-" prefix for them, since otherwise, the later opt-parsing segfaults. Before: $ perf stat --no-metrics -- ls Segmentation fault (core dumped) After: $ perf stat --no-metrics -- ls Error: option `no-metrics' isn't available Usage: perf stat [] [] Signed-off-by: Michael Petlan Tested-by: Arnaldo Carvalho de Melo LPU-Reference: 1485912065.62416880.1544457604340.JavaMail.zimbra@redhat.com Signed-off-by: Arnaldo Carvalho de Melo commit 4eaf97e8c5b13d01dd3c3b00181b6eed208aec01 Author: Michael Petlan Date: Wed Nov 21 16:39:18 2018 -0500 perf tests: Use shebangs in the shell scripts Since the first line was used as a test identification, it needs to be skipped by shell_test__description() function now. Further notes from Hendrik: It might be worth to note that adding the shebang is necessary to spot them as scripts. Using /bin/sh looks fine to. Just briefly checked whether the scripts contains some bash-specifics, which is not the case. Signed-off-by: Michael Petlan Reviewed-by: Hendrik Brueckner Cc: Jiri Olsa LPU-Reference: 2127419430.57657104.1542836358464.JavaMail.zimbra@redhat.com Signed-off-by: Arnaldo Carvalho de Melo commit 571766010ea6bf9726b288eb2db1abb59b1841af Author: Adrian Hunter Date: Tue Nov 27 10:46:34 2018 +0200 perf auxtrace: Alter addr_filter__entire_dso() to work if there are no symbols addr_filter__entire_dso() uses the first and last symbols from a dso, and so does not work when there are no symbols. Alter it to filter the whole file instead. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Mathieu Poirier Fixes: 1b36c03e3569 ("perf record: Add support for using symbols in address filters") Link: http://lkml.kernel.org/r/20181127084634.12469-1-adrian.hunter@intel.com [ split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo commit b5c2161cc415babb84d2b49599df8bd03b2b9b69 Author: Adrian Hunter Date: Tue Nov 27 10:46:34 2018 +0200 perf dso: Export data_file_size() method there are no symbols Will be used outside dso.c in a followup patch, so rename it and make it non-static. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: http://lkml.kernel.org/r/20181127084634.12469-1-adrian.hunter@intel.com [ split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo commit bea2ef803ade3359026d5d357348842bca9edcf1 Author: Marc Zyngier Date: Tue Dec 4 17:11:19 2018 +0000 KVM: arm/arm64: vgic: Cap SPIs to the VM-defined maximum SPIs should be checked against the VMs specific configuration, and not the architectural maximum. Cc: stable@vger.kernel.org Signed-off-by: Marc Zyngier commit 6992195cc6c6c4d673a3266ae59cbeeb746d61af Author: Christoffer Dall Date: Tue Nov 6 13:33:38 2018 +0100 KVM: arm64: Clarify explanation of STAGE2_PGTABLE_LEVELS In attempting to re-construct the logic for our stage 2 page table layout I found the reasoning in the comment explaining how we calculate the number of levels used for stage 2 page tables a bit backwards. This commit attempts to clarify the comment, to make it slightly easier to read without having the Arm ARM open on the right page. While we're at it, fixup a typo in a comment that was recently changed. Reviewed-by: Suzuki K Poulose Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit 2e2f6c3c0b08eed3fcf7de3c7684c940451bdeb1 Author: Julien Thierry Date: Mon Nov 26 18:26:44 2018 +0000 KVM: arm/arm64: vgic: Do not cond_resched_lock() with IRQs disabled To change the active state of an MMIO, halt is requested for all vcpus of the affected guest before modifying the IRQ state. This is done by calling cond_resched_lock() in vgic_mmio_change_active(). However interrupts are disabled at this point and we cannot reschedule a vcpu. We actually don't need any of this, as kvm_arm_halt_guest ensures that all the other vcpus are out of the guest. Let's just drop that useless code. Signed-off-by: Julien Thierry Suggested-by: Christoffer Dall Cc: stable@vger.kernel.org Signed-off-by: Marc Zyngier commit b8e0ba7c8bea994011aff3b4c35256b180fab874 Author: Punit Agrawal Date: Tue Dec 11 17:10:41 2018 +0000 KVM: arm64: Add support for creating PUD hugepages at stage 2 KVM only supports PMD hugepages at stage 2. Now that the various page handling routines are updated, extend the stage 2 fault handling to map in PUD hugepages. Addition of PUD hugepage support enables additional page sizes (e.g., 1G with 4K granule) which can be useful on cores that support mapping larger block sizes in the TLB entries. Signed-off-by: Punit Agrawal Reviewed-by: Christoffer Dall Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon [ Replace BUG() => WARN_ON(1) for arm32 PUD helpers ] Signed-off-by: Suzuki Poulose Signed-off-by: Marc Zyngier commit 35a63966194dd994f44150f07398c62f8dca011e Author: Punit Agrawal Date: Tue Dec 11 17:10:40 2018 +0000 KVM: arm64: Update age handlers to support PUD hugepages In preparation for creating larger hugepages at Stage 2, add support to the age handling notifiers for PUD hugepages when encountered. Provide trivial helpers for arm32 to allow sharing code. Signed-off-by: Punit Agrawal Reviewed-by: Christoffer Dall Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon [ Replaced BUG() => WARN_ON(1) for arm32 PUD helpers ] Signed-off-by: Suzuki K Poulose Signed-off-by: Marc Zyngier commit eb3f0624ea082def887acc79e97934e27d0188b7 Author: Punit Agrawal Date: Tue Dec 11 17:10:39 2018 +0000 KVM: arm64: Support handling access faults for PUD hugepages In preparation for creating larger hugepages at Stage 2, extend the access fault handling at Stage 2 to support PUD hugepages when encountered. Provide trivial helpers for arm32 to allow sharing of code. Signed-off-by: Punit Agrawal Reviewed-by: Christoffer Dall Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon [ Replaced BUG() => WARN_ON(1) in PUD helpers ] Signed-off-by: Suzuki K Poulose Signed-off-by: Marc Zyngier commit 86d1c55ea605025f78d026e7fc3a2bb4c3fc2d6a Author: Punit Agrawal Date: Tue Dec 11 17:10:38 2018 +0000 KVM: arm64: Support PUD hugepage in stage2_is_exec() In preparation for creating PUD hugepages at stage 2, add support for detecting execute permissions on PUD page table entries. Faults due to lack of execute permissions on page table entries is used to perform i-cache invalidation on first execute. Provide trivial implementations of arm32 helpers to allow sharing of code. Signed-off-by: Punit Agrawal Reviewed-by: Christoffer Dall Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon [ Replaced BUG() => WARN_ON(1) in arm32 PUD helpers ] Signed-off-by: Suzuki K Poulose Signed-off-by: Marc Zyngier commit 4ea5af53114091e23a8fc279f25637e6c4e892c6 Author: Punit Agrawal Date: Tue Dec 11 17:10:37 2018 +0000 KVM: arm64: Support dirty page tracking for PUD hugepages In preparation for creating PUD hugepages at stage 2, add support for write protecting PUD hugepages when they are encountered. Write protecting guest tables is used to track dirty pages when migrating VMs. Also, provide trivial implementations of required kvm_s2pud_* helpers to allow sharing of code with arm32. Signed-off-by: Punit Agrawal Reviewed-by: Christoffer Dall Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon [ Replaced BUG() => WARN_ON() in arm32 pud helpers ] Signed-off-by: Suzuki K Poulose Signed-off-by: Marc Zyngier commit f8df73388ee25b5e5f1d26249202e7126ca8139d Author: Punit Agrawal Date: Tue Dec 11 17:10:36 2018 +0000 KVM: arm/arm64: Introduce helpers to manipulate page table entries Introduce helpers to abstract architectural handling of the conversion of pfn to page table entries and marking a PMD page table entry as a block entry. The helpers are introduced in preparation for supporting PUD hugepages at stage 2 - which are supported on arm64 but do not exist on arm. Signed-off-by: Punit Agrawal Reviewed-by: Suzuki K Poulose Acked-by: Christoffer Dall Cc: Russell King Cc: Catalin Marinas Cc: Will Deacon Reviewed-by: Marc Zyngier Signed-off-by: Suzuki K Poulose Signed-off-by: Marc Zyngier commit 6396b852e46e562f4742ed0a9042b537eb26b8aa Author: Punit Agrawal Date: Tue Dec 11 17:10:35 2018 +0000 KVM: arm/arm64: Re-factor setting the Stage 2 entry to exec on fault Stage 2 fault handler marks a page as executable if it is handling an execution fault or if it was a permission fault in which case the executable bit needs to be preserved. The logic to decide if the page should be marked executable is duplicated for PMD and PTE entries. To avoid creating another copy when support for PUD hugepages is introduced refactor the code to share the checks needed to mark a page table entry as executable. Signed-off-by: Punit Agrawal Reviewed-by: Suzuki K Poulose Reviewed-by: Christoffer Dall Signed-off-by: Suzuki K Poulose Signed-off-by: Marc Zyngier commit 3f58bf63455588a260b6abc8761c48bc8977b919 Author: Punit Agrawal Date: Tue Dec 11 17:10:34 2018 +0000 KVM: arm/arm64: Share common code in user_mem_abort() The code for operations such as marking the pfn as dirty, and dcache/icache maintenance during stage 2 fault handling is duplicated between normal pages and PMD hugepages. Instead of creating another copy of the operations when we introduce PUD hugepages, let's share them across the different pagesizes. Signed-off-by: Punit Agrawal Reviewed-by: Suzuki K Poulose Reviewed-by: Christoffer Dall Signed-off-by: Suzuki K Poulose Signed-off-by: Marc Zyngier commit 60c3ab30d8c2ff3a52606df03f05af2aae07dc6b Author: Christoffer Dall Date: Tue Dec 11 12:51:03 2018 +0100 KVM: arm/arm64: vgic-v2: Set active_source to 0 when restoring state When restoring the active state from userspace, we don't know which CPU was the source for the active state, and this is not architecturally exposed in any of the register state. Set the active_source to 0 in this case. In the future, we can expand on this and exposse the information as additional information to userspace for GICv2 if anyone cares. Cc: stable@vger.kernel.org Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit d1878af3a5a6ac00bc8a3edfecf80539ee9c546e Author: Mark Rutland Date: Thu Dec 6 12:31:44 2018 +0000 KVM: arm/arm64: Log PSTATE for unhandled sysregs When KVM traps an unhandled sysreg/coproc access from a guest, it logs the guest PC. To aid debugging, it would be helpful to know which exception level the trap came from, along with other PSTATE/CPSR bits, so let's log the PSTATE/CPSR too. Acked-by: Christoffer Dall Signed-off-by: Mark Rutland Signed-off-by: Marc Zyngier commit fb544d1ca65a89f7a3895f7531221ceeed74ada7 Author: Christoffer Dall Date: Tue Dec 11 13:23:57 2018 +0100 KVM: arm/arm64: Fix VMID alloc race by reverting to lock-less We recently addressed a VMID generation race by introducing a read/write lock around accesses and updates to the vmid generation values. However, kvm_arch_vcpu_ioctl_run() also calls need_new_vmid_gen() but does so without taking the read lock. As far as I can tell, this can lead to the same kind of race: VM 0, VCPU 0 VM 0, VCPU 1 ------------ ------------ update_vttbr (vmid 254) update_vttbr (vmid 1) // roll over read_lock(kvm_vmid_lock); force_vm_exit() local_irq_disable need_new_vmid_gen == false //because vmid gen matches enter_guest (vmid 254) kvm_arch.vttbr = : read_unlock(kvm_vmid_lock); enter_guest (vmid 1) Which results in running two VCPUs in the same VM with different VMIDs and (even worse) other VCPUs from other VMs could now allocate clashing VMID 254 from the new generation as long as VCPU 0 is not exiting. Attempt to solve this by making sure vttbr is updated before another CPU can observe the updated VMID generation. Cc: stable@vger.kernel.org Fixes: f0cf47d939d0 "KVM: arm/arm64: Close VMID generation race" Reviewed-by: Julien Thierry Signed-off-by: Christoffer Dall Signed-off-by: Marc Zyngier commit e4b92b108c6cd6b311e4b6e85d6a87a34599a6e3 Author: Arnd Bergmann Date: Fri Dec 7 13:45:54 2018 +0100 timekeeping: remove obsolete time accessors There are no more remaining users of these deprecated wrappers, so let's remove them before new users have a chance to make it in. See Documentation/core-api/timekeeping.rst for replacements when porting old drivers that contain calls to this function. Signed-off-by: Arnd Bergmann Acked-by: John Stultz commit d651d1607f22fd0cd249cb045627569f8028092b Author: Arnd Bergmann Date: Wed Dec 5 11:14:27 2018 +1100 vfs: replace current_kernel_time64 with ktime equivalent current_time is the last remaining caller of current_kernel_time64(), which is a wrapper around ktime_get_coarse_real_ts64(). This calls the latter directly for consistency with the rest of the kernel that is moving to the ktime_get_ family of time accessors, as now documented in Documentation/core-api/timekeeping.rst. An open questions is whether we may want to actually call the more accurate ktime_get_real_ts64() for file systems that save high-resolution timestamps in their on-disk format. This would add a small overhead to each update of the inode stamps but lead to inode timestamps to actually have a usable resolution better than one jiffy (1 to 10 milliseconds normally). Experiments on a variety of hardware platforms show a typical time of around 100 CPU cycles to read the cycle counter and calculate the accurate time from that. On old platforms without a cycle counter, this can be signiciantly higher, up to several microseconds to access a hardware clock, but those have become very rare by now. I traced the original addition of the current_kernel_time() call to set the nanosecond fields back to linux-2.5.48, where Andi Kleen added a patch with subject "nanosecond stat timefields". Andi explains that the motivation was to introduce as little overhead as possible back then. At this time, reading the clock hardware was also more expensive when most architectures did not have a cycle counter. One side effect of having more accurate inode timestamp would be having to write out the inode every time that mtime/ctime/atime get touched on most systems, whereas many file systems today only write it when the timestamps have changed, i.e. at most once per jiffy unless something else changes as well. That change would certainly be noticed in some workloads, which is enough reason to not do it without a good reason, regardless of the cost of reading the time. One thing we could still consider however would be to round the timestamps from current_time() to multiples of NSEC_PER_JIFFY, e.g. full milliseconds rather than having six or seven meaningless but confusing digits at the end of the timestamp. Link: http://lkml.kernel.org/r/20180726130820.4174359-1-arnd@arndb.de Signed-off-by: Arnd Bergmann commit 437e78d3fd6d35e6d56230962e6d03bb5dcda7f6 Author: Arnd Bergmann Date: Fri Dec 7 13:41:02 2018 +0100 timekeeping: remove timespec_add/timespec_del The last users were removed a while ago since everyone moved to ktime_t, so we can remove the two unused interfaces for old timespec structures. With those two gone, set_normalized_timespec() is also unused, so remove that as well. Signed-off-by: Arnd Bergmann Acked-by: John Stultz commit 926617889dc8383a120c66a2ecf7959a69f96950 Author: Arnd Bergmann Date: Tue Aug 14 14:15:23 2018 +0200 timekeeping: remove unused {read,update}_persistent_clock After arch/sh has removed the last reference to these functions, we can remove them completely and just rely on the 64-bit time_t based versions. This cleans up a rather ugly use of __weak functions. Signed-off-by: Arnd Bergmann Acked-by: John Stultz commit 19f48591e67c83e74e1b612f180b96ce7f1eaf85 Author: Arnd Bergmann Date: Fri Apr 20 17:46:39 2018 +0200 sh: remove board_time_init() callback The only remaining user of board_time_init() is the of-generic machine, and that just calls the global timer_init() function. Calling that one has no effect on non-DT platforms, so we can simply call it unconditionally in place of board_time_init(). Signed-off-by: Arnd Bergmann commit 07df7800c6cd0bfc3bfcbfc5f12ebbd73423a5ec Author: Arnd Bergmann Date: Wed Jan 24 16:18:50 2018 +0100 sh: remove unused rtc_sh_get/set_time infrastructure All platforms are now converted to RTC drivers, so this has become obsolete. The board_time_init() callback still has one caller, but could otherwise also get killed. This removes one more usage of the deprecated timespec structure, which overflows in y2038. Signed-off-by: Arnd Bergmann commit 09e81263e5013ce5add177d50c0b1da0725ce266 Author: Arnd Bergmann Date: Wed Jan 24 16:08:13 2018 +0100 sh: sh03: rtc: push down rtc class ops into driver The SH RTC support has an extra level of indirection to provide either the old read_persistent_clock/update_persistent_clock interface or the rtc-generic device for hctosys/systohc. By removing the indirection and always using the RTC_CLASS interface, we can avoid the lossy double conversion between rtc_time and timespec, so we end up supporting the entire range of 'year' values, and clarifying the rtc_set_time callback. I did not change the behavior of sh03_rtc_settimeofday(), which keeps just updating the seconds/minutes by calling set_rtc_mmss(), this could be improved if anyone cares. Also, the file should ideally be moved into drivers/rtc and not use rtc-generic. Signed-off-by: Arnd Bergmann commit b0495e4b67b230cdb8a7ba244cd260e529c53b84 Author: Arnd Bergmann Date: Wed Jan 24 15:04:31 2018 +0100 sh: dreamcast: rtc: push down rtc class ops into driver The SH RTC support has an extra level of indirection to provide either the old read_persistent_clock/update_persistent_clock interface or the rtc-generic device for hctosys/systohc. Both do the same thing for dreamcast, so we can do away with the abstraction and simply let the RTC core code to take care of it. Signed-off-by: Arnd Bergmann commit 2367c4b5fa09b2947d03c5cd23d7bc0200b7fe4f Author: Arnd Bergmann Date: Wed Apr 18 16:18:35 2018 +0200 y2038: signal: Add compat_sys_rt_sigtimedwait_time64 Now that 32-bit architectures have two variants of sys_rt_sigtimedwaid() for 32-bit and 64-bit time_t, we also need to have a second compat system call entry point on the corresponding 64-bit architectures. The traditional system call keeps getting handled by compat_sys_rt_sigtimedwait(), and this adds a new compat_sys_rt_sigtimedwait_time64() that differs only in the timeout argument type. The naming remains a bit asymmetric for the moment. Ideally we would want to have compat_sys_rt_sigtimedwait_time32() for the old version and compat_sys_rt_sigtimedwait() for the new one to mirror the names of the native entry points, but renaming the existing system call tables causes unnecessary churn. I would suggest renaming all such system calls together at a later point. Signed-off-by: Arnd Bergmann commit df8522a340ee4ccb725036e1f9145f5646939aed Author: Arnd Bergmann Date: Wed Apr 18 16:15:37 2018 +0200 y2038: signal: Add sys_rt_sigtimedwait_time32 Once sys_rt_sigtimedwait() gets changed to a 64-bit time_t, we have to provide compatibility support for existing binaries. An earlier version of this patch reused the compat_sys_rt_sigtimedwait entry point to avoid code duplication, but this newer approach duplicates the existing native entry point instead, which seems a bit cleaner. Signed-off-by: Arnd Bergmann commit e11d4284e2f4de5048c6d1787c82226f0a198292 Author: Arnd Bergmann Date: Wed Apr 18 13:43:52 2018 +0200 y2038: socket: Add compat_sys_recvmmsg_time64 recvmmsg() takes two arguments to pointers of structures that differ between 32-bit and 64-bit architectures: mmsghdr and timespec. For y2038 compatbility, we are changing the native system call from timespec to __kernel_timespec with a 64-bit time_t (in another patch), and use the existing compat system call on both 32-bit and 64-bit architectures for compatibility with traditional 32-bit user space. As we now have two variants of recvmmsg() for 32-bit tasks that are both different from the variant that we use on 64-bit tasks, this means we also require two compat system calls! The solution I picked is to flip things around: The existing compat_sys_recvmmsg() call gets moved from net/compat.c into net/socket.c and now handles the case for old user space on all architectures that have set CONFIG_COMPAT_32BIT_TIME. A new compat_sys_recvmmsg_time64() call gets added in the old place for 64-bit architectures only, this one handles the case of a compat mmsghdr structure combined with __kernel_timespec. In the indirect sys_socketcall(), we now need to call either do_sys_recvmmsg() or __compat_sys_recvmmsg(), depending on what kind of architecture we are on. For compat_sys_socketcall(), no such change is needed, we always call __compat_sys_recvmmsg(). I decided to not add a new SYS_RECVMMSG_TIME64 socketcall: Any libc implementation for 64-bit time_t will need significant changes including an updated asm/unistd.h, and it seems better to consistently use the separate syscalls that configuration, leaving the socketcall only for backward compatibility with 32-bit time_t based libc. The naming is asymmetric for the moment, so both existing syscalls entry points keep their names, while the new ones are recvmmsg_time32 and compat_recvmmsg_time64 respectively. I expect that we will rename the compat syscalls later as we start using generated syscall tables everywhere and add these entry points. Signed-off-by: Arnd Bergmann commit 54578ee883e34d2d1c518d48f1c1e2dd3f387188 Author: Bin Liu Date: Tue Dec 18 07:58:05 2018 -0600 usb: musb: dsps: fix runtime pm for peripheral mode Since the runtime PM support was added in musb, dsps relies on the timer calling otg_timer() to activate the usb subsystem. However the driver doesn't enable the timer for peripheral port, then the peripheral port is unable to be enumerated by a host if the other usb port is disabled or in peripheral mode too. So let's start the timer for peripheral port too. Fixes: ea2f35c01d5e ("usb: musb: Fix sleeping function called from invalid context for hdrc glue") Acked-by: Tony Lindgren Signed-off-by: Bin Liu Signed-off-by: Greg Kroah-Hartman commit 6010abf2c2c0e382d7e8ee44bd11f343aae90cce Author: Bin Liu Date: Tue Dec 18 07:58:04 2018 -0600 usb: musb: dsps: fix otg state machine Due to lack of ID pin interrupt event on AM335x devices, the musb dsps driver uses polling to detect usb device attach for dual-role port. But in the case if a micro-A cable adapter is attached without a USB device attached to the cable, the musb state machine gets stuck in a_wait_vrise state waiting for the MUSB_CONNECT interrupt which won't happen due to the usb device is not attached. The state is stuck in a_wait_vrise even after the micro-A cable is detached, which could cause VBUS retention if then the dual-role port is attached to a host port. To fix the problem, make a_wait_vrise as a transient state, then move the state to either a_wait_bcon for host port or a_idle state for dual-role port, if no usb device is attached to the port. Signed-off-by: Bin Liu Signed-off-by: Greg Kroah-Hartman commit bd7d95cafb499e24903b7d21f9eeb2c5208160c2 Author: Mark Rutland Date: Fri Nov 9 15:07:11 2018 +0000 arm64: KVM: Consistently advance singlestep when emulating instructions When we emulate a guest instruction, we don't advance the hardware singlestep state machine, and thus the guest will receive a software step exception after a next instruction which is not emulated by the host. We bodge around this in an ad-hoc fashion. Sometimes we explicitly check whether userspace requested a single step, and fake a debug exception from within the kernel. Other times, we advance the HW singlestep state rely on the HW to generate the exception for us. Thus, the observed step behaviour differs for host and guest. Let's make this simpler and consistent by always advancing the HW singlestep state machine when we skip an instruction. Thus we can rely on the hardware to generate the singlestep exception for us, and never need to explicitly check for an active-pending step, nor do we need to fake a debug exception from the guest. Cc: Peter Maydell Reviewed-by: Alex Bennée Reviewed-by: Christoffer Dall Signed-off-by: Mark Rutland Signed-off-by: Marc Zyngier commit 0d640732dbebed0f10f18526de21652931f0b2f2 Author: Mark Rutland Date: Fri Nov 9 15:07:10 2018 +0000 arm64: KVM: Skip MMIO insn after emulation When we emulate an MMIO instruction, we advance the CPU state within decode_hsr(), before emulating the instruction effects. Having this logic in decode_hsr() is opaque, and advancing the state before emulation is problematic. It gets in the way of applying consistent single-step logic, and it prevents us from being able to fail an MMIO instruction with a synchronous exception. Clean this up by only advancing the CPU state *after* the effects of the instruction are emulated. Cc: Peter Maydell Reviewed-by: Alex Bennée Reviewed-by: Christoffer Dall Signed-off-by: Mark Rutland Signed-off-by: Marc Zyngier commit da0abe1a04110491697ca9ff146e1107f40b4808 Author: Richard Fitzgerald Date: Fri Dec 14 14:44:16 2018 +0000 irqchip: Add driver for Cirrus Logic Madera codecs The Cirrus Logic Madera codecs (Cirrus Logic CS47L35/85/90/91 and WM1840) are highly complex devices containing up to 7 programmable DSPs and many other internal sources of interrupts plus a number of GPIOs that can be used as interrupt inputs. The large number (>150) of internal interrupt sources are managed by an on-board interrupt controller. This driver provides the handling for the interrupt controller. As the codec is accessed via regmap, we can make use of the generic IRQ functionality from regmap to do most of the work. Only around half of the possible interrupt source are currently of interest from the driver so only this subset is defined. Others can be added in future if needed. The KConfig options are not user-configurable because this driver is mandatory so is automatically included when the parent MFD driver is selected. Signed-off-by: Richard Fitzgerald Signed-off-by: Charles Keepax Signed-off-by: Marc Zyngier commit 34743bfddef2c50af20234ae873324ca49320a55 Author: Mike Snitzer Date: Mon Dec 10 11:55:56 2018 -0500 dm rq: cleanup leftover code from recently removed q->mq_ops branching When commit 6a23e05c2fe3c6 ("dm: remove legacy request-based IO path") removed some q->mq_ops branching from map_request() it left in place a goto that was only needed if that branching (and conditional 'r' assignment) existed. Now that the branching is gone map_request()'s goto can be removed too. Signed-off-by: Mike Snitzer commit bbf6a566920e1b0244b27b5f9882fb7f8bc83a31 Author: Eric Biggers Date: Wed Dec 5 20:54:13 2018 -0800 dm verity: log the hash algorithm implementation Log the hash algorithm's driver name when a dm-verity target is created. This will help people determine whether the expected implementation is being used. It can make an enormous difference; e.g., SHA-256 on ARM can be 8x faster with the crypto extensions than without. It can also be useful to know if an implementation using an external crypto accelerator is being used instead of a software implementation. Example message: [ 35.281945] device-mapper: verity: sha256 using implementation "sha256-ce" We've already found the similar message in fs/crypto/keyinfo.c to be very useful. Signed-off-by: Eric Biggers Signed-off-by: Mike Snitzer commit af331ebae7e10699a023fcce4f0671a01419ee3c Author: Eric Biggers Date: Wed Dec 5 20:53:00 2018 -0800 dm crypt: log the encryption algorithm implementation Log the encryption algorithm's driver name when a dm-crypt target is created. This will help people determine whether the expected implementation is being used. In some cases we've seen people do benchmarks and reject using encryption for performance reasons, when in fact they used a much slower implementation than was possible on the hardware. It can make an enormous difference; e.g., AES-XTS on ARM can be over 10x faster with the crypto extensions than without. It can also be useful to know if an implementation using an external crypto accelerator is being used instead of a software implementation. Example message: [ 29.307629] device-mapper: crypt: xts(aes) using implementation "xts-aes-ce" We've already found the similar message in fs/crypto/keyinfo.c to be very useful. Signed-off-by: Eric Biggers Signed-off-by: Mike Snitzer commit e8c2566f83527f6bcced86739adc5cd5262e2dd2 Author: Colin Ian King Date: Wed Nov 28 15:15:31 2018 +0000 dm integrity: fix spelling mistake in workqueue name Rename the workqueue from dm-intergrity-recalc to dm-integrity-recalc. Signed-off-by: Colin Ian King Signed-off-by: Mike Snitzer commit a00f5276e26636cbf72f24f79831026d2e2868e7 Author: Sweet Tea Date: Tue Nov 13 08:04:24 2018 -0500 dm flakey: Properly corrupt multi-page bios. The flakey target is documented to be able to corrupt the Nth byte in a bio, but does not corrupt byte indices after the first biovec in the bio. Change the corrupting function to actually corrupt the Nth byte no matter in which biovec that index falls. A test device generating two-page bios, atop a flakey device configured to corrupt a byte index on the second page, verified both the failure to corrupt before this patch and the expected corruption after this change. Signed-off-by: John Dorminy Signed-off-by: Mike Snitzer commit ef87bfc24f9b8da82c89aff493df20f078bc9cb1 Author: Milan Broz Date: Wed Nov 7 22:24:55 2018 +0100 dm: Check for device sector overflow if CONFIG_LBDAF is not set Reference to a device in device-mapper table contains offset in sectors. If the sector_t is 32bit integer (CONFIG_LBDAF is not set), then several device-mapper targets can overflow this offset and validity check is then performed on a wrong offset and a wrong table is activated. See for example (on 32bit without CONFIG_LBDAF) this overflow: # dmsetup create test --table "0 2048 linear /dev/sdg 4294967297" # dmsetup table test 0 2048 linear 8:96 1 This patch adds explicit check for overflow if the offset is sector_t type. Signed-off-by: Milan Broz Reviewed-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit 8d683dcd65c037efc9fb38c696ec9b65b306e573 Author: AliOS system security Date: Mon Nov 5 15:31:42 2018 +0800 dm crypt: use u64 instead of sector_t to store iv_offset The iv_offset in the mapping table of crypt target is a 64bit number when IV algorithm is plain64, plain64be, essiv or benbi. It will be assigned to iv_offset of struct crypt_config, cc_sector of struct convert_context and iv_sector of struct dm_crypt_request. These structures members are defined as a sector_t. But sector_t is 32bit when CONFIG_LBDAF is not set in 32bit kernel. In this situation sector_t is not big enough to store the 64bit iv_offset. Here is a reproducer. Prepare test image and device (loop is automatically allocated by cryptsetup): # dd if=/dev/zero of=tst.img bs=1M count=1 # echo "tst"|cryptsetup open --type plain -c aes-xts-plain64 \ --skip 500000000000000000 tst.img test On 32bit system (use IV offset value that overflows to 64bit; CONFIG_LBDAF if off) and device checksum is wrong: # dmsetup table test --showkeys 0 2048 crypt aes-xts-plain64 dfa7cfe3c481f2239155739c42e539ae8f2d38f304dcc89d20b26f69daaf0933 3551657984 7:0 0 # sha256sum /dev/mapper/test 533e25c09176632b3794f35303488c4a8f3f965dffffa6ec2df347c168cb6c19 /dev/mapper/test On 64bit system (and on 32bit system with the patch), table and checksum is now correct: # dmsetup table test --showkeys 0 2048 crypt aes-xts-plain64 dfa7cfe3c481f2239155739c42e539ae8f2d38f304dcc89d20b26f69daaf0933 500000000000000000 7:0 0 # sha256sum /dev/mapper/test 5d16160f9d5f8c33d8051e65fdb4f003cc31cd652b5abb08f03aa6fce0df75fc /dev/mapper/test Signed-off-by: AliOS system security Tested-and-Reviewed-by: Milan Broz Signed-off-by: Mike Snitzer commit d7e6b8dfc7bcb3f4f3a18313581f67486a725b52 Author: Nikos Tsironis Date: Wed Oct 31 17:53:09 2018 -0400 dm kcopyd: Fix bug causing workqueue stalls When using kcopyd to run callbacks through dm_kcopyd_do_callback() or submitting copy jobs with a source size of 0, the jobs are pushed directly to the complete_jobs list, which could be under processing by the kcopyd thread. As a result, the kcopyd thread can continue running completed jobs indefinitely, without releasing the CPU, as long as someone keeps submitting new completed jobs through the aforementioned paths. Processing of work items, queued for execution on the same CPU as the currently running kcopyd thread, is thus stalled for excessive amounts of time, hurting performance. Running the following test, from the device mapper test suite [1], dmtest run --suite snapshot -n parallel_io_to_many_snaps_N , with 8 active snapshots, we get, in dmesg, messages like the following: [68899.948523] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 95s! [68899.949282] Showing busy workqueues and worker pools: [68899.949288] workqueue events: flags=0x0 [68899.949295] pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=2/256 [68899.949306] pending: vmstat_shepherd, cache_reap [68899.949331] workqueue mm_percpu_wq: flags=0x8 [68899.949337] pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 [68899.949345] pending: vmstat_update [68899.949387] workqueue dm_bufio_cache: flags=0x8 [68899.949392] pwq 4: cpus=2 node=0 flags=0x0 nice=0 active=1/256 [68899.949400] pending: work_fn [dm_bufio] [68899.949423] workqueue kcopyd: flags=0x8 [68899.949429] pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 [68899.949437] pending: do_work [dm_mod] [68899.949452] workqueue kcopyd: flags=0x8 [68899.949458] pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=2/256 [68899.949466] in-flight: 13:do_work [dm_mod] [68899.949474] pending: do_work [dm_mod] [68899.949487] workqueue kcopyd: flags=0x8 [68899.949493] pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 [68899.949501] pending: do_work [dm_mod] [68899.949515] workqueue kcopyd: flags=0x8 [68899.949521] pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 [68899.949529] pending: do_work [dm_mod] [68899.949541] workqueue kcopyd: flags=0x8 [68899.949547] pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=1/256 [68899.949555] pending: do_work [dm_mod] [68899.949568] pool 0: cpus=0 node=0 flags=0x0 nice=0 hung=95s workers=4 idle: 27130 27223 1084 Fix this by splitting the complete_jobs list into two parts: A user facing part, named callback_jobs, and one used internally by kcopyd, retaining the name complete_jobs. dm_kcopyd_do_callback() and dispatch_job() now push their jobs to the callback_jobs list, which is spliced to the complete_jobs list once, every time the kcopyd thread wakes up. This prevents kcopyd from hogging the CPU indefinitely and causing workqueue stalls. Re-running the aforementioned test: * Workqueue stalls are eliminated * The maximum writing time among all targets is reduced from 09m37.10s to 06m04.85s and the total run time of the test is reduced from 10m43.591s to 7m19.199s [1] https://github.com/jthornber/device-mapper-test-suite Signed-off-by: Nikos Tsironis Signed-off-by: Ilias Tsitsimpis Signed-off-by: Mike Snitzer commit 721b1d98fb517ae99ab3b757021cf81db41e67be Author: Nikos Tsironis Date: Wed Oct 31 17:53:08 2018 -0400 dm snapshot: Fix excessive memory usage and workqueue stalls kcopyd has no upper limit to the number of jobs one can allocate and issue. Under certain workloads this can lead to excessive memory usage and workqueue stalls. For example, when creating multiple dm-snapshot targets with a 4K chunk size and then writing to the origin through the page cache. Syncing the page cache causes a large number of BIOs to be issued to the dm-snapshot origin target, which itself issues an even larger (because of the BIO splitting taking place) number of kcopyd jobs. Running the following test, from the device mapper test suite [1], dmtest run --suite snapshot -n many_snapshots_of_same_volume_N , with 8 active snapshots, results in the kcopyd job slab cache growing to 10G. Depending on the available system RAM this can lead to the OOM killer killing user processes: [463.492878] kthreadd invoked oom-killer: gfp_mask=0x6040c0(GFP_KERNEL|__GFP_COMP), nodemask=(null), order=1, oom_score_adj=0 [463.492894] kthreadd cpuset=/ mems_allowed=0 [463.492948] CPU: 7 PID: 2 Comm: kthreadd Not tainted 4.19.0-rc7 #3 [463.492950] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014 [463.492952] Call Trace: [463.492964] dump_stack+0x7d/0xbb [463.492973] dump_header+0x6b/0x2fc [463.492987] ? lockdep_hardirqs_on+0xee/0x190 [463.493012] oom_kill_process+0x302/0x370 [463.493021] out_of_memory+0x113/0x560 [463.493030] __alloc_pages_slowpath+0xf40/0x1020 [463.493055] __alloc_pages_nodemask+0x348/0x3c0 [463.493067] cache_grow_begin+0x81/0x8b0 [463.493072] ? cache_grow_begin+0x874/0x8b0 [463.493078] fallback_alloc+0x1e4/0x280 [463.493092] kmem_cache_alloc_node+0xd6/0x370 [463.493098] ? copy_process.part.31+0x1c5/0x20d0 [463.493105] copy_process.part.31+0x1c5/0x20d0 [463.493115] ? __lock_acquire+0x3cc/0x1550 [463.493121] ? __switch_to_asm+0x34/0x70 [463.493129] ? kthread_create_worker_on_cpu+0x70/0x70 [463.493135] ? finish_task_switch+0x90/0x280 [463.493165] _do_fork+0xe0/0x6d0 [463.493191] ? kthreadd+0x19f/0x220 [463.493233] kernel_thread+0x25/0x30 [463.493235] kthreadd+0x1bf/0x220 [463.493242] ? kthread_create_on_cpu+0x90/0x90 [463.493248] ret_from_fork+0x3a/0x50 [463.493279] Mem-Info: [463.493285] active_anon:20631 inactive_anon:4831 isolated_anon:0 [463.493285] active_file:80216 inactive_file:80107 isolated_file:435 [463.493285] unevictable:0 dirty:51266 writeback:109372 unstable:0 [463.493285] slab_reclaimable:31191 slab_unreclaimable:3483521 [463.493285] mapped:526 shmem:4903 pagetables:1759 bounce:0 [463.493285] free:33623 free_pcp:2392 free_cma:0 ... [463.493489] Unreclaimable slab info: [463.493513] Name Used Total [463.493522] bio-6 1028KB 1028KB [463.493525] bio-5 1028KB 1028KB [463.493528] dm_snap_pending_exception 236783KB 243789KB [463.493531] dm_exception 41KB 42KB [463.493534] bio-4 1216KB 1216KB [463.493537] bio-3 439396KB 439396KB [463.493539] kcopyd_job 6973427KB 6973427KB ... [463.494340] Out of memory: Kill process 1298 (ruby2.3) score 1 or sacrifice child [463.494673] Killed process 1298 (ruby2.3) total-vm:435740kB, anon-rss:20180kB, file-rss:4kB, shmem-rss:0kB [463.506437] oom_reaper: reaped process 1298 (ruby2.3), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB Moreover, issuing a large number of kcopyd jobs results in kcopyd hogging the CPU, while processing them. As a result, processing of work items, queued for execution on the same CPU as the currently running kcopyd thread, is stalled for long periods of time, hurting performance. Running the aforementioned test we get, in dmesg, messages like the following: [67501.194592] BUG: workqueue lockup - pool cpus=4 node=0 flags=0x0 nice=0 stuck for 27s! [67501.195586] Showing busy workqueues and worker pools: [67501.195591] workqueue events: flags=0x0 [67501.195597] pwq 8: cpus=4 node=0 flags=0x0 nice=0 active=1/256 [67501.195611] pending: cache_reap [67501.195641] workqueue mm_percpu_wq: flags=0x8 [67501.195645] pwq 8: cpus=4 node=0 flags=0x0 nice=0 active=1/256 [67501.195656] pending: vmstat_update [67501.195682] workqueue kblockd: flags=0x18 [67501.195687] pwq 5: cpus=2 node=0 flags=0x0 nice=-20 active=1/256 [67501.195698] pending: blk_timeout_work [67501.195753] workqueue kcopyd: flags=0x8 [67501.195757] pwq 8: cpus=4 node=0 flags=0x0 nice=0 active=1/256 [67501.195768] pending: do_work [dm_mod] [67501.195802] workqueue kcopyd: flags=0x8 [67501.195806] pwq 8: cpus=4 node=0 flags=0x0 nice=0 active=1/256 [67501.195817] pending: do_work [dm_mod] [67501.195834] workqueue kcopyd: flags=0x8 [67501.195838] pwq 8: cpus=4 node=0 flags=0x0 nice=0 active=1/256 [67501.195848] pending: do_work [dm_mod] [67501.195881] workqueue kcopyd: flags=0x8 [67501.195885] pwq 8: cpus=4 node=0 flags=0x0 nice=0 active=1/256 [67501.195896] pending: do_work [dm_mod] [67501.195920] workqueue kcopyd: flags=0x8 [67501.195924] pwq 8: cpus=4 node=0 flags=0x0 nice=0 active=2/256 [67501.195935] in-flight: 67:do_work [dm_mod] [67501.195945] pending: do_work [dm_mod] [67501.195961] pool 8: cpus=4 node=0 flags=0x0 nice=0 hung=27s workers=3 idle: 129 23765 The root cause for these issues is the way dm-snapshot uses kcopyd. In particular, the lack of an explicit or implicit limit to the maximum number of in-flight COW jobs. The merging path is not affected because it implicitly limits the in-flight kcopyd jobs to one. Fix these issues by using a semaphore to limit the maximum number of in-flight kcopyd jobs. We grab the semaphore before allocating a new kcopyd job in start_copy() and start_full_bio() and release it after the job finishes in copy_callback(). The initial semaphore value is configurable through a module parameter, to allow fine tuning the maximum number of in-flight COW jobs. Setting this parameter to zero initializes the semaphore to INT_MAX. A default value of 2048 maximum in-flight kcopyd jobs was chosen. This value was decided experimentally as a trade-off between memory consumption, stalling the kernel's workqueues and maintaining a high enough throughput. Re-running the aforementioned test: * Workqueue stalls are eliminated * kcopyd's job slab cache uses a maximum of 130MB * The time taken by the test to write to the snapshot-origin target is reduced from 05m20.48s to 03m26.38s [1] https://github.com/jthornber/device-mapper-test-suite Signed-off-by: Nikos Tsironis Signed-off-by: Ilias Tsitsimpis Signed-off-by: Mike Snitzer commit ef9923739e6d2233dc16aba70b7d81767d85cfcb Author: Shenghui Wang Date: Tue Oct 30 15:35:54 2018 +0800 dm bufio: update comment in dm-bufio.c * Hashtable has been replaced by rbtree to manage buffers. Update the comment. * Fix typo in the comment for dm_bufio_issue_flush Signed-off-by: Shenghui Wang Signed-off-by: Mike Snitzer commit e8ea141a0f5e1d7b23f47d10c480d4fc55caaf14 Author: Shenghui Wang Date: Wed Oct 24 16:04:36 2018 +0800 dm writecache: fix typo in error msg for creating writecache_flush_thread The error msg should be "flush thread" instead of "endio thread" for writecache_flush_thread. Signed-off-by: Shenghui Wang Signed-off-by: Mike Snitzer commit 53b471687012c80a8c03250cecf7121ffa8781f8 Author: Mike Snitzer Date: Mon Dec 3 17:00:54 2018 -0500 dm: remove indirect calls from __send_changing_extent_only() No need to be so fancy. Signed-off-by: Mike Snitzer commit 935fcc56abc321ca828f2d1fbb732fd478fd3449 Author: wuzhouhui Date: Thu Mar 22 22:22:38 2018 +0800 dm mpath: only flush workqueue when needed The workqueues are shared by many multipath devices, only flush whole workqueue when necessary. Otherwise, we just flush works as needed. Signed-off-by: wuzhouhui Signed-off-by: Mike Snitzer commit 2adc5c559a0770ef75d1647fbf557c7f56194ef8 Author: Mike Snitzer Date: Thu Nov 8 14:59:41 2018 -0500 dm rq: remove unused arguments from rq_completed() Signed-off-by: Mike Snitzer commit 24113d4878439baf1f23c1a33dfcc340fba66e97 Author: Mikulas Patocka Date: Tue Nov 6 22:34:59 2018 +0100 dm: avoid indirect call in __dm_make_request Indirect calls are inefficient because of retpolines that are used for spectre workaround. This patch replaces an indirect call with a condition (that can be predicted by the branch predictor). Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer commit ed49e839199e73966b9ff5946c3e87759827b40e Merge: 40906ebe3af6a a7a850dba8249 Author: Takashi Iwai Date: Tue Dec 18 14:59:56 2018 +0100 Merge tag 'asoc-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v4.21 Not much work on the core this time around but we've seen quite a bit of driver work, including on the generic DT drivers. There's also a large part of the diff from a merge of the DaVinci and OMAP directories, along with some active development there: - Preparatory work from Morimoto-san for merging the audio-graph and audio-graph-scu cards. - A merge of the TI OMAP and DaVinci directories, the OMAP product line has been merged into the DaVinci product line so there is now a lot of IP sharing which meant that the split directories just got in the way. This has pulled in a few architecture changes as well. - A big cleanup of the Maxim MAX9867 driver from Ladislav Michl. - Support for Asahi Kaesi AKM4118, AMD ACP3x, Intel platforms with RT5660, Meson AXG S/PDIF inputs, several Qualcomm IPs and Xilinx I2S controllers. commit 46b14eef59a8157138dc02f916a7f97c73b3ec53 Author: Peter Hutterer Date: Thu Dec 13 11:28:51 2018 +1000 HID: doc: fix wrong data structure reference for UHID_OUTPUT Signed-off-by: Peter Hutterer Signed-off-by: Jiri Kosina commit 41c5c5b0e7c8a0fd03722f2b061e1d492e359d45 Author: Honghui Zhang Date: Fri Dec 14 09:25:42 2018 +0800 arm64: dts: mt7622: Remove un-used property for PCIe The "num-lanes" property for PCIe is not used, remove it. Signed-off-by: Honghui Zhang Signed-off-by: Lorenzo Pieralisi commit ebcd631df106561aa3906801053775e5f15a8e34 Author: Honghui Zhang Date: Fri Dec 14 09:25:41 2018 +0800 arm: dts: mt7623: Remove un-used property for PCIe The "num-lanes" property for PCIe is not used, remove it. Signed-off-by: Honghui Zhang Signed-off-by: Lorenzo Pieralisi commit f2bb7d6a82da32bfd59c65540758fd2a01cccf74 Author: Honghui Zhang Date: Fri Dec 14 09:25:40 2018 +0800 dt-bindings: PCI: MediaTek: Remove un-used property The "num-lanes" property is not used, remove it. Signed-off-by: Honghui Zhang Signed-off-by: Lorenzo Pieralisi commit 7b96dc91be5e86f94e950ffd947874839a8aee9d Author: Honghui Zhang Date: Fri Dec 14 09:25:39 2018 +0800 PCI: mediatek: Remove un-used variant in struct mtk_pcie_port The "lane" variant in struct mtk_pcie_port is not used, remove it. Signed-off-by: Honghui Zhang Signed-off-by: Lorenzo Pieralisi commit a137401d85129953a1713d443216eb6b1074c12e Merge: 0d7410ea6efcd 33221307c3f99 Author: Daniel Borkmann Date: Tue Dec 18 14:47:18 2018 +0100 Merge branch 'bpf-bpftool-mount-tracefs' Quentin Monnet says: ==================== This series focus on mounting (or not mounting) tracefs with bpftool. First patch makes bpftool attempt to mount tracefs if tracefs is not found when running "bpftool prog tracelog". Second patch adds an option to bpftool to prevent it from attempting to mount any file system (tracefs or bpffs), in case this behaviour is undesirable for some users. ==================== Signed-off-by: Daniel Borkmann commit 33221307c3f993500a9cfc6900811058c6bfc152 Author: Quentin Monnet Date: Tue Dec 18 10:13:19 2018 +0000 tools: bpftool: add an option to prevent auto-mount of bpffs, tracefs In order to make life easier for users, bpftool automatically attempts to mount the BPF virtual file system, if it is not mounted already, before trying to pin objects in it. Similarly, it attempts to mount tracefs if necessary before trying to dump the trace pipe to the console. While mounting file systems on-the-fly can improve user experience, some administrators might prefer to avoid that. Let's add an option to block these mount attempts. Note that it does not prevent automatic mounting of tracefs by debugfs for the "bpftool prog tracelog" command. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit be3245e22d227ad68ab97785d506561374daa028 Author: Quentin Monnet Date: Tue Dec 18 10:13:18 2018 +0000 tools: bpftool: attempt to mount tracefs if required for tracelog cmd As a follow-up to commit 30da46b5dc3a ("tools: bpftool: add a command to dump the trace pipe"), attempt to mount the tracefs virtual file system if it is not detected on the system before trying to dump content of the tracing pipe on an invocation of "bpftool prog tracelog". Usually, tracefs in automatically mounted by debugfs when the user tries to access it (e.g. "ls /sys/kernel/debug/tracing" mounts the tracefs). So if we failed to find it, it is probably that debugfs is not here either. Therefore, we just attempt a single mount, at a location that does not involve debugfs: /sys/kernel/tracing. Suggested-by: Daniel Borkmann Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 0d7410ea6efcdfda56773999f692bbd5d4e4bc00 Author: Yonghong Song Date: Mon Dec 17 17:31:57 2018 -0800 tools/bpf: check precise {func, line, jited_line}_info_rec_size in test_btf Current btf func_info, line_info and jited_line are designed to be extensible. The record sizes for {func,line}_info are passed to kernel, and the record sizes for {func,line,jited_line}_info are returned to userspace during bpf_prog_info query. In bpf selftests test_btf.c, when testing whether kernel returns a legitimate {func,line, jited_line)_info rec_size, the test only compares to the minimum allowed size. If the returned rec_size is smaller than the minimum allowed size, it is considered incorrect. The minimum allowed size for these three info sizes are equal to current value of sizeof(struct bpf_func_info), sizeof(struct bpf_line_info) and sizeof(__u64). The original thinking was that in the future when rec_size is increased in kernel, the same test should run correctly. But this sacrificed the precision of testing under the very kernel the test is shipped with, and bpf selftest is typically run with the same repo kernel. So this patch changed the testing of rec_size such that the kernel returned value should be equal to the size defined by tools uapi header bpf.h which syncs with kernel uapi header. Martin discovered a bug in one of rec_size comparisons. Instead of comparing to minimum func_info rec_size 8, it compares to 4. This patch fixed that issue as well. Fixes: 999d82cbc044 ("tools/bpf: enhance test_btf file testing to test func info") Fixes: 05687352c600 ("bpf: Refactor and bug fix in test_func_type in test_btf.c") Fixes: 4d6304c76355 ("bpf: Add unit tests for bpf_line_info") Suggested-by: Martin KaFai Lau Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit ca46afdb2754dbb4a5d5772332fa16957d9bc618 Merge: 8162b3d1a728c 028713aa8389d Author: Ingo Molnar Date: Tue Dec 18 14:39:00 2018 +0100 Merge tag 'perf-core-for-mingo-4.21-20181217' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: - Introduce 'perf record --aio' to use asynchronous IO trace writing, disabled by default (Alexey Budankov) - Add fallback routines to be used in places where we don't have the CPU mode (kernel/userspace/hypervisor) and thus must first fallback lookups looking at all map trees when trying to resolve symbols (Adrian Hunter) - Fix error with config term "pt=0", where we should just force "pt=1" and warn the user about the former being nonsensical (Adrian Hunter) - Fix 'perf test' entry where we expect 'sleep' to come in a PERF_RECORD_COMM but instead we get 'coreutils' when sleep is provided by some versions of the 'coreutils' package (Adrian Hunter) - Introduce 'perf top --kallsyms file' to match 'perf report --kallsyms', useful when dealing with BPF, where symbol resolution happens via kallsyms, not via the default vmlinux ELF symtabs (Arnaldo Carvalho de Melo) - Support 'srccode' output field in 'perf script' (Andi Kleen) - Introduce basic 'perf annotation' support for the ARC architecture (Eugeniy Paltsev) - Compute and display average IPC and IPC coverage per symbol in 'perf annotate' and 'perf report' (Jin Yao) - Make 'perf top' use ordered_events and process histograms in a separate thread (Jiri Olsa) - Make 'perf trace' use ordered_events (Jiri Olsa) - Add support for ETMv3 and PTMv1.1 decoding in cs-etm (Mathieu Poirier) - Support for ARM A32/T32 instruction sets in CoreSight trace (cs-etm) (Robert Walker) - Fix 'perf stat' shadow stats for clock events. (Ravi Bangoria) - Remove needless rb_tree extra indirection from map__find() (Eric Saint-Etienne) - Fix CSV mode column output for non-cgroup events in 'perf stat' (Stephane Eranian) - Add sanity check to libtraceevent's is_timestamp_in_us() (Tzvetomir Stoyanov) - Use ERR_CAST instead of ERR_PTR(PTR_ERR()) (Wen Yang) - Fix Load_Miss_Real_Latency on SKL/SKX intel vendor event files (Andi Kleen) - strncpy() fixes triggered by new warnings on gcc 8.2.0 (Arnaldo Carvalho de Melo) - Handle tracefs syscall tracepoint older 'nr' field in 'perf trace', that got renamed to '__syscall_nr' to work in older kernels (Arnaldo Carvalho de Melo) - Give better hint about devel package for libssl (Arnaldo Carvalho de Melo) - Fix the 'perf trace' build in architectures lacking explicit mmap.h file (Arnaldo Carvalho de Melo) - Remove extra rb_tree traversal indirection from map__find() (Eric Saint-Etienne) - Disable breakpoint tests for 32-bit ARM (Florian Fainelli) - Fix typos all over the place, mostly in comments, but also in some debug messages and JSON files (Ingo Molnar) - Allow specifying proc-map-timeout in config file (Mark Drayton) - Fix mmap_flags table generation script (Sihyeon Jang) - Fix 'size' parameter to snprintf in the 'perf config' code (Sihyeon Jang) - More libtraceevent renames to make it a proper library (Tzvetomir Stoyanov) - Implement new API tep_get_ref() in libtraceevent (Tzvetomir Stoyanov) - Added support for pkg-config in libtraceevent (Tzvetomir Stoyanov) Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ingo Molnar commit 221b35fedee1b38b9cee99320f0c60263d229e14 Merge: 272c1a9b49398 801c7a1e52862 Author: Daniel Vetter Date: Tue Dec 18 14:24:52 2018 +0100 Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm-next Lucas writes: "nothing major this time, mostly some cleanups that were found on the way of reworking the code in preparation for new feature additions." Small conflict in drivers/gpu/drm/etnaviv/etnaviv_drv.c because drm-misc-next also has a patch to switch over to _put() functions. Signed-off-by: Daniel Vetter From: Lucas Stach Link: https://patchwork.freedesktop.org/patch/msgid/1545130845.5874.23.camel@pengutronix.de commit c5f48c0a7aa1a8c82d81cdf27e63aa0a5544c6e6 Author: Ingo Molnar Date: Mon Dec 3 11:44:51 2018 +0100 genirq: Fix various typos in comments Go over the IRQ subsystem source code (including irqchip drivers) and fix common typos in comments. No change in functionality intended. Signed-off-by: Ingo Molnar Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Zyngier Cc: Peter Zijlstra Cc: Linus Torvalds Cc: linux-kernel@vger.kernel.org commit dc7eb0f2c23f58bc0e15574bda2dc8498d30a833 Author: Shaul Triebitz Date: Sat Dec 15 11:03:20 2018 +0200 mac80211: do not advertise HE cap IE if HE disabled When disabling HE due to the lack of HT/VHT, do it at an earlier stage to avoid advertising HE capabilities IE. Also, at this point, no need to check if AP supports HE, since it is already checked earlier (in ieee80211_prep_channel). Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 002245ec20b273bc1e31ed8fbee01396955a0f19 Author: Shaul Triebitz Date: Sat Dec 15 11:03:19 2018 +0200 mac80211: set STA flag DISABLE_HE if HE is not supported Up until now, the IEEE80211_STA_DISABLE_HE flag was set only based on whether the AP has advertised HE capabilities. This flag should be set also if STA does not support HE (regardless of the AP support). Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 2e249fc320862e3f75fd255a21554d6de90fb55a Author: Shaul Triebitz Date: Sat Dec 15 11:03:15 2018 +0200 mac80211: update driver when MU EDCA params change Similar to WMM IE, if MU_EDCA IE parameters changed (or ceased to exist) tell the Driver about it. Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit daa5b83513a7a85491ffa03e7aabd9d7348e97d5 Author: Shaul Triebitz Date: Sat Dec 15 11:03:05 2018 +0200 mac80211: update HE operation fields to D3.0 HE Operation element has changed in 11ax D3.0. Update the fields accordingly. Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 55ebd6e6c765cce4697a6fbb97acf6eec9ad7a51 Author: Emmanuel Grumbach Date: Sat Dec 15 11:03:04 2018 +0200 mac80211: propagate the support for TWT to the driver TWT is a feature that was added in 11ah and enhanced in 11ax. There are two bits that need to be set if we want to use the feature in 11ax: one in the HE Capability IE and one in the Extended Capability IE. This is because of backward compatibility between 11ah and 11ax. In order to simplify the flow for the low level driver in managed mode, aggregate the two bits and add a boolean that tells whether TWT is supported or not, but only if 11ax is supported. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit fdb313e3182094939b34234bdade0fbce28dfb2c Author: Emmanuel Grumbach Date: Sat Dec 15 11:03:03 2018 +0200 ieee80211: add bits for TWT in Extended Capabilities IE These bits are defined in ieee802.11ax to advertise support for TWT in addition to the bits in the HE IE. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 20c3a2c33e9fdc82e9e8e8d2a6445b3256d20191 Author: Thomas Lendacky Date: Thu Dec 13 23:03:54 2018 +0000 x86/speculation: Add support for STIBP always-on preferred mode Different AMD processors may have different implementations of STIBP. When STIBP is conditionally enabled, some implementations would benefit from having STIBP always on instead of toggling the STIBP bit through MSR writes. This preference is advertised through a CPUID feature bit. When conditional STIBP support is requested at boot and the CPU advertises STIBP always-on mode as preferred, switch to STIBP "on" support. To show that this transition has occurred, create a new spectre_v2_user_mitigation value and a new spectre_v2_user_strings message. The new mitigation value is used in spectre_v2_user_select_mitigation() to print the new mitigation message as well as to return a new string from stibp_state(). Signed-off-by: Tom Lendacky Signed-off-by: Thomas Gleixner Cc: Andrea Arcangeli Cc: Konrad Rzeszutek Wilk Cc: Jiri Kosina Cc: Borislav Petkov Cc: Tim Chen Cc: David Woodhouse Link: https://lkml.kernel.org/r/20181213230352.6937.74943.stgit@tlendack-t1.amdoffice.net commit 30c63115e20b70f89b7cfb66b35e2a0ef4b0ef07 Author: Sriram R Date: Tue Dec 4 17:46:52 2018 +0530 nl80211: Add support to notify radar event info received from STA Currently radar detection and corresponding channel switch is handled at the AP device. STA ignores these detected radar events since the radar signal can be seen mostly by the AP as well. But in scenarios where a radar signal is seen only at STA, notifying this event to the AP which can trigger a channel switch can be useful. Stations can report such radar events autonomously through Spectrum management (Measurement Report) action frame to its AP. The userspace on processing the report can notify the kernel with the use of the added NL80211_CMD_NOTIFY_RADAR to indicate the detected event and inturn adding the reported channel to NOL. Signed-off-by: Sriram R Signed-off-by: Johannes Berg commit 8ca66b7ccf3c9aeb3b6796967bf48f776bfd5523 Author: Lucas Stach Date: Fri Dec 14 13:15:28 2018 +0100 irqchip/irq-imx-gpcv2: Add IRQCHIP_DECLARE for i.MX8MQ compatible The GPC node on i.MX8MQ can not claim to be compatible with the i.MX7D GPC, as the power gating part has some significant differences. Thus we can not rely on the irqchip being probed with the old compatible. Signed-off-by: Lucas Stach Signed-off-by: Marc Zyngier commit 1fb51c975a80eab6b36fec203a178852fbb37665 Author: Wei Yongjun Date: Mon Dec 17 11:58:18 2018 +0000 irqchip/irq-rda-intc: Fix return value check in rda8810_intc_init() In case of error, the function of_io_request_and_map() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: d852e62ad689 ("irqchip: Add RDA8810PL interrupt driver") Acked-by: Manivannan Sadhasivam Signed-off-by: Wei Yongjun Signed-off-by: Marc Zyngier commit aa02ef099cff042c2a9109782ec2bf1bffc955d4 Author: Hui Wang Date: Wed Nov 7 10:36:43 2018 +0800 x86/topology: Use total_cpus for max logical packages calculation nr_cpu_ids can be limited on the command line via nr_cpus=. This can break the logical package management because it results in a smaller number of packages while in kdump kernel. Check below case: There is a two sockets system, each socket has 8 cores, which has 16 logical cpus while HT was turn on. 0 1 2 3 4 5 6 7 | 16 17 18 19 20 21 22 23 cores on socket 0 threads on socket 0 8 9 10 11 12 13 14 15 | 24 25 26 27 28 29 30 31 cores on socket 1 threads on socket 1 While starting the kdump kernel with command line option nr_cpus=16 panic was triggered on one of the cpus 24-31 eg. 26, then online cpu will be 1-15, 26(cpu 0 was disabled in kdump), ncpus will be 16 and __max_logical_packages will be 1, but actually two packages were booted on. This issue can reproduced by set kdump option nr_cpus=, and then trigger panic on last socket's thread, for example: taskset -c 26 echo c > /proc/sysrq-trigger Use total_cpus which will not be limited by nr_cpus command line to calculate the value of __max_logical_packages. Signed-off-by: Hui Wang Signed-off-by: Thomas Gleixner Cc: Cc: Cc: Cc: Link: https://lkml.kernel.org/r/20181107023643.22174-1-john.wanghui@huawei.com commit a7a850dba82498a1e050d8d153cae67ce0edb3b2 Merge: c5fd9e77be443 0f4967bc21de0 Author: Mark Brown Date: Tue Dec 18 12:23:59 2018 +0000 Merge branch 'asoc-4.21' into asoc-next commit c5fd9e77be44360b4827069c59f524815517917b Merge: 7566ec393f416 a01b8d1d24451 Author: Mark Brown Date: Tue Dec 18 12:23:57 2018 +0000 Merge branch 'asoc-4.20' into asoc-linus commit 0f4967bc21de0bb9e107f9ad3ced852daf66acd2 Author: Peter Ujfalusi Date: Mon Dec 17 14:21:42 2018 +0200 ASoC: ti: Kconfig: Remove the deprecated options We no longer have these options used anywhere. Signed-off-by: Peter Ujfalusi Acked-by: Tony Lindgren Signed-off-by: Mark Brown commit 41e95652ee225f121d38916d8d6849e3c15a924a Author: Peter Ujfalusi Date: Mon Dec 17 14:21:41 2018 +0200 ARM: davinci_all_defconfig: Update the audio options Use the new options for default audio support. Signed-off-by: Peter Ujfalusi Acked-by: Tony Lindgren Signed-off-by: Mark Brown commit eab5b50a13de4717cad5eda3d26d889f2f4ea37d Author: Peter Ujfalusi Date: Mon Dec 17 14:21:40 2018 +0200 ARM: omap1_defconfig: Do not select ASoC by default No audio support is enabled by default via ASoC, disable the code as well. Signed-off-by: Peter Ujfalusi Acked-by: Tony Lindgren Signed-off-by: Mark Brown commit 3162b05fb74cd107b2a66f20485c62514b20048f Author: Peter Ujfalusi Date: Mon Dec 17 14:21:39 2018 +0200 ARM: omap2plus_defconfig: Update the audio options Use the new options for default audio support and enable Nokia n900 audio as well. Signed-off-by: Peter Ujfalusi Acked-by: Tony Lindgren Signed-off-by: Mark Brown commit 4d8c1e7efb9f915034c3dba2bc85ed1f8509ae0c Author: Peter Ujfalusi Date: Mon Dec 17 14:21:38 2018 +0200 ARM: davinci: dm365-evm: Update for the new ASoC Kcofnig options The codec selection config options for DMA365 has been changed. Signed-off-by: Peter Ujfalusi Acked-by: Tony Lindgren Signed-off-by: Mark Brown commit 558eb0bfb271323cfd9f864f34d3253a65f352dd Author: Peter Ujfalusi Date: Mon Dec 17 14:21:37 2018 +0200 ARM: OMAP2: Update for new MCBSP Kconfig option The MCBSP config option has been changed. Signed-off-by: Peter Ujfalusi Acked-by: Tony Lindgren Signed-off-by: Mark Brown commit c27ace2e95a29c3b359123363d4f88864452917d Author: Peter Ujfalusi Date: Mon Dec 17 14:21:36 2018 +0200 ARM: OMAP1: Makefile: Update for new MCBSP Kconfig option The MCBSP config option has been changed. Signed-off-by: Peter Ujfalusi Acked-by: Tony Lindgren Signed-off-by: Mark Brown commit ca1c4d6535249ad43068834687f78d0db82d9e2e Author: Peter Ujfalusi Date: Mon Dec 17 14:21:35 2018 +0200 MAINTAINERS: Add entry for sound/soc/ti and update the OMAP audio support The sound/soc/davinci and omap directories are merged under sound/soc/ti. Add myself as maintainer and update the OMAP audio support section with the new path and file names. Signed-off-by: Peter Ujfalusi Acked-by: Tony Lindgren Signed-off-by: Mark Brown commit f2055e145f2975a75dace8e386fad9364828cdb4 Author: Peter Ujfalusi Date: Mon Dec 17 14:21:34 2018 +0200 ASoC: ti: Merge davinci and omap directories Create new directory to contain all Texas Instruments specific DAI, platform and machine drivers instead of scattering them under davinci and omap directories. There is already inter dependency between the two directories becasue of McASP (on dra7x it is serviced by sDMA, not EDMA). With the upcoming AM654 we will need to introduce new platform driver for UDMA and it does not fit under davinci, nor under omap. With the move I have restructured the Kconfig to be more usable in the era of simple-sound-card: CPU DAIs can be selected individually and they will select the platform driver they can be served with. To avoid breakage, I have moved over deprecated Kconfig options so defconfig builds will work without regression. Signed-off-by: Peter Ujfalusi For sound/soc/{omap => ti}: Tested-by: Jarkko Nikula Acked-by: Jarkko Nikula Acked-by: Tony Lindgren Signed-off-by: Mark Brown commit 344f8e00933da8c275fa293caadfc62680d46d21 Author: Sara Sharon Date: Sat Dec 15 11:03:07 2018 +0200 mac80211: don't build AMSDU from GSO packets If we build AMSDU from GSO packets, it can lead to bad results if anyone tries to call skb_gso_segment on the packets. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit fca1279f090b8e38eadb95c3914d51e544142e74 Author: Johannes Berg Date: Sat Dec 15 11:03:08 2018 +0200 mac80211: document RCU requirements for ieee80211_tx_dequeue() In the iwlwifi conversion, we sometimes call this from outside of the wake_tx_queue() method, and in those cases must be in an RCU critical section. Document this requirement. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 233e98dc9c3009943aa34d58925d94ac9330e17b Author: Johannes Berg Date: Sat Dec 15 11:03:09 2018 +0200 mac80211: remove superfluous NULL check At the place where this code lives now, the skb can never be NULL, so we can remove the pointless NULL check. It seems to exist because this code was moved around a few times and originally came from a place where it could in fact be NULL. Signed-off-by: Johannes Berg commit dd665d23c1e94ad81d8720e90666030c5714a158 Author: Johannes Berg Date: Sat Dec 15 11:03:11 2018 +0200 mac80211: never pass NULL params to ieee80211_if_add() This isn't really a problem now, but it means that the function has a few NULL checks that are only relevant when coming from the initial interface added in mac80211, and that's confusing. Just pass non-NULL (but equivalently empty) in that case and remove all the NULL checks. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 8020919a9b99d6c990dc6a50e8215e291fbbe5a6 Author: Ilan Peer Date: Sat Dec 15 11:03:17 2018 +0200 mac80211: Properly handle SKB with radiotap only The monitor interface Rx handling of SKBs that contain only radiotap information was buggy as it tried to access the SKB assuming it contains a frame. To fix this, check the RX_FLAG_NO_PSDU flag in the Rx status (indicting that the SKB contains only radiotap information), and do not perform data path specific processing when the flag is set. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 925b5978cdc7287ba08ed21bf27970131f147720 Author: Luca Coelho Date: Sat Dec 15 11:03:21 2018 +0200 cfg80211: add some missing fall through annotations There are talks about enabling -Wimplicit-fallthrough warnings in the mainline and it is already enabled in linux-next. Add all the missing annotations to prevent warnings when this happens. And in one case, remove the extra text from the annotation so that the compiler recognizes it. Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg commit 30db641ef4f68054db9b191b6c0200fb1a96d458 Author: Johannes Berg Date: Sat Dec 15 11:03:23 2018 +0200 cfg80211: clarify LCI/civic location documentation The older code and current userspace assumed that this data is the content of the Measurement Report element, starting with the Measurement Token. Clarify this in the documentation. Signed-off-by: Johannes Berg commit 554be8333088e4a40f4b522c2b36ab23fb22f4be Author: Johannes Berg Date: Sat Dec 15 11:03:24 2018 +0200 mac80211: ftm responder: remove pointless defensive coding The pointer and corresponding length is always set in pairs in cfg80211, so no need to have this strange defensive check that also confuses static checkers. Clean it up. Signed-off-by: Johannes Berg commit 3453de98145fa1a9453d18a42406bb7a47bec269 Author: Randy Dunlap Date: Thu Dec 6 12:58:30 2018 -0800 wireless: FTM: fix kernel-doc "cannot understand" warnings Fix kernel-doc warnings in FTM due to missing "struct" keyword. Fixes 109 warnings from : ../include/net/cfg80211.h:2838: warning: cannot understand function prototype: 'struct cfg80211_ftm_responder_stats ' and fixes 88 warnings from : ../include/net/mac80211.h:477: warning: cannot understand function prototype: 'struct ieee80211_ftm_responder_params ' Fixes: 81e54d08d9d8 ("cfg80211: support FTM responder configuration/statistics") Fixes: bc847970f432 ("mac80211: support FTM responder configuration/statistics") Signed-off-by: Randy Dunlap Cc: Pradeep Kumar Chitrapu Cc: Johannes Berg Cc: David Spinadel Signed-off-by: Johannes Berg commit 3e8bf5234e4e23b66e49da636dc2ab165c8c91a0 Author: Linus Walleij Date: Wed Dec 12 10:19:50 2018 +0100 rfkill: gpio: Remove unused include The legacy header is no longer in use by the rfkill driver, so drop this include. Signed-off-by: Linus Walleij Signed-off-by: Johannes Berg commit 68406a9807e4db562a157df9a958b3b6e2cedb38 Author: James Prestwood Date: Tue Dec 11 16:52:14 2018 -0800 mac80211_hwsim: fix overwriting of if_combination Moved setting if_combination.num_different_channels/radar_detect_widths into an else after use_chanctx. In the case of use_chanctx, these two settings were getting overwritten. Signed-off-by: James Prestwood Signed-off-by: Johannes Berg commit 6848ac7ca39a226ede5df7af0efcc4ef0611e99c Author: Yangtao Li Date: Mon Nov 19 10:43:34 2018 -0500 x86/mm/dump_pagetables: Use DEFINE_SHOW_ATTRIBUTE() Use DEFINE_SHOW_ATTRIBUTE() instead of open coding it. Signed-off-by: Yangtao Li Signed-off-by: Thomas Gleixner Reviewed-by: Dave Hansen Cc: keescook@chromium.org Cc: luto@kernel.org Cc: peterz@infradead.org Cc: bp@alien8.de Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/20181119154334.18265-1-tiny.windzz@gmail.com commit ffeccc22d59cd585ce2b176c1e65d833e8ddc890 Author: Lorenzo Pieralisi Date: Thu Nov 29 18:23:54 2018 +0000 MAINTAINERS: Remove Jianguo Sun from HiSilicon STB DWC entry Jianguo Sun's email address reported in MAINTAINERS is not active any longer, remove it from the DWC HiSilicon STB entry. Signed-off-by: Lorenzo Pieralisi Cc: Bjorn Helgaas Cc: Shawn Guo Acked-by: Shawn Guo commit 6d6b05e3d5337f645a411cdf72f1a083e495acb8 Author: Stephen Warren Date: Fri Nov 30 11:37:19 2018 -0700 PCI: dwc: Don't hard-code DBI/ATU offset The DWC PCIe core contains various separate register spaces: DBI, DBI2, ATU, DMA, etc. The relationship between the addresses of these register spaces is entirely determined by the implementation of the IP block, not by the IP block design itself. Hence, the DWC driver must not make assumptions that one register space can be accessed at a fixed offset from any other register space. To avoid such assumptions, introduce an explicit/separate register pointer for the ATU register space. In particular, the current assumption is not valid for NVIDIA's T194 SoC. The ATU register space is only used on systems that require unrolled ATU access. This property is detected at run-time for host controllers, and when this is detected, this patch provides a default value for atu_base that matches the previous assumption re: register layout. An alternative would be to update all drivers for HW that requires unrolled access to explicitly set atu_base. However, it's hard to tell which drivers would require atu_base to be set. The unrolled property is not detected for endpoint systems, and so any endpoint driver that requires unrolled access must explicitly set the iatu_unroll_enabled flag (none do at present), and so a check is added to require the driver to also set atu_base while at it. Signed-off-by: Stephen Warren Signed-off-by: Lorenzo Pieralisi Acked-by: Gustavo Pimentel Acked-by: Vidya Sagar commit 9e56f0df3684bd752347e7c3df5e8ed1fc55d139 Author: Leonard Crestez Date: Wed Nov 7 13:57:03 2018 +0000 PCI: imx: Add imx6sx suspend/resume support Enable PCI suspend/resume support on imx6sx SOCs. This is similar to imx7d with a few differences: * The PM_Turn_Off bit is exposed through an IOMUX GPR, like all other pcie control bits on 6sx. * The pcie_inbound_axi clk needs to be turned off in suspend. On resume it is restored via resume -> deassert_core_reset -> enable_ref_clk. Most of the resume logic is shared with the initial reset after probe. Signed-off-by: Leonard Crestez Signed-off-by: Lorenzo Pieralisi Reviewed-by: Andrey Smirnov Acked-by: Lucas Stach commit 3d71746c420c1c1c27cf5c4e48f8fa0a6cfdc185 Author: Baruch Siach Date: Wed Oct 3 15:49:43 2018 +0300 PCI: armada8k: Add support for gpio controlled reset signal Add support for the gpio reset signal binding as described in the designware-pcie.txt DT binding document. Both the documented 'reset-gpio' property name and the more standard 'reset-gpios' name are supported. Signed-off-by: Baruch Siach Signed-off-by: Lorenzo Pieralisi Acked-by: Thomas Petazzoni commit a3ed1446520ef68466ba75b774152d789710ea95 Author: Trent Piepho Date: Fri Nov 16 00:08:33 2018 +0000 PCI: dwc: Adjust Kconfig to allow IMX6 PCIe host on IMX7 The IMX6 PCI-e host driver also supports the IMX7d. However, the Kconfig dependencies of the driver prevented it from being enabled unless the kernel was built with both IMX6 and IMX7 support. It works fine to build with only IMX7 support enabled therefore adjust the Kconfig entry to allow this configuration. Signed-off-by: Trent Piepho Signed-off-by: Lorenzo Pieralisi Reviewed-by: Lucas Stach Cc: Andrey Smirnov commit edfd39f0a417111365442f07c04150d2950f3a25 Author: Stefan Agner Date: Mon Nov 19 11:00:22 2018 +0100 PCI: dwc: layerscape: Constify driver data Constify driver data since they do not get changed at runtime. Signed-off-by: Stefan Agner Signed-off-by: Lorenzo Pieralisi commit 3f7cceeab895fcc17ac8db0d9a5e8ca2954b4661 Author: Leonard Crestez Date: Mon Oct 8 18:06:21 2018 +0000 PCI: imx: Add multi-pd support On some chips the PCIe and PCIE_PHY blocks are in separate power domains which can be power-gated independently. The PCI driver needs to handle this by keeping both domain active. This is intended for imx6sx where PCIe is in DISPLAY and PCIE_PHY in its own domain. Defining the DISPLAY domain requires a way for PCIe to keep it active or it will break when displays are off. The power-domains on imx6sx are meant to look like this: power-domains = <&pd_disp>, <&pd_pci>; power-domain-names = "pcie", "pcie_phy"; Signed-off-by: Leonard Crestez [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi Reviewed-by: Ulf Hansson commit 07daef8b41e0d9e7802a448f6766504e7641a234 Author: YueHaibing Date: Sun Dec 9 14:22:25 2018 +0800 ntp: Remove duplicated include Signed-off-by: YueHaibing Signed-off-by: Thomas Gleixner Cc: Cc: Link: https://lkml.kernel.org/r/20181209062225.4344-1-yuehaibing@huawei.com commit 801c7a1e528623f073c4007cb04d9a817e33b3a4 Author: Lucas Stach Date: Thu Nov 22 15:29:27 2018 +0100 drm/etnaviv: remove lastctx member from gpu struct It only written and we don't infer any useful information from it anymore. Remove it. Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner commit f9d255f4549e9798dce30408f25645710b5eed58 Author: Lucas Stach Date: Mon Oct 15 12:49:07 2018 +0200 drm/etnaviv: replace header include with forward declaration The etnaviv_gpu header only needs to know about the pointer types, so replace by a forward declaration and only include the headers where needed. Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner commit 5a23144cb507bda66b98666e46b8b677df14c2e7 Author: Lucas Stach Date: Wed Sep 12 12:55:42 2018 +0200 drm/etnaviv: remove unnecessary local irq disable The only event function that is called from IRQ context is event_free, which is already using atomic bitmap operations, so we can avoid taking the event spinlock in this function completely. As other the other functions still using the event spinlock are all called from normal process context, we can avoid disabling IRQs while holding the spinlock. Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner commit f83f97684a737f66c9a10437544c92e3436ca4e0 Author: Geert Uytterhoeven Date: Wed Dec 12 13:38:59 2018 +0100 pinctrl: sh-pfc: Make pinmux_cfg_reg.var_field_width[] variable-length pinmux_cfg_reg.var_field_width[] is actually a variable-length array, terminated by a zero, and counting at most r_width entries. Usually the number of entries is much smaller than r_width, so the ability to catch bugs at compile time through an "excess elements in array initializer" warning is fairly limited. Hence make the array variable-length, decreasing kernel size slightly. Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit ce16e8dd0db2701265e6dfdb4fbed632b6ff61c2 Author: Geert Uytterhoeven Date: Thu Dec 13 15:20:13 2018 +0100 pinctrl: sh-pfc: Print actual field width for variable-width fields The debug code in sh_pfc_write_config_reg() prints the width of the field being modified. However, registers with a variable-width field layout are identified by pinmux_cfg_reg.field_width being zero, hence zeroes are printed instead of the actual field widths. Fix this by printing the Hamming weight of the field mask instead, which is correct for both fixed-width and variable-width fields. Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 054f2400f706327f96770219c3065b5131f8f154 Author: Geert Uytterhoeven Date: Thu Dec 13 14:41:11 2018 +0100 pinctrl: sh-pfc: sh7734: Fix shifted values in IPSR10 Some values in the Peripheral Function Select Register 10 descriptor are shifted by one position, which may cause a peripheral function to be programmed incorrectly. Fixing this makes all HSCIF0 pins use Function 4 (value 3), like was already the case for the HSCK0 pin in field IP10[5:3]. Fixes: ac1ebc2190f575fc ("sh-pfc: Add sh7734 pinmux support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 4d374bacd7c9665179f9752a52d5d602c45d8190 Author: Geert Uytterhoeven Date: Thu Dec 13 14:32:34 2018 +0100 pinctrl: sh-pfc: sh7734: Remove bogus IPSR10 value The IP10[5:3] field in Peripheral Function Select Register 10 has a width of 3 bits, i.e. it allows programming one out of 8 different configurations. However, 9 values are provided instead of 8, overflowing into the subsequent field in the register, and thus breaking the configuration of the latter. Fix this by dropping a bogus zero value. Fixes: ac1ebc2190f575fc ("sh-pfc: Add sh7734 pinmux support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 9540cbdfcd861caf67a6f0e4bb7f46d41c4aad86 Author: Geert Uytterhoeven Date: Thu Dec 13 14:27:56 2018 +0100 pinctrl: sh-pfc: sh7269: Add missing PCIOR0 field The Port C I/O Register 0 contains 7 reserved bits, but the descriptor contains only dummy configuration values for 6 reserved bits, thus breaking the configuration of all subsequent fields in the register. Fix this by adding the two missing configuration values. Fixes: f5e811f2a43117b2 ("sh-pfc: Add sh7269 pinmux support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 1b99d0c80bbe1810572c2cb77b90f67886adfa8d Author: Geert Uytterhoeven Date: Thu Dec 13 14:09:56 2018 +0100 pinctrl: sh-pfc: sh7264: Fix PFCR3 and PFCR0 register configuration The Port F Control Register 3 (PFCR3) contains only a single field. However, counting from left to right, it is the fourth field, not the first field. Insert the missing dummy configuration values (3 fields of 16 values) to fix this. The descriptor for the Port F Control Register 0 (PFCR0) lacks the description for the 4th field (PF0 Mode, PF0MD[2:0]). Add the missing configuration values to fix this. Fixes: a8d42fc4217b1ea1 ("sh-pfc: Add sh7264 pinmux support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit e28dc3f09c9d2555a9bd982f0847988591052226 Author: Geert Uytterhoeven Date: Thu Dec 13 13:59:42 2018 +0100 pinctrl: sh-pfc: r8a77995: Remove bogus SEL_PWM[0-3]_3 configurations While the SEL_PWM[0-3] fields in the Module Select Register 0 support 4 possible configurations per PWM pin, only the first 3 are valid. Replace the invalid and unused configurations for SEL_PWM[0-3]_3 by dummies. Fixes: 794a6711764658a1 ("pinctrl: sh-pfc: Initial R8A77995 PFC support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 755a5b805fa7ff22e2934d67501efd92109f41ea Author: Geert Uytterhoeven Date: Thu Dec 13 10:53:11 2018 +0100 pinctrl: sh-pfc: r8a77990: Fix MOD_SEL0 SEL_I2C1 field width The SEL_I2C1 (MOD_SEL0[21:20]) field in Module Select Register 0 has a width of 2 bits, i.e. it allows programming one out of 4 different configurations. However, the MOD_SEL0_21_20 macro contains 8 values instead of 4, overflowing into the subsequent fields in the register, and thus breaking the configuration of the latter. Fix this by dropping the bogus last 4 values, including the non-existent SEL_I2C1_4 configuration. Fixes: 6d4036a1e3b3ac0f ("pinctrl: sh-pfc: Initial R8A77990 PFC support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 94482af7055e1ffa211c1135256b85590ebcac99 Author: Geert Uytterhoeven Date: Wed Dec 12 14:42:16 2018 +0100 pinctrl: sh-pfc: sh7734: Add missing IPSR11 field The Peripheral Function Select Register 11 contains 3 reserved bits and 15 variable-width fields, but the variable field descriptor does not contain the 3-bit field IP11[25:23]. Fixes: 856cb4bb337ee504 ("sh: Add support pinmux for SH7734") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit b0f77269f6bba385f1f4dce44e7756cf8fbc0176 Author: Geert Uytterhoeven Date: Wed Dec 12 14:36:54 2018 +0100 pinctrl: sh-pfc: r8a77980: Add missing MOD_SEL0 field The Module Select Register 0 contains 20 (= 5 x 4) reserved bits, and 12 single-bit fields, but the variable field descriptor lacks a field of 4 reserved bits. Fixes: f59125248a691dfe ("pinctrl: sh-pfc: Add R8A77980 PFC support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 67d7745bc78e16ec6b3af02bc1da6c8c868cbd89 Author: Geert Uytterhoeven Date: Wed Dec 12 14:29:02 2018 +0100 pinctrl: sh-pfc: r8a77970: Add missing MOD_SEL0 field The Module Select Register 0 contains 20 (= 5 x 4) reserved bits, and 12 single-bit fields, but the variable field descriptor lacks a field of 4 reserved bits. Fixes: b92ac66a1819602b ("pinctrl: sh-pfc: Add R8A77970 PFC support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 6a6c195d98a1a5e70faa87f594d7564af1dd1bed Author: Geert Uytterhoeven Date: Wed Dec 12 14:21:16 2018 +0100 pinctrl: sh-pfc: r8a7794: Remove bogus IPSR9 field The Peripheral Function Select Register 9 contains 12 fields, but the variable field descriptor contains a 13th bogus field of 3 bits. Fixes: 43c4436e2f1890a7 ("pinctrl: sh-pfc: add R8A7794 PFC support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 9925e879572680125c5d00ad8b807aec720b1cb6 Author: Geert Uytterhoeven Date: Wed Dec 12 12:01:45 2018 +0100 pinctrl: sh-pfc: Validate pins/marks in pin groups at build time Add a build-time check, to ensure the number of pins and pin marks in a pin group matches. This helps catching bugs early. Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 124cde98f856b6206b804acbdec3b7c80f8c3427 Author: Geert Uytterhoeven Date: Wed Dec 12 11:20:14 2018 +0100 pinctrl: sh-pfc: sh73a0: Add missing TO pin to tpu4_to3 group The tpu4_to3_mux[] array contains the TPU4TO3 pin mark, but the tpu4_to3_pins[] array lacks the corresponding pin number. Add the missing pin number, for non-GPIO pin F26. Fixes: 5da4eb049de803c7 ("sh-pfc: sh73a0: Add TPU pin groups and functions") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 0d6256cb880166a4111bebce35790019e56b6e1b Author: Geert Uytterhoeven Date: Wed Dec 12 11:12:20 2018 +0100 pinctrl: sh-pfc: r8a7791: Remove bogus marks from vin1_b_data18 group The vin1_b_data18_mux[] arrays contains pin marks for the 2 LSB bits of the color components. The vin1_b_data18_pins[] array rightfully does not include the corresponding pin numbers, as RGB18 is subset of RGB24, containing only the 6 MSB bits of each component. Fixes: 8e32c9671f84acd8 ("pinctrl: sh-pfc: r8a7791: Add VIN pins") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 884fa25fb6e5e63ab970d612a628313bb68f37cc Author: Geert Uytterhoeven Date: Wed Dec 12 11:05:57 2018 +0100 pinctrl: sh-pfc: r8a7791: Remove bogus ctrl marks from qspi_data4_b group The qspi_data4_b_mux[] array contains pin marks for the clock and chip select pins. The qspi_data4_b_pins[] array rightfully does not contain the corresponding pin numbers, as the control pins are provided by a separate group (qspi_ctrl_b). Fixes: 2d0c386f135e4186 ("pinctrl: sh-pfc: r8a7791: Add QSPI pin groups") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 96bb2a6ab4eca10e5b6490b3f0738e9f7ec22c2b Author: Geert Uytterhoeven Date: Wed Dec 12 11:00:27 2018 +0100 pinctrl: sh-pfc: r8a7740: Add missing LCD0 marks to lcd0_data24_1 group The lcd0_data24_1_pins[] array contains the LCD0 D1[2-5] pin numbers, but the lcd0_data24_1_mux[] array lacks the corresponding pin marks. Fixes: 06c7dd866da70f6c ("sh-pfc: r8a7740: Add LCDC0 and LCDC1 pin groups and functions") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 1ebc589a7786f17f97b9e87b44e0fb4d0290d8f8 Author: Geert Uytterhoeven Date: Wed Dec 12 10:57:27 2018 +0100 pinctrl: sh-pfc: r8a7740: Add missing REF125CK pin to gether_gmii group The gether_gmii_mux[] array contains the REF125CK pin mark, but the gether_gmii_pins[] array lacks the corresponding pin number. Fixes: bae11d30d0cafdc5 ("sh-pfc: r8a7740: Add GETHER pin groups and functions") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 117774fbe6beae3fd4f1fed5b7f596acdd90a2ed Author: Geert Uytterhoeven Date: Wed Dec 12 11:35:35 2018 +0100 pinctrl: sh-pfc: r8a77990: Fix IOCTRL reg state after s2ram on R-Car E3 Due to an interaction with commit 9f2b76a2db3c4387 ("pinctrl: sh-pfc: r8a77990: Add R8A774C0 PFC support"), the state of the I/O Control Registers is saved/restored during s2ram on RZ/G2E, but not on R-Car E3. Hence on R-Car E3, SDHI voltage state is lost after system resume. Fix this by registering the I/O Control Registers on R-Car E3, too. Fixes: 33847a71373cd6ae ("pinctrl: sh-pfc: r8a77990: Add voltage switch operations for SDHI") Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Reviewed-by: Simon Horman commit db221412cd2014506642967155698825ad80f6b6 Author: Nicholas Mc Guire Date: Fri Dec 7 11:34:27 2018 +0100 pinctrl: rza1: Handle devm_kasprintf() failure cases devm_kasprintf() may return NULL on failure of internal allocation thus the assignments are not safe if not checked. On error rza1_pinctrl_register() respectively rza1_parse_gpiochip() return negative values so -ENOMEM in the (unlikely) failure case of devm_kasprintf() should be fine here. Signed-off-by: Nicholas Mc Guire Fixes: 5a49b644b307 ("pinctrl: Renesas RZ/A1 pin and gpio controller") Signed-off-by: Geert Uytterhoeven commit 28586a51eea666d5531bcaef2f68e4abbd87242c Author: Alex Hung Date: Tue Dec 18 12:00:54 2018 +0800 ACPI / OSI: Add OEM _OSI string to enable dGPU direct output For HP Inc. mobile workstation with hybrid graphics support, dGPU can directly output to external monitors; however, Nvidia and AMD's Linux drivers aren't able to support this feature. The OEM _OSI string "Linux-HPI-Hybrid-Graphics" is used by BIOS to implement dGPU direct output to external monitors. The form of the OEM _OSI strings is defined by each OEMs and is discussed in Documentation/acpi/osi.txt. Signed-off-by: Alex Hung Signed-off-by: Rafael J. Wysocki commit f4caa6ee736fa8a46c806ba4382c16f7e5a20248 Author: Geert Uytterhoeven Date: Thu Dec 6 17:30:39 2018 +0100 pinctrl: sh-pfc: r8a77990: Add support for pull-up only pins The R-Car Gen3 HardWare Manual Errata for Rev. 1.00 (Jul 2, 2018) states that the USB30_OVC pin supports pull-up only. It has a bit assigned in the pull-enable register (PUEN5), but not in the pull-up/down control register (PUD5). Add a check for this, to prevent configuring a prohibited setting. Reported-by: Yoshihiro Shimoda Fixes: 83f6941a42a5e773 ("pinctrl: sh-pfc: r8a77990: Add bias pinconf support") Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman commit 7edcbbf29006be46d5dbce5bac9aae73f3056d14 Author: Rafael J. Wysocki Date: Mon Dec 17 12:22:43 2018 +0100 ACPI: PM: Loop in full LPS0 mode only After a previous change, all non-wakeup GPEs are disabled for suspend-to-idle unless full Low-Power S0 (LPS0) mode is in use, so it is not necessary to do anything in acpi_s2idle_wake() unless in full LPS0 mode, which is only when lps0_device_handle is set. Modify the code accordingly. Tested-by: Mika Westerberg Signed-off-by: Rafael J. Wysocki commit f941d3e41da7f86bdb9dcc1977c2bcc6b89bfe47 Author: Rafael J. Wysocki Date: Mon Dec 17 12:21:55 2018 +0100 ACPI: EC / PM: Disable non-wakeup GPEs for suspend-to-idle There are systems in which non-wakeup GPEs fire during the "noirq" suspend stage of suspending devices and that effectively prevents the system that tries to suspend to idle from entering any low-power state at all. If the offending GPE fires regularly and often enough, the system appears to be suspended, but in fact it is in a tight loop over "noirq" suspend and "noirq" resume of devices all the time. To prevent that from happening, disable all non-wakeup GPEs except for the EC GPE for suspend-to-idle (the EC GPE is special, because on some systems it has to be enabled for power button wakeup events to be generated as expected). Fixes: 147a7d9d25ca (ACPI / PM: Do not reconfigure GPEs for suspend-to-idle) Link: https://bugzilla.kernel.org/show_bug.cgi?id=201987 Reported-by: Zhang Rui Tested-by: Mika Westerberg Tested-by: Zhang Rui Signed-off-by: Rafael J. Wysocki commit 663546903c835fe46308b1b1e53d32d1f2b33da9 Author: Doug Smythies Date: Mon Dec 17 23:34:04 2018 -0800 tools/power/x86/intel_pstate_tracer: Fix non root execution for post processing a trace file This script is supposed to be allowed to run with regular user privileges if a previously captured trace is being post processed. Commit fbe313884d7d (tools/power/x86/intel_pstate_tracer: Free the trace buffer memory) introduced a bug that breaks that option. Commit 35459105deb2 (tools/power/x86/intel_pstate_tracer: Add optional setting of trace buffer memory allocation) moved the code but kept the bug. This patch fixes the issue. Fixes: 35459105deb2 (tools/power/x86/intel_pstate_tracer: Add optional ...) Signed-off-by: Doug Smythies Signed-off-by: Rafael J. Wysocki commit 67e4eb30ea833e1a97f70e3aba00c6b165fd298c Merge: 7566ec393f416 901d32bc69f34 Author: Rafael J. Wysocki Date: Tue Dec 18 10:32:01 2018 +0100 Merge tag 'linux-cpupower-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux Pull cpupower utility updates for v4.21 from Shuah Khan: "This cpupower update Linux 4.21 adds support for auto-completion for cpupower tool from Abhishek Goel." * tag 'linux-cpupower-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux: cpupower : Auto-completion for cpupower tool commit 5f30b2e823484ce6a79f2b59901b6351c15effa6 Author: Nicholas Mc Guire Date: Fri Dec 14 17:56:10 2018 +0100 livepatch: check kzalloc return values kzalloc() return should always be checked - notably in example code where this may be seen as reference. On failure of allocation in livepatch_fix1_dummy_alloc() respectively dummy_alloc() previous allocation is freed (thanks to Petr Mladek for catching this) and NULL returned. Signed-off-by: Nicholas Mc Guire Fixes: 439e7271dc2b ("livepatch: introduce shadow variable API") Acked-by: Joe Lawrence Reviewed-by: Petr Mladek Acked-by: Miroslav Benes Signed-off-by: Jiri Kosina commit 8d503f206c336677954160ac62f0c7d9c219cd89 Author: Scott Chen Date: Thu Dec 13 06:01:47 2018 -0500 USB: serial: pl2303: add ids for Hewlett-Packard HP POS pole displays Add device ids to pl2303 for the HP POS pole displays: LM920: 03f0:026b TD620: 03f0:0956 LD960TA: 03f0:4439 LD220TA: 03f0:4349 LM940: 03f0:5039 Signed-off-by: Scott Chen Cc: stable Signed-off-by: Johan Hovold commit 7aedd9d48f2a8332c2c51a40d2dca8c097f0dcdb Author: Michael Mueller Date: Mon Dec 3 10:20:22 2018 +0100 KVM: s390: fix kmsg component kvm-s390 Relocate #define statement for kvm related kernel messages before the include of printk to become effective. Signed-off-by: Michael Mueller Acked-by: Christian Borntraeger Signed-off-by: Christian Borntraeger commit 308c3e6673b012beecb96ef04cc65f4a0e7cdd99 Author: Michael Mueller Date: Fri Nov 30 15:32:06 2018 +0100 KVM: s390: unregister debug feature on failing arch init Make sure the debug feature and its allocated resources get released upon unsuccessful architecture initialization. A related indication of the issue will be reported as kernel message. Signed-off-by: Michael Mueller Reviewed-by: Cornelia Huck Reviewed-by: Pierre Morel Reviewed-by: David Hildenbrand Message-Id: <20181130143215.69496-2-mimu@linux.ibm.com> Signed-off-by: Christian Borntraeger commit b12c97d45cd061862b79fe02aa41a73d685ec7a1 Author: John Hurley Date: Mon Dec 17 19:18:39 2018 -0800 nfp: flower: fix cb_ident duplicate in indirect block register Previously the identifier used for indirect block callback registry and for block rule cb registry (when done via indirect blocks) was the pointer to the netdev we were interested in receiving updates on. This worked fine if a single app existed that registered one callback per netdev of interest. However, if multiple cards are in place and, in turn, multiple apps, then each app may register the same callback with the same identifier to both the netdev's indirect block cb list and to a block's cb list. This can lead to EEXIST errors and/or incorrect cb deletions. Prevent this conflict by using the app pointer as the identifier for netdev indirect block cb registry, allowing each app to register a unique callback per netdev. For block cb registry, the same app may register multiple cbs to the same block if using TC shared blocks. Instead of the app, use the pointer to the allocated cb_priv data as the identifier here. This means that there can be a unique block callback for each app/netdev combo. Fixes: 3166dd07a9cb ("nfp: flower: offload tunnel decap rules via indirect TC blocks") Reported-by: Edward Cree Signed-off-by: John Hurley Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit d1675a16029610505895b60fc3e96c9dbac02d97 Author: Shalom Toledo Date: Tue Dec 18 07:31:31 2018 +0000 mlxsw: spectrum: Update the supported firmware to version 13.1910.622 This new firmware contains: * New packet traps for discarded packets * Secure firmware flash bug fix * Fence mechanism bug fix * TCAM RMA bug fix Signed-off-by: Shalom Toledo Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit f5c6dfdefb21708aa0f382c1dc36d4e82c6c3ed5 Author: David Ahern Date: Mon Dec 17 15:36:11 2018 -0800 ip6mr: Drop mfc6_cache argument to ip6mr_forward2 mfc6_cache is not needed by ip6mr_forward2 so drop it from the input argument list. Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 6e0735d1f7e573da0976d8b7447a82b09d8ec949 Author: David Ahern Date: Mon Dec 17 15:34:48 2018 -0800 ipmr: Drop mfc_cache argument to ipmr_queue_xmit mfc_cache is not needed by ipmr_queue_xmit so drop it from the input argument list. Signed-off-by: David Ahern Signed-off-by: David S. Miller commit eedbbb0d98b2a89250a8bb83d9c71b77881e5247 Author: Peter Oskolkov Date: Sun Dec 16 15:42:48 2018 -0800 net: dccp: initialize (addr,port) listening hashtable Commit d9fbc7f6431f "net: tcp: prefer listeners bound to an address" removes port-only listener lookups. This caused segfaults in DCCP lookups because DCCP did not initialize the (addr,port) hashtable. This patch adds said initialization. The only non-trivial issue here is the size of the new hashtable. It seemed reasonable to make it match the size of the port-only hashtable (= INET_LHTABLE_SIZE) that was used previously. Other parameters to inet_hashinfo2_init() match those used in TCP. V2 changes: marked inet_hashinfo2_init as an exported symbol so that DCCP compiles when configured as a module. Tested: syzcaller issues fixed; the second patch in the patchset tests that DCCP lookups work correctly. Fixes: d9fbc7f6431f "net: tcp: prefer listeners bound to an address" Reported-by: syzcaller Signed-off-by: Peter Oskolkov Signed-off-by: David S. Miller commit 6a95147c513190b8932c5ea695cb653272cf2c14 Merge: 11789039da536 56d3746247786 Author: David S. Miller Date: Mon Dec 17 23:08:54 2018 -0800 Merge branch 'bnxt_en-next' Michael Chan says: ==================== bnxt_en: Updates for net-next. Two main changes in this seris plus some miscellaneous changes. 1. Improvements and fixes for resource accounting which are required for enabling SR-IOV and RDMA on the new 57500 chips. Only SR-IOV for 57500 chips is enabled in this series. 2. New statistics counters and improvements to keep the basic counters and port counters during IFDOWN. 3. Msic. small changes for ETS, returning proper error codes when flashing NVRAM, and a link speed related fix for ethtool loopback selftest. ==================== Signed-off-by: David S. Miller commit 56d374624778652d2a999e18c87a25338b127b41 Author: Vasundhara Volam Date: Sun Dec 16 18:46:31 2018 -0500 bnxt_en: query force speeds before disabling autoneg mode. With autoneg enabled, PHY loopback test fails. To disable autoneg, driver needs to send a valid forced speed to FW. FW is not sending async event for invalid speeds. To fix this, query forced speeds and send the correct speed when disabling autoneg mode. Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit fd3ab1c70e0b953f4f772142051d215bffada718 Author: Michael Chan Date: Sun Dec 16 18:46:30 2018 -0500 bnxt_en: Do not free port statistics buffer when device is down. Port statistics which include RDMA counters are useful even when the netdevice is down. Do not free the port statistics DMA buffers when the netdevice is down. This is keep the snapshot of the port statistics and counters will just continue counting when the netdevice goes back up. Split the bnxt_free_stats() function into 2 functions. The port statistics buffers will only be freed when the netdevice is removed. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit b8875ca356f1c0b17ec68be6666269373a62288e Author: Michael Chan Date: Sun Dec 16 18:46:29 2018 -0500 bnxt_en: Save ring statistics before reset. With the current driver, the statistics reported by .ndo_get_stats64() are reset when the device goes down. Store a snapshot of the rtnl_link_stats64 before shutdown. This snapshot is added to the current counters in .ndo_get_stats64() so that the counters will not get reset when the device is down. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 7c675421afef18253a86ffc383f57bc15ef32ea8 Author: Vasundhara Volam Date: Sun Dec 16 18:46:28 2018 -0500 bnxt_en: Return linux standard errors in bnxt_ethtool.c Currently firmware specific errors are returned directly in flash_device and reset ethtool hooks. Modify it to return linux standard errors to userspace when flashing operations fail. Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 24654f095ed68eafcdfdbfccbe6324ad1475c1bb Author: Michael Chan Date: Sun Dec 16 18:46:27 2018 -0500 bnxt_en: Don't set ETS on unused TCs. Currently, the code allows ETS bandwidth weight 0 to be set on unused TCs. We should not set any DCB parameters on unused TCs at all. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit e37fed790335631c57477e7bee952a039ccb7a50 Author: Michael Chan Date: Sun Dec 16 18:46:26 2018 -0500 bnxt_en: Add ethtool -S priority counters. Display the CoS counters as additional priority counters by looking up the priority to CoS queue mapping. If the TX extended port statistics block size returned by firmware is big enough to cover the CoS counters, then we will display the new priority counters. We call firmware to get the up-to-date pri2cos mapping to convert the CoS counters to priority counters. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit b16b68918674af5e7beccb567fe7ebd8b44744b8 Author: Michael Chan Date: Sun Dec 16 18:46:25 2018 -0500 bnxt_en: Add SR-IOV support for 57500 chips. There are some minor differences when assigning VF resources on the new chips. The MSIX (NQ) resource has to be assigned and ring group is not needed on the new chips. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 36d65be9a88052cdfc8524eb591baf0e6c878408 Author: Michael Chan Date: Sun Dec 16 18:46:24 2018 -0500 bnxt_en: Disable MSIX before re-reserving NQs/CMPL rings. When bringing up a device, the code checks to see if the number of MSIX has changed. pci_disable_msix() should be called first before changing the number of reserved NQs/CMPL rings. This ensures that the MSIX vectors associated with the NQs/CMPL rings are still properly mapped when pci_disable_msix() masks the vectors. This patch will prevent errors when RDMA support is added for the new 57500 chips. When the RDMA driver shuts down, the number of NQs is decreased and we must use the new sequence to prevent MSIX errors. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 780baad44f0f1e87df5508d1ad5a87d359fb96d1 Author: Vasundhara Volam Date: Sun Dec 16 18:46:23 2018 -0500 bnxt_en: Reserve 1 stat_ctx for RDMA driver. bnxt_en requires same number of stat_ctxs as CP rings but RDMA requires only 1 stat_ctx. Also add a new parameter resv_stat_ctxs to better keep track of stat_ctxs reserved including resources used by RDMA. Add a stat_ctxs parameter to all the relevant resource reservation functions so we can reserve the correct number of stat_ctxs. Prior to this patch, we were not reserving the extra stat_ctx for RDMA and RDMA would not work on the new 57500 chips. Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit f4e896142de8304b433fd94f7eed55750c34defd Author: Vasundhara Volam Date: Sun Dec 16 18:46:22 2018 -0500 bnxt_en: Do not modify max_stat_ctxs after RDMA driver requests/frees stat_ctxs Calling bnxt_set_max_func_stat_ctxs() to modify max stat_ctxs requested or freed by the RDMA driver is wrong. After introducing reservation of resources recently, the driver has to keep track of all stat_ctxs including the ones used by the RDMA driver. This will provide a better foundation for accurate accounting of the stat_ctxs. Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit c027c6b4e91f21dfa4feab91e2155c8403f49f5c Author: Vasundhara Volam Date: Sun Dec 16 18:46:21 2018 -0500 bnxt_en: get rid of num_stat_ctxs variable For bnxt_en driver, stat_ctxs created will always be same as cp_nr_rings. Remove extra variable that duplicates the value. Also introduce bnxt_get_avail_stat_ctxs_for_en() helper to get available stat_ctxs and bnxt_get_ulp_stat_ctxs() helper to return number of stat_ctxs used by RDMA. Signed-off-by: Vasundhara Volam Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit e916b0815a11c6cbc82f2d8510982ea022628880 Author: Michael Chan Date: Sun Dec 16 18:46:20 2018 -0500 bnxt_en: Add bnxt_get_avail_cp_rings_for_en() helper function. The available CP rings are calculated differently on the new 57500 chips, so add this helper to do this calculation correctly. The VFs will be assigned these available CP rings. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit f7588cd89331211e2c4f0fdb94bb0ed4f92847be Author: Michael Chan Date: Sun Dec 16 18:46:19 2018 -0500 bnxt_en: Store the maximum NQs available on the PF. The PF has a pool of NQs and MSIX vectors assigned to it based on NVRAM configurations. The number of usable MSIX vectors on the PF is the minimum of the NQs and MSIX vectors. Any excess NQs without associated MSIX may be used for the VFs, so we need to store this max_nqs value. max_nqs minus the NQs used by the PF will be the available NQs for the VFs. Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 41e486f4f66d3e646fedd60469bc60e73662de50 Author: Paul Burton Date: Mon Dec 17 22:05:40 2018 -0800 MIPS: Remove struct mm_context_t fp_mode_switching field The fp_mode_switching field in struct mm_context_t was left unused by commit 8c8d953c2800 ("MIPS: Schedule on CPUs we need to lose FPU for a mode switch") in v4.19, with nothing modifying its value & nothing waiting on it having any particular value after that commit. Remove the unused field & the one remaining reference to it. Signed-off-by: Paul Burton commit 11789039da536fea96c98a40c2b441decf2e7323 Author: Stefano Brivio Date: Tue Dec 18 00:13:17 2018 +0100 fou: Prevent unbounded recursion in GUE error handler Handling exceptions for direct UDP encapsulation in GUE (that is, UDP-in-UDP) leads to unbounded recursion in the GUE exception handler, syzbot reported. While draft-ietf-intarea-gue-06 doesn't explicitly forbid direct encapsulation of UDP in GUE, it probably doesn't make sense to set up GUE this way, and it's currently not even possible to configure this. Skip exception handling if the GUE proto/ctype field is set to the UDP protocol number. Should we need to handle exceptions for UDP-in-GUE one day, we might need to either explicitly set a bound for recursion, or implement a special iterative handling for these cases. Reported-and-tested-by: syzbot+43f6755d1c2e62743468@syzkaller.appspotmail.com Fixes: b8a51b38e4d4 ("fou, fou6: ICMP error handlers for FoU and GUE") Signed-off-by: Stefano Brivio Signed-off-by: David S. Miller commit cd19181bf9ad4b7f40f2a4e0355d052109c76529 Author: Ming Lei Date: Tue Dec 18 12:15:29 2018 +0800 blk-mq: enable IO poll if .nr_queues of type poll > 0 The queue mapping of type poll only exists when set->map[HCTX_TYPE_POLL].nr_queues is bigger than zero, so enhance the constraint by checking .nr_queues of type poll before enabling IO poll. Otherwise IO race & timeout can be observed when running block/007. Cc: Jeff Moyer Cc: Christoph Hellwig Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 3c94d83cb352627f221d971b05f163c17527de74 Author: Jens Axboe Date: Mon Dec 17 21:11:17 2018 -0700 blk-mq: change blk_mq_queue_busy() to blk_mq_queue_inflight() There's a single user of this function, dm, and dm just wants to check if IO is inflight, not that it's just allocated. This fixes a hang with srp/002 in blktests with dm, where it tries to suspend but waits for inflight IO to finish first. As it checks for just allocated requests, this fails. Tested-by: Mike Snitzer Signed-off-by: Jens Axboe commit 06aa151ad1fc74a49b45336672515774a678d78d Author: Taehee Yoo Date: Mon Nov 5 18:23:25 2018 +0900 netfilter: ipt_CLUSTERIP: check MAC address when duplicate config is set If same destination IP address config is already existing, that config is just used. MAC address also should be same. However, there is no MAC address checking routine. So that MAC address checking routine is added. test commands: %iptables -A INPUT -p tcp -i lo -d 192.168.0.5 --dport 80 \ -j CLUSTERIP --new --hashmode sourceip \ --clustermac 01:00:5e:00:00:20 --total-nodes 2 --local-node 1 %iptables -A INPUT -p tcp -i lo -d 192.168.0.5 --dport 80 \ -j CLUSTERIP --new --hashmode sourceip \ --clustermac 01:00:5e:00:00:21 --total-nodes 2 --local-node 1 After this patch, above commands are disallowed. Signed-off-by: Taehee Yoo Signed-off-by: Pablo Neira Ayuso commit 2a61d8b883bbad26b06d2e6cc3777a697e78830d Author: Taehee Yoo Date: Mon Nov 5 18:23:13 2018 +0900 netfilter: ipt_CLUSTERIP: fix sleep-in-atomic bug in clusterip_config_entry_put() A proc_remove() can sleep. so that it can't be inside of spin_lock. Hence proc_remove() is moved to outside of spin_lock. and it also adds mutex to sync create and remove of proc entry(config->pde). test commands: SHELL#1 %while :; do iptables -A INPUT -p udp -i enp2s0 -d 192.168.1.100 \ --dport 9000 -j CLUSTERIP --new --hashmode sourceip \ --clustermac 01:00:5e:00:00:21 --total-nodes 3 --local-node 3; \ iptables -F; done SHELL#2 %while :; do echo +1 > /proc/net/ipt_CLUSTERIP/192.168.1.100; \ echo -1 > /proc/net/ipt_CLUSTERIP/192.168.1.100; done [ 2949.569864] BUG: sleeping function called from invalid context at kernel/sched/completion.c:99 [ 2949.579944] in_atomic(): 1, irqs_disabled(): 0, pid: 5472, name: iptables [ 2949.587920] 1 lock held by iptables/5472: [ 2949.592711] #0: 000000008f0ebcf2 (&(&cn->lock)->rlock){+...}, at: refcount_dec_and_lock+0x24/0x50 [ 2949.603307] CPU: 1 PID: 5472 Comm: iptables Tainted: G W 4.19.0-rc5+ #16 [ 2949.604212] Hardware name: To be filled by O.E.M. To be filled by O.E.M./Aptio CRB, BIOS 5.6.5 07/08/2015 [ 2949.604212] Call Trace: [ 2949.604212] dump_stack+0xc9/0x16b [ 2949.604212] ? show_regs_print_info+0x5/0x5 [ 2949.604212] ___might_sleep+0x2eb/0x420 [ 2949.604212] ? set_rq_offline.part.87+0x140/0x140 [ 2949.604212] ? _rcu_barrier_trace+0x400/0x400 [ 2949.604212] wait_for_completion+0x94/0x710 [ 2949.604212] ? wait_for_completion_interruptible+0x780/0x780 [ 2949.604212] ? __kernel_text_address+0xe/0x30 [ 2949.604212] ? __lockdep_init_map+0x10e/0x5c0 [ 2949.604212] ? __lockdep_init_map+0x10e/0x5c0 [ 2949.604212] ? __init_waitqueue_head+0x86/0x130 [ 2949.604212] ? init_wait_entry+0x1a0/0x1a0 [ 2949.604212] proc_entry_rundown+0x208/0x270 [ 2949.604212] ? proc_reg_get_unmapped_area+0x370/0x370 [ 2949.604212] ? __lock_acquire+0x4500/0x4500 [ 2949.604212] ? complete+0x18/0x70 [ 2949.604212] remove_proc_subtree+0x143/0x2a0 [ 2949.708655] ? remove_proc_entry+0x390/0x390 [ 2949.708655] clusterip_tg_destroy+0x27a/0x630 [ipt_CLUSTERIP] [ ... ] Fixes: b3e456fce9f5 ("netfilter: ipt_CLUSTERIP: fix a race condition of proc file creation") Signed-off-by: Taehee Yoo Signed-off-by: Pablo Neira Ayuso commit b12f7bad5ad3724d19754390a3e80928525c0769 Author: Taehee Yoo Date: Mon Nov 5 18:22:55 2018 +0900 netfilter: ipt_CLUSTERIP: remove wrong WARN_ON_ONCE in netns exit routine When network namespace is destroyed, both clusterip_tg_destroy() and clusterip_net_exit() are called. and clusterip_net_exit() is called before clusterip_tg_destroy(). Hence cleanup check code in clusterip_net_exit() doesn't make sense. test commands: %ip netns add vm1 %ip netns exec vm1 bash %ip link set lo up %iptables -A INPUT -p tcp -i lo -d 192.168.0.5 --dport 80 \ -j CLUSTERIP --new --hashmode sourceip \ --clustermac 01:00:5e:00:00:20 --total-nodes 2 --local-node 1 %exit %ip netns del vm1 splat looks like: [ 341.184508] WARNING: CPU: 1 PID: 87 at net/ipv4/netfilter/ipt_CLUSTERIP.c:840 clusterip_net_exit+0x319/0x380 [ipt_CLUSTERIP] [ 341.184850] Modules linked in: ipt_CLUSTERIP nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 xt_tcpudp iptable_filter bpfilter ip_tables x_tables [ 341.184850] CPU: 1 PID: 87 Comm: kworker/u4:2 Not tainted 4.19.0-rc5+ #16 [ 341.227509] Workqueue: netns cleanup_net [ 341.227509] RIP: 0010:clusterip_net_exit+0x319/0x380 [ipt_CLUSTERIP] [ 341.227509] Code: 0f 85 7f fe ff ff 48 c7 c2 80 64 2c c0 be a8 02 00 00 48 c7 c7 a0 63 2c c0 c6 05 18 6e 00 00 01 e8 bc 38 ff f5 e9 5b fe ff ff <0f> 0b e9 33 ff ff ff e8 4b 90 50 f6 e9 2d fe ff ff 48 89 df e8 de [ 341.227509] RSP: 0018:ffff88011086f408 EFLAGS: 00010202 [ 341.227509] RAX: dffffc0000000000 RBX: 1ffff1002210de85 RCX: 0000000000000000 [ 341.227509] RDX: 1ffff1002210de85 RSI: ffff880110813be8 RDI: ffffed002210de58 [ 341.227509] RBP: ffff88011086f4d0 R08: 0000000000000000 R09: 0000000000000000 [ 341.227509] R10: 0000000000000000 R11: 0000000000000000 R12: 1ffff1002210de81 [ 341.227509] R13: ffff880110625a48 R14: ffff880114cec8c8 R15: 0000000000000014 [ 341.227509] FS: 0000000000000000(0000) GS:ffff880116600000(0000) knlGS:0000000000000000 [ 341.227509] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 341.227509] CR2: 00007f11fd38e000 CR3: 000000013ca16000 CR4: 00000000001006e0 [ 341.227509] Call Trace: [ 341.227509] ? __clusterip_config_find+0x460/0x460 [ipt_CLUSTERIP] [ 341.227509] ? default_device_exit+0x1ca/0x270 [ 341.227509] ? remove_proc_entry+0x1cd/0x390 [ 341.227509] ? dev_change_net_namespace+0xd00/0xd00 [ 341.227509] ? __init_waitqueue_head+0x130/0x130 [ 341.227509] ops_exit_list.isra.10+0x94/0x140 [ 341.227509] cleanup_net+0x45b/0x900 [ ... ] Fixes: 613d0776d3fe ("netfilter: exit_net cleanup check added") Signed-off-by: Taehee Yoo Signed-off-by: Pablo Neira Ayuso commit 5a86d68bcf02f2d1e9a5897dd482079fd5f75e7f Author: Taehee Yoo Date: Mon Nov 5 18:22:44 2018 +0900 netfilter: ipt_CLUSTERIP: fix deadlock in netns exit routine When network namespace is destroyed, cleanup_net() is called. cleanup_net() holds pernet_ops_rwsem then calls each ->exit callback. So that clusterip_tg_destroy() is called by cleanup_net(). And clusterip_tg_destroy() calls unregister_netdevice_notifier(). But both cleanup_net() and clusterip_tg_destroy() hold same lock(pernet_ops_rwsem). hence deadlock occurrs. After this patch, only 1 notifier is registered when module is inserted. And all of configs are added to per-net list. test commands: %ip netns add vm1 %ip netns exec vm1 bash %ip link set lo up %iptables -A INPUT -p tcp -i lo -d 192.168.0.5 --dport 80 \ -j CLUSTERIP --new --hashmode sourceip \ --clustermac 01:00:5e:00:00:20 --total-nodes 2 --local-node 1 %exit %ip netns del vm1 splat looks like: [ 341.809674] ============================================ [ 341.809674] WARNING: possible recursive locking detected [ 341.809674] 4.19.0-rc5+ #16 Tainted: G W [ 341.809674] -------------------------------------------- [ 341.809674] kworker/u4:2/87 is trying to acquire lock: [ 341.809674] 000000005da2d519 (pernet_ops_rwsem){++++}, at: unregister_netdevice_notifier+0x8c/0x460 [ 341.809674] [ 341.809674] but task is already holding lock: [ 341.809674] 000000005da2d519 (pernet_ops_rwsem){++++}, at: cleanup_net+0x119/0x900 [ 341.809674] [ 341.809674] other info that might help us debug this: [ 341.809674] Possible unsafe locking scenario: [ 341.809674] [ 341.809674] CPU0 [ 341.809674] ---- [ 341.809674] lock(pernet_ops_rwsem); [ 341.809674] lock(pernet_ops_rwsem); [ 341.809674] [ 341.809674] *** DEADLOCK *** [ 341.809674] [ 341.809674] May be due to missing lock nesting notation [ 341.809674] [ 341.809674] 3 locks held by kworker/u4:2/87: [ 341.809674] #0: 00000000d9df6c92 ((wq_completion)"%s""netns"){+.+.}, at: process_one_work+0xafe/0x1de0 [ 341.809674] #1: 00000000c2cbcee2 (net_cleanup_work){+.+.}, at: process_one_work+0xb60/0x1de0 [ 341.809674] #2: 000000005da2d519 (pernet_ops_rwsem){++++}, at: cleanup_net+0x119/0x900 [ 341.809674] [ 341.809674] stack backtrace: [ 341.809674] CPU: 1 PID: 87 Comm: kworker/u4:2 Tainted: G W 4.19.0-rc5+ #16 [ 341.809674] Workqueue: netns cleanup_net [ 341.809674] Call Trace: [ ... ] [ 342.070196] down_write+0x93/0x160 [ 342.070196] ? unregister_netdevice_notifier+0x8c/0x460 [ 342.070196] ? down_read+0x1e0/0x1e0 [ 342.070196] ? sched_clock_cpu+0x126/0x170 [ 342.070196] ? find_held_lock+0x39/0x1c0 [ 342.070196] unregister_netdevice_notifier+0x8c/0x460 [ 342.070196] ? register_netdevice_notifier+0x790/0x790 [ 342.070196] ? __local_bh_enable_ip+0xe9/0x1b0 [ 342.070196] ? __local_bh_enable_ip+0xe9/0x1b0 [ 342.070196] ? clusterip_tg_destroy+0x372/0x650 [ipt_CLUSTERIP] [ 342.070196] ? trace_hardirqs_on+0x93/0x210 [ 342.070196] ? __bpf_trace_preemptirq_template+0x10/0x10 [ 342.070196] ? clusterip_tg_destroy+0x372/0x650 [ipt_CLUSTERIP] [ 342.123094] clusterip_tg_destroy+0x3ad/0x650 [ipt_CLUSTERIP] [ 342.123094] ? clusterip_net_init+0x3d0/0x3d0 [ipt_CLUSTERIP] [ 342.123094] ? cleanup_match+0x17d/0x200 [ip_tables] [ 342.123094] ? xt_unregister_table+0x215/0x300 [x_tables] [ 342.123094] ? kfree+0xe2/0x2a0 [ 342.123094] cleanup_entry+0x1d5/0x2f0 [ip_tables] [ 342.123094] ? cleanup_match+0x200/0x200 [ip_tables] [ 342.123094] __ipt_unregister_table+0x9b/0x1a0 [ip_tables] [ 342.123094] iptable_filter_net_exit+0x43/0x80 [iptable_filter] [ 342.123094] ops_exit_list.isra.10+0x94/0x140 [ 342.123094] cleanup_net+0x45b/0x900 [ ... ] Fixes: 202f59afd441 ("netfilter: ipt_CLUSTERIP: do not hold dev") Signed-off-by: Taehee Yoo Signed-off-by: Pablo Neira Ayuso commit 07a09d1b73c9651289d35449460d10e195e2f197 Author: Prashant Bhole Date: Mon Dec 17 16:57:50 2018 +0900 bpf: libbpf: fix memleak by freeing line_info This patch fixes a memory leak in libbpf by freeing up line_info member of struct bpf_program while unloading a program. Fixes: 3d65014146c6 ("bpf: libbpf: Add btf_line_info support to libbpf") Signed-off-by: Prashant Bhole Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit 37c7b1caeaf60c8d3bc3cedc9ff4b9cc2f015d7e Merge: 6c4fc209fcf9d 8772c8bc093b2 Author: Daniel Borkmann Date: Tue Dec 18 01:12:00 2018 +0100 Merge branch 'bpf-btf-type-fixes' Yonghong Song says: ==================== Commit 69b693f0aefa ("bpf: btf: Introduce BPF Type Format (BTF)") introduced BTF, a debug info format for BTF. The original design has a couple of issues though. First, the bitfield size is only encoded in int type. If the struct member bitfield type is enum, pahole ([1]) or llvm is forced to replace enum with int type. As a result, the original type information gets lost. Second, the original BTF design does not envision the possibility of BTF=>header_file conversion ([2]), hence does not encode "struct" or "union" info for a forward type. Such information is necessary to convert BTF to a header file. This patch set fixed the issue by introducing kind_flag, using one bit in type->info. When kind_flag, the struct/union btf_member->offset will encode both bitfield_size and bit_offset, covering both int and enum base types. The kind_flag is also used to indicate whether the forward type is a union (when set) or a struct. Patch #1 refactors function btf_int_bits_seq_show() so Patch #2 can reuse part of the function. Patch #2 implemented kind_flag support for struct/union/fwd types. Patch #3 added kind_flag support for cgroup local storage map pretty print. Patch #4 syncs kernel uapi btf.h to tools directory. Patch #5 added unit tests for kind_flag. Patch #6 added tests for kernel bpffs based pretty print with kind_flag. Patch #7 refactors function btf_dumper_int_bits() so Patch #8 can reuse part of the function. Patch #8 added bpftool support of pretty print with kind_flag set. [1] https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?id=b18354f64cc215368c3bc0df4a7e5341c55c378c [2] https://lwn.net/SubscriberLink/773198/fe3074838f5c3f26/ Change logs: v2 -> v3: . Relocated comments about bitfield_size/bit_offset interpretation of the "offset" field right before the "offset" struct member. . Added missing byte alignment checking for non-bitfield enum member of a struct with kind_flag set. . Added two test cases in unit tests for struct type, kind_flag set, non-bitfield int/enum member, not-byte aligned bit offsets. . Added comments to help understand there is no overflow for total_bits_offset in bpftool function btf_dumper_int_bits(). . Added explanation of typedef type dumping fix in Patch #8 commit message. v1 -> v2: . If kind_flag is set for a structure, ensure an int member, whether it is a bitfield or not, is a regular int type. . Added support so cgroup local storage map pretty print works with kind_flag. ==================== Signed-off-by: Daniel Borkmann commit 8772c8bc093b2d5823125475e1206b80664f8acb Author: Yonghong Song Date: Sat Dec 15 22:13:58 2018 -0800 tools: bpftool: support pretty print with kind_flag set The following example shows map pretty print with structures which include bitfield members. enum A { A1, A2, A3, A4, A5 }; typedef enum A ___A; struct tmp_t { char a1:4; int a2:4; int :4; __u32 a3:4; int b; ___A b1:4; enum A b2:4; }; struct bpf_map_def SEC("maps") tmpmap = { .type = BPF_MAP_TYPE_ARRAY, .key_size = sizeof(__u32), .value_size = sizeof(struct tmp_t), .max_entries = 1, }; BPF_ANNOTATE_KV_PAIR(tmpmap, int, struct tmp_t); and the following map update in the bpf program: key = 0; struct tmp_t t = {}; t.a1 = 2; t.a2 = 4; t.a3 = 6; t.b = 7; t.b1 = 8; t.b2 = 10; bpf_map_update_elem(&tmpmap, &key, &t, 0); With this patch, I am able to print out the map values correctly with this patch: bpftool map dump id 187 [{ "key": 0, "value": { "a1": 0x2, "a2": 0x4, "a3": 0x6, "b": 7, "b1": 0x8, "b2": 0xa } } ] Previously, if a function prototype argument has a typedef type, the prototype is not printed since function __btf_dumper_type_only() bailed out with error if the type is a typedef. This commit corrected this behavior by printing out typedef properly. The following example shows forward type and typedef type can be properly printed in function prototype with modified test_btf_haskv.c. struct t; union u; __attribute__((noinline)) static int test_long_fname_1(struct dummy_tracepoint_args *arg, struct t *p1, union u *p2, __u32 unused) ... int _dummy_tracepoint(struct dummy_tracepoint_args *arg) { return test_long_fname_1(arg, 0, 0, 0); } $ bpftool p d xlated id 24 ... int test_long_fname_1(struct dummy_tracepoint_args * arg, struct t * p1, union u * p2, __u32 unused) ... Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 9f95e37e31a4eabd7c8152f2ddcdbea5eafdb7c8 Author: Yonghong Song Date: Sat Dec 15 22:13:57 2018 -0800 tools: bpftool: refactor btf_dumper_int_bits() The core dump funcitonality in btf_dumper_int_bits() is refactored into a separate function btf_dumper_bitfield() which will be used by the next patch. Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit d0ebce687edc5d5a899b3de6b1adbfa0c5b64021 Author: Yonghong Song Date: Sat Dec 15 22:13:56 2018 -0800 tools/bpf: test kernel bpffs map pretty print with struct kind_flag The new tests are added to test bpffs map pretty print in kernel with kind_flag for structure type. $ test_btf -p ...... BTF pretty print array(#1)......OK BTF pretty print array(#2)......OK PASS:8 SKIP:0 FAIL:0 Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit cd9de5d3d64b472f67a5ac8520f79ce42f7583b8 Author: Yonghong Song Date: Sat Dec 15 22:13:55 2018 -0800 tools/bpf: add test_btf unit tests for kind_flag This patch added unit tests for different types handling type->info.kind_flag. The following new tests are added: $ test_btf ... BTF raw test[82] (invalid int kind_flag): OK BTF raw test[83] (invalid ptr kind_flag): OK BTF raw test[84] (invalid array kind_flag): OK BTF raw test[85] (invalid enum kind_flag): OK BTF raw test[86] (valid fwd kind_flag): OK BTF raw test[87] (invalid typedef kind_flag): OK BTF raw test[88] (invalid volatile kind_flag): OK BTF raw test[89] (invalid const kind_flag): OK BTF raw test[90] (invalid restrict kind_flag): OK BTF raw test[91] (invalid func kind_flag): OK BTF raw test[92] (invalid func_proto kind_flag): OK BTF raw test[93] (valid struct kind_flag, bitfield_size = 0): OK BTF raw test[94] (valid struct kind_flag, int member, bitfield_size != 0): OK BTF raw test[95] (valid union kind_flag, int member, bitfield_size != 0): OK BTF raw test[96] (valid struct kind_flag, enum member, bitfield_size != 0): OK BTF raw test[97] (valid union kind_flag, enum member, bitfield_size != 0): OK BTF raw test[98] (valid struct kind_flag, typedef member, bitfield_size != 0): OK BTF raw test[99] (valid union kind_flag, typedef member, bitfield_size != 0): OK BTF raw test[100] (invalid struct type, bitfield_size greater than struct size): OK BTF raw test[101] (invalid struct type, kind_flag bitfield base_type int not regular): OK BTF raw test[102] (invalid struct type, kind_flag base_type int not regular): OK BTF raw test[103] (invalid union type, bitfield_size greater than struct size): OK ... PASS:122 SKIP:0 FAIL:0 The second parameter name of macro BTF_INFO_ENC(kind, root, vlen) in selftests test_btf.c is also renamed from "root" to "kind_flag". Note that before this patch "root" is not used and always 0. Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 128b343dbef543e75793deed5cb3e5eeb9b69d0e Author: Yonghong Song Date: Sat Dec 15 22:13:53 2018 -0800 tools/bpf: sync btf.h header from kernel to tools Sync include/uapi/linux/btf.h to tools/include/uapi/linux/btf.h. Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit ffa0c1cf59596fba54546ea828305acfcc2cf55e Author: Yonghong Song Date: Sat Dec 15 22:13:52 2018 -0800 bpf: enable cgroup local storage map pretty print with kind_flag Commit 970289fc0a83 ("bpf: add bpffs pretty print for cgroup local storage maps") added bpffs pretty print for cgroup local storage maps. The commit worked for struct without kind_flag set. This patch refactored and made pretty print also work with kind_flag set for the struct. Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 9d5f9f701b1891466fb3dbb1806ad97716f95cc3 Author: Yonghong Song Date: Sat Dec 15 22:13:51 2018 -0800 bpf: btf: fix struct/union/fwd types with kind_flag This patch fixed two issues with BTF. One is related to struct/union bitfield encoding and the other is related to forward type. Issue #1 and solution: ====================== Current btf encoding of bitfield follows what pahole generates. For each bitfield, pahole will duplicate the type chain and put the bitfield size at the final int or enum type. Since the BTF enum type cannot encode bit size, pahole workarounds the issue by generating an int type whenever the enum bit size is not 32. For example, -bash-4.4$ cat t.c typedef int ___int; enum A { A1, A2, A3 }; struct t { int a[5]; ___int b:4; volatile enum A c:4; } g; -bash-4.4$ gcc -c -O2 -g t.c The current kernel supports the following BTF encoding: $ pahole -JV t.o [1] TYPEDEF ___int type_id=2 [2] INT int size=4 bit_offset=0 nr_bits=32 encoding=SIGNED [3] ENUM A size=4 vlen=3 A1 val=0 A2 val=1 A3 val=2 [4] STRUCT t size=24 vlen=3 a type_id=5 bits_offset=0 b type_id=9 bits_offset=160 c type_id=11 bits_offset=164 [5] ARRAY (anon) type_id=2 index_type_id=2 nr_elems=5 [6] INT sizetype size=8 bit_offset=0 nr_bits=64 encoding=(none) [7] VOLATILE (anon) type_id=3 [8] INT int size=1 bit_offset=0 nr_bits=4 encoding=(none) [9] TYPEDEF ___int type_id=8 [10] INT (anon) size=1 bit_offset=0 nr_bits=4 encoding=SIGNED [11] VOLATILE (anon) type_id=10 Two issues are in the above: . by changing enum type to int, we lost the original type information and this will not be ideal later when we try to convert BTF to a header file. . the type duplication for bitfields will cause BTF bloat. Duplicated types cannot be deduplicated later if the bitfield size is different. To fix this issue, this patch implemented a compatible change for BTF struct type encoding: . the bit 31 of struct_type->info, previously reserved, now is used to indicate whether bitfield_size is encoded in btf_member or not. . if bit 31 of struct_type->info is set, btf_member->offset will encode like: bit 0 - 23: bit offset bit 24 - 31: bitfield size if bit 31 is not set, the old behavior is preserved: bit 0 - 31: bit offset So if the struct contains a bit field, the maximum bit offset will be reduced to (2^24 - 1) instead of MAX_UINT. The maximum bitfield size will be 256 which is enough for today as maximum bitfield in compiler can be 128 where int128 type is supported. This kernel patch intends to support the new BTF encoding: $ pahole -JV t.o [1] TYPEDEF ___int type_id=2 [2] INT int size=4 bit_offset=0 nr_bits=32 encoding=SIGNED [3] ENUM A size=4 vlen=3 A1 val=0 A2 val=1 A3 val=2 [4] STRUCT t kind_flag=1 size=24 vlen=3 a type_id=5 bitfield_size=0 bits_offset=0 b type_id=1 bitfield_size=4 bits_offset=160 c type_id=7 bitfield_size=4 bits_offset=164 [5] ARRAY (anon) type_id=2 index_type_id=2 nr_elems=5 [6] INT sizetype size=8 bit_offset=0 nr_bits=64 encoding=(none) [7] VOLATILE (anon) type_id=3 Issue #2 and solution: ====================== Current forward type in BTF does not specify whether the original type is struct or union. This will not work for type pretty print and BTF-to-header-file conversion as struct/union must be specified. $ cat tt.c struct t; union u; int foo(struct t *t, union u *u) { return 0; } $ gcc -c -g -O2 tt.c $ pahole -JV tt.o [1] INT int size=4 bit_offset=0 nr_bits=32 encoding=SIGNED [2] FWD t type_id=0 [3] PTR (anon) type_id=2 [4] FWD u type_id=0 [5] PTR (anon) type_id=4 To fix this issue, similar to issue #1, type->info bit 31 is used. If the bit is set, it is union type. Otherwise, it is a struct type. $ pahole -JV tt.o [1] INT int size=4 bit_offset=0 nr_bits=32 encoding=SIGNED [2] FWD t kind_flag=0 type_id=0 [3] PTR (anon) kind_flag=0 type_id=2 [4] FWD u kind_flag=1 type_id=0 [5] PTR (anon) kind_flag=0 type_id=4 Pahole/LLVM change: =================== The new kind_flag functionality has been implemented in pahole and llvm: https://github.com/yonghong-song/pahole/tree/bitfield https://github.com/yonghong-song/llvm/tree/bitfield Note that pahole hasn't implemented func/func_proto kind and .BTF.ext. So to print function signature with bpftool, the llvm compiler should be used. Fixes: 69b693f0aefa ("bpf: btf: Introduce BPF Type Format (BTF)") Acked-by: Martin KaFai Lau Signed-off-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit f97be3ab044cf6dd342fed7668c977ba07a7cd95 Author: Yonghong Song Date: Sat Dec 15 22:13:50 2018 -0800 bpf: btf: refactor btf_int_bits_seq_show() Refactor function btf_int_bits_seq_show() by creating function btf_bitfield_seq_show() which has no dependence on btf and btf_type. The function btf_bitfield_seq_show() will be in later patch to directly dump bitfield member values. Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 26cb5a328c6b2bda9e859307ce4cfc60df3a2c28 Author: Al Viro Date: Fri Nov 9 22:26:42 2018 -0500 exofs_mount(): fix leaks on failure exits ... and don't abuse mount_nodev(), while we are at it. Signed-off-by: Al Viro Reviewed-by: David Howells commit 9580913966488dc78d8d2893c7427d0a84124e74 Author: Michał Mirosław Date: Mon Dec 17 20:28:15 2018 +0100 power: supply: bq25890: fix BAT_COMP field definition According to datasheet, BAT_COMP field spans bits 5-7. The rest of the code seems to assume this already. Fixes: 4aeae9cb0dad ("power_supply: Add support for TI BQ25890 charger chip") Signed-off-by: Michał Mirosław Signed-off-by: Sebastian Reichel commit 241faeceb849cb02c6439ecb2a08f14bf409dd30 Author: Phil Sutter Date: Wed Dec 12 19:29:07 2018 +0100 netfilter: nf_tables: Speed up selective rule dumps If just a table name was given, nf_tables_dump_rules() continued over the list of tables even after a match was found. The simple fix is to exit the loop if it reached the bottom and ctx->table was not NULL. When iterating over the table's chains, the same problem as above existed. But worse than that, if a chain name was given the hash table wasn't used to find the corresponding chain. Fix this by introducing a helper function iterating over a chain's rules (and taking care of the cb->args handling), then introduce a shortcut to it if a chain name was given. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit 8294059931448aa1ca112615bdffa3eab552c382 Author: Alin Nastac Date: Thu Dec 13 11:10:37 2018 +0100 netfilter: nf_nat_sip: fix RTP/RTCP source port translations Each media stream negotiation between 2 SIP peers will trigger creation of 4 different expectations (2 RTP and 2 RTCP): - INVITE will create expectations for the media packets sent by the called peer - reply to the INVITE will create expectations for media packets sent by the caller The dport used by these expectations usually match the ones selected by the SIP peers, but they might get translated due to conflicts with another expectation. When such event occur, it is important to do this translation in both directions, dport translation on the receiving path and sport translation on the sending path. This commit fixes the sport translation when the peer requiring it is also the one that starts the media stream. In this scenario, first media stream packet is forwarded from LAN to WAN and will rely on nf_nat_sip_expected() to do the necessary sport translation. However, the expectation matched by this packet does not contain the necessary information for doing SNAT, this data being stored in the paired expectation created by the sender's SIP message (INVITE or reply to it). Signed-off-by: Alin Nastac Signed-off-by: Pablo Neira Ayuso commit d6f0453391e042ba12f9571e6ded76c9e414d245 Author: Thierry Reding Date: Mon Dec 17 15:16:54 2018 +0100 i2c: tegra: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Thierry Reding Signed-off-by: Wolfram Sang commit 199fa087dc6b503baad06712716fac645a983e8a Author: Leon Romanovsky Date: Thu Dec 13 13:15:11 2018 +0200 net/mlx5: Continue driver initialization despite debugfs failure The failure to create debugfs entry is unpleasant event, but not enough to abort drier initialization. Align the mlx5_core code to debugfs design and continue execution whenever debugfs_create_dir() successes or not. Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 0604ee4aefa20f493a32dc223599f922fb615367 Author: Thierry Reding Date: Mon Dec 17 15:16:53 2018 +0100 i2c: tegra: Add missing kerneldoc for some fields Not all fields were properly documented. Add kerneldoc for the missing fields to prevent the build from flagging them. Reported-by: Wolfram Sang Signed-off-by: Thierry Reding Signed-off-by: Wolfram Sang commit 5cbabeec1eb758233b35683123de446a57852932 Author: Florian Westphal Date: Thu Dec 13 16:01:34 2018 +0100 netfilter: nat: remove nf_nat_l4proto struct This removes the (now empty) nf_nat_l4proto struct, all its instances and all the no longer needed runtime (un)register functionality. nf_nat_need_gre() can be axed as well: the module that calls it (to load the no-longer-existing nat_gre module) also calls other nat core functions. GRE nat is now always available if kernel is built with it. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit faec18dbb0405c7d4dda025054511dc3a6696918 Author: Florian Westphal Date: Thu Dec 13 16:01:33 2018 +0100 netfilter: nat: remove l4proto->manip_pkt This removes the last l4proto indirection, the two callers, the l3proto packet mangling helpers for ipv4 and ipv6, now call the nf_nat_l4proto_manip_pkt() helper. nf_nat_proto_{dccp,tcp,sctp,gre,icmp,icmpv6} are left behind, even though they contain no functionality anymore to not clutter this patch. Next patch will remove the empty files and the nf_nat_l4proto struct. nf_nat_proto_udp.c is renamed to nf_nat_proto.c, as it now contains the other nat manip functionality as well, not just udp and udplite. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 76b90019e03d866eab85cb57c2a6416ab94284dc Author: Florian Westphal Date: Thu Dec 13 16:01:32 2018 +0100 netfilter: nat: remove l4proto->nlattr_to_range all protocols did set this to nf_nat_l4proto_nlattr_to_range, so just call it directly. The important difference is that we'll now also call it for protocols that we don't support (i.e., nf_nat_proto_unknown did not provide .nlattr_to_range). However, there should be no harm, even icmp provided this callback. If we don't implement a specific l4nat for this, nothing would make use of this information, so adding a big switch/case construct listing all supported l4protocols seems a bit pointless. This change leaves a single function pointer in the l4proto struct. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit fe2d0020994cd9d4f451e3024109319af287413b Author: Florian Westphal Date: Thu Dec 13 16:01:31 2018 +0100 netfilter: nat: remove l4proto->in_range With exception of icmp, all of the l4 nat protocols set this to nf_nat_l4proto_in_range. Get rid of this and just check the l4proto in the caller. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 40e786bd296d5517b1f6c4bcc9ed13e502606ced Author: Florian Westphal Date: Thu Dec 13 16:01:30 2018 +0100 netfilter: nat: fold in_range indirection into caller No need for indirections here, we only support ipv4 and ipv6 and the called functions are very small. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 203f2e78200c27e42e9f7d063091f950bf5fe4a0 Author: Florian Westphal Date: Thu Dec 13 16:01:29 2018 +0100 netfilter: nat: remove l4proto->unique_tuple fold remaining users (icmp, icmpv6, gre) into nf_nat_l4proto_unique_tuple. The static-save of old incarnation of resolved key in gre and icmp is removed as well, just use the prandom based offset like the others. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 716b23c19edd47134104d39e3537d21c0b68d7d1 Author: Florian Westphal Date: Thu Dec 13 16:01:28 2018 +0100 netfilter: nat: un-export nf_nat_l4proto_unique_tuple almost all l4proto->unique_tuple implementations just call this helper, so make ->unique_tuple() optional and call its helper directly if the l4proto doesn't override it. This is an intermediate step to get rid of ->unique_tuple completely. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit c990bbafdb11c608bba2d529f72ded9bdff88678 Author: Thierry Reding Date: Mon Dec 17 15:16:52 2018 +0100 i2c: tegra: Cleanup kerneldoc comments Some of the kerneldoc uses a strange spelling for abbreviations. Turn them into all-uppercase and clean up some whitespace issues while at it. Signed-off-by: Thierry Reding Signed-off-by: Wolfram Sang commit 912da924a29fc6bd466b98a8791d6f7cf74caf61 Author: Florian Westphal Date: Thu Dec 13 16:01:27 2018 +0100 netfilter: remove NF_NAT_RANGE_PROTO_RANDOM support Historically this was net_random() based, and was then converted to a hash based algorithm (private boot seed + hash of endpoint addresses) due to concerns of leaking net_random() bits. RANDOM_FULLY mode was added later to avoid problems with hash based mode (see commit 34ce324019e76, "netfilter: nf_nat: add full port randomization support" for details). Just make prandom_u32() the default search starting point and get rid of ->secure_port() altogether. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit df7043bed47e0f525224c55c2e005c97f958d80d Author: Yafang Shao Date: Thu Dec 13 22:39:21 2018 +0800 netfilter: remove unused parameters in nf_ct_l4proto_[un]register_sysctl() These parameters aren't used now. So remove them. Signed-off-by: Yafang Shao Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit a504b703bb1da526a01593da0e4be2af9d9f5fa8 Author: Florian Westphal Date: Mon Dec 10 17:18:46 2018 +0100 netfilter: nat: limit port clash resolution attempts In case almost or all available ports are taken, clash resolution can take a very long time, resulting in soft lockup. This can happen when many to-be-natted hosts connect to same destination:port (e.g. a proxy) and all connections pass the same SNAT. Pick a random offset in the acceptable range, then try ever smaller number of adjacent port numbers, until either the limit is reached or a useable port was found. This results in at most 248 attempts (128 + 64 + 32 + 16 + 8, i.e. 4 restarts with new search offset) instead of 64000+, Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 89a5e15bcba87df5120d4656e0ff33d4f7cd6152 Author: Linus Walleij Date: Mon Dec 17 22:36:25 2018 +0100 gpio/mmc/of: Respect polarity in the device tree The device tree bindings for the MMC card detect and write protect lines specify that these should be active low unless "cd-inverted" or "wp-inverted" has been specified. However that is not how the kernel code has worked. It has always respected the flags passed to the phandle in the device tree, but respected the "cd-inverted" and "wp-inverted" flags such that if those are set, the polarity will be the inverse of that specified in the device tree. Switch to behaving like the old code did and fix the regression. Fixes: 81c85ec15a19 ("gpio: OF: Parse MMC-specific CD and WP properties") Cc: Bartosz Golaszewski Cc: Guenter Roeck Reported-by: Guenter Roeck Signed-off-by: Linus Walleij commit b635cbf68ff35817d5a1634b0ade41f96ef70daf Author: Xiaozhou Liu Date: Wed Dec 5 23:50:15 2018 +0800 netfilter: nat: remove unnecessary 'else if' branch Since a pseudo-random starting point is used in finding a port in the default case, that 'else if' branch above is no longer a necessity. So remove it to simplify code. Signed-off-by: Xiaozhou Liu Signed-off-by: Pablo Neira Ayuso commit 3035a66934dadca3a7d2dcd059af93ccf5f49715 Author: Adamski, Krzysztof (Nokia - PL/Wroclaw) Date: Thu Dec 13 12:09:38 2018 +0000 i2c: axxia: support sequence command mode In order to comply with SMBus specification, the Axxia I²C module will abort the multi message transfer if the delay between finishing sending one message and starting another is longer than 25ms. Unfortunately it isn't that hard to trigger this situation on a busy system. In order to fix this problem, we should make sure hardware does whole transaction without waiting for software to fill some data. Fortunately, in addition to Manual mode that is currently used by the driver to perform I²C transfers, the module supports also so called Sequence mode. In this mode, the module automatically performs predefined sequence of operations - it sends a slave address, transmits specified number of bytes from the FIFO, changes transfer direction, resends the slave address and then reads specified number of bytes to FIFO. While very inflexible, this does fit a most common case of multi message transfer - the one where you first write a register number you want to read and then read it. To use this mode effectively, a number of conditions must be met to ensure the transaction does fit the predefined sequence. In case this is not the case, a fallback to manual mode is used. The initialization of this mode is very similar to Manual mode. The most notable difference is different bit in the Master Interrupt Status designating finishing of transaction. Also some of the errors, like TSS, cannot happen in this mode. While it is possible to support transactions requesting a read of any size (RFL interrupt will be generated when FIFO size is not enough) the TFL interrupt is not available in this mode, thus the write part of the transaction cannot exceed FIFO_SIZE (8). Note that in case of a NAK during transaction, the NA/ND status bits will be set before STOP command is generated, triggering an interrupt while the controller is still busy. Current solution for this problem is to actively wait for this command to stop before leaving xfer callback. Signed-off-by: Krzysztof Adamski Reviewed-by: Alexander Sverdlin [wsa: added braces around else branch spotted by checkpatch] Signed-off-by: Wolfram Sang commit 03e6742584af8866ba014874669d0440bed3a623 Author: Thinh Nguyen Date: Mon Dec 10 14:08:01 2018 -0800 PCI: Override Synopsys USB 3.x HAPS device class Synopsys USB 3.x host HAPS platform has a class code of PCI_CLASS_SERIAL_USB_XHCI, and xhci driver can claim it. However, these devices should use dwc3-haps driver. Change these devices' class code to PCI_CLASS_SERIAL_USB_DEVICE to prevent the xhci-pci driver from claiming them. Signed-off-by: Thinh Nguyen Signed-off-by: Bjorn Helgaas commit b6061b1e566d70c7686d194a6c47dc6ffa665c77 Author: Thinh Nguyen Date: Mon Dec 10 14:07:54 2018 -0800 PCI: Move Synopsys HAPS platform device IDs Move Synopsys HAPS platform device IDs to pci_ids.h so that both drivers/pci/quirks.c and dwc3-haps driver can reference these IDs. Signed-off-by: Thinh Nguyen Signed-off-by: Bjorn Helgaas Acked-by: Felipe Balbi commit 1ccf1980e3e4853ecf11804774ef6ac071911150 Author: Fabrizio Castro Date: Thu Dec 13 20:19:02 2018 +0000 dt-bindings: i2c: rcar: Add r8a774c0 support Document RZ/G2E (R8A774C0) I2C compatibility with the relevant device dt-bindings. Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Wolfram Sang commit 3f74383f29ca2e0c7d9362c4c65a7c2cb4e1fd5f Author: Fabrizio Castro Date: Fri Dec 14 08:41:47 2018 +0000 dt-bindings: i2c: sh_mobile: Add r8a774c0 support Document RZ/G2E (R8A774C0) SoC bindings. Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Wolfram Sang commit 51243b73455f2d12cb82abffa7bc9028aec656e0 Author: Fabrizio Castro Date: Thu Dec 13 20:22:34 2018 +0000 i2c: sh_mobile: Add support for r8a774c0 (RZ/G2E) Similarly to R-Car E3, RZ/G2E doesn't come with automatic transmission registers, as such it is not considered compatible with the existing fallback bindings. Add SoC specific binding compatibility to allow for later support for automatic transmission. Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Wolfram Sang commit 0cb47164ed0c4f8133cc44915095a622f1293696 Merge: 02d26b9a57fae 37cf28d3b5bca Author: Wolfram Sang Date: Mon Dec 17 23:14:10 2018 +0100 Merge tag 'at24-4.21-updates-for-wolfram' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-5.0 at24: updates for 4.21 Adding a new compatible for 24c2048. commit 9b4924da4711674e62d97d4f5360446cc78337af Author: Martin Schiller Date: Fri Dec 14 08:48:25 2018 +0100 pinctrl: xway: fix gpio-hog related boot issues This patch is based on commit a86caa9ba5d7 ("pinctrl: msm: fix gpio-hog related boot issues"). It fixes the issue that the gpio ranges needs to be defined before gpiochip_add(). Therefore, we also have to swap the order of registering the pinctrl driver and registering the gpio chip. You also have to add the "gpio-ranges" property to the pinctrl device node to get it finally working. Signed-off-by: Martin Schiller Acked-by: John Crispin Signed-off-by: Linus Walleij commit c7f7e58fcbf33589f11bfde0506e076a00627e59 Author: Thiago Jung Bauermann Date: Wed Dec 12 23:39:09 2018 -0200 integrity: Remove references to module keyring From what I can tell, it has never been used. Mimi: This was introduced prior to Rusty's decision to use appended signatures for kernel modules. Signed-off-by: Thiago Jung Bauermann Acked-by: Mimi Zohar Signed-off-by: James Morris commit 02d26b9a57faeb600f4b6d39a5c417f959e8e503 Author: Enric Balletbo i Serra Date: Wed Jun 6 17:09:00 2018 +0200 i2c: i2c-cros-ec-tunnel: Switch to SPDX identifier. Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Enric Balletbo i Serra Signed-off-by: Wolfram Sang commit 12d6dd06989171ba9486790116832a65c5316fb1 Author: Fabrizio Castro Date: Thu Dec 13 20:18:14 2018 +0000 dt-bindings: gpio: rcar: Add r8a774c0 (RZ/G2E) support Document Renesas' RZ/G2E (R8A774C0) GPIO blocks compatibility within the relevant dt-bindings. Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Linus Walleij commit a0752e9c3097b2c4fccd618802938e0951038dfa Author: Linus Walleij Date: Mon Dec 17 14:11:08 2018 +0100 memory: omap-gpmc: Get the header of the enum Commit 21abf103818a ("gpio: Pass a flag to gpiochip_request_own_desc()") started to pass an enum gpiod_flags but this file is not including the header file that defines that enum and the compiler spits: drivers/memory/omap-gpmc.c: In function 'gpmc_probe_generic_child': drivers/memory/omap-gpmc.c:2174:9: error: type of formal parameter 4 is incomplete 0); ^ Cc: Ladislav Michl Cc: Janusz Krzysztofik Reported-by: Stephen Rothwell Fixes: 21abf103818a ("gpio: Pass a flag to gpiochip_request_own_desc()") Acked-by: Tony Lindgren Signed-off-by: Linus Walleij commit d6543c0f3964f20cd6f585d4794d07b7b31207c0 Author: Linus Walleij Date: Sat Dec 15 12:50:59 2018 +0100 ARM: omap1: Fix new user of gpiochip_request_own_desc() This fixes up a new user of gpiochip_request_own_desc() in the AMS Delta board that appeared after the patch that was applied recently. Fixes: 21abf103818a ("gpio: Pass a flag to gpiochip_request_own_desc()") Reviewed-by: Janusz Krzysztofik Acked-by: Tony Lindgren Signed-off-by: Linus Walleij commit af5395c214c15c18de3decf2229373a8c88c4fde Author: Max Filippov Date: Sun Nov 11 21:51:49 2018 -0800 xtensa: implement syscall tracepoints Add TIF_SYSCALL_TRACEPOINT flag definition; add _TIF_SYSCALL_TRACEPOINT to _TIF_WORK_MASK. Call trace_sys_enter from do_syscall_trace_enter and trace_sys_exit from do_syscall_trace_leave when TIF_SYSCALL_TRACEPOINT flag is set. Add declaration of sys_call_table to arch/xtensa/include/asm/syscall.h Add definition of NR_syscalls to arch/xtensa/include/asm/unistd.h Select HAVE_SYSCALL_TRACEPOINTS. This change allows tracing each syscall entry and exit through the ftrace mechanism. Signed-off-by: Max Filippov commit 9f24f3c1067c8e4ffbbcd759180b422c9a761b1b Author: Max Filippov Date: Fri Nov 9 15:45:53 2018 -0800 xtensa: implement tracehook functions and enable HAVE_ARCH_TRACEHOOK Implement syscall_get_nr, syscall_rollback, syscall_get_error, syscall_{get,set}_return_value and syscall_{get,set}_arguments. Select HAVE_ARCH_TRACEHOOK as Xtensa now has all support for that. Signed-off-by: Max Filippov commit 921534473a6bc2ff822f19c222970d213d2e0f76 Author: Max Filippov Date: Tue Nov 20 20:09:58 2018 -0800 xtensa: enable CORE_DUMP_USE_REGSET Drop xtensa_elf_core_copy_regs function, ELF_CORE_COPY_REGS macro, and dump_fpu function. Define CORE_DUMP_USE_REGSET to make ELF core dumper use regset interface. Signed-off-by: Max Filippov commit 1819afcc0b1327a470898e0a76100884969aff17 Author: Max Filippov Date: Sat Nov 24 21:36:11 2018 -0800 xtensa: implement TIE regset Put all coprocessors and non-coprocessor TIE state into the REGSET_TIE. Mark TIE regset with NT_PRFPREG note type. Reimplement ptrace_getxregs and ptrace_setxregs using REGSET_TIE. Signed-off-by: Max Filippov commit 06fbac8e8971f2fa526e189304dd95ee62f39dbe Author: Max Filippov Date: Fri Nov 9 19:32:06 2018 -0800 xtensa: implement task_user_regset_view - define struct user_pt_regs in the arch/xtensa/include/uapi/asm/ptrace.h with the same layout as xtensa_gregset_t; make xtensa_gregset_t a typedef; - define REGSET_GPR regset, implement register get and set functions; - define task_user_regset_view function and expose REGSET_GPR. Signed-off-by: Max Filippov commit 3aee3e25deeab083df21012060c98e9987ac9177 Author: Max Filippov Date: Thu Nov 15 19:33:47 2018 -0800 xtensa: call do_syscall_trace_{enter,leave} selectively Check whether calls to do_syscall_trace_{enter,leave} are necessary in the system_call function. Define _TIF_WORK_MASK to a bitmask of flags that reuire the calls. Fix comment. Signed-off-by: Max Filippov commit 6a986984b63990c80252b2208036fe731a6ae113 Author: Max Filippov Date: Fri Nov 9 15:43:14 2018 -0800 xtensa: use NO_SYSCALL instead of -1 For the sake of clarity define macro NO_SYSCALL and use it for setting/checking struct pt_regs::syscall field. Signed-off-by: Max Filippov commit 98c3115a4ec56f03056efd9295e0fcb4c5c57a85 Author: Dmitry V. Levin Date: Tue Nov 20 03:17:01 2018 +0300 xtensa: define syscall_get_arch() syscall_get_arch() is required to be implemented on all architectures in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Signed-off-by: Dmitry V. Levin Acked-by: Max Filippov Signed-off-by: Max Filippov commit b61c41c28eb09ae1bb02479a8f65171c037124c6 Author: Dmitry V. Levin Date: Thu Dec 13 20:23:26 2018 +0300 Move EM_XTENSA to uapi/linux/elf-em.h This should never have been defined in the arch tree to begin with, and now uapi/linux/audit.h header is going to use EM_XTENSA in order to define AUDIT_ARCH_XTENSA which is needed to implement syscall_get_arch() which in turn is required to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Cc: Max Filippov Cc: Oleg Nesterov Cc: Andy Lutomirski Cc: Elvira Khabirova Cc: Eugene Syromyatnikov Cc: Chris Zankel Cc: linux-xtensa@linux-xtensa.org Signed-off-by: Dmitry V. Levin Signed-off-by: Max Filippov commit 6c4fc209fcf9d27efbaa48368773e4d2bfbd59aa Author: Daniel Borkmann Date: Sun Dec 16 00:49:47 2018 +0100 bpf: remove useless version check for prog load Existing libraries and tracing frameworks work around this kernel version check by automatically deriving the kernel version from uname(3) or similar such that the user does not need to do it manually; these workarounds also make the version check useless at the same time. Moreover, most other BPF tracing types enabling bpf_probe_read()-like functionality have /not/ adapted this check, and in general these days it is well understood anyway that all the tracing programs are not stable with regards to future kernels as kernel internal data structures are subject to change from release to release. Back at last netconf we discussed [0] and agreed to remove this check from bpf_prog_load() and instead document it here in the uapi header that there is no such guarantee for stable API for these programs. [0] http://vger.kernel.org/netconf2018_files/DanielBorkmann_netconf2018.pdf Signed-off-by: Daniel Borkmann Acked-by: Alexei Starovoitov Acked-by: Quentin Monnet Signed-off-by: Alexei Starovoitov commit b5c8f358ce7c0cd1bd821962ccb2c7fd050e9339 Author: Anson Huang Date: Mon Dec 17 04:47:40 2018 +0000 dt-bindings: iio: magnetometer: add dt-bindings for freescale mag3110 Add Freescale MAG3110 dt-bindings and remove it from trivial-devices dt-bingding doc. Signed-off-by: Anson Huang [robh: fixup trivial-devices.txt change for trivial-devices.yaml] Signed-off-by: Rob Herring commit 3c259a1c36636553934d01562211ee8e86fc8079 Author: Frederick Lawler Date: Sun Dec 9 16:45:50 2018 -0600 PCI/ASPM: Remove unused lists from struct pcie_link_state ASPM does not make use of the children or link LIST_HEADs declared in struct pcie_link_state and defined in alloc_pcie_link_state(). Therefore, remove these lists. No functional change intended. Signed-off-by: Frederick Lawler Signed-off-by: Bjorn Helgaas commit 38b11beb73c52bd6fb3920775887fdd1004f2a68 Author: Sakari Ailus Date: Thu Dec 13 04:45:17 2018 -0500 media: staging/ipu3-imgu: Add MAINTAINERS entry Add a MAINTAINERS entry for the ImgU driver. Signed-off-by: Sakari Ailus Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 5e44465ccf7a6f088a7e94856d49ebecda12083f Author: Sakari Ailus Date: Thu Dec 13 04:36:51 2018 -0500 media: staging/ipu3-imgu: Address documentation comments Address comments on the documentation after Yong's original patch. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit d0276a2b830301e2320a96b458973cfe2af0f610 Author: Yong Zhi Date: Thu Dec 6 20:03:40 2018 -0500 media: v4l: Add Intel IPU3 meta buffer formats Add IPU3-specific meta formats for processing parameters and 3A statistics. V4L2_META_FMT_IPU3_PARAMS V4L2_META_FMT_IPU3_STAT_3A Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 34fc0e1bf89208a8ca7f86d14fb1ff1b081c3f3d Author: Rajmohan Mani Date: Thu Dec 6 20:03:42 2018 -0500 media: doc-rst: Add Intel IPU3 documentation This patch adds the details about the IPU3 Imaging Unit driver (both CIO2 and IMGU). Signed-off-by: Rajmohan Mani Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit d84273453689038be914a31b28f372147ceafee6 Author: Sakari Ailus Date: Wed Dec 12 06:13:10 2018 -0500 media: ipu3-imgu: Fix firmware binary location The firmware binary is located under "intel" directory in the linux-firmware repository. Reflect this in the driver. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit faa9ce7c59a756dccb9fbc5a1dcabb143ddb6287 Author: Sakari Ailus Date: Mon Dec 10 03:59:51 2018 -0500 media: ipu3-imgu: Fix compiler warnings Address a few false positive compiler warnings related to uninitialised variables. While at it, use bool where bool is needed and %u to print an unsigned integer. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 51abe041c5ed56efbdd944cbd45d27e2cd711406 Author: Bingbu Cao Date: Thu Dec 6 20:03:39 2018 -0500 media: staging/intel-ipu3: Add dual pipe support This patch adds support to run dual pipes simultaneously. A private ioctl to configure the pipe mode (video or still) is also implemented. IPU3 hardware supports a maximum of 2 streams per pipe. With the support of dual pipes, more than 2 stream outputs can be achieved. This helps to support advanced camera features like Continuous View Finder (CVF) and Snapshot During Video(SDV). Extend ipu3 IMGU driver to support dual pipes 1. Extend current IMGU device to contain 2 groups of video nodes and 2 subdevs 2. Extend current css to support 2 pipeline and make CSS APIs to support 2 pipe 3. Add a v4l2 ctrl to allow user to specify the mode of the pipe 4. Check media pipeline link status to get enabled pipes Signed-off-by: Bingbu Cao Signed-off-by: Tian Shu Qiu Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit daad52c8aa4fcf27d2e8b69daf851d82c141fd2f Author: Mauro Carvalho Chehab Date: Fri Dec 7 08:07:55 2018 -0500 media: drxk_hard: check if parameter is not NULL There is a smatch warning: drivers/media/dvb-frontends/drxk_hard.c: drivers/media/dvb-frontends/drxk_hard.c:1478 scu_command() error: we previously assumed 'parameter' could be null (see line 1467) Telling that parameter might be NULL. Well, it can't, due to the way the driver works, but it doesn't hurt to add a check, in order to shut up smatch. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Nick Desaulniers Signed-off-by: Mauro Carvalho Chehab commit 55b8cbe470d103b44104c64dbf89e5cad525d4e0 Merge: d63962e38cc0a 4fc96ee9085d3 Author: James Morris Date: Mon Dec 17 11:36:26 2018 -0800 Merge tag 'seccomp-next-part2' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux into next-seccomp seccomp fixes for sparse warnings and s390 build (Tycho) commit 4e460f656e9c8756fae32440ef3f6887e2ed4808 Author: Max Filippov Date: Fri Dec 14 14:41:58 2018 -0800 xtensa: support memtest Call early_memtest from the bootmem_init to run memtest if it's configured and enabled. Signed-off-by: Max Filippov commit 0db51ef26e87845d1748c363702585e2f0a06266 Merge: 8bd8ea195f6d1 9488585b21bef Author: James Morris Date: Mon Dec 17 11:31:58 2018 -0800 Merge tag 'tpmdd-next-20181217' of git://git.infradead.org/users/jjs/linux-tpmdd into next-tpm tpmdd updates for Linux v4.21 From Jarkko: v4.21 updates: * Support for partial reads of /dev/tpm0. * Clean up for TPM 1.x code: move the commands to tpm1-cmd.c and make everything to use the same data structure for building TPM commands i.e. struct tpm_buf. commit 5580b4a1a8ca85c53bd5b94c5d302e47dca3e5cb Merge: 8bd8ea195f6d1 eed9de3b4f471 Author: James Morris Date: Mon Dec 17 11:26:46 2018 -0800 Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity into next-integrity From Mimi: In Linux 4.19, a new LSM hook named security_kernel_load_data was upstreamed, allowing LSMs and IMA to prevent the kexec_load syscall.  Different signature verification methods exist for verifying the kexec'ed kernel image.  This pull request adds additional support in IMA to prevent loading unsigned kernel images via the kexec_load syscall, independently of the IMA policy rules, based on the runtime "secure boot" flag.  An initial IMA kselftest is included. In addition, this pull request defines a new, separate keyring named ".platform" for storing the preboot/firmware keys needed for verifying the kexec'ed kernel image's signature and includes the associated IMA kexec usage of the ".platform" keyring. (David Howell's and Josh Boyer's patches for reading the preboot/firmware keys, which were previously posted for a different use case scenario, are included here.) commit a28777f250311ac574237e6145ac72c7b3b7b049 Author: Joakim Tjernlund Date: Fri Dec 14 15:17:08 2018 +0100 ucc_geth: Add change_carrier() for Fixed PHYs This allows to control carrier from /sys/class/net/ethX/carrier for Fixed PHYs. Signed-off-by: Joakim Tjernlund Signed-off-by: David S. Miller commit 6211d46713c5dc62bb87dff208134b253ff5e128 Author: Joakim Tjernlund Date: Fri Dec 14 15:17:07 2018 +0100 gianfar: Add change_carrier() for Fixed PHYs This allows to control carrier from /sys/class/net/ethX/carrier for Fixed PHYs. Signed-off-by: Joakim Tjernlund Signed-off-by: David S. Miller commit 6e8b0ff1ba4cc145a8fb13a3212de0f75d5f043c Author: Joakim Tjernlund Date: Fri Dec 14 15:17:06 2018 +0100 dpaa_eth: Add change_carrier() for Fixed PHYs This allows to control carrier from /sys/class/net/ethX/carrier for Fixed PHYs. Signed-off-by: Joakim Tjernlund Signed-off-by: David S. Miller commit b3e5464e36c07dba70b544044a297d5819351765 Author: Joakim Tjernlund Date: Fri Dec 14 15:17:05 2018 +0100 Fixed PHY: Add fixed_phy_change_carrier() Drivers can use this as .ndo_change_carrier() to change carrier via /sys/class/net/ethX/carrier. Signed-off-by: Joakim Tjernlund Signed-off-by: David S. Miller commit 8bd8ea195f6d135a8d85201116314eb5237ad7e7 Merge: 1072bd678547f 7566ec393f416 Author: James Morris Date: Mon Dec 17 11:24:28 2018 -0800 Merge tag 'v4.20-rc7' into next-general Sync with Linux 4.20-rc7, to pick up: Revert "ovl: relax permission checking on underlying layers" commit 74ebbdda7cecf789661c208faccbeef10a7f05da Author: Marek Szyprowski Date: Fri Dec 14 12:34:10 2018 +0100 arm64: dts: exynos: Add Bluetooth chip to TM2(e) boards TM2(e) boards have a Broadcom Bluetooth chip connected to 3rd UART port. Add a device tree node describing it and its resources (control GPIO lines and clock). Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit 4beaacc6fea5a5ec43c55c22a6c83c03a5ecc775 Author: Eric Dumazet Date: Thu Dec 13 03:03:37 2018 -0800 net/mlx4_en: remove fallback after kzalloc_node() kzalloc_node(..., GFP_KERNEL, node) will attempt to allocate memory as close as possible to the node. There is no need to fallback to kzalloc() if this has failed. Signed-off-by: Eric Dumazet Cc: Tariq Toukan Signed-off-by: David S. Miller commit 580d48573c43211fe51f411d484dbb693cc93f7c Author: Yangtao Li Date: Sat Dec 15 03:41:19 2018 -0500 regmap: debugfs: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Mark Brown commit 32fa7b852feaf838a145ac0408ad0a14d24d2eec Author: Yangtao Li Date: Sat Dec 15 03:38:37 2018 -0500 regmap: rbtree: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Mark Brown commit ff9b85de5d5d292fa07869f194fd9e3966f1e720 Author: Or Gerlitz Date: Tue Nov 6 19:49:22 2018 +0200 net/mlx5e: Add some ethtool port control entries to the uplink rep netdev Some of the ethtool entries to control the port should be supported by the uplink rep netdev in switchdev mode, add them. While here, add also the get/set coalesce entries for all reps. Signed-off-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 371289b61ac1ac890c7e98b1bfd3b8f32e38efae Author: Or Gerlitz Date: Tue Nov 6 19:31:10 2018 +0200 net/mlx5e: Expose ethtool pause and link functions to mlx5e callers Towards supporting set/get of global pause for the port and get of the port link ksetting from the uplink representor, expose the relevant entries to other mlx5 callers. Signed-off-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 073caf508822750cde02086a6ac1b9131e69692c Author: Or Gerlitz Date: Thu Nov 1 19:14:21 2018 +0200 net/mlx5e: Add sriov and udp tunnel ndo support for the uplink rep Some of the sriov ndo calls are needed also on the switchdev mode - e.g setup VF mac and reading vport stats. Add them to the uplink rep netdev ops. Same for the UDP tunnel ones, need them there to identify offloaded udp tunnel ports. Signed-off-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit b36cdb42ad4b114d4b9bbba8770d7a4b8e1a62f6 Author: Or Gerlitz Date: Thu Nov 8 20:42:55 2018 +0200 net/mlx5e: Handle port mtu/link, dcb and lag for uplink reps Take care of setup/teardown for the port link, dcb, lag as well as dealing with port mtu and carrier for e-switch uplink representors. This is achieved by adding a dedicated profile instance for uplink representors which includes the enable/disable and more profile routines which are invoked by the general mlx5e code for netdev attach/detach. Signed-off-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit aec002f6f82cbfb39f92605614a88dd7a200a766 Author: Or Gerlitz Date: Wed Nov 7 16:34:52 2018 +0200 net/mlx5e: Uninstantiate esw manager vport netdev on switchdev mode Now, when we have a dedicated uplink representor, the netdev instance set over the esw manager vport (PF) is of no-use. As such, remove it once we're on switchdev mode and get it back to life when off switchdev. This is done by reloading the Ethernet interface as well (we already do that for the IB interface) from the eswitch code while going in/out of switchdev mode. The Eth add/remove entries are modified to act differently when called in switchdev mode. In this case we only deal with registration of the eth vport representors. The rep netdevices are created from the eswitch call to load the registered eth representors. Signed-off-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 13e509a4c1949855ddd5ef2e23bafdfb27b8337a Author: Or Gerlitz Date: Tue Feb 13 18:14:42 2018 +0200 net/mlx5e: Remove leftover code from the PF netdev being uplink rep Remove some last leftovers from using the PF netdev as the e-switch uplink representor. Signed-off-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit d9ee0491c2ffbb5bc8bc418dd857a045d0d0130f Author: Or Gerlitz Date: Tue Feb 13 15:48:30 2018 +0200 net/mlx5e: Use dedicated uplink vport netdev representor Currently, when running in sriov switchdev mode, we are using the PF netdevice as the uplink representor, this is problematic from few aspects: - will break when the PF isn't eswitch manager (e.g smart NIC env) - misalignment with other NIC switchdev drivers - makes us have and maintain special code, hurts the driver quality/robustness - which in turn opens the door for future bugs As of each and all of the above, we move to have a dedicated netdev representor for the uplink vport in a similar manner done for for the VF vports. This includes the following: 1. have an uplink rep netdev as we have for VF reps 2. all reps use same load/unload functions 3. HW stats for uplink based on physical port counters and not vport counters 4. link state for the uplink managed through PAOS and not vport state 5. the uplink rep has sysfs link to the PF PCI function && uses the PF MAC address Signed-off-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 025380b20dc2a3b92a36394799157a63a2fe5814 Author: Or Gerlitz Date: Wed Nov 28 18:56:41 2018 +0200 net/mlx5e: Use single argument for the esw representor build params helper This is prep step towards adding dedicated uplink representor. The patch doesn't change any functionality. Signed-off-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 915fe1a0d9cbf6d7657b388833dbcae13d22a567 Author: Or Gerlitz Date: Tue Nov 13 11:09:30 2018 +0200 net/mlx5: E-Switch, Remove redundant reloading of the IB interface The reload of the IB interface done on the offloads stop call is redundant b/c we do that on mlx5_eswitch_disable_sriov(), remove it. Signed-off-by: Or Gerlitz Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 7ba12bb676c2f7848a53224f9a65c6ef256bb3b6 Author: Anup Patel Date: Tue Dec 4 19:25:07 2018 +0530 RISC-V: Remove EARLY_PRINTK support The EARLY_PRINTK using SBI console calls is not required any more because we now have RISC-V SBI support in generic earlycon framework. Signed-off-by: Anup Patel Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt commit 2b3f786408c5400705ed722ab2f3065e86272857 Author: Anup Patel Date: Tue Dec 4 19:25:06 2018 +0530 RISC-V: defconfig: Enable RISC-V SBI earlycon support This patch enables RISC-V SBI earlycon support in default defconfig so that we can use "earlycon=sbi" in kernel parameters for early debug prints. Signed-off-by: Anup Patel Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt commit 028713aa8389d960cb1935a9954327bdaa163cf8 Author: Jiri Olsa Date: Wed Dec 5 17:05:09 2018 +0100 perf trace: Add ordered processing Sort events to provide the precise outcome of ordered events, just like is done with 'perf report' and 'perf top'. Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Dmitry Levin Cc: Eugene Syromiatnikov Cc: Frederic Weisbecker Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Steven Rostedt (VMware) Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20181205160509.1168-9-jolsa@kernel.org [ split from a larger patch, added trace__ prefixes to new 'struct trace' methods ] Signed-off-by: Arnaldo Carvalho de Melo commit e5edd5f298fafda28284bafb8371e6f0b7681035 Author: Ming Lei Date: Tue Dec 18 01:28:56 2018 +0800 blk-mq: skip zero-queue maps in blk_mq_map_swqueue From 7e849dd9cf37 ("nvme-pci: don't share queue maps"), the mapping table won't be initialized actually if map->nr_queues is zero, so we can't use blk_mq_map_queue_type() to retrieve hctx any more. This way still may cause broken mapping, fix it by skipping zero-queues maps in blk_mq_map_swqueue(). Cc: Jeff Moyer Cc: Mike Snitzer Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 13369816cb648f897ce9cbf57e55eeb742ce4eb3 Author: Dennis Zhou Date: Mon Dec 17 11:03:51 2018 -0500 block: fix blk-iolatency accounting underflow The blk-iolatency controller measures the time from rq_qos_throttle() to rq_qos_done_bio() and attributes this time to the first bio that needs to create the request. This means if a bio is plug-mergeable or bio-mergeable, it gets to bypass the blk-iolatency controller. The recent series [1], to tag all bios w/ blkgs undermined how iolatency was determining which bios it was charging and should process in rq_qos_done_bio(). Because all bios are being tagged, this caused the atomic_t for the struct rq_wait inflight count to underflow and result in a stall. This patch adds a new flag BIO_TRACKED to let controllers know that a bio is going through the rq_qos path. blk-iolatency now checks if this flag is set to see if it should process the bio in rq_qos_done_bio(). Overloading BLK_QUEUE_ENTERED works, but makes the flag rules confusing. BIO_THROTTLED was another candidate, but the flag is set for all bios that have gone through blk-throttle code. Overloading a flag comes with the burden of making sure that when either implementation changes, a change in setting rules for one doesn't cause a bug in the other. So here, we unfortunately opt for adding a new flag. [1] https://lore.kernel.org/lkml/20181205171039.73066-1-dennis@kernel.org/ Fixes: 5cdf2e3fea5e ("blkcg: associate blkg when associating a device") Signed-off-by: Dennis Zhou Cc: Josef Bacik Signed-off-by: Jens Axboe commit c16d6b5a9f47d0e581882269fca1d73be60208b2 Author: Ming Lei Date: Mon Dec 17 08:44:05 2018 -0700 blk-mq: fix dispatch from sw queue When a request is added to rq list of sw queue(ctx), the rq may be from a different type of hctx, especially after multi queue mapping is introduced. So when dispach request from sw queue via blk_mq_flush_busy_ctxs() or blk_mq_dequeue_from_ctx(), one request belonging to other queue type of hctx can be dispatched to current hctx in case that read queue or poll queue is enabled. This patch fixes this issue by introducing per-queue-type list. Cc: Christoph Hellwig Signed-off-by: Ming Lei Changed by me to not use separately cacheline aligned lists, just place them all in the same cacheline where we had just the one list and lock before. Signed-off-by: Jens Axboe commit 7211aef86f79583e59b88a0aba0bc830566f7e8e Author: Damien Le Moal Date: Mon Dec 17 15:14:05 2018 +0900 block: mq-deadline: Fix write completion handling For a zoned block device using mq-deadline, if a write request for a zone is received while another write was already dispatched for the same zone, dd_dispatch_request() will return NULL and the newly inserted write request is kept in the scheduler queue waiting for the ongoing zone write to complete. With this behavior, when no other request has been dispatched, rq_list in blk_mq_sched_dispatch_requests() is empty and blk_mq_sched_mark_restart_hctx() not called. This in turn leads to __blk_mq_free_request() call of blk_mq_sched_restart() to not run the queue when the already dispatched write request completes. The newly dispatched request stays stuck in the scheduler queue until eventually another request is submitted. This problem does not affect SCSI disk as the SCSI stack handles queue restart on request completion. However, this problem is can be triggered the nullblk driver with zoned mode enabled. Fix this by always requesting a queue restart in dd_dispatch_request() if no request was dispatched while WRITE requests are queued. Fixes: 5700f69178e9 ("mq-deadline: Introduce zone locking support") Cc: Signed-off-by: Damien Le Moal Add missing export of blk_mq_sched_restart() Signed-off-by: Jens Axboe commit 8ba35b3a0046d6573c98f00461d9bd1b86250d35 Author: Nathan Chancellor Date: Fri Oct 19 11:04:27 2018 -0700 vfio-mdev/samples: Use u8 instead of char for handle functions Clang warns: samples/vfio-mdev/mtty.c:592:39: warning: implicit conversion from 'int' to 'char' changes value from 162 to -94 [-Wconstant-conversion] *buf = UART_MSR_DSR | UART_MSR_DDSR | UART_MSR_DCD; ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ 1 warning generated. Turns out that all uses of buf in this function ultimately end up stored or cast to an unsigned type. Just use u8, which has the same number of bits but can store this larger number so Clang no longer warns. Signed-off-by: Nathan Chancellor Signed-off-by: Alex Williamson commit 83356b3d124af5ae472ce1358222f6b7749d2322 Author: Jiri Olsa Date: Thu Dec 6 14:38:52 2018 -0300 perf ordered_events: Add first_time() method To get the timestamp in the first event in the queue. Signed-off-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Dmitry Levin Cc: Eugene Syromiatnikov Cc: Frederic Weisbecker Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Steven Rostedt (VMware) Cc: Thomas Gleixner Link: https://lkml.kernel.org/n/tip-appp27jw1ul8kgg872j43r5o@git.kernel.org [ split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo commit 1f44b3e2fc5d7a2c5f6d1e67c80ebc226d6bd25f Author: Jiri Olsa Date: Wed Dec 5 17:05:08 2018 +0100 perf trace: Move event delivery to a new deliver_event() function Mov event delivery code to a new trace__deliver_event() function, so it's easier to add ordered delivery coming in the following patches. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Dmitry Levin Cc: Eugene Syromiatnikov Cc: Frederic Weisbecker Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Steven Rostedt (VMware) Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20181205160509.1168-8-jolsa@kernel.org [ Add trace__ prefix to the deliver_event method ] Signed-off-by: Arnaldo Carvalho de Melo commit 68ca5d07de207e56f57e887de23b03fbc1ebc2a6 Author: Jiri Olsa Date: Wed Dec 5 17:05:07 2018 +0100 perf ordered_events: Add ordered_events__flush_time interface Add OE_FLUSH__TIME flush type, to be able to flush only certain amount of the queue based on the provided timestamp. It will be used in the following patches. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Dmitry Levin Cc: Eugene Syromiatnikov Cc: Frederic Weisbecker Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Steven Rostedt (VMware) Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20181205160509.1168-7-jolsa@kernel.org [ Fix the build on older systems such as centos 5 and 6 where 'time' shadows a global declaration ] Signed-off-by: Arnaldo Carvalho de Melo commit 6d99a79cb40da3eddafef844b7a679fe5162f224 Author: Eugeniy Paltsev Date: Tue Dec 4 20:51:18 2018 +0300 perf annotate: Introduce basic support for ARC Introduce basic 'perf annotate' support for ARC to be able to use anotation via stdio interface. Signed-off-by: Eugeniy Paltsev Cc: Alexander Shishkin Cc: Alexey Brodkin Cc: Jiri Olsa Cc: linux-snps-arc@lists.infradead.org Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Vineet Gupta Link: http://lkml.kernel.org/r/20181204175118.25232-1-Eugeniy.Paltsev@synopsys.com Signed-off-by: Arnaldo Carvalho de Melo commit 75c375c0ae7cc75cec6683ee2539937c60c3e4af Author: Sihyeon Jang Date: Sun Dec 2 00:46:03 2018 +0900 perf config: Modify size factor of snprintf According to definition of snprintf, it gets size factor including null('\0') byte. So '-1' is not neccessary. Also it will be helpful unfied style with other cases. (eg. builtin-script.c) Signed-off-by: Sihyeon Jang Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20181201154603.10093-1-uneedsihyeon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit c8dd6ee51a4d0a119c8b4121d83008215e3209ed Author: Alexey Budankov Date: Wed Dec 5 20:19:41 2018 +0300 perf record: Fix memory leak on AIO objects deallocation Sending a part which was missed between v12 and v13 of the patch set introducing AIO trace streaming for perf record mode. The part is essential to avoid memory leakage during deallocation of AIO related trace data buffers. Signed-off-by: Alexey Budankov Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/e5d3154e-1583-83bb-9527-28ddbc6dbf9d@linux.intel.com [ No need to test for NULL before calling zfree() ] Signed-off-by: Arnaldo Carvalho de Melo commit 91b2b97025097ce7ca7536bc87eba2bf14760fb4 Author: Andi Kleen Date: Mon Nov 19 21:06:35 2018 -0800 perf vendor events intel: Fix Load_Miss_Real_Latency on SKL/SKX Fix incorrect event names for the Load_Miss_Real_Latency metric for Skylake and Skylake Server. Fixes https://github.com/andikleen/pmu-tools/issues/158 Before: % perf stat -M Load_Miss_Real_Latency true event syntax error: '..ss.pending,mem_load_retired.l1_miss_ps,mem_load_retired.fb_hit_ps}:W' \___ parser error Usage: perf stat [] [] -M, --metrics monitor specified metrics or metric groups (separated by ,) After: % perf stat -M Load_Miss_Real_Latency true Performance counter stats for 'true': 279,204 l1d_pend_miss.pending # 14.0 Load_Miss_Real_Latency 4,784 mem_load_uops_retired.l1_miss 15,188 mem_load_uops_retired.hit_lfb 0.000899640 seconds time elapsed Signed-off-by: Andi Kleen Acked-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Link: http://lkml.kernel.org/r/20181120050635.4215-1-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo commit bd8d57fb7e25e9fcf67a9eef5fa13aabe2016e07 Author: Arnaldo Carvalho de Melo Date: Thu Dec 6 13:52:13 2018 -0300 perf parse-events: Fix unchecked usage of strncpy() The strncpy() function may leave the destination string buffer unterminated, better use strlcpy() that we have a __weak fallback implementation for systems without it. This fixes this warning on an Alpine Linux Edge system with gcc 8.2: util/parse-events.c: In function 'print_symbol_events': util/parse-events.c:2465:4: error: 'strncpy' specified bound 100 equals destination size [-Werror=stringop-truncation] strncpy(name, syms->symbol, MAX_NAME_LEN); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function 'print_symbol_events.constprop', inlined from 'print_events' at util/parse-events.c:2508:2: util/parse-events.c:2465:4: error: 'strncpy' specified bound 100 equals destination size [-Werror=stringop-truncation] strncpy(name, syms->symbol, MAX_NAME_LEN); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In function 'print_symbol_events.constprop', inlined from 'print_events' at util/parse-events.c:2511:2: util/parse-events.c:2465:4: error: 'strncpy' specified bound 100 equals destination size [-Werror=stringop-truncation] strncpy(name, syms->symbol, MAX_NAME_LEN); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Fixes: 947b4ad1d198 ("perf list: Fix max event string size") Link: https://lkml.kernel.org/n/tip-b663e33bm6x8hrkie4uxh7u2@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit bef0b8970f27da5ca223e522a174d03e2587761d Author: Arnaldo Carvalho de Melo Date: Thu Dec 6 11:50:08 2018 -0300 perf probe: Fix unchecked usage of strncpy() The strncpy() function may leave the destination string buffer unterminated, better use strlcpy() that we have a __weak fallback implementation for systems without it. In this case the 'target' buffer is coming from a list of build-ids that are expected to have a len of at most (SBUILD_ID_SIZE - 1) chars, so probably we're safe, but since we're using strncpy() here, use strlcpy() instead to provide the intended safety checking without the using the problematic strncpy() function. This fixes this warning on an Alpine Linux Edge system with gcc 8.2: util/probe-file.c: In function 'probe_cache__open.isra.5': util/probe-file.c:427:3: error: 'strncpy' specified bound 41 equals destination size [-Werror=stringop-truncation] strncpy(sbuildid, target, SBUILD_ID_SIZE); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Cc: Adrian Hunter Cc: Jiri Olsa Cc: Masami Hiramatsu Cc: Namhyung Kim Fixes: 1f3736c9c833 ("perf probe: Show all cached probes") Link: https://lkml.kernel.org/n/tip-l7n8ggc9kl38qtdlouke5yp5@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4d0f16d059ddb91424480d88473f7392f24aebdc Author: Arnaldo Carvalho de Melo Date: Thu Dec 6 11:41:03 2018 -0300 perf ui helpline: Use strlcpy() as a shorter form of strncpy() + explicit set nul The strncpy() function may leave the destination string buffer unterminated, better use strlcpy() that we have a __weak fallback implementation for systems without it. In this case we are actually setting the null byte at the right place, but since we pass the buffer size as the limit to strncpy() and not it minus one, gcc ends up warning us about that, see below. So, lets just switch to the shorter form provided by strlcpy(). This fixes this warning on an Alpine Linux Edge system with gcc 8.2: ui/tui/helpline.c: In function 'tui_helpline__push': ui/tui/helpline.c:27:2: error: 'strncpy' specified bound 512 equals destination size [-Werror=stringop-truncation] strncpy(ui_helpline__current, msg, sz)[sz - 1] = '\0'; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Fixes: e6e904687949 ("perf ui: Introduce struct ui_helpline") Link: https://lkml.kernel.org/n/tip-d1wz0hjjsh19xbalw69qpytj@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2f5302533f306d5ee87bd375aef9ca35b91762cb Author: Arnaldo Carvalho de Melo Date: Thu Dec 6 11:29:48 2018 -0300 perf svghelper: Fix unchecked usage of strncpy() The strncpy() function may leave the destination string buffer unterminated, better use strlcpy() that we have a __weak fallback implementation for systems without it. In this specific case this would only happen if fgets() was buggy, as its man page states that it should read one less byte than the size of the destination buffer, so that it can put the nul byte at the end of it, so it would never copy 255 non-nul chars, as fgets reads into the orig buffer at most 254 non-nul chars and terminates it. But lets just switch to strlcpy to keep the original intent and silence the gcc 8.2 warning. This fixes this warning on an Alpine Linux Edge system with gcc 8.2: In function 'cpu_model', inlined from 'svg_cpu_box' at util/svghelper.c:378:2: util/svghelper.c:337:5: error: 'strncpy' output may be truncated copying 255 bytes from a string of length 255 [-Werror=stringop-truncation] strncpy(cpu_m, &buf[13], 255); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Arjan van de Ven Fixes: f48d55ce7871 ("perf: Add a SVG helper library file") Link: https://lkml.kernel.org/n/tip-xzkoo0gyr56gej39ltivuh9g@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit b6313899f4ed2e76b8375cf8069556f5b94fbff0 Author: Arnaldo Carvalho de Melo Date: Thu Dec 6 11:20:21 2018 -0300 perf help: Remove needless use of strncpy() Since we make sure the destination buffer has at least strlen(orig) + 1, no need to do a strncpy(dest, orig, strlen(orig)), just use strcpy(dest, orig). This silences this gcc 8.2 warning on Alpine Linux: In function 'add_man_viewer', inlined from 'perf_help_config' at builtin-help.c:284:3: builtin-help.c:192:2: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] strncpy((*p)->name, name, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ builtin-help.c: In function 'perf_help_config': builtin-help.c:187:15: note: length computed here size_t len = strlen(name); ^~~~~~~~~~~~ Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Fixes: 078006012401 ("perf_counter tools: add in basic glue from Git") Link: https://lkml.kernel.org/n/tip-2f69l7drca427ob4km8i7kvo@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 5192bde7d98c99f2cd80225649e3c2e7493722f7 Author: Arnaldo Carvalho de Melo Date: Thu Dec 6 11:09:46 2018 -0300 perf header: Fix unchecked usage of strncpy() The strncpy() function may leave the destination string buffer unterminated, better use strlcpy() that we have a __weak fallback implementation for systems without it. This fixes this warning on an Alpine Linux Edge system with gcc 8.2: util/header.c: In function 'perf_event__synthesize_event_update_name': util/header.c:3625:2: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] strncpy(ev->data, evsel->name, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ util/header.c:3618:15: note: length computed here size_t len = strlen(evsel->name); ^~~~~~~~~~~~~~~~~~~ Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Fixes: a6e5281780d1 ("perf tools: Add event_update event unit type") Link: https://lkml.kernel.org/n/tip-wycz66iy8dl2z3yifgqf894p@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 7572588085a13d5db02bf159542189f52fdb507e Author: Arnaldo Carvalho de Melo Date: Thu Dec 6 11:02:57 2018 -0300 perf header: Fix unchecked usage of strncpy() The strncpy() function may leave the destination string buffer unterminated, better use strlcpy() that we have a __weak fallback implementation for systems without it. This fixes this warning on an Alpine Linux Edge system with gcc 8.2: util/header.c: In function 'perf_event__synthesize_event_update_unit': util/header.c:3586:2: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] strncpy(ev->data, evsel->unit, size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ util/header.c:3579:16: note: length computed here size_t size = strlen(evsel->unit); ^~~~~~~~~~~~~~~~~~~ Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Fixes: a6e5281780d1 ("perf tools: Add event_update event unit type") Link: https://lkml.kernel.org/n/tip-fiikh5nay70bv4zskw2aa858@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit fca5085c15255bbde203b7322c15f07ebb12f63e Author: Arnaldo Carvalho de Melo Date: Thu Dec 6 10:49:46 2018 -0300 perf dso: Fix unchecked usage of strncpy() The strncpy() function may leave the destination string buffer unterminated, better use strlcpy() that we have a __weak fallback implementation for systems without it. This fixes this warning on an Alpine Linux Edge system with gcc 8.2: In function 'decompress_kmodule', inlined from 'dso__decompress_kmodule_fd' at util/dso.c:305:9: util/dso.c:298:3: error: 'strncpy' destination unchanged after copying no bytes [-Werror=stringop-truncation] strncpy(pathname, tmpbuf, len); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CC /tmp/build/perf/util/values.o CC /tmp/build/perf/util/debug.o cc1: all warnings being treated as errors Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Fixes: c9a8a6131fb6 ("perf tools: Move the temp file processing into decompress_kmodule") Link: https://lkml.kernel.org/n/tip-tl2hdxj64tt4k8btbi6a0ugw@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 15a5cd19627a3046e7b66626abdeed3f92daafd2 Author: Mathieu Poirier Date: Tue Dec 4 13:39:04 2018 -0700 perf cs-etm: Add support for PTMv1.1 decoding This patch is re-using the mechanic set forth by ETMv3 to add support for PTM decoding. Configuration for both encoding protocol is similar but the generated stream itself is very different, hence requiring special handling. Signed-off-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1543955944-10042-4-git-send-email-mathieu.poirier@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 7d0f4fefc492498a180da8fd5c9ebe11dc768c83 Author: Mathieu Poirier Date: Tue Dec 4 13:39:03 2018 -0700 perf cs-etm: Add support for ETMv3 trace decoding Add support for the creation of packet printer and decoder for the ETMv3 trace architecture. That way traces generated by tracers adhering to that trace protocol can be handled properly by the perf infrastructure. Signed-off-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1543955944-10042-3-git-send-email-mathieu.poirier@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 78688342c547bb274b563e6d87ef7774c7686aaf Author: Mathieu Poirier Date: Tue Dec 4 13:39:02 2018 -0700 perf cs-etm: Add configuration for ETMv3 trace protocol This patch deals with the proper initialisation of configuration parameters for the ETMv3 trace protocol in order to properly handle packets generated by tracers following this specification. Signed-off-by: Mathieu Poirier Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1543955944-10042-2-git-send-email-mathieu.poirier@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 8aa5c8eddcdd055c29a4c30df2587104c07c7c2d Author: Jiri Olsa Date: Tue Nov 13 11:15:34 2018 +0100 perf top: Move perf_top__reset_sample_counters() to after counts display Move the perf_top__reset_sample_counters() call to right after we display the counters so we can see the updated numbers for longer. Signed-off-by: Jiri Olsa Acked-by: David S. Miller Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Peter Zijlstra Link: https://lkml.kernel.org/n/tip-o72pyiwt05f3p2juprwmz2jo@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d8590430fb1e70132f1d330d6bbab7b943b35c3c Author: Jiri Olsa Date: Mon Nov 19 11:12:01 2018 +0100 perf top: Display slow reader warning when droping samples Currently we display the "Too slow to read ring buffer.." helpline only in the slow reader thread. This patch triggers it also when the processing thread drops samples, because it has the same reason, which is too many data on input. Signed-off-by: Jiri Olsa Acked-by: David S. Miller Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Peter Zijlstra Link: https://lkml.kernel.org/n/tip-bnev2mloavyurmgchcr3o24o@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 97f7e0b33db81fd821828390e9095771abe62816 Author: Jiri Olsa Date: Sun Nov 11 20:02:46 2018 +0100 perf top: Save and display the drop count stats Add drop count to 'perf top' headers: # perf top --stdio PerfTop: 3549 irqs/sec kernel:51.8% exact: 100.0% lost: 0/0 drop: 0/0 [4000Hz cycles:ppp], (all, 8 CPUs) # perf top Samples: 0 of event 'cycles:ppp', 4000 Hz, Event count (approx.): 0 lost: 0/0 drop: 0/0 The format is: / Signed-off-by: Jiri Olsa Acked-by: David S. Miller Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Peter Zijlstra Link: http://lkml.kernel.org/n/tip-2lj87zz8tq9ye1ntax3ulw0n@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d63b9f6fea7613e2fdc8a5ef7e17ecc9cf24bf9d Author: Jiri Olsa Date: Sun Nov 11 19:52:06 2018 +0100 perf top: Drop samples which are behind the refresh rate Drop samples from processing thread if they get behind the latest event read from the kernel maps. If it gets behind more than the refresh rate (-d option), drop the sample. Signed-off-by: Jiri Olsa Acked-by: David S. Miller Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Peter Zijlstra Link: https://lkml.kernel.org/n/tip-x533ra5c1pgofvbtsizzuydd@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit c94cef4beb66d3e1f4ed0f3bf6c2663a9c3cf3c0 Author: Jiri Olsa Date: Wed Nov 7 20:11:19 2018 +0100 perf top: Set the 'session_done' volatile variable when exiting So we can get out of hist processing ASAP on user request. Signed-off-by: Jiri Olsa Acked-by: David S. Miller Acked-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Peter Zijlstra Link: https://lkml.kernel.org/n/tip-r8aufbgbixr2f85s3wcoaw9v@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 94ad6e7e3606454498aeac1fdd1b9de5c1e6735a Author: Jiri Olsa Date: Mon Nov 5 21:23:40 2018 +0100 perf top: Use cond variable instead of a lock Use conditional variable logic to synchronize between the reading and processing threads. Currently it's done by having mutex around rotation code. Using a POSIX cond variable to sync both threads after queues rotation: Process thread: - Detects data - Switches queues - Sets rotate variable - Waits in pthread_cond_wait() Read thread: - Detects rotate is set - Kicks the process thread with a pthread_cond_signal() After this rotation is safely completed and both threads can continue with the new queue. Signed-off-by: Jiri Olsa Acked-by: David S. Miller Acked-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Peter Zijlstra Link: http://lkml.kernel.org/n/tip-3rdeg23rv3brvy1pwt3igvyw@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 16c66bc167cc52992f66748aed7ac21396189457 Author: Jiri Olsa Date: Mon Nov 5 13:24:55 2018 +0100 perf top: Add processing thread Add a new thread that takes care of the hist creating to alleviate the main reader thread so it can keep perf mmaps served in time so that we reduce the possibility of losing events. The 'perf top' command now spawns 2 extra threads, the data processing is the following: 1) The main thread reads the data from mmaps and queues them to ordered events object; 2) The processing threads takes the data from the ordered events object and create initial histogram; 3) The GUI thread periodically sorts the initial histogram and presents it. Passing the data between threads 1 and 2 is done by having 2 ordered events queues. One is always being stored by thread 1 while the other is flushed out in thread 2. Passing the data between threads 2 and 3 stays the same as was initially for threads 1 and 3. Signed-off-by: Jiri Olsa Acked-by: David S. Miller Acked-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Peter Zijlstra Link: http://lkml.kernel.org/n/tip-hhf4hllgkmle9wl1aly1jli0@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 254de74cd14a2e64323caeffe653de0f390a4e65 Author: Jiri Olsa Date: Mon Nov 5 21:34:47 2018 +0100 perf top: Move lost events warning to helpline We can't display the UI box saying that we are slow in the reader thread. That will make 'perf top' even slower and the user even more angry ;-) Move the UI box message from the reader thread to the UI thread and change it to a helpline, so there's no need to 'press any key'. Signed-off-by: Jiri Olsa Acked-by: David S. Miller Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Peter Zijlstra Link: https://lkml.kernel.org/n/tip-x4k0iuw7tt6mywsaguq6jfwu@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit d24e3c98ac11b941669885cc09d88b3b970e9d66 Author: Jiri Olsa Date: Tue Nov 6 15:45:14 2018 +0100 perf top: Save and display the lost count stats Add a 'lost count' to 'perf top' headers: # perf top --stdio PerfTop: 3850 irqs/sec kernel:49.0% exact: 100.0% lost: 0/0 [4000Hz cycles:ppp], (all, 8 CPUs) # perf top Samples: 0 of event 'cycles:ppp', 4000 Hz, Event count (approx.): 0 lost: 0/0 The format is: / Signed-off-by: Jiri Olsa Acked-by: David S. Miller Acked-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Peter Zijlstra Link: https://lkml.kernel.org/n/tip-zo11rn270gij5jtp8fknpf8u@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit a4a6668a623e11f818a6abc9b5339855ee0407b1 Author: Jiri Olsa Date: Wed Nov 7 16:58:36 2018 +0100 perf ordered_events: Add private data member We will need it in following patch, where we can't use the container_of() trick to get the higher level object. Signed-off-by: Jiri Olsa Acked-by: David S. Miller Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Peter Zijlstra Link: http://lkml.kernel.org/n/tip-vgs9aoek21v14o3obza586yy@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit b8494f1df875abba925374cf31bd96a464a7e5d1 Author: Jiri Olsa Date: Wed Nov 7 16:46:47 2018 +0100 perf ordered_events: Rework show_progress for __ordered_events__flush Decide to use the progress bar one level higher, we will need this in following patch. Signed-off-by: Jiri Olsa Acked-by: David S. Miller Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Peter Zijlstra Link: http://lkml.kernel.org/n/tip-ocjdukp2a8ujikkmafd0j5zv@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit dd2e18e9ac20e3ffc27cabf318e83b43ed5ddb92 Author: Andi Kleen Date: Mon Dec 3 16:18:48 2018 -0800 perf tools: Support 'srccode' output When looking at PT or brstackinsn traces with 'perf script' it can be very useful to see the source code. This adds a simple facility to print them with 'perf script', if the information is available through dwarf % perf record ... % perf script -F insn,ip,sym,srccode ... 4004c6 main 5 for (i = 0; i < 10000000; i++) 4004cd main 5 for (i = 0; i < 10000000; i++) 4004c6 main 5 for (i = 0; i < 10000000; i++) 4004cd main 5 for (i = 0; i < 10000000; i++) 4004cd main 5 for (i = 0; i < 10000000; i++) 4004cd main 5 for (i = 0; i < 10000000; i++) 4004cd main 5 for (i = 0; i < 10000000; i++) 4004cd main 5 for (i = 0; i < 10000000; i++) 4004b3 main 6 v++; % perf record -b ... % perf script -F insn,ip,sym,srccode,brstackinsn ... main+22: 0000000000400543 insn: e8 ca ff ff ff # PRED |18 f1(); f1: 0000000000400512 insn: 55 |10 { 0000000000400513 insn: 48 89 e5 0000000000400516 insn: b8 00 00 00 00 |11 f2(); 000000000040051b insn: e8 d6 ff ff ff # PRED f2: 00000000004004f6 insn: 55 |5 { 00000000004004f7 insn: 48 89 e5 00000000004004fa insn: 8b 05 2c 0b 20 00 |6 c = a / b; 0000000000400500 insn: 8b 0d 2a 0b 20 00 0000000000400506 insn: 99 0000000000400507 insn: f7 f9 0000000000400509 insn: 89 05 29 0b 20 00 000000000040050f insn: 90 |7 } 0000000000400510 insn: 5d 0000000000400511 insn: c3 # PRED f1+14: 0000000000400520 insn: b8 00 00 00 00 |12 f2(); 0000000000400525 insn: e8 cc ff ff ff # PRED f2: 00000000004004f6 insn: 55 |5 { 00000000004004f7 insn: 48 89 e5 00000000004004fa insn: 8b 05 2c 0b 20 00 |6 c = a / b; Not supported for callchains currently, would need some layout changes there. Committer notes: Fixed the build on Alpine Linux (3.4 .. 3.8) by addressing this warning: In file included from util/srccode.c:19:0: /usr/include/sys/fcntl.h:1:2: error: #warning redirecting incorrect #include to [-Werror=cpp] #warning redirecting incorrect #include to ^~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Andi Kleen Tested-by: Jiri Olsa Link: http://lkml.kernel.org/r/20181204001848.24769-1-andi@firstfloor.org Signed-off-by: Arnaldo Carvalho de Melo commit 42da438c1bc4ad9b904401aff03678ddbf1329b0 Author: Arnaldo Carvalho de Melo Date: Wed Dec 5 13:08:11 2018 -0300 perf trace: We need to consider "nr" if "__syscall_nr" is not there To cope with older kernels that don't have this patch backported: 026842d148b9 ("tracing/syscalls: Rename "/format" tracepoint field name "nr" to "__syscall_nr:") This makes 'perf trace' work again in RHEL7 kernels. Cc: Taeung Song Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-6h1syw2isegnhb1bjmtr9x9k@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 3fcb10e496505e5573a7fc386cd1152781d37fe6 Author: Mark Drayton Date: Tue Dec 4 12:34:20 2018 -0800 perf tools: Allow specifying proc-map-timeout in config file The default timeout of 500ms for parsing /proc//maps files is too short for profiling many of our services. This can be overridden by passing --proc-map-timeout to the relevant command but it'd be nice to globally increase our default value. This patch permits setting a different default with the core.proc-map-timeout config file parameter. Signed-off-by: Mark Drayton Acked-by: Song Liu Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20181204203420.1683114-1-mbd@fb.com Signed-off-by: Arnaldo Carvalho de Melo commit 65c9fee2da2fbbedbba402996ddb412072e762fc Author: Ingo Molnar Date: Mon Dec 3 11:22:00 2018 +0100 tools lib subcmd: Fix a few source code comment typos Go over the tools/ files that are maintained in Arnaldo's tree and fix common typos: half of them were in comments, the other half in JSON files. No change in functionality intended. Committer notes: This was split from a larger patch as there are code that is, additionally, maintained outside the kernel tree, so to ease cherry-picking and/or backporting, split this into multiple patches. Signed-off-by: Ingo Molnar Cc: Jiri Olsa Cc: Josh Poimboeuf Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20181203102200.GA104797@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit adba163441597ffb56141233a2ef722b75caca87 Author: Ingo Molnar Date: Mon Dec 3 11:22:00 2018 +0100 perf tools: Fix diverse comment typos Go over the tools/ files that are maintained in Arnaldo's tree and fix common typos: half of them were in comments, the other half in JSON files. No change in functionality intended. Committer notes: This was split from a larger patch as there are code that is, additionally, maintained outside the kernel tree, so to ease cherry-picking and/or backporting, split this into multiple patches. Just typos in comments, no need to backport, reducing the possibility of possible backporting artifacts. Signed-off-by: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20181203102200.GA104797@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit e4a8b0af5121392da2d40204ee330fd9e88d0858 Author: Ingo Molnar Date: Mon Dec 3 11:22:00 2018 +0100 perf bpf-loader: Fix debugging message typo Go over the tools/ files that are maintained in Arnaldo's tree and fix common typos: half of them were in comments, the other half in JSON files. No change in functionality intended. Committer notes: This was split from a larger patch as there are code that is, additionally, maintained outside the kernel tree, so to ease cherry picking and/or backporting, split this into multiple patches. This one has information that is presented to the user, albeit in debug mode. Signed-off-by: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan Link: http://lkml.kernel.org/r/20181203102200.GA104797@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 1a7ea3283f7d15d7ce76a30870c3ca648adf1fc4 Author: Ingo Molnar Date: Mon Dec 3 11:22:00 2018 +0100 perf tools Documentation: Fix diverse typos Go over the tools/ files that are maintained in Arnaldo's tree and fix common typos: half of them were in comments, the other half in JSON files. No change in functionality intended. Committer notes: This was split from a larger patch as there are code that is, additionally, maintained outside the kernel tree, so to ease cherry picking and/or backporting, split this into multiple patches. In this particular case, it affects documentation, so may be interesting to cherry pick as it is information that is presented to the user. Signed-off-by: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20181203102200.GA104797@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 3e449f7c36c3ac49f140b5dc3c40693e551f47d2 Author: Ingo Molnar Date: Mon Dec 3 11:22:00 2018 +0100 tools lib traceevent: Fix diverse typos in comments Go over the tools/ files that are maintained in Arnaldo's tree and fix common typos: half of them were in comments, the other half in JSON files. No change in functionality intended. Committer notes: This was split from a larger patch as there are code that is, additionally, maintained outside the kernel tree, so to ease cherry picking and/or backporting, split this into multiple patches. Signed-off-by: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Steven Rostedt (VMware) Cc: Tzvetomir Stoyanov Link: http://lkml.kernel.org/r/20181203102200.GA104797@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit b1d6f155e1bbb67778c17aba661fb4ea4e1a3641 Author: Ingo Molnar Date: Mon Dec 3 11:22:00 2018 +0100 perf vendor events intel: Fix diverse typos Go over the tools/ files that are maintained in Arnaldo's tree and fix common typos: half of them were in comments, the other half in JSON files. ( Care should be taken not to re-import these typos in the future, if the JSON files get updated by the vendor without fixing the typos. ) No change in functionality intended. Committer notes: This was split from a larger patch as there are code that is, additionally, maintained outside the kernel tree, so to ease cherry picking and/or backporting, split this into multiple patches. Signed-off-by: Ingo Molnar Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: Kan Liang Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20181203102200.GA104797@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 24f967337f6d6bce931425769c0f5ff5cf2d212e Author: Florian Fainelli Date: Mon Dec 3 11:11:36 2018 -0800 perf tests ARM: Disable breakpoint tests 32-bit The breakpoint tests on the ARM 32-bit kernel are broken in several ways. The breakpoint length requested does not necessarily match whether the function address has the Thumb bit (bit 0) set or not, and this does matter to the ARM kernel hw_breakpoint infrastructure. See [1] for background. [1]: https://lkml.org/lkml/2018/11/15/205 As Will indicated, the overflow handling would require single-stepping which is not supported at the moment. Just disable those tests for the ARM 32-bit platforms and update the comment above to explain these limitations. Co-developed-by: Will Deacon Signed-off-by: Florian Fainelli Signed-off-by: Will Deacon Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20181203191138.2419-1-f.fainelli@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit a7ee4d625ede4f62146ff3bb2aeee074e4cf5fa1 Author: Robert Walker Date: Mon Dec 3 12:18:46 2018 +0000 perf cs-etm: Support for ARM A32/T32 instruction sets in CoreSight trace This patch adds support for generating instruction samples from trace of AArch32 programs using the A32 and T32 instruction sets. T32 has variable 2 or 4 byte instruction size, so the conversion between addresses and instruction counts requires extra information from the trace decoder, requiring version 0.10.0 of OpenCSD. A check for the OpenCSD library version has been added to the feature check for OpenCSD. Signed-off-by: Robert Walker Reviewed-by: Mathieu Poirier Tested-by: Leo Yan Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1543839526-30348-1-git-send-email-robert.walker@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 00879763fcf21f4b32d63d2241c877f8c1df950e Author: Sihyeon Jang Date: Sun Dec 2 17:06:51 2018 +0900 perf beauty mmap_flags: Fixed syntax error Fixed missing ']' error Committer testing: Before: # tools/perf/trace/beauty/mmap_flags.sh static const char *mmap_flags[] = { [ilog2(0x40) + 1] = "32BIT", tools/perf/trace/beauty/mmap_flags.sh: line 23: [: missing `]' [ilog2(0x01) + 1] = "SHARED", [ilog2(0x02) + 1] = "PRIVATE", [ilog2(0x10) + 1] = "FIXED", [ilog2(0x20) + 1] = "ANONYMOUS", [ilog2(0x100000) + 1] = "FIXED_NOREPLACE", tools/perf/trace/beauty/mmap_flags.sh: line 28: [: missing `]' [ilog2(0x0100) + 1] = "GROWSDOWN", [ilog2(0x0800) + 1] = "DENYWRITE", [ilog2(0x1000) + 1] = "EXECUTABLE", [ilog2(0x2000) + 1] = "LOCKED", [ilog2(0x4000) + 1] = "NORESERVE", [ilog2(0x8000) + 1] = "POPULATE", [ilog2(0x10000) + 1] = "NONBLOCK", [ilog2(0x20000) + 1] = "STACK", [ilog2(0x40000) + 1] = "HUGETLB", [ilog2(0x80000) + 1] = "SYNC", }; # After: $ tools/perf/trace/beauty/mmap_flags.sh static const char *mmap_flags[] = { [ilog2(0x40) + 1] = "32BIT", [ilog2(0x01) + 1] = "SHARED", [ilog2(0x02) + 1] = "PRIVATE", [ilog2(0x10) + 1] = "FIXED", [ilog2(0x20) + 1] = "ANONYMOUS", [ilog2(0x100000) + 1] = "FIXED_NOREPLACE", [ilog2(0x0100) + 1] = "GROWSDOWN", [ilog2(0x0800) + 1] = "DENYWRITE", [ilog2(0x1000) + 1] = "EXECUTABLE", [ilog2(0x2000) + 1] = "LOCKED", [ilog2(0x4000) + 1] = "NORESERVE", [ilog2(0x8000) + 1] = "POPULATE", [ilog2(0x10000) + 1] = "NONBLOCK", [ilog2(0x20000) + 1] = "STACK", [ilog2(0x40000) + 1] = "HUGETLB", [ilog2(0x80000) + 1] = "SYNC", }; $ Signed-off-by: Sihyeon Jang Cc: Jiri Olsa Cc: Namhyung Kim Fixes: aca70cc40a0b ("perf beauty mmap_flags: Check if the arch has a mmap.h file") Link: http://lkml.kernel.org/r/20181202080651.4685-1-uneedsihyeon@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 6cd99d21741dbffb40e28ab7d955b27d09c3352f Author: Tzvetomir Stoyanov Date: Fri Nov 30 10:44:10 2018 -0500 tools lib traceevent: traceevent API cleanup In order to make libtraceevent into a proper library, its API should be straightforward. This patch hides few API functions, intended for internal usage only: tep_free_event(), tep_free_format_field(), __tep_data2host2(), __tep_data2host4() and __tep_data2host8(). The patch also alignes the libtraceevent summary man page with these API changes. Signed-off-by: Tzvetomir Stoyanov Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20181130154647.891651290@goodmis.org Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit f0bba09ce3f88ddeef7a3e45f612d26b1e951d5b Author: Tzvetomir Stoyanov Date: Fri Nov 30 10:44:09 2018 -0500 perf tools: traceevent API cleanup, remove __tep_data2host*() In order to make libtraceevent into a proper library, its API should be straightforward. The __tep_data2host*() functions are going to no longer be available as a libtraceevent API, tep_read_number() should be used instead. This patch replaces __tep_data2host*() usage with tep_read_number() in perf. Signed-off-by: Tzvetomir Stoyanov Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20181130154647.743979275@goodmis.org Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit fc39851c455ce9e593302c9e376cdb9593c10704 Author: Tzvetomir Stoyanov Date: Fri Nov 30 10:44:08 2018 -0500 tools lib traceevent: Rename tep_free_format() to tep_free_event() In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. This renames tep_free_format() to tep_free_event(), which describes more closely the purpose of the function. Signed-off-by: Tzvetomir Stoyanov Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20181130154647.591673556@goodmis.org Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit 97fbf3f0e0aa854ed33141dc9a5410f0ac6c71f3 Author: Tzvetomir Stoyanov Date: Fri Nov 30 10:44:07 2018 -0500 tools lib traceevent, perf tools: Rename 'struct tep_event_format' to 'struct tep_event' In order to make libtraceevent into a proper library, variables, data structures and functions require a unique prefix to prevent name space conflicts. This renames 'struct tep_event_format' to 'struct tep_event', which describes more closely the purpose of the struct. Signed-off-by: Tzvetomir Stoyanov Cc: Adrian Hunter Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20181130154647.436403995@goodmis.org Signed-off-by: Steven Rostedt (VMware) [ Fixup conflict with 6e33c250a88f ("tools lib traceevent: Fix compile warnings in tools/lib/traceevent/event-parse.c") ] Signed-off-by: Arnaldo Carvalho de Melo commit 4c784894ac29195af24362125a72beda4aeb8b9f Author: Tzvetomir Stoyanov Date: Fri Nov 30 10:44:06 2018 -0500 tools lib traceevent: Install trace-seq.h API header file This patch installs trace-seq.h header file on "make install". Signed-off-by: Tzvetomir Stoyanov Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20181130154647.176265533@goodmis.org Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit cc03e1a8f82dff36fb329469c28cbfe7d2e6156a Author: Tzvetomir Stoyanov Date: Fri Nov 30 10:44:05 2018 -0500 tools lib traceevent: Added support for pkg-config This patch implements integration with pkg-config framework. pkg-config can be used by the library users to determine required CFLAGS and LDFLAGS in order to use the library Signed-off-by: Tzvetomir Stoyanov Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20181130154647.022471992@goodmis.org Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit 477be10ca781bbee29d6a1da958d63d5c9a2d83b Author: Tzvetomir Stoyanov Date: Fri Nov 30 10:44:04 2018 -0500 tools lib traceevent: Implement new API tep_get_ref() This patch implements a new API of the tracevent library: int tep_get_ref(struct tep_handle *tep); The API returns the reference counter "ref_count" of the tep handler. As "struct tep_handle" is internal only, its members cannot be accessed by the library users, the API is used to get the reference counter. Signed-off-by: Tzvetomir Stoyanov Cc: Andrew Morton Cc: Jiri Olsa Cc: Namhyung Kim Link: http://lkml.kernel.org/r/20181130154646.890615385@goodmis.org Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit 239ca3e78609378a1ed5d9db1c7db629a71c2857 Author: Jin Yao Date: Fri Nov 30 21:54:57 2018 +0800 perf report: Documentation average IPC and IPC coverage Add explanations for new columns "IPC" and "IPC coverage" in perf documentation. v5: --- Update the description according to Ingo's comments. Signed-off-by: Jin Yao Reviewed-by: Ingo Molnar Reviewed-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Kan Liang Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1543586097-27632-5-git-send-email-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit ec6ae74fe8f00c7df018628ada9d33190de72efa Author: Jin Yao Date: Fri Nov 30 21:54:56 2018 +0800 perf report: Display average IPC and IPC coverage per symbol Support displaying the average IPC and IPC coverage per symbol in 'perf report' --tui and --stdio modes. For example, $ perf record -b ... $ perf report -s symbol Overhead Symbol IPC [IPC Coverage] 39.60% [.] __random 2.30 [ 54.8%] 18.02% [.] main 0.43 [ 54.3%] 14.21% [.] compute_flag 2.29 [100.0%] 14.16% [.] rand 0.36 [100.0%] 7.06% [.] __random_r 2.57 [ 70.5%] 6.85% [.] rand@plt 0.00 [ 0.0%] Jiri Olsa provided the patch to support the --stdio mode. I merged Jiri's code in this patch. $ perf report -s symbol --stdio # Overhead Symbol IPC [IPC Coverage] # ........ ........................... .................... # 39.60% [.] __random 2.30 [ 54.8%] 18.02% [.] main 0.43 [ 54.3%] 14.21% [.] compute_flag 2.29 [100.0%] 14.16% [.] rand 0.36 [100.0%] 7.06% [.] __random_r 2.57 [ 70.5%] 6.85% [.] rand@plt 0.00 [ 0.0%] 0.02% [k] run_timer_softirq 1.60 [ 57.2%] The columns "IPC" and "[IPC Coverage]" are automatically enabled when the sort-key "symbol" is specified. If the perf.data file doesn't contain timed LBR information, columns are filled with "-". For example, # Overhead Symbol IPC [IPC Coverage] # ........ ........................... .................... # 46.57% [.] main - - 17.60% [.] rand - - 15.84% [.] __random_r - - 11.90% [.] __random - - 6.50% [.] compute_flag - - 1.59% [.] rand@plt - - 0.00% [.] _dl_relocate_object - - 0.00% [k] tlb_flush_mmu - - 0.00% [k] perf_event_mmap - - 0.00% [k] native_sched_clock - - 0.00% [k] intel_pmu_handle_irq_v4 - - 0.00% [k] native_write_msr - - v3: --- Removed the sortkey 'ipc' from command-line. The columns "IPC" and "[IPC Coverage]" are automatically enabled when "symbol" is specified. v2: --- Merge in Jiri's patch to support stdio mode Signed-off-by: Jin Yao Reviewed-by: Ingo Molnar Reviewed-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Kan Liang Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1543586097-27632-4-git-send-email-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 246fda09c127e689780d32ef72f2e870615ece3f Author: Jin Yao Date: Fri Nov 30 21:54:55 2018 +0800 perf annotate: Create a annotate2 flag in struct symbol We often use the symbol__annotate2() to annotate a specified symbol. While annotating may take some time, so in order to avoid annotating the same symbol repeatedly, the patch creates a new flag to indicate the symbol has been annotated. Signed-off-by: Jin Yao Reviewed-by: Ingo Molnar Reviewed-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Kan Liang Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1543586097-27632-3-git-send-email-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit ace4f8faea54f62521e349f70b49797e48873e1f Author: Jin Yao Date: Fri Nov 30 21:54:54 2018 +0800 perf annotate: Compute average IPC and IPC coverage per symbol Add support to 'perf report' annotate view or 'perf annotate --stdio2' to aggregate the IPC derived from timed LBRs per symbol. We compute the average IPC and the IPC coverage percentage. For example: $ perf annotate --stdio2 Percent IPC Cycle (Average IPC: 2.30, IPC Coverage: 54.8%) Disassembly of section .text: 000000000003aac0 : 8.32 3.28 sub $0x18,%rsp 3.28 mov $0x1,%esi 3.28 xor %eax,%eax 3.28 cmpl $0x0,argp_program_version_hook@@GLIBC_2.2.5+0x1e0 11.57 3.28 1 ↓ je 20 lock cmpxchg %esi,__abort_msg@@GLIBC_PRIVATE+0x8a0 ↓ jne 29 ↓ jmp 43 11.57 1.10 20: cmpxchg %esi,__abort_msg@@GLIBC_PRIVATE+0x8a0 0.00 1.10 1 ↓ je 43 29: lea __abort_msg@@GLIBC_PRIVATE+0x8a0,%rdi sub $0x80,%rsp → callq __lll_lock_wait_private add $0x80,%rsp 0.00 3.00 43: lea __ctype_b@GLIBC_2.2.5+0x38,%rdi 3.00 lea 0xc(%rsp),%rsi 8.49 3.00 1 → callq __random_r 7.91 1.94 cmpl $0x0,argp_program_version_hook@@GLIBC_2.2.5+0x1e0 0.00 1.94 1 ↓ je 68 lock decl __abort_msg@@GLIBC_PRIVATE+0x8a0 ↓ jne 70 ↓ jmp 8a 0.00 2.00 68: decl __abort_msg@@GLIBC_PRIVATE+0x8a0 21.56 2.00 1 ↓ je 8a 70: lea __abort_msg@@GLIBC_PRIVATE+0x8a0,%rdi sub $0x80,%rsp → callq __lll_unlock_wake_private add $0x80,%rsp 21.56 2.90 8a: movslq 0xc(%rsp),%rax 2.90 add $0x18,%rsp 9.03 2.90 1 ← retq It shows for this symbol the average IPC is 2.30 and the IPC coverage is 54.8%. Signed-off-by: Jin Yao Reviewed-by: Ingo Molnar Reviewed-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: Kan Liang Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1543586097-27632-2-git-send-email-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 44e92f8389b2242efde77d5321ffa88decd47df6 Author: Tzvetomir Stoyanov Date: Wed Nov 28 14:55:52 2018 -0500 tools lib traceevent: Add sanity check to is_timestamp_in_us() This patch adds a sanity check to is_timestamp_in_us() input parameter trace_clock. It avoids a potential segfault in this function for the case trace_clock is NULL. Reported-by: Slavomir Kaslev Signed-off-by: Tzvetomir Stoyanov Cc: Jiri Olsa Link: http://lkml.kernel.org/r/20181128145552.68c4f87b@gandalf.local.home Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Arnaldo Carvalho de Melo commit a1c8cf293d57cb7c952b667805441b9fbb9c640a Author: Arnaldo Carvalho de Melo Date: Tue Nov 27 12:19:15 2018 -0300 perf beauty mmap_flags: Check if the arch has a mmap.h file If not, then just use what is in asm-generic. This fixes the build for my sh4, m68k and riscv64 perf test build containers that were failing due to 80ee5668b8a7 ("perf beauty: Add a generator for MAP_ mmap's flag constants"), that were not covered in the cset introducing those tools/arch/*/include/uapi/asm/mman.h files. f3539c12d819 ("tools include: Add uapi mman.h for each architecture") Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Fixes: 80ee5668b8a7 ("perf beauty: Add a generator for MAP_ mmap's flag constants") Link: https://lkml.kernel.org/n/tip-rpy9t2e0wxpnum1yvxhreafe@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 93f20c0fe3e86088ec041e47755367c4bed584c6 Author: Alexey Budankov Date: Tue Nov 6 12:07:19 2018 +0300 perf record: Extend trace writing to multi AIO Multi AIO trace writing allows caching more kernel data into userspace memory postponing trace writing for the sake of overall profiling data thruput increase. It could be seen as kernel data buffer extension into userspace memory. With an --aio option value different from 0 (default value is 1) the tool has capability to cache more and more data into user space along with delegating spill to AIO. That allows avoiding to suspend at record__aio_sync() between calls of record__mmap_read_evlist() and increases profiling data thruput at the cost of userspace memory. Signed-off-by: Alexey Budankov Reviewed-by: Jiri Olsa Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Andi Kleen Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/050bb053-e7f3-aa83-fde7-f27ff90be7f6@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit d3d1af6f011a553a00d2bda90b2700c0d56bd8f7 Author: Alexey Budankov Date: Tue Nov 6 12:04:58 2018 +0300 perf record: Enable asynchronous trace writing The trace file offset is read once before mmaps iterating loop and written back after all performance data is enqueued for aio writing. The trace file offset is incremented linearly after every successful aio write operation. record__aio_sync() blocks till completion of the started AIO operation and then proceeds. record__aio_mmap_read_sync() implements a barrier for all incomplete aio write requests. Signed-off-by: Alexey Budankov Reviewed-by: Jiri Olsa Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Andi Kleen Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/ce2d45e9-d236-871c-7c8f-1bed2d37e8ac@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 0b77383134f3dbb461189a9c4f3b46b20152045d Author: Alexey Budankov Date: Tue Nov 6 12:03:35 2018 +0300 perf mmap: Map data buffer for preserving collected data The map->data buffer is used to preserve map->base profiling data for writing to disk. AIO map->cblock is used to queue corresponding map->data buffer for asynchronous writing. Signed-off-by: Alexey Budankov Reviewed-by: Jiri Olsa Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Andi Kleen Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/5fcda10c-6c63-68df-383a-c6d9e5d1f918@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 2a07d814747b386feec7d7150fe519feb2a2a5f2 Author: Alexey Budankov Date: Tue Nov 6 12:03:35 2018 +0300 tools build feature: Check if libaio is available This will be used by 'perf record' to speed up reading the perf ring buffer. Committer testing: $ make -C tools/perf O=/tmp/build/perf make: Entering directory '/home/acme/git/perf/tools/perf' BUILD: Doing 'make -j8' parallel build Auto-detecting system features: ... dwarf: [ on ] ... dwarf_getlocations: [ on ] ... glibc: [ on ] ... gtk2: [ OFF ] ... libaudit: [ OFF ] ... libbfd: [ OFF ] ... libelf: [ on ] ... libnuma: [ OFF ] ... numa_num_possible_cpus: [ OFF ] ... libperl: [ OFF ] ... libpython: [ OFF ] ... libslang: [ on ] ... libcrypto: [ on ] ... libunwind: [ on ] ... libdw-dwarf-unwind: [ on ] ... zlib: [ on ] ... lzma: [ on ] ... get_cpuid: [ on ] ... bpf: [ on ] ... libaio: [ on ] $ ls -la /tmp/build/perf/feature/test-libaio.* -rwxrwxr-x. 1 acme acme 18296 Nov 26 08:49 /tmp/build/perf/feature/test-libaio.bin -rw-rw-r--. 1 acme acme 1165 Nov 26 08:49 /tmp/build/perf/feature/test-libaio.d -rw-rw-r--. 1 acme acme 0 Nov 26 08:49 /tmp/build/perf/feature/test-libaio.make.output $ $ grep -i aio /tmp/build/perf/FEATURE-DUMP feature-libaio=1 $ Signed-off-by: Alexey Budankov Tested-by: Arnaldo Carvalho de Melo Reviewed-by: Jiri Olsa Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Andi Kleen Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/5fcda10c-6c63-68df-383a-c6d9e5d1f918@linux.intel.com [ split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo commit 1c6f709b9f96366cc47af23c05ecec9b8c0c392d Author: Adrian Hunter Date: Mon Nov 26 14:12:52 2018 +0200 perf intel-pt: Fix error with config term "pt=0" Users should never use 'pt=0', but if they do it may give a meaningless error: $ perf record -e intel_pt/pt=0/u uname Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (intel_pt/pt=0/u). Fix that by forcing 'pt=1'. Committer testing: # perf record -e intel_pt/pt=0/u uname Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (intel_pt/pt=0/u). /bin/dmesg | grep -i perf may provide additional information. # perf record -e intel_pt/pt=0/u uname pt=0 doesn't make sense, forcing pt=1 Linux [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.020 MB perf.data ] # Signed-off-by: Adrian Hunter Tested-by: Arnaldo Carvalho de Melo Cc: Jiri Olsa Link: http://lkml.kernel.org/r/b7c5b4e5-9497-10e5-fd43-5f3e4a0fe51d@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 1b3aae90c6abdf8a844da2aa4aed1eb6947a7d39 Author: Arnaldo Carvalho de Melo Date: Tue Nov 27 10:31:03 2018 -0300 perf top: Allow passing a kallsyms file This basically replicates what was done for 'perf report' in: b226a5a72901 ("perf report: Allow user to specify path to kallsyms file") This should help with resolving eBPF symbols, that are in kallsyms but, of course, not in vmlinux. Reported-by: Ivan Babrou Tested-by: Ivan Babrou Cc: Adrian Hunter Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: David Ahern Cc: David S. Miller Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-x52mx1ybq8128rtg9hjrj5qk@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 19702894cd93d79c5b5a63f56f6f417595b1a57c Author: Wen Yang Date: Tue Nov 27 17:06:10 2018 +0800 perf bpf: Use ERR_CAST instead of ERR_PTR(PTR_ERR()) Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)). This makes it more readable and also fix this warning detected by err_cast.cocci: tools/perf/util/bpf-loader.c:1606:11-18: WARNING: ERR_CAST can be used with op Signed-off-by: Wen Yang Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Julia Lawall Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wen Yang Cc: zhong.weidong@zte.com.cn Link: http://lkml.kernel.org/r/20181127090610.28488-1-wen.yang99@zte.com.cn Signed-off-by: Arnaldo Carvalho de Melo commit 92151b0a230ce2792e4b2b1f43ca3ea80a83292e Author: Arnaldo Carvalho de Melo Date: Tue Nov 27 09:56:55 2018 -0300 tools include: Adopt ERR_CAST() from the kernel err.h header Add ERR_CAST(), so that tools can use it, just like the kernel. This addresses coccinelle checks that are being performed to tools/ in addition to kernel sources, so lets add this to cover that and to get tools code closer to kernel coding standards. This originally was introduced in the kernel headers in this cset: d1bc8e954452 ("Add an ERR_CAST() function to complement ERR_PTR and co.") Cc: Adrian Hunter Cc: Alexander Shishkin Cc: David Ahern Cc: David Howells Cc: Jiri Olsa Cc: Julia Lawall Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Wang Nan Cc: Wen Yang Cc: zhong.weidong@zte.com.cn Link: https://lkml.kernel.org/n/tip-tlt97p066zyhzqhl5jt86og7@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 741dad88dde296999da30332157ca47f0543747d Author: Adrian Hunter Date: Thu Nov 22 16:04:56 2018 +0200 perf test: Fix perf_event_attr test failure Fix inconsistent use of tabs and spaces error: # perf test 16 -v 16: Setup struct perf_event_attr : --- start --- test child forked, pid 20224 File "/usr/libexec/perf-core/tests/attr.py", line 119 log.warning("expected %s=%s, got %s" % (t, self[t], other[t])) ^ TabError: inconsistent use of tabs and spaces in indentation test child finished with -1 ---- end ---- Setup struct perf_event_attr: FAILED! Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: http://lkml.kernel.org/r/20181122140456.16817-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 3c567356dbe0da4fc310cfcffafc39526e1ca43a Author: Peter Zijlstra Date: Mon Dec 3 18:03:53 2018 +0100 x86/mm/cpa: Rename @addrinarray to @numpages The CPA_ARRAY interface works in single pages, and everything, except in these 'few' locations is this variable called 'numpages'. Remove this 'addrinarray' abberation and use 'numpages' consistently. Signed-off-by: Peter Zijlstra (Intel) Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: Tom.StDenis@amd.com Cc: dave.hansen@intel.com Link: http://lkml.kernel.org/r/20181203171043.695039210@infradead.org Signed-off-by: Ingo Molnar commit c38116bb940ae37f51fccd315b420ee5961dcb76 Author: Peter Zijlstra Date: Mon Dec 3 18:03:52 2018 +0100 x86/mm/cpa: Better use CLFLUSHOPT Currently we issue an MFENCE before and after flushing a range. This means that if we flush a bunch of single page ranges -- like with the cpa array, we issue a whole bunch of superfluous MFENCEs. Reorgainze the code a little to avoid this. [ mingo: capitalize instructions, tweak changelog and comments. ] Signed-off-by: Peter Zijlstra (Intel) Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: Tom.StDenis@amd.com Cc: dave.hansen@intel.com Link: http://lkml.kernel.org/r/20181203171043.626999883@infradead.org Signed-off-by: Ingo Molnar commit fe0937b24ff5d7b343b9922201e469f9a6009d9d Author: Peter Zijlstra Date: Mon Dec 3 18:03:51 2018 +0100 x86/mm/cpa: Fold cpa_flush_range() and cpa_flush_array() into a single cpa_flush() function Note that the cache flush loop in cpa_flush_*() is identical when we use __cpa_addr(); further observe that flush_tlb_kernel_range() is a special case of to the cpa_flush_array() TLB invalidation code. This then means the two functions are virtually identical. Fold these two functions into a single cpa_flush() call. Signed-off-by: Peter Zijlstra (Intel) Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: Tom.StDenis@amd.com Cc: dave.hansen@intel.com Link: http://lkml.kernel.org/r/20181203171043.559855600@infradead.org Signed-off-by: Ingo Molnar commit 83b4e39146aa70913580966e0f2b78b7c3492760 Author: Peter Zijlstra Date: Mon Dec 3 18:03:50 2018 +0100 x86/mm/cpa: Make cpa_data::numpages invariant Make sure __change_page_attr_set_clr() doesn't modify cpa->numpages. Signed-off-by: Peter Zijlstra (Intel) Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: Tom.StDenis@amd.com Cc: dave.hansen@intel.com Link: http://lkml.kernel.org/r/20181203171043.493000228@infradead.org Signed-off-by: Ingo Molnar commit 2aac9f9d5b85da1cc77c51d78aa41012244f7518 Author: Adrian Hunter Date: Thu Nov 22 15:55:45 2018 +0200 perf tests record: Allow for 'sleep' being 'coreutils' If the 'sleep' command is provided by coreutils, then the "PERF_RECORD_* events & perf_sample fields" test will fail because the MMAP name is 'coreutils' not 'sleep', and there is an extra COMM event. Fix the test to detect that case. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: http://lkml.kernel.org/r/20181122135545.16295-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 935f5839827ef54b53406e80906f7c355eb73c1b Author: Peter Zijlstra Date: Mon Dec 3 18:03:49 2018 +0100 x86/mm/cpa: Optimize cpa_flush_array() TLB invalidation Instead of punting and doing tlb_flush_all(), do the same as flush_tlb_kernel_range() does and use single page invalidations. Signed-off-by: Peter Zijlstra (Intel) Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: Tom.StDenis@amd.com Cc: dave.hansen@intel.com Link: http://lkml.kernel.org/r/20181203171043.430001980@infradead.org Signed-off-by: Ingo Molnar commit 5fe26b7a8f4693d532c7a3c3632e47e7d7016238 Author: Peter Zijlstra Date: Mon Dec 3 18:03:48 2018 +0100 x86/mm/cpa: Simplify the code after making cpa->vaddr invariant Since cpa->vaddr is invariant, this means we can remove all workarounds that deal with it changing. Signed-off-by: Peter Zijlstra (Intel) Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: Tom.StDenis@amd.com Cc: dave.hansen@intel.com Link: http://lkml.kernel.org/r/20181203171043.366619025@infradead.org Signed-off-by: Ingo Molnar commit 98bfc9b038cde1ce108f69a50720e394fe774cb7 Author: Peter Zijlstra Date: Mon Dec 3 18:03:47 2018 +0100 x86/mm/cpa: Make cpa_data::vaddr invariant Currently __change_page_attr_set_clr() will modify cpa->vaddr when !(CPA_ARRAY | CPA_PAGES_ARRAY), whereas in the array cases it will increment cpa->curpage. Change __cpa_addr() such that its @idx argument also works in the !array case and use cpa->curpage increments for all cases. NOTE: since cpa_data::numpages is 'unsigned long' so should cpa_data::curpage be. NOTE: after this only cpa->numpages is still modified. Signed-off-by: Peter Zijlstra (Intel) Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: Tom.StDenis@amd.com Cc: dave.hansen@intel.com Link: http://lkml.kernel.org/r/20181203171043.295174892@infradead.org Signed-off-by: Ingo Molnar commit 16ebf031e8ab73779a382c9f2b097891da6af923 Author: Peter Zijlstra Date: Mon Dec 3 18:03:46 2018 +0100 x86/mm/cpa: Add __cpa_addr() helper The code to compute the virtual address of a cpa_data is duplicated; introduce a helper before more copies happen. Signed-off-by: Peter Zijlstra (Intel) Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: Tom.StDenis@amd.com Cc: dave.hansen@intel.com Link: http://lkml.kernel.org/r/20181203171043.229119497@infradead.org Signed-off-by: Ingo Molnar commit ecc729f1f47142ad31741549f400b611435c1af7 Author: Peter Zijlstra Date: Mon Dec 3 18:03:45 2018 +0100 x86/mm/cpa: Add ARRAY and PAGES_ARRAY selftests The current pageattr-test code only uses the regular range interface, add code that also tests the array and pages interface. Signed-off-by: Peter Zijlstra (Intel) Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: Tom.StDenis@amd.com Cc: dave.hansen@intel.com Link: http://lkml.kernel.org/r/20181203171043.162771364@infradead.org Signed-off-by: Ingo Molnar commit 0631ca3a6e6edd23a2ca7cab707d1abf291a097d Author: Adrian Hunter Date: Thu Nov 22 13:29:37 2018 +0200 tools lib traceevent: Fix compile warnings in tools/lib/traceevent/event-parse.c Fix following warnings: event-parse.c: In function ‘tep_find_event_by_name’: event-parse.c:3521:21: warning: ‘event’ may be used uninitialized in this function [-Wmaybe-uninitialized] pevent->last_event = event; ~~~~~~~~~~~~~~~~~~~^~~~~~~ CC ui/gtk/hists.o LINK plugin_mac80211.so CC nlattr.o event-parse.c: In function ‘tep_data_lat_fmt’: event-parse.c:5200:4: warning: ‘migrate_disable’ may be used uninitialized in this function [-Wmaybe-uninitialized] trace_seq_printf(s, "%d", migrate_disable); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ event-parse.c:5207:4: warning: ‘lock_depth’ may be used uninitialized in this function [-Wmaybe-uninitialized] trace_seq_printf(s, "%d", lock_depth); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LINK plugin_sched_switch.so LINK plugin_function.so LINK plugin_xen.so event-parse.c: In function ‘tep_event_info’: event-parse.c:5047:7: warning: ‘len_arg’ may be used uninitialized in this function [-Wmaybe-uninitialized] trace_seq_printf(s, format, len_arg, (char)val); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ event-parse.c:4884:6: note: ‘len_arg’ was declared here int len_arg; ^~~~~~~ event-parse.c:4338:11: warning: ‘vsize’ may be used uninitialized in this function [-Wmaybe-uninitialized] val = tep_read_number(pevent, bptr, vsize); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ event-parse.c:4224:6: note: ‘vsize’ was declared here int vsize; ^~~~~ $ gcc --version gcc (Clear Linux OS for Intel Architecture) 8.2.1 20180502 Signed-off-by: Adrian Hunter Cc: Jiri Olsa Cc: Steven Rostedt (VMware) Cc: Tzvetomir Stoyanov (VMware) Link: http://lkml.kernel.org/r/20181122112937.10582-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 692d0e63324d2954a0c63a812a8588e97023a295 Author: Adrian Hunter Date: Tue Nov 6 23:07:12 2018 +0200 perf script: Use fallbacks for branch stacks Branch stacks do not necessarily have the same cpumode as the 'ip'. Use the fallback functions in those cases. This patch depends on patch "perf tools: Add fallback functions for cases where cpumode is insufficient". Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: David S. Miller Cc: Jiri Olsa Cc: Leo Yan Cc: Mathieu Poirier Cc: stable@vger.kernel.org # 4.19 Link: http://lkml.kernel.org/r/20181106210712.12098-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 225f99e0c811e23836c4911a2ff147e167dd1fe8 Author: Adrian Hunter Date: Tue Nov 6 23:07:11 2018 +0200 perf tools: Use fallback for sample_addr_correlates_sym() cases thread__resolve() is used in the sample_addr_correlates_sym() cases where 'addr' is a destination of a branch which does not necessarily have the same cpumode as the 'ip'. Use the fallback function in that case. This patch depends on patch "perf tools: Add fallback functions for cases where cpumode is insufficient". Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: David S. Miller Cc: Jiri Olsa Cc: Leo Yan Cc: Mathieu Poirier Cc: stable@vger.kernel.org # 4.19 Link: http://lkml.kernel.org/r/20181106210712.12098-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 8e80ad9983caeee09c3a0a1a37e05bff93becce4 Author: Adrian Hunter Date: Tue Nov 6 23:07:10 2018 +0200 perf thread: Add fallback functions for cases where cpumode is insufficient For branch stacks or branch samples, the sample cpumode might not be correct because it applies only to the sample 'ip' and not necessary to 'addr' or branch stack addresses. Add fallback functions that can be used to deal with those cases Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: David S. Miller Cc: Jiri Olsa Cc: Leo Yan Cc: Mathieu Poirier Cc: stable@vger.kernel.org # 4.19 Link: http://lkml.kernel.org/r/20181106210712.12098-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit ec1891afae740be581ecf5abc8bda74c4549203f Author: Adrian Hunter Date: Tue Nov 6 23:07:10 2018 +0200 perf machine: Record if a arch has a single user/kernel address space Some architectures have a single address space for kernel and user addresses, which makes it possible to determine if an address is in kernel space or user space. Some don't, e.g.: sparc. Cache that info in perf_env so that, for instance, code needing to fallback failed symbol lookups at the kernel space in single address space arches can lookup at userspace. Signed-off-by: Adrian Hunter Cc: Andi Kleen Cc: David S. Miller Cc: Jiri Olsa Cc: Leo Yan Cc: Mathieu Poirier Cc: stable@vger.kernel.org # 4.19 Link: http://lkml.kernel.org/r/20181106210712.12098-2-adrian.hunter@intel.com [ split from a larger patch ] Signed-off-by: Arnaldo Carvalho de Melo commit 804234f27180dcf9a25cb98a88d5212f65b7f3fd Author: Arnaldo Carvalho de Melo Date: Tue Nov 27 11:45:49 2018 -0300 perf env: Also consider env->arch == NULL as local operation We'll set a new machine field based on env->arch, which for live mode, like with 'perf top' means we need to use uname() to figure the name of the arch, fix perf_env__arch() to consider both (env == NULL) and (env->arch == NULL) as local operation. Cc: Adrian Hunter Cc: Andi Kleen Cc: David Ahern Cc: David S. Miller Cc: Jiri Olsa Cc: Leo Yan Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Wang Nan Cc: stable@vger.kernel.org # 4.19 Link: https://lkml.kernel.org/n/tip-vcz4ufzdon7cwy8dm2ua53xk@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit b18e088825883bcb8dc4c4a641494049cf8ccec3 Author: Eric Saint-Etienne Date: Fri Nov 23 02:42:39 2018 -0800 perf map: Remove extra indirection from map__find() A double pointer is used in map__find() where a single pointer is enough because the function doesn't affect the rbtree and the rbtree is locked. Signed-off-by: Eric Saint-Etienne Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Eric Saint-Etienne Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1542969759-24346-1-git-send-email-eric.saint.etienne@oracle.com Signed-off-by: Arnaldo Carvalho de Melo commit bc4da38a4789e7819fca4c7723ded0b86aea27c0 Author: Stephane Eranian Date: Wed Nov 7 02:50:45 2018 -0800 perf stat: Fix CSV mode column output for non-cgroup events When using the -x option, perf stat prints CSV-style output with one event per line. For each event, it prints the count, the unit, the event name, the cgroup, and a bunch of other event specific fields (such as insn per cycles). When you use CSV-style mode, you expect a normalized output where each event is printed with the same number of fields regardless of what it is so it can easily be imported into a spreadsheet or parsed. For instance, if an event does not have a unit, then print an empty field for it. Although this approach was implemented for the unit, it was not for the cgroup. When mixing cgroup and non-cgroup events, then non-cgroup events would not show an empty field, instead the next field was printed, make columns not line up correctly. This patch fixes the cgroup output issues by forcing an empty field for non-cgroup events as soon as one event has cgroup. Before: @ @cycles @foo @ 0 @100.00@@ 2531614 @ @cycles @6420922@100.00@ @ foo cgroup lines up with time_running! After: @ @cycles @foo @0 @100.00@@ 2594834 @ @cycles @ @5287372 @100.00@@ Fields line up. Signed-off-by: Stephane Eranian Acked-by: Jiri Olsa Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1541587845-9150-1-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 57ddf09173c1e7d0511ead8924675c7198e56545 Author: Ravi Bangoria Date: Fri Nov 16 09:58:43 2018 +0530 perf stat: Fix shadow stats for clock events Commit 0aa802a79469 ("perf stat: Get rid of extra clock display function") introduced scale and unit for clock events. Thus, perf_stat__update_shadow_stats() now saves scaled values of clock events in msecs, instead of original nsecs. But while calculating values of shadow stats we still consider clock event values in nsecs. This results in a wrong shadow stat values. Ex, # ./perf stat -e task-clock,cycles ls 2.60 msec task-clock:u # 0.877 CPUs utilized 2,430,564 cycles:u # 1215282.000 GHz Fix this by saving original nsec values for clock events in perf_stat__update_shadow_stats(). After patch: # ./perf stat -e task-clock,cycles ls 3.14 msec task-clock:u # 0.839 CPUs utilized 3,094,528 cycles:u # 0.985 GHz Suggested-by: Jiri Olsa Reported-by: Anton Blanchard Signed-off-by: Ravi Bangoria Reviewed-by: Jiri Olsa Cc: Alexander Shishkin Cc: Jin Yao Cc: Namhyung Kim Cc: Thomas Richter Cc: yuzhoujian@didichuxing.com Fixes: 0aa802a79469 ("perf stat: Get rid of extra clock display function") Link: http://lkml.kernel.org/r/20181116042843.24067-1-ravi.bangoria@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 54fceb0bafd9f80fa2f8acb2fbadb039e2d55c9f Author: Arnaldo Carvalho de Melo Date: Thu Nov 29 20:41:54 2018 -0300 perf build: Give better hint about devel package for libssl In debian/ubuntu its libssl-dev, but for fedora/RHEL/Centos/etc its openssl-devel, fix it. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian Cc: Wang Nan Fixes: 8ee4646038e4 ("perf build: Add libcrypto feature detection") Link: https://lkml.kernel.org/n/tip-lnxqszts6aq2c9jy4b7mlnym@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 02117e42db7470e59910088b2b0ee42d581d2651 Merge: ba6f508d0ec4a 721066dfd4d5c Author: Ingo Molnar Date: Mon Dec 17 18:48:25 2018 +0100 Merge branch 'x86/urgent' into x86/mm, to pick up dependent fix Signed-off-by: Ingo Molnar commit c03b0358ab60504151b35587c88205c7b7fe22be Author: Paolo Abeni Date: Mon Dec 17 12:39:02 2018 +0100 net: unbreak CONFIG_RETPOLINE=n builds The kbuild bot reported a build breakage with CONFIG_RETPOLINE=n due to commit aaa5d90b395a ("net: use indirect call wrappers at GRO network layer"). I screwed the wrapper implementation for such config. Fix the issue properly ignoring the builtin symbols arguments, when retpoline is not enabled. Reported-by: kbuild test robot Fixes: aaa5d90b395a ("net: use indirect call wrappers at GRO network layer") Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 8162b3d1a728cf63abf54be4167dd9beec5d9d37 Author: Masami Hiramatsu Date: Mon Dec 17 17:21:53 2018 +0900 kprobes/x86: Remove unneeded arch_within_kprobe_blacklist from x86 Remove x86 specific arch_within_kprobe_blacklist(). Since we have already added all blacklisted symbols to the kprobe blacklist by arch_populate_kprobe_blacklist(), we don't need arch_within_kprobe_blacklist() on x86 anymore. Tested-by: Andrea Righi Signed-off-by: Masami Hiramatsu Cc: Andy Lutomirski Cc: Anil S Keshavamurthy Cc: Borislav Petkov Cc: David S. Miller Cc: Linus Torvalds Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Yonghong Song Link: http://lkml.kernel.org/r/154503491354.26176.13903264647254766066.stgit@devbox Signed-off-by: Ingo Molnar commit fe6e65615415987629a2dda583b4495677d8c388 Author: Masami Hiramatsu Date: Mon Dec 17 17:21:24 2018 +0900 kprobes/x86: Show x86-64 specific blacklisted symbols correctly Show x86-64 specific blacklisted symbols in debugfs. Since x86-64 prohibits probing on symbols which are in entry text, those should be shown. Tested-by: Andrea Righi Signed-off-by: Masami Hiramatsu Cc: Andy Lutomirski Cc: Anil S Keshavamurthy Cc: Borislav Petkov Cc: David S. Miller Cc: Linus Torvalds Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Yonghong Song Link: http://lkml.kernel.org/r/154503488425.26176.17136784384033608516.stgit@devbox Signed-off-by: Ingo Molnar commit fb1a59fae8baa3f3c69b72a87ff94fc4fa5683ec Author: Masami Hiramatsu Date: Mon Dec 17 17:20:55 2018 +0900 kprobes: Blacklist symbols in arch-defined prohibited area Blacklist symbols in arch-defined probe-prohibited areas. With this change, user can see all symbols which are prohibited to probe in debugfs. All archtectures which have custom prohibit areas should define its own arch_populate_kprobe_blacklist() function, but unless that, all symbols marked __kprobes are blacklisted. Reported-by: Andrea Righi Tested-by: Andrea Righi Signed-off-by: Masami Hiramatsu Cc: Andy Lutomirski Cc: Anil S Keshavamurthy Cc: Borislav Petkov Cc: David S. Miller Cc: Linus Torvalds Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Yonghong Song Link: http://lkml.kernel.org/r/154503485491.26176.15823229545155174796.stgit@devbox Signed-off-by: Ingo Molnar commit 76aea1eeb98d2d75d9297fda777efeffe3657aeb Merge: 43b9e4febc66b 7566ec393f416 Author: Ingo Molnar Date: Mon Dec 17 17:46:26 2018 +0100 Merge tag 'v4.20-rc7' into perf/core, to pick up fixes Signed-off-by: Ingo Molnar commit 283ac6d5fb2a47f12bcef7806b78acf6ad89907e Author: Shuah Khan Date: Wed Dec 12 20:25:14 2018 -0700 selftests: Fix test errors related to lib.mk khdr target Commit b2d35fa5fc80 ("selftests: add headers_install to lib.mk") added khdr target to run headers_install target from the main Makefile. The logic uses KSFT_KHDR_INSTALL and top_srcdir as controls to initialize variables and include files to run headers_install from the top level Makefile. There are a few problems with this logic. 1. Exposes top_srcdir to all tests 2. Common logic impacts all tests 3. Uses KSFT_KHDR_INSTALL, top_srcdir, and khdr in an adhoc way. Tests add "khdr" dependency in their Makefiles to TEST_PROGS_EXTENDED in some cases, and STATIC_LIBS in other cases. This makes this framework confusing to use. The common logic that runs for all tests even when KSFT_KHDR_INSTALL isn't defined by the test. top_srcdir is initialized to a default value when test doesn't initialize it. It works for all tests without a sub-dir structure and tests with sub-dir structure fail to build. e.g: make -C sparc64/drivers/ or make -C drivers/dma-buf ../../lib.mk:20: ../../../../scripts/subarch.include: No such file or directory make: *** No rule to make target '../../../../scripts/subarch.include'. Stop. There is no reason to require all tests to define top_srcdir and there is no need to require tests to add khdr dependency using adhoc changes to TEST_* and other variables. Fix it with a consistent use of KSFT_KHDR_INSTALL and top_srcdir from tests that have the dependency on headers_install. Change common logic to include khdr target define and "all" target with dependency on khdr when KSFT_KHDR_INSTALL is defined. Only tests that have dependency on headers_install have to define just the KSFT_KHDR_INSTALL, and top_srcdir variables and there is no need to specify khdr dependency in the test Makefiles. Fixes: b2d35fa5fc80 ("selftests: add headers_install to lib.mk") Cc: stable@vger.kernel.org Signed-off-by: Shuah Khan Reviewed-by: Khalid Aziz Reviewed-by: Anders Roxell Signed-off-by: Shuah Khan commit e7121ab4056ff3419f981bbf03c1e7db39223149 Author: Mauro Carvalho Chehab Date: Mon Dec 17 10:57:20 2018 -0500 media: docs: fix some GPL licensing ambiguity at the text Those files are meant to be dual GPL 2.0 and GFDL without implicit sections. However, by a wrong cut-and-paste, I ended by applying a GPL 2+ license text to it, while still using the GPL 2.0 SPDX tag, with would cause an ambiguity about the licensing model. Solve this by explicitly mentioning that the dual licensing is between GPL 2.0 and GFDL and correcting the text. Signed-off-by: Mauro Carvalho Chehab commit 4bd257d884902b81493cf11531915009ab5787cf Merge: d2b4387f3bdf0 7566ec393f416 Author: Mauro Carvalho Chehab Date: Mon Dec 17 10:34:24 2018 -0500 Merge tag 'v4.20-rc7' into patchwork Linux 4.20-rc7 * tag 'v4.20-rc7': (403 commits) Linux 4.20-rc7 scripts/spdxcheck.py: always open files in binary mode checkstack.pl: fix for aarch64 userfaultfd: check VM_MAYWRITE was set after verifying the uffd is registered fs/iomap.c: get/put the page in iomap_page_create/release() hugetlbfs: call VM_BUG_ON_PAGE earlier in free_huge_page() memblock: annotate memblock_is_reserved() with __init_memblock psi: fix reference to kernel commandline enable arch/sh/include/asm/io.h: provide prototypes for PCI I/O mapping in asm/io.h mm/sparse: add common helper to mark all memblocks present mm: introduce common STRUCT_PAGE_MAX_SHIFT define alpha: fix hang caused by the bootmem removal XArray: Fix xa_alloc when id exceeds max drm/vmwgfx: Protect from excessive execbuf kernel memory allocations v3 MAINTAINERS: Daniel for drm co-maintainer drm/amdgpu: drop fclk/gfxclk ratio setting IB/core: Fix oops in netdev_next_upper_dev_rcu() dm thin: bump target version drm/vmwgfx: remove redundant return ret statement drm/i915: Flush GPU relocs harder for gen3 ... commit 1669907e3d1abfa3f7586e2d55dbbc117b5adba2 Author: Ross Lagerwall Date: Fri Dec 14 12:55:45 2018 +0000 xen/pciback: Check dev_data before using it If pcistub_init_device fails, the release function will be called with dev_data set to NULL. Check it before using it to avoid a NULL pointer dereference. Signed-off-by: Ross Lagerwall Reviewed-by: Boris Ostrovsky Signed-off-by: Boris Ostrovsky commit bf9445a33ae6ac2f0822d2f1ce1365408387d568 Author: Andrea Righi Date: Mon Dec 10 16:12:57 2018 +0100 kprobes/x86/xen: blacklist non-attachable xen interrupt functions Blacklist symbols in Xen probe-prohibited areas, so that user can see these prohibited symbols in debugfs. See also: a50480cb6d61. Signed-off-by: Andrea Righi Acked-by: Masami Hiramatsu Signed-off-by: Boris Ostrovsky commit ec18f48bbc415bbdf6c9764603e2a18d5f04943d Author: Seung-Woo Kim Date: Fri Dec 14 12:34:09 2018 +0100 tty: serial: samsung: Increase maximum baudrate This driver can be used to communicate with Bluetooth chip in high-speed UART mode, so increase the maximum baudrate to 3Mbps. Signed-off-by: Seung-Woo Kim [mszyprow: rephrased commit message] Signed-off-by: Marek Szyprowski Signed-off-by: Greg Kroah-Hartman commit 31e933645742ee6719d37573a27cce0761dcf92b Author: Beomho Seo Date: Fri Dec 14 12:34:08 2018 +0100 tty: serial: samsung: Properly set flags in autoCTS mode Commit 391f93f2ec9f ("serial: core: Rework hw-assited flow control support") has changed the way the autoCTS mode is handled. According to that change, serial drivers which enable H/W autoCTS mode must set UPSTAT_AUTOCTS to prevent the serial core from inadvertently disabling TX. This patch adds proper handling of UPSTAT_AUTOCTS flag. Signed-off-by: Beomho Seo [mszyprow: rephrased commit message] Signed-off-by: Marek Szyprowski Signed-off-by: Greg Kroah-Hartman commit 778ec49c14018730ec177bdd34b17e15e2e748b8 Author: Rob Herring Date: Wed Dec 5 13:50:43 2018 -0600 tty: Use of_node_name_{eq,prefix} 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. For hvc, the code can also be simplified by using of_stdout pointer instead of searching again for the stdout node. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-serial@vger.kernel.org Cc: sparclinux@vger.kernel.org Signed-off-by: Rob Herring Acked-by: Michael Ellerman Acked-by: David S. Miller Signed-off-by: Greg Kroah-Hartman commit d72402145ace0697a6a9e8e75a3de5bf3375f78d Author: Sergey Senozhatsky Date: Thu Dec 13 13:58:39 2018 +0900 tty/serial: do not free trasnmit buffer page under port lock LKP has hit yet another circular locking dependency between uart console drivers and debugobjects [1]: CPU0 CPU1 rhltable_init() __init_work() debug_object_init uart_shutdown() /* db->lock */ /* uart_port->lock */ debug_print_object() free_page() printk() call_console_drivers() debug_check_no_obj_freed() /* uart_port->lock */ /* db->lock */ debug_print_object() So there are two dependency chains: uart_port->lock -> db->lock And db->lock -> uart_port->lock This particular circular locking dependency can be addressed in several ways: a) One way would be to move debug_print_object() out of db->lock scope and, thus, break the db->lock -> uart_port->lock chain. b) Another one would be to free() transmit buffer page out of db->lock in UART code; which is what this patch does. It makes sense to apply a) and b) independently: there are too many things going on behind free(), none of which depend on uart_port->lock. The patch fixes transmit buffer page free() in uart_shutdown() and, additionally, in uart_port_startup() (as was suggested by Dmitry Safonov). [1] https://lore.kernel.org/lkml/20181211091154.GL23332@shao2-debian/T/#u Signed-off-by: Sergey Senozhatsky Reviewed-by: Petr Mladek Acked-by: Peter Zijlstra (Intel) Cc: Greg Kroah-Hartman Cc: Jiri Slaby Cc: Andrew Morton Cc: Waiman Long Cc: Dmitry Safonov Cc: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit d464b7dba1b82dce315af16de88cd6a866306b55 Author: Christian Gromm Date: Mon Dec 17 15:10:17 2018 +0100 staging: most: Documentation: add information to driver_usage file This patch updates driver_usage.txt file to reflect the latest changes that this patch set introduces. Signed-off-by: Christian Gromm Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit e6861b916e7d09b5692fd907e19d6f87e050c9b1 Author: Christian Gromm Date: Mon Dec 17 15:10:16 2018 +0100 staging: most: sound: remove channel number from ALSA card's long name Adding the channel number to the name of the sound card is wrong, as the card does not represent a single streaming channel of the MOST device. Signed-off-by: Christian Gromm Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 6cebb201963677795e8828c858c2e1502ba39b55 Author: Christian Gromm Date: Mon Dec 17 15:10:15 2018 +0100 staging: most: sound: use static name for ALSA card This patch uses a static name for the sound card's short name and long name. Having the card names configurable doesn't make sense anymore, as the card represents the same physical hardware. Signed-off-by: Christian Gromm Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 4c6375dc1c03a5097cb9f3575a441c15b270e397 Author: Christian Gromm Date: Mon Dec 17 15:10:14 2018 +0100 staging: most: sound: rename variable Since the channels of a MOST device are now being represented as individual PCM devices of one sound card, the variable card_name is not suitable anymore to describe them. Therefore, this patch renames the variable to device_name. Signed-off-by: Christian Gromm Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit ba99c631810bd9aef2fc7e62420d77371d2d04f5 Author: Christian Gromm Date: Mon Dec 17 15:10:13 2018 +0100 staging: most: sound: correct label name This patch fixes the lable name that is used to jump to error handling section of function audio_probe_channel() in case something went wrong. Signed-off-by: Christian Gromm Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 15600aea2754c3f0cd3440b95b91bbf1602a3fca Author: Christian Gromm Date: Mon Dec 17 15:10:12 2018 +0100 staging: most: sound: create one sound card w/ multiple PCM devices per MOST device This patch avoids that a sound card is created and registered with ALSA every time a channel is being linked. Instead the channels are hooked on the same card, which is registered not until the final link has been added to the component. The string provided by user space that used to be the card name becomes the PCM device name. The user space API to add a link is being expanded by a "create" flag to trigger the registration. Signed-off-by: Christian Gromm Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 6d7f677a2afa1c82d7fc7af7f9159cbffd5dc010 Author: Darwin Dingel Date: Mon Dec 10 11:29:09 2018 +1300 serial: 8250: Rate limit serial port rx interrupts during input overruns When a serial port gets faulty or gets flooded with inputs, its interrupt handler starts to work double time to get the characters to the workqueue for the tty layer to handle them. When this busy time on the serial/tty subsystem happens during boot, where it is also busy on the userspace trying to initialise, some processes can continuously get preempted and will be on hold until the interrupts subside. The fix is to backoff on processing received characters for a specified amount of time when an input overrun is seen (received a new character before the previous one is processed). This only stops receive and will continue to transmit characters to serial port. After the backoff period is done, it receive will be re-enabled. This is optional and will only be enabled by setting 'overrun-throttle-ms' in the dts. Signed-off-by: Darwin Dingel Signed-off-by: Greg Kroah-Hartman commit bdb48e4c7d0796850d4c1a24fe1386677e8a922c Author: Darwin Dingel Date: Mon Dec 10 11:27:39 2018 +1300 dt-bindings: serial: 8250: Add rate limit for serial port input overruns When a serial port continuously experiences input overrun from (1) continuous receive characters from remote and or (2) hardware issues, its interrupt handler can preempt other tasks especially when the system is busy (ie. boot up period). This can cause other tasks to get starved of processing time from the CPU. When this dts binding is enabled and input overrun on the serial port is detected, serial port receive will be throttled to give some breathing room for processing other tasks. Value provided will be in milliseconds. &serial0{ overrun-throttle-ms = <500>; }; Signed-off-by: Darwin Dingel Reviewed-by: Rob Herring Signed-off-by: Greg Kroah-Hartman commit 4bc16f9dd71a7a8590114e7d7e8812a0214d2994 Author: Marek Vasut Date: Sun Dec 16 18:38:58 2018 +0100 gpio: pca953x: Add regmap dependency for PCA953x driver Select REGMAP_I2C in Kconfig, since the driver now depends on regmap and this was missing, thus breaking build on various systems. Signed-off-by: Marek Vasut Cc: Linus Walleij Cc: Bartosz Golaszewski Signed-off-by: Linus Walleij commit 85af74c474b21940e88483fd48f6094145c89d97 Author: Nicolas Saenz Julienne Date: Mon Dec 10 17:50:05 2018 +0100 gpio: raspberrypi-exp: decrease refcount on firmware dt node We're getting a reference RPi's firmware node in order to be able to communicate with it's driver. We should decrease the reference count on the dt node after being done with it. Fixes: a98d90e7d588 ("gpio: raspberrypi-exp: Driver for RPi3 GPIO expander via mailbox service") Signed-off-by: Nicolas Saenz Julienne Signed-off-by: Linus Walleij commit 64a428077758383518c258641e81d57fcd454792 Author: Ryan Case Date: Thu Dec 13 11:43:20 2018 -0800 tty: serial: qcom_geni_serial: Remove interrupt storm Disable M_TX_FIFO_WATERMARK_EN after we've sent all data for a given transaction so we don't continue to receive a flurry of free space interrupts while waiting for the M_CMD_DONE notification. Re-enable the watermark when establishing the next transaction. Also clear the watermark interrupt after filling the FIFO so we do not receive notification again prior to actually having free space. Signed-off-by: Ryan Case Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson Signed-off-by: Greg Kroah-Hartman commit 6e0856d317440a950b17c00a9283114f025e5699 Author: Pan Bian Date: Thu Nov 22 08:52:33 2018 +0800 HID: intel-ish-hid: fixes incorrect error handling The memory chunk allocated by hid_allocate_device() should be released by hid_destroy_device(), not kfree(). Fixes: 0b28cb4bcb1("HID: intel-ish-hid: ISH HID client driver") Signed-off-by: Pan Bian Reviewed-by: Benjamin Tissoires Signed-off-by: Jiri Kosina commit 71ab1c0336c71ace5725740f200beca9667a339f Author: Geert Uytterhoeven Date: Thu Dec 13 19:44:43 2018 +0100 serial: sh-sci: Resume PIO in sci_rx_interrupt() on DMA failure On (H)SCIF, sci_submit_rx() is called in the receive interrupt handler. Hence if DMA submission fails, the interrupt handler should resume handling reception using PIO, else no more data is received. Make sci_submit_rx() return an error indicator, so the receive interrupt handler can act appropriately. Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman Acked-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman commit 2e948218b7c1262a3830823d6620eb227e3d4e3a Author: Geert Uytterhoeven Date: Thu Dec 13 19:44:42 2018 +0100 serial: sh-sci: Fix crash in rx_timer_fn() on PIO fallback When falling back to PIO, active_rx must be set to a different value than cookie_rx[i], else sci_dma_rx_find_active() will incorrectly find a match, leading to a NULL pointer dereference in rx_timer_fn() later. Use zero instead, which is the same value as after driver initialization. Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman commit dd1f2250da95e87cb3e612858f94b14f99445a7c Author: Geert Uytterhoeven Date: Thu Dec 13 19:44:41 2018 +0100 serial: sh-sci: Fix locking in sci_submit_rx() Some callers of sci_submit_rx() hold the port spinlock, others don't. During fallback to PIO, the driver needs to obtain the port spinlock. If the lock was already held, spinlock recursion is detected, causing a deadlock: BUG: spinlock recursion on CPU#0. Fix this by adding a flag parameter to sci_submit_rx() for the caller to indicate the port spinlock is already held, so spinlock recursion can be avoided. Move the spin_lock_irqsave() up, so all DMA disable steps are protected, which is safe as the recently introduced dmaengine_terminate_async() can be called in atomic context. Signed-off-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Greg Kroah-Hartman commit 52042d8e82ff50d40e76a275ac0b97aa663328b0 Author: Andrea Gelmini Date: Wed Nov 28 12:05:13 2018 +0100 btrfs: Fix typos in comments and strings The typos accumulate over time so once in a while time they get fixed in a large patch. Signed-off-by: Andrea Gelmini Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1690dd41e0cb1dade80850ed8a3eb0121b96d22f Author: Johannes Thumshirn Date: Wed Dec 12 15:14:17 2018 +0100 btrfs: improve error handling of btrfs_add_link In the error handling block, err holds the return value of either btrfs_del_root_ref() or btrfs_del_inode_ref() but it hasn't been checked since it's introduction with commit fe66a05a0679 (Btrfs: improve error handling for btrfs_insert_dir_item callers) in 2012. If the error handling in the error handling fails, there's not much left to do and the abort either happened earlier in the callees or is necessary here. So if one of btrfs_del_root_ref() or btrfs_del_inode_ref() failed, abort the transaction, but still return the original code of the failure stored in 'ret' as this will be reported to the user. Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit 34a28e3d77535efc7761aa8d67275c07d1fe2c58 Author: Filipe Manana Date: Fri Dec 7 15:25:38 2018 +0000 Btrfs: use generic_remap_file_range_prep() for cloning and deduplication Since cloning and deduplication are no longer Btrfs specific operations, we now have generic code to handle parameter validation, compare file ranges used for deduplication, clear capabilities when cloning, etc. This change makes Btrfs use it, eliminating a lot of code in Btrfs and also fixing a few bugs, such as: 1) When cloning, the destination file's capabilities were not dropped (the fstest generic/513 tests this); 2) We were not checking if the destination file is immutable; 3) Not checking if either the source or destination files are swap files (swap file support is coming soon for Btrfs); 4) System limits were not checked (resource limits and O_LARGEFILE). Note that the generic helper generic_remap_file_range_prep() does start and waits for writeback by calling filemap_write_and_wait_range(), however that is not enough for Btrfs for two reasons: 1) With compression, we need to start writeback twice in order to get the pages marked for writeback and ordered extents created; 2) filemap_write_and_wait_range() (and all its other variants) only waits for the IO to complete, but we need to wait for the ordered extents to finish, so that when we do the actual reflinking operations the file extent items are in the fs tree. This is also important due to the fact that the generic helper, for the deduplication case, compares the contents of the pages in the requested range, which might require reading extents from disk in the very unlikely case that pages get invalidated after writeback finishes (so the file extent items must be up to date in the fs tree). Since these reasons are specific to Btrfs we have to do it in the Btrfs code before calling generic_remap_file_range_prep(). This also results in a simpler way of dealing with existing delalloc in the source/target ranges, specially for the deduplication case where we used to lock all the pages first and then if we found any dealloc for the range, or ordered extent, we would unlock the pages trigger writeback and wait for ordered extents to complete, then lock all the pages again and check if deduplication can be done. So now we get a simpler approach: lock the inodes, then trigger writeback and then wait for ordered extents to complete. So make btrfs use generic_remap_file_range_prep() (XFS and OCFS2 use it) to eliminate duplicated code, fix a few bugs and benefit from future bug fixes done there - for example the recent clone and dedupe bugs involving reflinking a partial EOF block got a counterpart fix in the generic helper, since it affected all filesystems supporting these operations, so we no longer need special checks in Btrfs for them. Reviewed-by: Nikolay Borisov Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 61ed3a144aa75e76a3b0f75c2f49c81435e74621 Author: Nikolay Borisov Date: Thu Nov 29 18:41:31 2018 +0200 btrfs: Refactor main loop in extent_readpages extent_readpages processes all pages in the readlist in batches of 16, this is implemented by a single for loop but thanks to an if condition the loop does 2 things based on whether we've filled the batch or not. Additionally due to the structure of the code there is an additional check which deals with partial batches. Streamline all of this by explicitly using two loops. The outter one is used to process all pages while the inner one just fills in the batch of 16 (currently). Due to this new structure the code guarantees that all pages are processed in the loop hence the code to deal with any leftovers is eliminated. This also enable the compiler to inline __extent_readpages: ./scripts/bloat-o-meter fs/btrfs/extent_io.o extent_io.for add/remove: 0/1 grow/shrink: 1/0 up/down: 660/-820 (-160) Function old new delta extent_readpages 476 1136 +660 __extent_readpages 820 - -820 Total: Before=44315, After=44155, chg -0.36% Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 15c8276302c42ebf704b44578f25bc35dfdbde24 Author: Nikolay Borisov Date: Wed Dec 5 10:48:50 2018 +0200 btrfs: Remove 1st shrink/grow phase from balance The first step of the rebalance process ensures there is 1MiB free on each device. This number seems rather small. And in fact when talking to the original authors their opinions were: "man that's a little bonkers" "i don't think we even need that code anymore" "I think it was there to make sure we had room for the blank 1M at the beginning. I bet it goes all the way back to v0" "we just don't need any of that tho, i say we just delete it" Clearly, this piece of code has lost its original intent throughout the years. It doesn't really bring any real practical benefits to the relocation process. Additionally, this patch makes the balance process more lightweight by removing a pair of shrink/grow operations which are rather expensive for heavily populated filesystems. This is mainly due to shrink requiring relocating block groups, involving heavy use of the btree. The intermediate shrink/grow can fail and leave the filesystem in a middle state that would need to be changed back by the user. Suggested-by: Josef Bacik Reviewed-by: Josef Bacik Signed-off-by: Nikolay Borisov [ update changelog ] Signed-off-by: David Sterba commit be6821f82c3cc36e026f5afd10249988852b35ea Author: Filipe Manana Date: Tue Dec 11 10:19:45 2018 +0000 Btrfs: send, fix race with transaction commits that create snapshots If we create a snapshot of a snapshot currently being used by a send operation, we can end up with send failing unexpectedly (returning -ENOENT error to user space for example). The following diagram shows how this happens. CPU 1 CPU2 CPU3 btrfs_ioctl_send() (...) create_snapshot() -> creates snapshot of a root used by the send task btrfs_commit_transaction() create_pending_snapshot() __get_inode_info() btrfs_search_slot() btrfs_search_slot_get_root() down_read commit_root_sem get reference on eb of the commit root -> eb with bytenr == X up_read commit_root_sem btrfs_cow_block(root node) btrfs_free_tree_block() -> creates delayed ref to free the extent btrfs_run_delayed_refs() -> runs the delayed ref, adds extent to fs_info->pinned_extents btrfs_finish_extent_commit() unpin_extent_range() -> marks extent as free in the free space cache transaction commit finishes btrfs_start_transaction() (...) btrfs_cow_block() btrfs_alloc_tree_block() btrfs_reserve_extent() -> allocates extent at bytenr == X btrfs_init_new_buffer(bytenr X) btrfs_find_create_tree_block() alloc_extent_buffer(bytenr X) find_extent_buffer(bytenr X) -> returns existing eb, which the send task got (...) -> modifies content of the eb with bytenr == X -> uses an eb that now belongs to some other tree and no more matches the commit root of the snapshot, resuts will be unpredictable The consequences of this race can be various, and can lead to searches in the commit root performed by the send task failing unexpectedly (unable to find inode items, returning -ENOENT to user space, for example) or not failing because an inode item with the same number was added to the tree that reused the metadata extent, in which case send can behave incorrectly in the worst case or just fail later for some reason. Fix this by performing a copy of the commit root's extent buffer when doing a search in the context of a send operation. CC: stable@vger.kernel.org # 4.4.x: 1fc28d8e2e9: Btrfs: move get root out of btrfs_search_slot to a helper CC: stable@vger.kernel.org # 4.4.x: f9ddfd0592a: Btrfs: remove unused check of skip_locking CC: stable@vger.kernel.org # 4.4.x Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 827aa18e7b903c5ff3b3cd8fec328a99b1dbd411 Author: Filipe Manana Date: Mon Dec 10 17:53:35 2018 +0000 Btrfs: use nofs context when initializing security xattrs to avoid deadlock When initializing the security xattrs, we are holding a transaction handle therefore we need to use a GFP_NOFS context in order to avoid a deadlock with reclaim in case it's triggered. Fixes: 39a27ec1004e8 ("btrfs: use GFP_KERNEL for xattr and acl allocations") Reviewed-by: Nikolay Borisov Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0568e82dbe2510fc1fa664f58e5c997d3f1e649e Author: Josef Bacik Date: Fri Nov 30 11:52:14 2018 -0500 btrfs: run delayed items before dropping the snapshot With my delayed refs patches in place we started seeing a large amount of aborts in __btrfs_free_extent: BTRFS error (device sdb1): unable to find ref byte nr 91947008 parent 0 root 35964 owner 1 offset 0 Call Trace: ? btrfs_merge_delayed_refs+0xaf/0x340 __btrfs_run_delayed_refs+0x6ea/0xfc0 ? btrfs_set_path_blocking+0x31/0x60 btrfs_run_delayed_refs+0xeb/0x180 btrfs_commit_transaction+0x179/0x7f0 ? btrfs_check_space_for_delayed_refs+0x30/0x50 ? should_end_transaction.isra.19+0xe/0x40 btrfs_drop_snapshot+0x41c/0x7c0 btrfs_clean_one_deleted_snapshot+0xb5/0xd0 cleaner_kthread+0xf6/0x120 kthread+0xf8/0x130 ? btree_invalidatepage+0x90/0x90 ? kthread_bind+0x10/0x10 ret_from_fork+0x35/0x40 This was because btrfs_drop_snapshot depends on the root not being modified while it's dropping the snapshot. It will unlock the root node (and really every node) as it walks down the tree, only to re-lock it when it needs to do something. This is a problem because if we modify the tree we could cow a block in our path, which frees our reference to that block. Then once we get back to that shared block we'll free our reference to it again, and get ENOENT when trying to lookup our extent reference to that block in __btrfs_free_extent. This is ultimately happening because we have delayed items left to be processed for our deleted snapshot _after_ all of the inodes are closed for the snapshot. We only run the delayed inode item if we're deleting the inode, and even then we do not run the delayed insertions or delayed removals. These can be run at any point after our final inode does its last iput, which is what triggers the snapshot deletion. We can end up with the snapshot deletion happening and then have the delayed items run on that file system, resulting in the above problem. This problem has existed forever, however my patches made it much easier to hit as I wake up the cleaner much more often to deal with delayed iputs, which made us more likely to start the snapshot dropping work before the transaction commits, which is when the delayed items would generally be run. Before, generally speaking, we would run the delayed items, commit the transaction, and wakeup the cleaner thread to start deleting snapshots, which means we were less likely to hit this problem. You could still hit it if you had multiple snapshots to be deleted and ended up with lots of delayed items, but it was definitely harder. Fix for now by simply running all the delayed items before starting to drop the snapshot. We could make this smarter in the future by making the delayed items per-root, and then simply drop any delayed items for roots that we are going to delete. But for now just a quick and easy solution is the safest. CC: stable@vger.kernel.org # 4.4+ Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 83354f0772cd07828b0fcdf1ef2872fd2032acb8 Author: Josef Bacik Date: Fri Nov 30 11:52:13 2018 -0500 btrfs: catch cow on deleting snapshots When debugging some weird extent reference bug I suspected that we were changing a snapshot while we were deleting it, which could explain my bug. This was indeed what was happening, and this patch helped me verify my theory. It is never correct to modify the snapshot once it's being deleted, so mark the root when we are deleting it and make sure we complain about it when it happens. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 01e0da48856fe964e2a981e5541cee234b8a43a3 Author: Qu Wenruo Date: Mon Dec 10 15:01:03 2018 +0800 btrfs: extent-tree: cleanup one-shot usage of @blocksize in do_walk_down @blocksize variable in do_walk_down() is only used once, really no need to declare it. Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 7c3c7cb99c771c4ce6a01a95e969dbc576fd7533 Author: Filipe Manana Date: Fri Dec 7 13:23:32 2018 +0000 Btrfs: scrub, move setup of nofs contexts higher in the stack Since scrub workers only do memory allocation with GFP_KERNEL when they need to perform repair, we can move the recent setup of the nofs context up to scrub_handle_errored_block() instead of setting it up down the call chain at insert_full_stripe_lock() and scrub_add_page_to_wr_bio(), removing some duplicate code and comment. So the only paths for which a scrub worker can do memory allocations using GFP_KERNEL are the following: scrub_bio_end_io_worker() scrub_block_complete() scrub_handle_errored_block() lock_full_stripe() insert_full_stripe_lock() -> kmalloc with GFP_KERNEL scrub_bio_end_io_worker() scrub_block_complete() scrub_handle_errored_block() scrub_write_page_to_dev_replace() scrub_add_page_to_wr_bio() -> kzalloc with GFP_KERNEL Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0e94c4f45d14cf89d1f40c91b0a8517e791672a7 Author: David Sterba Date: Tue Dec 4 16:11:56 2018 +0100 btrfs: scrub: move scrub_setup_ctx allocation out of device_list_mutex The scrub context is allocated with GFP_KERNEL and called from btrfs_scrub_dev under the fs_info::device_list_mutex. This is not safe regarding reclaim that could try to flush filesystem data in order to get the memory. And the device_list_mutex is held during superblock commit, so this would cause a lockup. Move the alocation and initialization before any changes that require the mutex. Signed-off-by: David Sterba commit 92f7ba434f51e8e9317f1d166105889aa230abd2 Author: David Sterba Date: Tue Dec 4 16:11:55 2018 +0100 btrfs: scrub: pass fs_info to scrub_setup_ctx We can pass fs_info directly as this is the only member of btrfs_device that's bing used inside scrub_setup_ctx. Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit 28bad2125767c51a2974c234470981b39d3623ab Author: Josef Bacik Date: Mon Dec 3 10:20:38 2018 -0500 btrfs: fix truncate throttling We have a bunch of magic to make sure we're throttling delayed refs when truncating a file. Now that we have a delayed refs rsv and a mechanism for refilling that reserve simply use that instead of all of this magic. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit db2462a6ad3dc490ac33250042e728226ef3ba00 Author: Josef Bacik Date: Mon Dec 3 10:20:37 2018 -0500 btrfs: don't run delayed refs in the end transaction logic Over the years we have built up a lot of infrastructure to keep delayed refs in check, mostly by running them at btrfs_end_transaction() time. We have a lot of different maths we do to figure out how much, if we should do it inline or async, etc. This existed because we had no feedback mechanism to force the flushing of delayed refs when they became a problem. However with the enospc flushing infrastructure in place for flushing delayed refs when they put too much pressure on the enospc system we have this problem solved. Rip out all of this code as it is no longer needed. Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 64403612b73a94bc7b02cf8ca126e3b8ced6e921 Author: Josef Bacik Date: Mon Dec 3 10:20:36 2018 -0500 btrfs: rework btrfs_check_space_for_delayed_refs Now with the delayed_refs_rsv we can now know exactly how much pending delayed refs space we need. This means we can drastically simplify btrfs_check_space_for_delayed_refs by simply checking how much space we have reserved for the global rsv (which acts as a spill over buffer) and the delayed refs rsv. If our total size is beyond that amount then we know it's time to commit the transaction and stop any more delayed refs from being generated. With the introduction of dealyed_refs_rsv infrastructure, namely btrfs_update_delayed_refs_rsv we now know exactly how much pending delayed refs space is required. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 413df7252d5256df406a23d7efb679f46d19a23d Author: Josef Bacik Date: Mon Dec 3 10:20:35 2018 -0500 btrfs: add new flushing states for the delayed refs rsv A nice thing we gain with the delayed refs rsv is the ability to flush the delayed refs on demand to deal with enospc pressure. Add states to flush delayed refs on demand, and this will allow us to remove a lot of ad-hoc work around checking to see if we should commit the transaction to run our delayed refs. Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 4c8edbc75cb9ff846066cd9781ede4f27caf3cf4 Author: Josef Bacik Date: Mon Dec 3 10:20:34 2018 -0500 btrfs: update may_commit_transaction to use the delayed refs rsv Any space used in the delayed_refs_rsv will be freed up by a transaction commit, so instead of just counting the pinned space we also need to account for any space in the delayed_refs_rsv when deciding if it will make a different to commit the transaction to satisfy our space reservation. If we have enough bytes to satisfy our reservation ticket then we are good to go, otherwise subtract out what space we would gain back by committing the transaction and compare that against the pinned space to make our decision. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit ba2c4d4e3bda7d6de2bc616ae6715e0a0725b294 Author: Josef Bacik Date: Mon Dec 3 10:20:33 2018 -0500 btrfs: introduce delayed_refs_rsv Traditionally we've had voodoo in btrfs to account for the space that delayed refs may take up by having a global_block_rsv. This works most of the time, except when it doesn't. We've had issues reported and seen in production where sometimes the global reserve is exhausted during transaction commit before we can run all of our delayed refs, resulting in an aborted transaction. Because of this voodoo we have equally dubious flushing semantics around throttling delayed refs which we often get wrong. So instead give them their own block_rsv. This way we can always know exactly how much outstanding space we need for delayed refs. This allows us to make sure we are constantly filling that reservation up with space, and allows us to put more precise pressure on the enospc system. Instead of doing math to see if its a good time to throttle, the normal enospc code will be invoked if we have a lot of delayed refs pending, and they will be run via the normal flushing mechanism. For now the delayed_refs_rsv will hold the reservations for the delayed refs, the block group updates, and deleting csums. We could have a separate rsv for the block group updates, but the csum deletion stuff is still handled via the delayed_refs so that will stay there. Historical background: The global reserve has grown to cover everything we don't reserve space explicitly for, and we've grown a lot of weird ad-hoc heuristics to know if we're running short on space and when it's time to force a commit. A failure rate of 20-40 file systems when we run hundreds of thousands of them isn't super high, but cleaning up this code will make things less ugly and more predictible. Thus the delayed refs rsv. We always know how many delayed refs we have outstanding, and although running them generates more we can use the global reserve for that spill over, which fits better into it's desired use than a full blown reservation. This first approach is to simply take how many times we're reserving space for and multiply that by 2 in order to save enough space for the delayed refs that could be generated. This is a niave approach and will probably evolve, but for now it works. Signed-off-by: Josef Bacik Reviewed-by: David Sterba # high-level review [ added background notes from the cover letter ] Signed-off-by: David Sterba commit 158ffa364bf723fa1ef128060646d23dc3942994 Author: Josef Bacik Date: Mon Dec 3 10:20:32 2018 -0500 btrfs: only track ref_heads in delayed_ref_updates We use this number to figure out how many delayed refs to run, but __btrfs_run_delayed_refs really only checks every time we need a new delayed ref head, so we always run at least one ref head completely no matter what the number of items on it. Fix the accounting to only be adjusted when we add/remove a ref head. In addition to using this number to limit the number of delayed refs run, a future patch is also going to use it to calculate the amount of space required for delayed refs space reservation. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit bedc661760a9837d592070669b296ab58e8f40c9 Author: Josef Bacik Date: Mon Dec 3 10:20:31 2018 -0500 btrfs: cleanup extent_op handling The cleanup_extent_op function actually would run the extent_op if it needed running, which made the name sort of a misnomer. Change it to run_and_cleanup_extent_op, and move the actual cleanup work to cleanup_extent_op so it can be used by check_ref_cleanup() in order to unify the extent op handling. Reviewed-by: Lu Fengqi Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 07c47775f410168c259494ecb8f62cee0a84ec81 Author: Josef Bacik Date: Mon Dec 3 10:20:30 2018 -0500 btrfs: add cleanup_ref_head_accounting helper We were missing some quota cleanups in check_ref_cleanup, so break the ref head accounting cleanup into a helper and call that from both check_ref_cleanup and cleanup_ref_head. This will hopefully ensure that we don't screw up accounting in the future for other things that we add. Reviewed-by: Omar Sandoval Reviewed-by: Liu Bo Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit d7baffdaf9f9df8c9715aa507e3be2f409347c74 Author: Josef Bacik Date: Mon Dec 3 10:20:29 2018 -0500 btrfs: add btrfs_delete_ref_head helper We do this dance in cleanup_ref_head and check_ref_cleanup, unify it into a helper and cleanup the calling functions. Reviewed-by: Omar Sandoval Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit fdb1e121803433775d1e6f79b21a13add8b22f57 Author: Johannes Thumshirn Date: Wed Dec 5 15:23:04 2018 +0100 btrfs: use PAGE_ALIGNED instead of open-coding it When using a 'var & (PAGE_SIZE - 1)' construct one is checking for a page alignment and thus should use the PAGE_ALIGNED() macro instead of open-coding it. Convert all open-coded occurrences of PAGE_ALIGNED(). Reviewed-by: Nikolay Borisov Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7073017aeb98db311ca407f0f552f2bfc1af3015 Author: Johannes Thumshirn Date: Wed Dec 5 15:23:03 2018 +0100 btrfs: use offset_in_page instead of open-coding it Constructs like 'var & (PAGE_SIZE - 1)' or 'var & ~PAGE_MASK' can denote an offset into a page. So replace them by the offset_in_page() macro instead of open-coding it if they're not used as an alignment check. Reviewed-by: Nikolay Borisov Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit cb5583dd52fab469a001a007385066fcd60629c5 Author: David Sterba Date: Fri Sep 7 16:11:23 2018 +0200 btrfs: dev-replace: open code trivial locking helpers The dev-replace locking functions are now trivial wrappers around rw semaphore that can be used directly everywhere. No functional change. Signed-off-by: David Sterba commit 53176dde0acd8fa49c6c2e6097283acc6241480f Author: David Sterba Date: Thu Apr 5 01:41:06 2018 +0200 btrfs: dev-replace: remove custom read/write blocking scheme After the rw semaphore has been added, the custom blocking using ::blocking_readers and ::read_lock_wq is redundant. The blocking logic in __btrfs_map_block is replaced by extending the time the semaphore is held, that has the same blocking effect on writes as the previous custom scheme that waited until ::blocking_readers was zero. Signed-off-by: David Sterba commit 129827e3001fd1e6892a0629b48f9c7c91cbb8b6 Author: David Sterba Date: Thu Apr 5 01:29:24 2018 +0200 btrfs: dev-replace: swich locking to rw semaphore This is the first part of removing the custom locking and waiting scheme used for device replace. It was probably copied from extent buffer locking, but there's nothing that would require more than is provided by the common locking primitives. The rw spinlock protects waiting tasks counter in case of incompatible locks and the waitqueue. Same as rw semaphore. This patch only switches the locking primitive, for better bisectability. There should be no functional change other than the overhead of the locking and potential sleeping instead of spinning when the lock is contended. Signed-off-by: David Sterba commit ceb21a8db48559fd0809e03c4df9eb37743d9170 Author: David Sterba Date: Fri Aug 24 19:35:04 2018 +0200 btrfs: reada: reorder dev-replace locks before radix tree preload The device-replace read lock is going to use rw semaphore in followup commits. The semaphore might sleep which is not possible in the radix tree preload section. The lock nesting is now: * device replace * radix tree preload * readahead spinlock Signed-off-by: David Sterba commit d1051d6ebf8ef3517a5a3cf82bba8436d190f1c2 Author: Nikolay Borisov Date: Wed Nov 21 17:10:52 2018 +0200 btrfs: Fix error handling in btrfs_cleanup_ordered_extents Running btrfs/124 in a loop hung up on me sporadically with the following call trace: btrfs D 0 5760 5324 0x00000000 Call Trace: ? __schedule+0x243/0x800 schedule+0x33/0x90 btrfs_start_ordered_extent+0x10c/0x1b0 [btrfs] ? wait_woken+0xa0/0xa0 btrfs_wait_ordered_range+0xbb/0x100 [btrfs] btrfs_relocate_block_group+0x1ff/0x230 [btrfs] btrfs_relocate_chunk+0x49/0x100 [btrfs] btrfs_balance+0xbeb/0x1740 [btrfs] btrfs_ioctl_balance+0x2ee/0x380 [btrfs] btrfs_ioctl+0x1691/0x3110 [btrfs] ? lockdep_hardirqs_on+0xed/0x180 ? __handle_mm_fault+0x8e7/0xfb0 ? _raw_spin_unlock+0x24/0x30 ? __handle_mm_fault+0x8e7/0xfb0 ? do_vfs_ioctl+0xa5/0x6e0 ? btrfs_ioctl_get_supported_features+0x30/0x30 [btrfs] do_vfs_ioctl+0xa5/0x6e0 ? entry_SYSCALL_64_after_hwframe+0x3e/0xbe ksys_ioctl+0x3a/0x70 __x64_sys_ioctl+0x16/0x20 do_syscall_64+0x60/0x1b0 entry_SYSCALL_64_after_hwframe+0x49/0xbe This happens because during page writeback it's valid for writepage_delalloc to instantiate a delalloc range which doesn't belong to the page currently being written back. The reason this case is valid is due to find_lock_delalloc_range returning any available range after the passed delalloc_start and ignoring whether the page under writeback is within that range. In turn ordered extents (OE) are always created for the returned range from find_lock_delalloc_range. If, however, a failure occurs while OE are being created then the clean up code in btrfs_cleanup_ordered_extents will be called. Unfortunately the code in btrfs_cleanup_ordered_extents doesn't consider the case of such 'foreign' range being processed and instead it always assumes that the range OE are created for belongs to the page. This leads to the first page of such foregin range to not be cleaned up since it's deliberately missed and skipped by the current cleaning up code. Fix this by correctly checking whether the current page belongs to the range being instantiated and if so adjsut the range parameters passed for cleaning up. If it doesn't, then just clean the whole OE range directly. Fixes: 524272607e88 ("btrfs: Handle delalloc error correctly to avoid ordered extent hang") CC: stable@vger.kernel.org # 4.14+ Reviewed-by: Josef Bacik Signed-off-by: Nikolay Borisov Signed-off-by: David Sterba commit 3522e90301d7a669288611cb7e73cab4ac135545 Author: Lu Fengqi Date: Thu Nov 29 11:33:38 2018 +0800 btrfs: remove always true if branch in find_delalloc_range The @found is always false when it comes to the if branch. Besides, the bool type is more suitable for @found. Change the return value of the function and its caller to bool as well. Reviewed-by: Nikolay Borisov Signed-off-by: Lu Fengqi Reviewed-by: David Sterba Signed-off-by: David Sterba commit 27a7ff554e8d349627a90bda275c527b7348adae Author: Lu Fengqi Date: Thu Nov 29 17:31:32 2018 +0800 btrfs: skip file_extent generation check for free_space_inode in run_delalloc_nocow The test case btrfs/001 with inode_cache mount option will encounter the following warning: WARNING: CPU: 1 PID: 23700 at fs/btrfs/inode.c:956 cow_file_range.isra.19+0x32b/0x430 [btrfs] CPU: 1 PID: 23700 Comm: btrfs Kdump: loaded Tainted: G W O 4.20.0-rc4-custom+ #30 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 RIP: 0010:cow_file_range.isra.19+0x32b/0x430 [btrfs] Call Trace: ? free_extent_buffer+0x46/0x90 [btrfs] run_delalloc_nocow+0x455/0x900 [btrfs] btrfs_run_delalloc_range+0x1a7/0x360 [btrfs] writepage_delalloc+0xf9/0x150 [btrfs] __extent_writepage+0x125/0x3e0 [btrfs] extent_write_cache_pages+0x1b6/0x3e0 [btrfs] ? __wake_up_common_lock+0x63/0xc0 extent_writepages+0x50/0x80 [btrfs] do_writepages+0x41/0xd0 ? __filemap_fdatawrite_range+0x9e/0xf0 __filemap_fdatawrite_range+0xbe/0xf0 btrfs_fdatawrite_range+0x1b/0x50 [btrfs] __btrfs_write_out_cache+0x42c/0x480 [btrfs] btrfs_write_out_ino_cache+0x84/0xd0 [btrfs] btrfs_save_ino_cache+0x551/0x660 [btrfs] commit_fs_roots+0xc5/0x190 [btrfs] btrfs_commit_transaction+0x2bf/0x8d0 [btrfs] btrfs_mksubvol+0x48d/0x4d0 [btrfs] btrfs_ioctl_snap_create_transid+0x170/0x180 [btrfs] btrfs_ioctl_snap_create_v2+0x124/0x180 [btrfs] btrfs_ioctl+0x123f/0x3030 [btrfs] The file extent generation of the free space inode is equal to the last snapshot of the file root, so the inode will be passed to cow_file_rage. But the inode was created and its extents were preallocated in btrfs_save_ino_cache, there are no cow copies on disk. The preallocated extent is not yet in the extent tree, and btrfs_cross_ref_exist will ignore the -ENOENT returned by check_committed_ref, so we can directly write the inode to the disk. Fixes: 78d4295b1eee ("btrfs: lift some btrfs_cross_ref_exist checks in nocow path") CC: stable@vger.kernel.org # 4.18+ Reviewed-by: Filipe Manana Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 41bd60676923822de1df2c50b3f9a10171f4338a Author: Filipe Manana Date: Wed Nov 28 14:54:28 2018 +0000 Btrfs: fix fsync of files with multiple hard links in new directories The log tree has a long standing problem that when a file is fsync'ed we only check for new ancestors, created in the current transaction, by following only the hard link for which the fsync was issued. We follow the ancestors using the VFS' dget_parent() API. This means that if we create a new link for a file in a directory that is new (or in an any other new ancestor directory) and then fsync the file using an old hard link, we end up not logging the new ancestor, and on log replay that new hard link and ancestor do not exist. In some cases, involving renames, the file will not exist at all. Example: mkfs.btrfs -f /dev/sdb mount /dev/sdb /mnt mkdir /mnt/A touch /mnt/foo ln /mnt/foo /mnt/A/bar xfs_io -c fsync /mnt/foo In this example after log replay only the hard link named 'foo' exists and directory A does not exist, which is unexpected. In other major linux filesystems, such as ext4, xfs and f2fs for example, both hard links exist and so does directory A after mounting again the filesystem. Checking if any new ancestors are new and need to be logged was added in 2009 by commit 12fcfd22fe5b ("Btrfs: tree logging unlink/rename fixes"), however only for the ancestors of the hard link (dentry) for which the fsync was issued, instead of checking for all ancestors for all of the inode's hard links. So fix this by tracking the id of the last transaction where a hard link was created for an inode and then on fsync fallback to a full transaction commit when an inode has more than one hard link and at least one new hard link was created in the current transaction. This is the simplest solution since this is not a common use case (adding frequently hard links for which there's an ancestor created in the current transaction and then fsync the file). In case it ever becomes a common use case, a solution that consists of iterating the fs/subvol btree for each hard link and check if any ancestor is new, could be implemented. This solves many unexpected scenarios reported by Jayashree Mohan and Vijay Chidambaram, and for which there is a new test case for fstests under review. Fixes: 12fcfd22fe5b ("Btrfs: tree logging unlink/rename fixes") CC: stable@vger.kernel.org # 4.4+ Reported-by: Vijay Chidambaram Reported-by: Jayashree Mohan Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit bbe339cc323ca9d2a57ac203d2d9d11a09655dcc Author: David Sterba Date: Tue Nov 27 15:25:13 2018 +0100 btrfs: drop extra enum initialization where using defaults The first auto-assigned value to enum is 0, we can use that and not initialize all members where the auto-increment does the same. This is used for values that are not part of on-disk format. Reviewed-by: Omar Sandoval Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 5b840301ac4b8a8e8d42d0c7edc31dc3e257145d Author: David Sterba Date: Tue Nov 27 15:17:47 2018 +0100 btrfs: switch BTRFS_ORDERED_* to enums We can use simple enum for values that are not part of on-disk format: ordered extent flags. Reviewed-by: Omar Sandoval Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 50b5b6020fc3e2c4c67ff28bf3986a1e70bffc7d Author: David Sterba Date: Tue Nov 27 15:11:43 2018 +0100 btrfs: switch EXTENT_FLAG_* to enums We can use simple enum for values that are not part of on-disk format: extent map flags. Reviewed-by: Omar Sandoval Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 80cb38362d330e1e4156a4904c17ce994589bd7d Author: David Sterba Date: Tue Nov 27 15:03:20 2018 +0100 btrfs: switch EXTENT_BUFFER_* to enums We can use simple enum for values that are not part of on-disk format: extent buffer flags; Reviewed-by: Omar Sandoval Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 61fa90c16b0b5efd1d5a6d1c74124c46e9138350 Author: David Sterba Date: Tue Nov 27 14:57:19 2018 +0100 btrfs: switch BTRFS_ROOT_* to enums We can use simple enum for values that are not part of on-disk format: root tree flags. Reviewed-by: Omar Sandoval Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit eb1a524c95206e41c54e8cee25a66f9488a151ef Author: David Sterba Date: Tue Nov 27 14:55:46 2018 +0100 btrfs: switch BTRFS_FS_* to enums We can use simple enum for values that are not part of on-disk format: internal filesystem states. Reviewed-by: Omar Sandoval Reviewed-by: Qu Wenruo Signed-off-by: David Sterba commit 688a75b9a30a72cd944aa5e6a428a80472f44877 Author: David Sterba Date: Tue Nov 27 14:53:06 2018 +0100 btrfs: switch BTRFS_BLOCK_RSV_* to enums We can use simple enum for values that are not part of on-disk format: block reserve types. Reviewed-by: Omar Sandoval Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit b00146b5d53c0306326eb46245901d20b69efd16 Author: David Sterba Date: Tue Nov 27 14:50:27 2018 +0100 btrfs: switch BTRFS_FS_STATE_* to enums We can use simple enum for values that are not part of on-disk format: global filesystem states. Reviewed-by: Omar Sandoval Reviewed-by: Qu Wenruo Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit da12fe5414f922d896289f037515096f189c66da Author: Nikolay Borisov Date: Tue Nov 27 20:57:58 2018 +0200 btrfs: Refactor btrfs_merge_bio_hook This function really checks whether adding more data to the bio will straddle a stripe/chunk. So first let's give it a more appropraite name - btrfs_bio_fits_in_stripe. Secondly, the offset parameter was never used to just remove it. Thirdly, pages are submitted to either btree or data inodes so it's guaranteed that tree->ops is set so replace the check with an ASSERT. Finally, document the parameters of the function. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2ab4fd3135ee21514a50c4f139c4f80c0b43a8ec Author: Lu Fengqi Date: Wed Nov 28 11:22:54 2018 +0800 btrfs: cleanup the useless DEFINE_WAIT in cleanup_transaction When it was introduced in commit f094ac32aba3 ("Btrfs: fix NULL pointer after aborting a transaction"), it was not used. Signed-off-by: Lu Fengqi Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit d2e174d5d3eedb3b9dd97167307bf1f01bd2fa5c Author: Johannes Thumshirn Date: Wed Nov 28 09:54:56 2018 +0100 btrfs: document extent mapping assumptions in checksum Document why map_private_extent_buffer() cannot return '1' (i.e. the map spans two pages) for the csum_tree_block() case. The current algorithm for detecting a page boundary crossing in map_private_extent_buffer() will return a '1' *IFF* the extent buffer's offset in the page + the offset passed in by csum_tree_block() and the minimal length passed in by csum_tree_block() - 1 are bigger than PAGE_SIZE. We always pass BTRFS_CSUM_SIZE (32) as offset and a minimal length of 32 and the current extent buffer allocator always guarantees page aligned extends, so the above condition can't be true. Reviewed-by: Nikolay Borisov Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba commit cc2c39d605d23e7f1fbc376bf011fd06e46ee79f Author: Johannes Thumshirn Date: Wed Nov 28 09:54:54 2018 +0100 btrfs: don't initialize 'offset' in map_private_extent_buffer() In map_private_extent_buffer() the 'offset' variable is initialized to a page aligned version of the 'start' parameter. But later on it is overwritten with either the offset from the extent buffer's start or 0. So get rid of the initial initialization. Reviewed-by: Nikolay Borisov Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba commit a5fb11429167ee6ddeeacc554efaf5776b36433a Author: Filipe Manana Date: Mon Nov 26 20:07:17 2018 +0000 Btrfs: fix deadlock with memory reclaim during scrub When a transaction commit starts, it attempts to pause scrub and it blocks until the scrub is paused. So while the transaction is blocked waiting for scrub to pause, we can not do memory allocation with GFP_KERNEL from scrub, otherwise we risk getting into a deadlock with reclaim. Checking for scrub pause requests is done early at the beginning of the while loop of scrub_stripe() and later in the loop, scrub_extent() and scrub_raid56_parity() are called, which in turn call scrub_pages() and scrub_pages_for_parity() respectively. These last two functions do memory allocations using GFP_KERNEL. Same problem could happen while scrubbing the super blocks, since it calls scrub_pages(). We also can not have any of the worker tasks, created by the scrub task, doing GFP_KERNEL allocations, because before pausing, the scrub task waits for all the worker tasks to complete (also done at scrub_stripe()). So make sure GFP_NOFS is used for the memory allocations because at any time a scrub pause request can happen from another task that started to commit a transaction. Fixes: 58c4e173847a ("btrfs: scrub: use GFP_KERNEL on the submission path") CC: stable@vger.kernel.org # 4.6+ Reviewed-by: Nikolay Borisov Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 78e62c02abb94e49ea739226a70325a6bf7a6603 Author: Nikolay Borisov Date: Thu Nov 22 10:17:49 2018 +0200 btrfs: Remove extent_io_ops::readpage_io_failed_hook For data inodes this hook does nothing but to return -EAGAIN which is used to signal to the endio routines that this bio belongs to a data inode. If this is the case the actual retrying is handled by bio_readpage_error. Alternatively, if this bio belongs to the btree inode then btree_io_failed_hook just does some cleanup and doesn't retry anything. This patch simplifies the code flow by eliminating readpage_io_failed_hook and instead open-coding btree_io_failed_hook in end_bio_extent_readpage. Also eliminate some needless checks since IO is always performed on either data inode or btree inode, both of which are guaranteed to have their extent_io_tree::ops set. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7b41ba71c1a08ae35805b562ae5e2f8ddfb8e00d Author: Johannes Thumshirn Date: Fri Nov 23 09:42:27 2018 +0100 btrfs: remove btrfs_bio_end_io_t The btrfs_bio_end_io_t typedef was introduced with commit a1d3c4786a4b ("btrfs: btrfs_multi_bio replaced with btrfs_bio") but never used anywhere. This commit also introduced a forward declaration of 'struct btrfs_bio' which is only needed for btrfs_bio_end_io_t. Remove both as they're not needed anywhere. Reviewed-by: Nikolay Borisov Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba commit b3a0dd50c3951ec1b9a12ec39034194022fd8693 Author: David Sterba Date: Thu Nov 22 17:16:49 2018 +0100 btrfs: replace btrfs_io_bio::end_io with a simple helper The end_io callback implemented as btrfs_io_bio_endio_readpage only calls kfree. Also the callback is set only in case the csum buffer is allocated and not pointing to the inline buffer. We can use that information to drop the indirection and call a helper that will free the csums only in the right case. This shrinks struct btrfs_io_bio by 8 bytes. Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 31fecccbd7b2174487a6b7361153b60a4eda6108 Author: David Sterba Date: Thu Nov 22 17:16:46 2018 +0100 btrfs: remove redundant csum buffer in btrfs_io_bio The io_bio tracks checksums and has an inline buffer or an allocated one. And there's a third member that points to the right one, but we don't need to use an extra pointer for that. Let btrfs_io_bio::csum point to the right buffer and check that the inline buffer is not accidentally freed. This shrinks struct btrfs_io_bio by 8 bytes. Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 600b6cf468b038798313da42d2438c10bcb10261 Author: David Sterba Date: Thu Nov 22 17:16:44 2018 +0100 btrfs: replace async_cow::root with fs_info The async_cow::root is used to propagate fs_info to async_cow_submit. We can't use inode to reach it because it could become NULL after write without compression in async_cow_start. Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 06ea01b1eeb10450ee8448f8895dd641c8d37047 Author: David Sterba Date: Tue Jul 17 22:08:41 2018 +0200 btrfs: merge btrfs_submit_bio_done to its caller There's one caller and its code is simple, we can open code it in run_one_async_done. The errors are passed through bio. Reviewed-by: Nikolay Borisov Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba commit 7333bd02dcb7cefa91eb94efb8e7578ec764145c Author: Anand Jain Date: Tue Nov 20 16:12:57 2018 +0800 btrfs: balance: print to system log when balance ends or is paused Print a kernel log message when the balance ends, either for cancel or completed or if it is paused. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 56fc37d936909cdfb6d8c8674fd64e66a9ec8f7d Author: Anand Jain Date: Tue Nov 20 16:12:56 2018 +0800 btrfs: balance: print args during start and resume The information about balance arguments is important for system audit, this patch prints the textual representation when balance starts or is resumed. Example command: $ btrfs balance start -f -mprofiles=raid1,convert=single,soft -dlimit=10..20,usage=50 /btrfs Example kernel log output: BTRFS info (device sdb): balance: start -f -dusage=50,limit=10..20 -mconvert=single,soft,profiles=raid1 -sconvert=single,soft,profiles=raid1 Signed-off-by: Anand Jain Reviewed-by: David Sterba [ update changelog, simplify code ] Signed-off-by: David Sterba commit f89e09cf45533eb25ca8e7fbedec697ecb37eb94 Author: Anand Jain Date: Tue Nov 20 16:12:55 2018 +0800 btrfs: add helper to describe block group flags Factor out helper that describes block group flags from describe_relocation. The result will not be longer than the given size. Signed-off-by: Anand Jain Reviewed-by: David Sterba [ add comments ] Signed-off-by: David Sterba commit 9a6f209e36500efac51528132a3e3083586eda5f Author: Filipe Manana Date: Mon Nov 19 14:15:36 2018 +0000 Btrfs: fix deadlock when enabling quotas due to concurrent snapshot creation If the quota enable and snapshot creation ioctls are called concurrently we can get into a deadlock where the task enabling quotas will deadlock on the fs_info->qgroup_ioctl_lock mutex because it attempts to lock it twice, or the task creating a snapshot tries to commit the transaction while the task enabling quota waits for the former task to commit the transaction while holding the mutex. The following time diagrams show how both cases happen. First scenario: CPU 0 CPU 1 btrfs_ioctl() btrfs_ioctl_quota_ctl() btrfs_quota_enable() mutex_lock(fs_info->qgroup_ioctl_lock) btrfs_start_transaction() btrfs_ioctl() btrfs_ioctl_snap_create_v2 create_snapshot() --> adds snapshot to the list pending_snapshots of the current transaction btrfs_commit_transaction() create_pending_snapshots() create_pending_snapshot() qgroup_account_snapshot() btrfs_qgroup_inherit() mutex_lock(fs_info->qgroup_ioctl_lock) --> deadlock, mutex already locked by this task at btrfs_quota_enable() Second scenario: CPU 0 CPU 1 btrfs_ioctl() btrfs_ioctl_quota_ctl() btrfs_quota_enable() mutex_lock(fs_info->qgroup_ioctl_lock) btrfs_start_transaction() btrfs_ioctl() btrfs_ioctl_snap_create_v2 create_snapshot() --> adds snapshot to the list pending_snapshots of the current transaction btrfs_commit_transaction() --> waits for task at CPU 0 to release its transaction handle btrfs_commit_transaction() --> sees another task started the transaction commit first --> releases its transaction handle --> waits for the transaction commit to be completed by the task at CPU 1 create_pending_snapshot() qgroup_account_snapshot() btrfs_qgroup_inherit() mutex_lock(fs_info->qgroup_ioctl_lock) --> deadlock, task at CPU 0 has the mutex locked but it is waiting for us to finish the transaction commit So fix this by setting the quota enabled flag in fs_info after committing the transaction at btrfs_quota_enable(). This ends up serializing quota enable and snapshot creation as if the snapshot creation happened just before the quota enable request. The quota rescan task, scheduled after committing the transaction in btrfs_quote_enable(), will do the accounting. Fixes: 6426c7ad697d ("btrfs: qgroup: Fix qgroup accounting when creating snapshot") Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 5a8067c0d17feb7579db0476191417b441a8996e Author: Filipe Manana Date: Mon Nov 19 09:48:12 2018 +0000 Btrfs: fix access to available allocation bits when starting balance The available allocation bits members from struct btrfs_fs_info are protected by a sequence lock, and when starting balance we access them incorrectly in two different ways: 1) In the read sequence lock loop at btrfs_balance() we use the values we read from fs_info->avail_*_alloc_bits and we can immediately do actions that have side effects and can not be undone (printing a message and jumping to a label). This is wrong because a retry might be needed, so our actions must not have side effects and must be repeatable as long as read_seqretry() returns a non-zero value. In other words, we were essentially ignoring the sequence lock; 2) Right below the read sequence lock loop, we were reading the values from avail_metadata_alloc_bits and avail_data_alloc_bits without any protection from concurrent writers, that is, reading them outside of the read sequence lock critical section. So fix this by making sure we only read the available allocation bits while in a read sequence lock critical section and that what we do in the critical section is repeatable (has nothing that can not be undone) so that any eventual retry that is needed is handled properly. Fixes: de98ced9e743 ("Btrfs: use seqlock to protect fs_info->avail_{data, metadata, system}_alloc_bits") Fixes: 14506127979a ("btrfs: fix a bogus warning when converting only data or metadata") Reviewed-by: Nikolay Borisov Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0e6ec385b55f6001da8c6b1532494241e52c550d Author: Filipe Manana Date: Fri Nov 16 13:04:44 2018 +0000 Btrfs: allow clear_extent_dirty() to receive a cached extent state record We can have a lot freed extents during the life span of transaction, so the red black tree that keeps track of the ranges of each freed extent (fs_info->freed_extents[]) can get quite big. When finishing a transaction commit we find each range, process it (discard the extents, unpin them) and then remove it from the red black tree. We can use an extent state record as a cache when searching for a range, so that when we clean the range we can use the cached extent state we passed to the search function instead of iterating the red black tree again. Doing things as fast as possible when finishing a transaction (in state TRANS_STATE_UNBLOCKED) is convenient as it reduces the time we block another task that wants to commit the next transaction. So change clear_extent_dirty() to allow an optional extent state record to be passed as an argument, which will be passed down to __clear_extent_bit. Reviewed-by: Nikolay Borisov Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit cc5de4e70256cbf4f28c0340e2d9f14cb6ed10aa Author: Nikolay Borisov Date: Tue Oct 30 16:43:28 2018 +0200 btrfs: Handle final split-brain possibility during fsid change This patch lands the last case which needs to be handled by the fsid change code. Namely, this is the case where a multidisk filesystem has already undergone at least one successful fsid change i.e all disks have the METADATA_UUID incompat bit and power failure occurs as another fsid change is in progress. When such an event occurs, disks could be split in 2 groups. One of the groups will have both METADATA_UUID and CHANGING_FSID_V2 flags set coupled with old fsid/metadata_uuid pairs. The other group of disks will have only METADATA_UUID bit set and their fsid will be different than the one in disks in the first group. Here we look at the following cases: a) A disk from the first group is scanned first, so fs_devices is created with stale fsid/metdata_uuid. Then when a disk from the second group is scanned it needs to first check whether there exists such an fs_devices that has fsid_change set to true (because it was created with a disk having the CHANGING_FSID_V2 flag), the metadata_uuid and fsid of the fs_devices will be different (since it was created by a disk which already has had at least 1 successful fsid change) and finally the metadata_uuid of the fs_devices will equal that of the currently scanned disk (because metadata_uuid never really changes). When the correct fs_devices is found the information from the scanned disk will replace the current one in fs_devices since the scanned disk will have higher generation number. b) A disk from the second group is scanned so fs_devices is created as usual with differing fsid/metdata_uid. Then when a disk from the first group is scanned the code detects that it has both CHANGING_FSID_V2 and METADATA_UUID flags set and will search for fs_devices that has differing metadata_uuid/fsid and whose metadata_uuid is the same as that of the scanned device. Signed-off-by: Nikolay Borisov Signed-off-by: David Sterba commit 7a62d0f07377b51a9033eb12fa537c264bcba3e5 Author: Nikolay Borisov Date: Tue Oct 30 16:43:27 2018 +0200 btrfs: Handle one more split-brain scenario during fsid change This commit continues hardening the scanning code to handle cases where power loss could have caused disks in a multi-disk filesystem to be in inconsistent state. Namely handle the situation that can occur when some of the disks in multi-disk fs have completed their fsid change i.e they have METADATA_UUID incompat flag set, have cleared the CHANGING_FSID_V2 flag and their fsid/metadata_uuid are different. At the same time the other half of the disks will have their fsid/metadata_uuid unchanged and will only have CHANGING_FSID_V2 flag. This is handled by introducing code in the scan path which: a) Handles the case when a device with CHANGING_FSID_V2 flag is scanned and as a result btrfs_fs_devices is created with matching fsid/metdata_uuid. Subsequently, when a device with completed fsid change is scanned it will detect this via the new code in find_fsid i.e that such an fs_devices exist that fsid_change flag is set to true, it's metadata_uuid/fsid match and the metadata_uuid of the scanned device matches that of the fs_devices. In this case, it's important to note that the devices which has its fsid change completed will have a higher generation number than the device with FSID_CHANGING_V2 flag set, so its superblock block will be used during mount. To prevent an assertion triggering because the sb used for mounting will have differing fsid/metadata_uuid than the ones in the fs_devices struct also add code in device_list_add which overwrites the values in fs_devices. b) Alternatively we can end up with a device that completed its fsid change be scanned first which will create the respective btrfs_fs_devices struct with differing fsid/metadata_uuid. In this case when a device with FSID_CHANGING_V2 flag set is scanned it will call the newly added find_fsid_inprogress function which will return the correct fs_devices. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit d1a63002829a4d8014de20dc141b404cc808405e Author: Nikolay Borisov Date: Tue Oct 30 16:43:26 2018 +0200 btrfs: add members to fs_devices to track fsid changes In order to gracefully handle split-brain scenario during fsid change (which are very unlikely, yet possible), two more pieces of information will be necessary: 1. The highest generation number among all devices registered to a particular btrfs_fs_devices 2. A boolean flag whether a given btrfs_fs_devices was created by a device which had the FSID_CHANGING_V2 flag set. This is a preparatory patch and just introduces the variables as well as code which sets them, their actual use is going to happen in a later patch. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit fbc6feaec98ac0c6a615bbe9e17c5689a1a84650 Author: Nikolay Borisov Date: Tue Oct 30 16:43:25 2018 +0200 btrfs: Add handling for disk split-brain scenario during fsid change Even though fsid change without rewrite is a very quick operation it's still possible to experience a split-brain scenario if power loss occurs at the most inconvenient time. This patch handles the case where power failure occurs while the first transaction (the one setting CHANGING_FSID_V2) flag is being persisted on disk. This can cause the btrfs_fs_devices of this filesystem to be created by a device which: a) has the CHANGING_FSID_V2 flag set but its fsid value is intact b) or a device which doesn't have CHANGING_FSID_V2 flag set and its fsid value is intact This situation is trivially handled by the current find_fsid code since in both cases the devices are going to be treated like ordinary devices. Since btrfs is always mounted using the superblock of the latest device (the one with highest generation number), meaning it will have the CHANGING_FSID_V2 flag set, ensure it's being cleared on mount. On the first transaction commit following mount all disks will have it cleared. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit de37aa513105f864d3c21105bf5542d498f21ca2 Author: Nikolay Borisov Date: Tue Oct 30 16:43:24 2018 +0200 btrfs: Remove fsid/metadata_fsid fields from btrfs_info Currently btrfs_fs_info structure contains a copy of the fsid/metadata_uuid fields. Same values are also contained in the btrfs_fs_devices structure which fs_info has a reference to. Let's reduce duplication by removing the fields from fs_info and always refer to the ones in fs_devices. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 56f20f4009d3c0b2e6165d9136fed40028c8225d Author: Nikolay Borisov Date: Mon Nov 19 17:37:45 2018 +0200 btrfs: Add sysfs support for metadata_uuid feature Since the metadata_uuid is a new incompat feature it requires the respective sysfs hooks. This patch adds the 'metdata_uuid' feature to be shown if it supported by the kernel. Additionally it adds /sys/fs/btrfs/UUID/metadata_uuid attribute which allows one to read the current metadata_uuid. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7239ff4b2be8ec0c3160da7fdd1475785fdb4cb9 Author: Nikolay Borisov Date: Tue Oct 30 16:43:23 2018 +0200 btrfs: Introduce support for FSID change without metadata rewrite This field is going to be used when the user wants to change the UUID of the filesystem without having to rewrite all metadata blocks. This field adds another level of indirection such that when the FSID is changed what really happens is the current UUID (the one with which the fs was created) is copied to the 'metadata_uuid' field in the superblock as well as a new incompat flag is set METADATA_UUID. When the kernel detects this flag is set it knows that the superblock in fact has 2 UUIDs: 1. Is the UUID which is user-visible, currently known as FSID. 2. Metadata UUID - this is the UUID which is stamped into all on-disk datastructures belonging to this file system. When the new incompat flag is present device scanning checks whether both fsid/metadata_uuid of the scanned device match any of the registered filesystems. When the flag is not set then both UUIDs are equal and only the FSID is retained on disk, metadata_uuid is set only in-memory during mount. Additionally a new metadata_uuid field is also added to the fs_info struct. It's initialised either with the FSID in case METADATA_UUID incompat flag is not set or with the metdata_uuid of the superblock otherwise. This commit introduces the new fields as well as the new incompat flag and switches all users of the fsid to the new logic. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba [ minor updates in comments ] Signed-off-by: David Sterba commit ce9f967f31ea91365c0aa897dbc2bddbd39d7a73 Author: Johannes Thumshirn Date: Mon Nov 19 10:38:17 2018 +0100 btrfs: use EXPORT_FOR_TESTS for conditionally exported functions Several functions in BTRFS are only used inside the source file they are declared if CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not defined. However if CONFIG_BTRFS_FS_RUN_SANITY_TESTS is defined these functions are shared with the unit tests code. Before the introduction of the EXPORT_FOR_TESTS macro, these functions could not be declared as static and the compiler had a harder task when optimizing and inlining them. As we have EXPORT_FOR_TESTS now, use it where appropriate to support the compiler. Reviewed-by: Nikolay Borisov Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit f8f591df7d725e3b1ea97e13ac830791b7c4a038 Author: Johannes Thumshirn Date: Mon Nov 19 10:38:16 2018 +0100 btrfs: introduce EXPORT_FOR_TESTS macro Depending on whether CONFIG_BTRFS_FS_RUN_SANITY_TESTS is set, some BTRFS functions are either local to the file they are implemented in and thus should be declared static or are called from within the test implementation defined in a different file. Introduce an EXPORT_FOR_TESTS macro which depending on CONFIG_BTRFS_FS_RUN_SANITY_TESTS either adds the 'static' keyword to a function or not. Reviewed-by: Nikolay Borisov Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba commit e9a05cf31bf1821a5885440dd0d27aca2a3dc324 Author: Johannes Thumshirn Date: Mon Nov 19 10:38:13 2018 +0100 btrfs: remove unused drop_on_err in btrfs_mkdir Up to commit 32955c5422a8 ("btrfs: switch to discard_new_inode()") the drop_on_err variable in btrfs_mkdir() was used to check whether the inode had to be dropped via iput(). After commit 32955c5422a8 ("btrfs: switch to discard_new_inode()") discard_new_inode() is called when err is set and inode is non NULL. Therefore drop_on_err is not used anymore and thus causes a warning when building with -Wunused-but-set-variable. Reviewed-by: Omar Sandoval Reviewed-by: Nikolay Borisov Reviewed-by: Qu Wenruo Signed-off-by: Johannes Thumshirn Signed-off-by: David Sterba commit 9bfd61d9755a515fc876aa70717824cea645bffd Author: Nikolay Borisov Date: Fri Oct 26 14:43:21 2018 +0300 btrfs: Replace BUG_ON with ASSERT in find_lock_delalloc_range lock_delalloc_pages should only return 2 values - 0 in case of success and -EAGAIN if the range of pages to be locked should be shrunk due to some of gone. Manual inspections confirms that this is indeed the case since __process_pages_contig is where lock_delalloc_pages gets its return value. The latter always returns 0 or -EAGAIN so the invariant holds. No functional changes. Reviewed-by: Qu Wenruo Reviewed-by: Anand Jain Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 917aacecc567d56d0ec5f244043f403f7102eda8 Author: Nikolay Borisov Date: Fri Oct 26 14:43:20 2018 +0300 btrfs: Sink find_lock_delalloc_range's 'max_bytes' argument All callers of this function pass BTRFS_MAX_EXTENT_SIZE (128M) so let's reduce the argument count and make that a local variable. No functional changes. Reviewed-by: Qu Wenruo Reviewed-by: Anand Jain Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 64bc6c2a34535515f8319b2054795f0ca0b842f9 Author: Nikolay Borisov Date: Fri Oct 26 14:43:19 2018 +0300 btrfs: Remove superfluous check form btrfs_remove_chunk It's unnecessary to check map->stripes[i].dev for NULL given its value is already set and dereferenced above the the check. No functional changes. Reviewed-by: Qu Wenruo Reviewed-by: Anand Jain Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit f9085abfaeaf45971044fad2281ffd917cde4526 Author: Anand Jain Date: Tue Nov 20 19:56:16 2018 +0800 btrfs: don't report user-requested cancel as an error As of now only user requested replace cancel can cancel the replace-scrub so no need to log the error. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 49365e69762715fb301db0bce3333e4c41dda810 Author: Anand Jain Date: Tue Nov 20 19:56:15 2018 +0800 btrfs: silence warning if replace is canceled When we successfully cancel the device replace, its scrub worker returns -ECANCELED, which is then passed to btrfs_dev_replace_finishing. It cleans up based on the returned status and propagates the same -ECANCELED back the parent function. As of now only user can cancel the replace-scrub, so its ok to silence the warning here. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 53e62fb5a4aedeff05aa1efd277de32dc765f4bf Author: Anand Jain Date: Sun Nov 11 22:22:24 2018 +0800 btrfs: dev-replace: add explicit check for replace result "no error" We recast the replace return status BTRFS_IOCTL_DEV_REPLACE_RESULT_SCRUB_INPROGRESS to 0, to indicate no error. And since BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR should also return 0, which is also declared as 0, so we just return. Instead add it to the if statement so that there is enough clarity while reading the code. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit fe97e2e173afb61f1bb889c45f9597102c9f4849 Author: Anand Jain Date: Sun Nov 11 22:22:21 2018 +0800 btrfs: dev-replace: replace's scrub must not be running in suspended state When the replace state is in the suspended state, btrfs_scrub_cancel() should fail with -ENOTCONN as there is no scrub running. As a safety catch check if btrfs_scrub_cancel() returns -ENOTCONN and assert if it doesn't. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit b47dda2ef6d793b67fd5979032dcd106e3f0a5c9 Author: Anand Jain Date: Sun Nov 11 22:22:20 2018 +0800 btrfs: dev-replace: set result code of cancel by status of scrub The device-replace needs to check the result code of the scrub workers in btrfs_dev_replace_cancel and distinguish if successful cancel operation and when the there was no operation running. If btrfs_scrub_cancel() fails, return BTRFS_IOCTL_DEV_REPLACE_RESULT_NOT_STARTED so that user can try to cancel the replace again. Signed-off-by: Anand Jain Reviewed-by: David Sterba [ update changelog ] Signed-off-by: David Sterba commit d189dd70e2556181732598956d808ea53cc8774e Author: Anand Jain Date: Wed Nov 14 13:50:26 2018 +0800 btrfs: fix use-after-free due to race between replace start and cancel The device replace cancel thread can race with the replace start thread and if fs_info::scrubs_running is not yet set, btrfs_scrub_cancel() will fail to stop the scrub thread. The scrub thread continues with the scrub for replace which then will try to write to the target device and which is already freed by the cancel thread. scrub_setup_ctx() warns as tgtdev is NULL. struct scrub_ctx *scrub_setup_ctx(struct btrfs_device *dev, int is_dev_replace) { ... if (is_dev_replace) { WARN_ON(!fs_info->dev_replace.tgtdev); <=== sctx->pages_per_wr_bio = SCRUB_PAGES_PER_WR_BIO; sctx->wr_tgtdev = fs_info->dev_replace.tgtdev; sctx->flush_all_writes = false; } [ 6724.497655] BTRFS info (device sdb): dev_replace from /dev/sdb (devid 1) to /dev/sdc started [ 6753.945017] BTRFS info (device sdb): dev_replace from /dev/sdb (devid 1) to /dev/sdc canceled [ 6852.426700] WARNING: CPU: 0 PID: 4494 at fs/btrfs/scrub.c:622 scrub_setup_ctx.isra.19+0x220/0x230 [btrfs] ... [ 6852.428928] RIP: 0010:scrub_setup_ctx.isra.19+0x220/0x230 [btrfs] ... [ 6852.432970] Call Trace: [ 6852.433202] btrfs_scrub_dev+0x19b/0x5c0 [btrfs] [ 6852.433471] btrfs_dev_replace_start+0x48c/0x6a0 [btrfs] [ 6852.433800] btrfs_dev_replace_by_ioctl+0x3a/0x60 [btrfs] [ 6852.434097] btrfs_ioctl+0x2476/0x2d20 [btrfs] [ 6852.434365] ? do_sigaction+0x7d/0x1e0 [ 6852.434623] do_vfs_ioctl+0xa9/0x6c0 [ 6852.434865] ? syscall_trace_enter+0x1c8/0x310 [ 6852.435124] ? syscall_trace_enter+0x1c8/0x310 [ 6852.435387] ksys_ioctl+0x60/0x90 [ 6852.435663] __x64_sys_ioctl+0x16/0x20 [ 6852.435907] do_syscall_64+0x50/0x180 [ 6852.436150] entry_SYSCALL_64_after_hwframe+0x49/0xbe Further, as the replace thread enters scrub_write_page_to_dev_replace() without the target device it panics: static int scrub_add_page_to_wr_bio(struct scrub_ctx *sctx, struct scrub_page *spage) { ... bio_set_dev(bio, sbio->dev->bdev); <====== [ 6929.715145] BUG: unable to handle kernel NULL pointer dereference at 00000000000000a0 .. [ 6929.717106] Workqueue: btrfs-scrub btrfs_scrub_helper [btrfs] [ 6929.717420] RIP: 0010:scrub_write_page_to_dev_replace+0xb4/0x260 [btrfs] .. [ 6929.721430] Call Trace: [ 6929.721663] scrub_write_block_to_dev_replace+0x3f/0x60 [btrfs] [ 6929.721975] scrub_bio_end_io_worker+0x1af/0x490 [btrfs] [ 6929.722277] normal_work_helper+0xf0/0x4c0 [btrfs] [ 6929.722552] process_one_work+0x1f4/0x520 [ 6929.722805] ? process_one_work+0x16e/0x520 [ 6929.723063] worker_thread+0x46/0x3d0 [ 6929.723313] kthread+0xf8/0x130 [ 6929.723544] ? process_one_work+0x520/0x520 [ 6929.723800] ? kthread_delayed_work_timer_fn+0x80/0x80 [ 6929.724081] ret_from_fork+0x3a/0x50 Fix this by letting the btrfs_dev_replace_finishing() to do the job of cleaning after the cancel, including freeing of the target device. btrfs_dev_replace_finishing() is called when btrfs_scub_dev() returns along with the scrub return status. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 05c49e6bc1e8866ecfd674ebeeb58cdbff9145c2 Author: Anand Jain Date: Sun Nov 11 22:22:18 2018 +0800 btrfs: dev-replace: go back to suspend state if another EXCL_OP is running In a secnario where balance and replace co-exists as below, - start balance - pause balance - start replace - reboot and when system restarts, balance resumes first. Then the replace is attempted to restart but will fail as the EXCL_OP lock is already held by the balance. If so place the replace state back to BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED state. Fixes: 010a47bde9420 ("btrfs: add proper safety check before resuming dev-replace") CC: stable@vger.kernel.org # 4.18+ Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0d228ece59a35a9b9e8ff0d40653234a6d90f61e Author: Anand Jain Date: Sun Nov 11 22:22:17 2018 +0800 btrfs: dev-replace: go back to suspended state if target device is missing At the time of forced unmount we place the running replace to BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED state, so when the system comes back and expect the target device is missing. Then let the replace state continue to be in BTRFS_IOCTL_DEV_REPLACE_STATE_SUSPENDED state instead of BTRFS_IOCTL_DEV_REPLACE_STATE_STARTED as there isn't any matching scrub running as part of replace. Fixes: e93c89c1aaaa ("Btrfs: add new sources for device replace code") CC: stable@vger.kernel.org # 4.4+ Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit 54862d6d28fc439d1f99c6e19bb38d9dc08161e0 Author: Anand Jain Date: Sun Nov 11 22:22:16 2018 +0800 btrfs: mark btrfs_dev_replace_start as static There isn't any other consumer other than in its own file dev-replace.c. Signed-off-by: Anand Jain Reviewed-by: Nikolay Borisov Signed-off-by: David Sterba commit a9261d4125c97ce8624e9941b75dee1b43ad5df9 Author: Anand Jain Date: Mon Oct 15 10:45:17 2018 +0800 btrfs: harden agaist duplicate fsid on scanned devices It's not that impossible to imagine that a device OR a btrfs image is copied just by using the dd or the cp command. Which in case both the copies of the btrfs will have the same fsid. If on the system with automount enabled, the copied FS gets scanned. We have a known bug in btrfs, that we let the device path be changed after the device has been mounted. So using this loop hole the new copied device would appears as if its mounted immediately after it's been copied. For example: Initially.. /dev/mmcblk0p4 is mounted as / $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT mmcblk0 179:0 0 29.2G 0 disk |-mmcblk0p4 179:4 0 4G 0 part / |-mmcblk0p2 179:2 0 500M 0 part /boot |-mmcblk0p3 179:3 0 256M 0 part [SWAP] `-mmcblk0p1 179:1 0 256M 0 part /boot/efi $ btrfs fi show Label: none uuid: 07892354-ddaa-4443-90ea-f76a06accaba Total devices 1 FS bytes used 1.40GiB devid 1 size 4.00GiB used 3.00GiB path /dev/mmcblk0p4 Copy mmcblk0 to sda $ dd if=/dev/mmcblk0 of=/dev/sda And immediately after the copy completes the change in the device superblock is notified which the automount scans using btrfs device scan and the new device sda becomes the mounted root device. $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 1 14.9G 0 disk |-sda4 8:4 1 4G 0 part / |-sda2 8:2 1 500M 0 part |-sda3 8:3 1 256M 0 part `-sda1 8:1 1 256M 0 part mmcblk0 179:0 0 29.2G 0 disk |-mmcblk0p4 179:4 0 4G 0 part |-mmcblk0p2 179:2 0 500M 0 part /boot |-mmcblk0p3 179:3 0 256M 0 part [SWAP] `-mmcblk0p1 179:1 0 256M 0 part /boot/efi $ btrfs fi show / Label: none uuid: 07892354-ddaa-4443-90ea-f76a06accaba Total devices 1 FS bytes used 1.40GiB devid 1 size 4.00GiB used 3.00GiB path /dev/sda4 The bug is quite nasty that you can't either unmount /dev/sda4 or /dev/mmcblk0p4. And the problem does not get solved until you take sda out of the system on to another system to change its fsid using the 'btrfstune -u' command. Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit b50836edf9fe531c66310071df59eac2d8dfc708 Author: Hans van Kranenburg Date: Thu Oct 4 23:24:42 2018 +0200 btrfs: introduce nparity raid_attr Instead of hardcoding exceptions for RAID5 and RAID6 in the code, use an nparity field in raid_attr. Signed-off-by: Hans van Kranenburg Signed-off-by: David Sterba commit da612e31aee51bd13231c78a47c714b543bd3ad8 Author: Hans van Kranenburg Date: Thu Oct 4 23:24:41 2018 +0200 btrfs: fix ncopies raid_attr for RAID56 RAID5 and RAID6 profile store one copy of the data, not 2 or 3. These values are not yet used anywhere so there's no change. Reviewed-by: Nikolay Borisov Signed-off-by: Hans van Kranenburg Signed-off-by: David Sterba commit baf92114c7e6dd6124aa3d506e4bc4b694da3bc3 Author: Hans van Kranenburg Date: Thu Oct 4 23:24:40 2018 +0200 btrfs: alloc_chunk: fix more DUP stripe size handling Commit 92e222df7b "btrfs: alloc_chunk: fix DUP stripe size handling" fixed calculating the stripe_size for a new DUP chunk. However, the same calculation reappears a bit later, and that one was not changed yet. The resulting bug that is exposed is that the newly allocated device extents ('stripes') can have a few MiB overlap with the next thing stored after them, which is another device extent or the end of the disk. The scenario in which this can happen is: * The block device for the filesystem is less than 10GiB in size. * The amount of contiguous free unallocated disk space chosen to use for chunk allocation is 20% of the total device size, or a few MiB more or less. An example: - The filesystem device is 7880MiB (max_chunk_size gets set to 788MiB) - There's 1578MiB unallocated raw disk space left in one contiguous piece. In this case stripe_size is first calculated as 789MiB, (half of 1578MiB). Since 789MiB (stripe_size * data_stripes) > 788MiB (max_chunk_size), we enter the if block. Now stripe_size value is immediately overwritten while calculating an adjusted value based on max_chunk_size, which ends up as 788MiB. Next, the value is rounded up to a 16MiB boundary, 800MiB, which is actually more than the value we had before. However, the last comparison fails to detect this, because it's comparing the value with the total amount of free space, which is about twice the size of stripe_size. In the example above, this means that the resulting raw disk space being allocated is 1600MiB, while only a gap of 1578MiB has been found. The second device extent object for this DUP chunk will overlap for 22MiB with whatever comes next. The underlying problem here is that the stripe_size is reused all the time for different things. So, when entering the code in the if block, stripe_size is immediately overwritten with something else. If later we decide we want to have the previous value back, then the logic to compute it was copy pasted in again. With this change, the value in stripe_size is not unnecessarily destroyed, so the duplicated calculation is not needed any more. Signed-off-by: Hans van Kranenburg Signed-off-by: David Sterba commit 23f0ff1ec4b0b2860e9faaa98149bd4f30e82a18 Author: Hans van Kranenburg Date: Thu Oct 4 23:24:39 2018 +0200 btrfs: alloc_chunk: improve chunk size variable name The variable num_bytes is really a way too generic name for a variable in this function. There are a dozen other variables that hold a number of bytes as value. Give it a name that actually describes what it does, which is holding the size of the chunk that we're allocating. Reviewed-by: David Sterba Signed-off-by: Hans van Kranenburg Signed-off-by: David Sterba commit 2f29df4fc24ee3467f0073300d93a55499c7dd9f Author: Hans van Kranenburg Date: Thu Oct 4 23:24:38 2018 +0200 btrfs: alloc_chunk: do not refurbish num_bytes The variable num_bytes is used to store the chunk length of the chunk that we're allocating. Do not reuse it for something really different in the same function. Reviewed-by: Nikolay Borisov Signed-off-by: Hans van Kranenburg Signed-off-by: David Sterba commit 3cd24c698004d2f7668e0eb9fc1f096f533c791b Author: Ethan Lien Date: Thu Nov 1 14:49:03 2018 +0800 btrfs: use tagged writepage to mitigate livelock of snapshot Snapshot is expected to be fast. But if there are writers steadily creating dirty pages in our subvolume, the snapshot may take a very long time to complete. To fix the problem, we use tagged writepage for snapshot flusher as we do in the generic write_cache_pages(), so we can omit pages dirtied after the snapshot command. This does not change the semantics regarding which data get to the snapshot, if there are pages being dirtied during the snapshotting operation. There's a sync called before snapshot is taken in old/new case, any IO in flight just after that may be in the snapshot but this depends on other system effects that might still sync the IO. We do a simple snapshot speed test on a Intel D-1531 box: fio --ioengine=libaio --iodepth=32 --bs=4k --rw=write --size=64G --direct=0 --thread=1 --numjobs=1 --time_based --runtime=120 --filename=/mnt/sub/testfile --name=job1 --group_reporting & sleep 5; time btrfs sub snap -r /mnt/sub /mnt/snap; killall fio original: 1m58sec patched: 6.54sec This is the best case for this patch since for a sequential write case, we omit nearly all pages dirtied after the snapshot command. For a multi writers, random write test: fio --ioengine=libaio --iodepth=32 --bs=4k --rw=randwrite --size=64G --direct=0 --thread=1 --numjobs=4 --time_based --runtime=120 --filename=/mnt/sub/testfile --name=job1 --group_reporting & sleep 5; time btrfs sub snap -r /mnt/sub /mnt/snap; killall fio original: 15.83sec patched: 10.35sec The improvement is smaller compared to the sequential write case, since we omit only half of the pages dirtied after snapshot command. Reviewed-by: Nikolay Borisov Signed-off-by: Ethan Lien Reviewed-by: David Sterba Signed-off-by: David Sterba commit c629732d247e253e811a7ef6667a53349ae5a0ab Author: Nikolay Borisov Date: Thu Nov 8 10:18:08 2018 +0200 btrfs: Remove unused extent_state argument from btrfs_writepage_endio_finish_ordered This parameter was never used, yet was part of the interface of the function ever since its introduction as extent_io_ops::writepage_end_io_hook in e6dcd2dc9c48 ("Btrfs: New data=ordered implementation"). Now that NULL is passed everywhere as a value for this parameter let's remove it for good. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8cc0237abc3f138d9b5fa4cd8af26f3c335ba7eb Author: Nikolay Borisov Date: Thu Nov 8 10:18:07 2018 +0200 btrfs: Remove extent_page_data argument from writepage_delalloc The only remaining use of the 'epd' argument in writepage_delalloc is to reference the extent_io_tree which was set in extent_writepages. Since it is guaranteed that page->mapping of any page passed to writepage_delalloc (and __extent_writepage as the sole caller) to be equal to that passed in extent_writepages we can directly get the io_tree via the already passed inode (which is also taken from page->mapping->host). No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7789a55aa1c98e3408a77167699f86fdb79f097b Author: Nikolay Borisov Date: Thu Nov 8 10:18:06 2018 +0200 btrfs: Move epd::extent_locked check to writepage_delalloc's caller If epd::extent_locked is set then writepage_delalloc terminates. Make this a bit more apparent in the caller by simply bubbling the check up. This enables to remove epd as an argument to writepage_delalloc in a future patch. No functional change. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit fc8a168aa9ab1680c2bd52bf9db7c994e0f2524f Author: Nikolay Borisov Date: Thu Nov 8 16:16:38 2018 +0200 btrfs: Check for missing device before bio submission in btrfs_map_bio Before btrfs_map_bio submits all stripe bios it does a number of checks to ensure the device for every stripe is present. However, it doesn't do a DEV_STATE_MISSING check, instead this is relegated to the lower level btrfs_schedule_bio (in the async submission case, sync submission doesn't check DEV_STATE_MISSING at all). Additionally btrfs_schedule_bios does the duplicate device->bdev check which has already been performed in btrfs_map_bio. This patch moves the DEV_STATE_MISSING check in btrfs_map_bio and removes the duplicate device->bdev check. Doing so ensures that no bio cloning/submission happens for both async/sync requests in the face of missing device. This makes the async io submission path slightly shorter in terms of instruction count. No functional changes. Reviewed-by: Josef Bacik Reviewed-by: Anand Jain Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit ab457246f8a45bbb3e79fd2a9c1044b5ac14ec99 Author: Anand Jain Date: Mon Nov 12 13:05:15 2018 +0800 btrfs: remove redundant replace_state init dev_replace::replace_state has been set to BTRFS_DEV_REPLACE_ITEM_STATE_NEVER_STARTED (0) in the same function, So delete the line which sets replace_state = 0; Reviewed-by: Nikolay Borisov Signed-off-by: Anand Jain Signed-off-by: David Sterba commit 6d4cbf790307515dcd91eb2165e36e9b83d0fab6 Author: Filipe Manana Date: Mon Nov 12 10:24:30 2018 +0000 Btrfs: remove no longer used io_err from btrfs_log_ctx The io_err field of struct btrfs_log_ctx is no longer used after the recent simplification of the fast fsync path, where we now wait for ordered extents to complete before logging the inode. We did this in commit b5e6c3e170b7 ("btrfs: always wait on ordered extents at fsync time") and commit a2120a473a80 ("btrfs: clean up the left over logged_list usage") removed its last use. Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 59b0713a8a6c0f72ab468507dcd6b866869b900a Author: Filipe Manana Date: Fri Nov 9 10:43:08 2018 +0000 Btrfs: simpler and more efficient cleanup of a log tree's extent io tree We currently are in a loop finding each range (corresponding to a btree node/leaf) in a log root's extent io tree and then clean it up. This is a waste of time since we are traversing the extent io tree's rb_tree more times then needed (one for a range lookup and another for cleaning it up) without any good reason. We free the log trees when we are in the critical section of a transaction commit (the transaction state is set to TRANS_STATE_COMMIT_DOING), so it's of great convenience to do everything as fast as possible in order to reduce the time we block other tasks from starting a new transaction. So fix this by traversing the extent io tree once and cleaning up all its records in one go while traversing it. Reviewed-by: Nikolay Borisov Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 46cc775e29c55d6ae9f4dbb733ec066ff56d3922 Author: Nikolay Borisov Date: Mon Oct 15 17:04:01 2018 +0300 btrfs: Adjust loop in free_extent_buffer The loop construct in free_extent_buffer was added in 242e18c7c1a8 ("Btrfs: reduce lock contention on extent buffer locks") as means of reducing the times the eb lock is taken, the non-last ref count is decremented and lock is released. As the special handling of UNMAPPED extent buffers was removed now there is only one decrement op which is happening for EXTENT_BUFFER_UNMAPPED case. This commit modifies the loop condition so that in case of UNMAPPED buffers the eb's lock is taken only if we are 100% sure the eb is going to be freed by the current executor of the code. Additionally, remove superfluous ref count ops in btrfs test. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9cfc8ba712be5abd476532bf672389f67e41f4ff Author: Nikolay Borisov Date: Wed Aug 15 18:26:57 2018 +0300 btrfs: Remove special handling of EXTENT_BUFFER_UNMAPPED while freeing Now that the whole of btrfs code has been audited for eb reference count management it's time to remove the hunk in free_extent_buffer that essentially considered the condition "eb->ref == 2 && EXTENT_BUFFER_DUMMY" to equal "eb->ref = 1". Also remove the last location which takes an extra reference count in alloc_test_extent_buffer. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit df44971468c1a960cac1ace116e4fa9be50a9479 Author: Nikolay Borisov Date: Wed Aug 15 18:26:56 2018 +0300 btrfs: Remove unnecessary tree locking code in qgroup_rescan_leaf In qgroup_rescan_leaf a copy is made of the target leaf by calling btrfs_clone_extent_buffer. The latter allocates a new buffer and attaches a new set of pages and copies the content of the source buffer. The new scratch buffer is only used to iterate it's items, it's not published anywhere and cannot be accessed by a third party. Hence, it's not necessary to perform any locking on it whatsoever. Furthermore, remove the extra extent_buffer_get call since the new buffer is always allocated with a reference count of 1 which is sufficient here. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8c7eeb6557877e3272f3105955ca103ee351f16d Author: Nikolay Borisov Date: Wed Aug 15 18:26:55 2018 +0300 btrfs: Remove extra reference count bumps in btrfs_compare_trees When the 2 comparison trees roots are initialised they are private to the function and already have reference counts of 1 each. There is no need to further increment the reference count since the cloned buffers are already accessed via struct btrfs_path. Eventually the 2 paths used for comparison are going to be released, effectively disposing of the cloned buffers. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 24cee18a1c1d7c731ea5987e0c99daea22ae7f4a Author: Nikolay Borisov Date: Wed Aug 15 18:26:54 2018 +0300 btrfs: Remove extraneous extent_buffer_get from tree_mod_log_rewind When a rewound buffer is created it already has a ref count of 1 and the dummy flag set. Then another ref is taken bumping the count to 2. Finally when this buffer is released from btrfs_release_path the extra reference is decremented by the special handling code in free_extent_buffer. However, this special code is in fact redundant sinca ref count of 1 is still correct since the buffer is only accessed via btrfs_path struct. This paves the way forward of removing the special handling in free_extent_buffer. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6c122e2a0c515cfb3f3a9cefb5dad4cb62109c78 Author: Nikolay Borisov Date: Wed Aug 15 18:26:53 2018 +0300 btrfs: Remove redundant extent_buffer_get in get_old_root get_old_root used used only by btrfs_search_old_slot to initialise the path structure. The old root is always a cloned buffer (either via alloc dummy or via btrfs_clone_extent_buffer) and its reference count is 2: 1 from allocation, 1 from extent_buffer_get call in get_old_root. This latter explicit ref count acquire operation is in fact unnecessary since the semantic is such that the newly allocated buffer is handed over to the btrfs_path for lifetime management. Considering this just remove the extra extent_buffer_get in get_old_root. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5c623d334a4f7f270de223cde2a3f3b743023e2a Author: Nikolay Borisov Date: Wed Aug 15 18:26:52 2018 +0300 btrfs: Remove needless tree locking in iterate_inode_extrefs In iterate_inode_exrefs the eb is cloned via btrfs_clone_extent_buffer which creates a private extent buffer with the dummy flag set and ref count of 1. Then this buffer is locked for reading and its ref count is incremented by 1. Finally it's fed to the passed iterate_irefs_t function. The actual iterate call back is inode_to_path (coming from paths_from_inode) which feeds the eb to btrfs_ref_to_path. In this final function the passed eb is only read by first assigning it to the local eb variable. This variable is only modified in the case another eb was referenced from the passed path that is eb != eb_in check triggers. Considering this there is no point in locking the cloned eb in iterate_inode_refs since it's never being modified and is not published anywhere. Furthermore the cloned eb is completely fine having its ref count be 1. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit e5bba0b0f843e047ca025b53f1dcfa7e6bd05d86 Author: Nikolay Borisov Date: Wed Aug 15 18:26:51 2018 +0300 btrfs: Remove needless tree locking in iterate_inode_refs In iterate_inode_refs the eb is cloned via btrfs_clone_extent_buffer which creates a private extent buffer with the dummy flag set and ref count of 1. Then this buffer is locked for reading and its ref count is incremented by 1. Finally it's fed to the passed iterate_irefs_t function. The actual iterate call back is inode_to_path (coming from paths_from_inode) which feeds the eb to btrfs_ref_to_path. In this final function the passed eb is only read by first assigning it to the local eb variable. This variable is only modified in the case another eb was referenced from the passed path that is eb != eb_in check triggers. Considering this there is no point in locking the cloned eb in iterate_inode_refs since it's never being modified and is not published anywhere. Furthermore the cloned eb is completely fine having its ref count be 1. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit d9cb2459b2e96264246e3a78f43c2f74c2c72461 Author: Qu Wenruo Date: Sat Nov 3 17:24:52 2018 +0800 btrfs: tests: Use BTRFS_MAX_EXTENT_SIZE to replace the intermediate number In extent-io self test, we need 2 ordered extents at its maximum size to do the test. Instead of using the intermediate numbers, use BTRFS_MAX_EXTENT_SIZE for @max_bytes, and twice @max_bytes for @total_dirty. This should explain why we need all these magic numbers and prevent people to modify them by accident. Reviewed-by: Nikolay Borisov Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit ed46ff3d423780fa5173b38a844bf0fdb210a2a7 Author: Omar Sandoval Date: Thu Nov 3 10:28:14 2016 -0700 Btrfs: support swap files Btrfs has not allowed swap files since commit 35054394c4b3 ("Btrfs: stop providing a bmap operation to avoid swapfile corruptions"). However, now that the proper restrictions are in place, Btrfs can support swap files through the swap file a_ops, similar to iomap in commit 67482129cdab ("iomap: add a swapfile activation function"). For Btrfs, activation needs to make sure that the file can be used as a swap file, which currently means that it must be fully allocated as NOCOW with no compression on one device. It must also do the proper tracking so that ioctls will not interfere with the swap file. Deactivation clears this tracking. Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit 60ca842e345716eb8c3f7df070511848b9f1a796 Author: Omar Sandoval Date: Wed May 16 16:34:31 2018 -0700 Btrfs: rename and export get_chunk_map The Btrfs swap code is going to need it, so give it a btrfs_ prefix and make it non-static. Reviewed-by: Nikolay Borisov Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit eede2bf34f4fa84ce82e36878ccdd0fdc4b1463c Author: Omar Sandoval Date: Thu Nov 3 10:28:12 2016 -0700 Btrfs: prevent ioctls from interfering with a swap file A later patch will implement swap file support for Btrfs, but before we do that, we need to make sure that the various Btrfs ioctls cannot change a swap file. When a swap file is active, we must make sure that the extents of the file are not moved and that they don't become shared. That means that the following are not safe: - chattr +c (enable compression) - reflink - dedupe - snapshot - defrag Don't allow those to happen on an active swap file. Additionally, balance, resize, device remove, and device replace are also unsafe if they affect an active swapfile. Add a red-black tree of block groups and devices which contain an active swapfile. Relocation checks each block group against this tree and skips it or errors out for balance or resize, respectively. Device remove and device replace check the tree for the device they will operate on. Note that we don't have to worry about chattr -C (disable nocow), which we ignore for non-empty files, because an active swapfile must be non-empty and can't be truncated. We also don't have to worry about autodefrag because it's only done on COW files. Truncate and fallocate are already taken care of by the generic code. Device add doesn't do relocation so it's not an issue, either. Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit abbb55f4cd56dffb20ba7dd8dfc53154c79934f1 Author: Nikolay Borisov Date: Thu Nov 1 14:09:53 2018 +0200 btrfs: Remove extent_io_ops::split_extent_hook callback This is the counterpart to merge_extent_hook, similarly, it's used only for data/freespace inodes so let's remove it, rename it and call it directly where necessary. No functional changes. Reviewed-by: Josef Bacik Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5c848198aad3ad1c68309aa7002fa571a540568c Author: Nikolay Borisov Date: Thu Nov 1 14:09:52 2018 +0200 btrfs: Remove extent_io_ops::merge_extent_hook callback This callback is used only for data and free space inodes. Such inodes are guaranteed to have their extent_io_tree::private_data set to the inode struct. Exploit this fact to directly call the function. Also give it a more descriptive name. No functional changes. Reviewed-by: Josef Bacik Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit a36bb5f9a90c9bab05b7084d21718450e8067fb0 Author: Nikolay Borisov Date: Thu Nov 1 14:09:51 2018 +0200 btrfs: Remove extent_io_ops::clear_bit_hook callback This is the counterpart to ex-set_bit_hook (now btrfs_set_delalloc_extent), similar to what was done before remove clear_bit_hook and rename the function. No functional changes. Reviewed-by: Josef Bacik Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit e06a1fc99cc7eca09118cc02c4d7540fa69e9d09 Author: Nikolay Borisov Date: Thu Nov 1 14:09:50 2018 +0200 btrfs: Remove extent_io_ops::set_bit_hook extent_io callback This callback is used to properly account delalloc extents for data inodes (ordinary file inodes and freespace v1 inodes). Those can be easily identified since they have their extent_io trees ->private_data member point to the inode. Let's exploit this fact to remove the needless indirection through extent_io_hooks and directly call the function. Also give the function a name which reflects its purpose - btrfs_set_delalloc_extent. This patch also modified test_find_delalloc so that the extent_io_tree used for testing doesn't have its ->private_data set which would have caused a crash in btrfs_set_delalloc_extent due to the btrfs_inode->root member not being initialised. The old version of the code also didn't call set_bit_hook since the extent_io ops weren't set for the inode. No functional changes. Reviewed-by: Josef Bacik Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 65a680f6b7d6e83ca3a440588d3581f4a38265bf Author: Nikolay Borisov Date: Thu Nov 1 14:09:49 2018 +0200 btrfs: Remove extent_io_ops::check_extent_io_range callback This callback was only used in debug builds by btrfs_leak_debug_check. A better approach is to move its implementation in btrfs_leak_debug_check and ensure the latter is only executed for extent tree which have ->private_data set i.e. relate to a data node and not the btree one. No functional changes. Reviewed-by: Josef Bacik Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7087a9d8db88ef9b7f8a30ac5706aa396b78e6c9 Author: Nikolay Borisov Date: Thu Nov 1 14:09:48 2018 +0200 btrfs: Remove extent_io_ops::writepage_end_io_hook This callback is ony ever called for data page writeout so there is no need to actually abstract it via extent_io_ops. Lets just export it, remove the definition of the callback and call it directly in the functions that invoke the callback. Also rename the function to btrfs_writepage_endio_finish_ordered since what it really does is account finished io in the ordered extent data structures. No functional changes. Reviewed-by: Josef Bacik Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit d75855b4518b525dbba4e461819b26bc5bb89a82 Author: Nikolay Borisov Date: Thu Nov 1 14:09:47 2018 +0200 btrfs: Remove extent_io_ops::writepage_start_hook This hook is called only from __extent_writepage_io which is already called only from the data page writeout path. So there is no need to make an indirect call via extent_io_ops. This patch just removes the callback definition, exports the callback function and calls it directly at the only call site. Also give the function a more descriptive name. No functional changes. Reviewed-by: Josef Bacik Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5eaad97af8aeff38debe7d3c69ec3a0d71f8350f Author: Nikolay Borisov Date: Thu Nov 1 14:09:46 2018 +0200 btrfs: Remove extent_io_ops::fill_delalloc This callback is called only from writepage_delalloc which in turn is guaranteed to be called from the data page writeout path. In the end there is no reason to have the call to this function to be indrected via the extent_io_ops structure. This patch removes the callback definition, exports the function and calls it directly. No functional changes. Reviewed-by: Josef Bacik Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba [ rename to btrfs_run_delalloc_range ] Signed-off-by: David Sterba commit 06f2548f9d74a925a16967bb4ff3d860e0c6b33f Author: Nikolay Borisov Date: Fri Nov 9 16:08:30 2018 +0200 btrfs: Add function to distinguish between data and btree inode This will be used in future patches that remove the optional extent_io_ops callbacks. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 05a37c48604c19b50873fd9663f9140c150469d1 Author: Qu Wenruo Date: Fri Oct 5 17:45:55 2018 +0800 btrfs: volumes: Make sure no dev extent is beyond device boundary Add extra dev extent end check against device boundary. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5eb193812a42dc49331f25137a38dfef9612d3e4 Author: Qu Wenruo Date: Fri Oct 5 17:45:54 2018 +0800 btrfs: volumes: Make sure there is no overlap of dev extents at mount time Enhance btrfs_verify_dev_extents() to remember previous checked dev extents, so it can verify no dev extents can overlap. Analysis from Hans: "Imagine allocating a DATA|DUP chunk. In the chunk allocator, we first set... max_stripe_size = SZ_1G; max_chunk_size = BTRFS_MAX_DATA_CHUNK_SIZE ... which is 10GiB. Then... /* we don't want a chunk larger than 10% of writeable space */ max_chunk_size = min(div_factor(fs_devices->total_rw_bytes, 1), max_chunk_size); Imagine we only have one 7880MiB block device in this filesystem. Now max_chunk_size is down to 788MiB. The next step in the code is to search for max_stripe_size * dev_stripes amount of free space on the device, which is in our example 1GiB * 2 = 2GiB. Imagine the device has exactly 1578MiB free in one contiguous piece. This amount of bytes will be put in devices_info[ndevs - 1].max_avail Next we recalculate the stripe_size (which is actually the device extent length), based on the actual maximum amount of available raw disk space: stripe_size = div_u64(devices_info[ndevs - 1].max_avail, dev_stripes); stripe_size is now 789MiB Next we do... data_stripes = num_stripes / ncopies ...where data_stripes ends up as 1, because num_stripes is 2 (the amount of device extents we're going to have), and DUP has ncopies 2. Next there's a check... if (stripe_size * data_stripes > max_chunk_size) ...which matches because 789MiB * 1 > 788MiB. We go into the if code, and next is... stripe_size = div_u64(max_chunk_size, data_stripes); ...which resets stripe_size to max_chunk_size: 788MiB Next is a fun one... /* bump the answer up to a 16MB boundary */ stripe_size = round_up(stripe_size, SZ_16M); ...which changes stripe_size from 788MiB to 800MiB. We're not done changing stripe_size yet... /* But don't go higher than the limits we found while searching * for free extents */ stripe_size = min(devices_info[ndevs - 1].max_avail, stripe_size); This is bad. max_avail is twice the stripe_size (we need to fit 2 device extents on the same device for DUP). The result here is that 800MiB < 1578MiB, so it's unchanged. However, the resulting DUP chunk will need 1600MiB disk space, which isn't there, and the second dev_extent might extend into the next thing (next dev_extent? end of device?) for 22MiB. The last shown line of code relies on a situation where there's twice the value of stripe_size present as value for the variable stripe_size when it's DUP. This was actually the case before commit 92e222df7b "btrfs: alloc_chunk: fix DUP stripe size handling", from which I quote: "[...] in the meantime there's a check to see if the stripe_size does not exceed max_chunk_size. Since during this check stripe_size is twice the amount as intended, the check will reduce the stripe_size to max_chunk_size if the actual correct to be used stripe_size is more than half the amount of max_chunk_size." In the previous version of the code, the 16MiB alignment (why is this done, by the way?) would result in a 50% chance that it would actually do an 8MiB alignment for the individual dev_extents, since it was operating on double the size. Does this matter? Does it matter that stripe_size can be set to anything which is not 16MiB aligned because of the amount of remaining available disk space which is just taken? What is the main purpose of this round_up? The most straightforward thing to do seems something like... stripe_size = min( div_u64(devices_info[ndevs - 1].max_avail, dev_stripes), stripe_size ) ..just putting half of the max_avail into stripe_size." Link: https://lore.kernel.org/linux-btrfs/b3461a38-e5f8-f41d-c67c-2efac8129054@mendix.com/ Reported-by: Hans van Kranenburg Signed-off-by: Qu Wenruo [ add analysis from report ] Signed-off-by: David Sterba commit e72d79d6bcee564dbdf83169c743bbd3f8438108 Author: Qu Wenruo Date: Fri Nov 2 09:39:50 2018 +0800 btrfs: Refactor find_free_extent loops update into find_free_extent_update_loop We have a complex loop design for find_free_extent(), that has different behavior for each loop, some even includes new chunk allocation. Instead of putting such a long code into find_free_extent() and makes it harder to read, just extract them into find_free_extent_update_loop(). With all the cleanups, the main find_free_extent() should be pretty barebone: find_free_extent() |- Iterate through all block groups | |- Get a valid block group | |- Try to do clustered allocation in that block group | |- Try to do unclustered allocation in that block group | |- Check if the result is valid | | |- If valid, then exit | |- Jump to next block group | |- Push harder to find free extents |- If not found, re-iterate all block groups Signed-off-by: Qu Wenruo Reviewed-by: Su Yue [ copy callchain from changelog to function comment ] Signed-off-by: David Sterba commit e1a4184815672c0cd8ea91beca3dd6d0bd4b9e53 Author: Qu Wenruo Date: Fri Nov 2 09:39:49 2018 +0800 btrfs: Refactor unclustered extent allocation into find_free_extent_unclustered() This patch will extract unclsutered extent allocation code into find_free_extent_unclustered(). And this helper function will use return value to indicate what to do next. This should make find_free_extent() a little easier to read. Signed-off-by: Qu Wenruo Reviewed-by: Su Yue Reviewed-by: Josef Bacik [Update merge conflict with fb5c39d7a887 ("btrfs: don't use ctl->free_space for max_extent_size")] Reviewed-by: David Sterba Signed-off-by: David Sterba commit d06e3bb69009d21802776b8751dfe5deef7102f5 Author: Qu Wenruo Date: Fri Nov 2 09:39:48 2018 +0800 btrfs: Refactor clustered extent allocation into find_free_extent_clustered We have two main methods to find free extents inside a block group: 1) clustered allocation 2) unclustered allocation This patch will extract the clustered allocation into find_free_extent_clustered() to make it a little easier to read. Instead of jumping between different labels in find_free_extent(), the helper function will use return value to indicate different behavior. Signed-off-by: Qu Wenruo Reviewed-by: Su Yue Reviewed-by: Josef Bacik Signed-off-by: David Sterba commit b4bd745d1230ddcf8de408997db9a45cd696508d Author: Qu Wenruo Date: Fri Nov 2 09:39:47 2018 +0800 btrfs: Introduce find_free_extent_ctl structure for later rework Instead of tons of different local variables in find_free_extent(), extract them into find_free_extent_ctl structure, and add better explanation for them. Some modification may looks redundant, but will later greatly simplify function parameter list during find_free_extent() refactor. Also add two comments to co-operate with fb5c39d7a887 ("btrfs: don't use ctl->free_space for max_extent_size"), to make ffe_ctl->max_extent_size update more reader-friendly. Signed-off-by: Qu Wenruo Reviewed-by: Su Yue Reviewed-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit e2907c1a6ae1842f9c1d5393bbe966c1ccfbc335 Author: Lu Fengqi Date: Wed Oct 24 20:24:02 2018 +0800 btrfs: extent-tree: Detect bytes_pinned underflow earlier Introduce a new wrapper update_bytes_pinned to replace open coded bytes_pinned modifiers. Now the underflows of space_info::bytes_pinned get detected and reported. Reviewed-by: Josef Bacik Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 9f9b8e8d0ebe1af42ddd3c86e12569c53914a89d Author: Qu Wenruo Date: Wed Oct 24 20:24:01 2018 +0800 btrfs: extent-tree: Detect bytes_may_use underflow earlier Although we have space_info::bytes_may_use underflow detection in btrfs_free_reserved_data_space_noquota(), we have more callers who are subtracting number from space_info::bytes_may_use. So instead of doing underflow detection for every caller, introduce a new wrapper update_bytes_may_use() to replace open coded bytes_may_use modifiers. This also introduce a macro to declare more wrappers, but currently space_info::bytes_may_use is the mostly interesting one. Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Signed-off-by: Lu Fengqi Signed-off-by: David Sterba commit 85dd506c8e022a5c5555ad22decfa0abf93a5d64 Author: Filipe Manana Date: Fri Oct 26 17:15:21 2018 +0100 Btrfs: remove no longer used stuff for tracking pending ordered extents Tracking pending ordered extents per transaction was introduced in commit 50d9aa99bd35 ("Btrfs: make sure logged extents complete in the current transaction V3") and later updated in commit 161c3549b45a ("Btrfs: change how we wait for pending ordered extents"). However now that on fsync we always wait for ordered extents to complete before logging, done in commit 5636cf7d6dc8 ("btrfs: remove the logged extents infrastructure"), we no longer need the stuff to track for pending ordered extents, which was not completely removed in the mentioned commit. So remove the remaining of the pending ordered extents infrastructure. Reviewed-by: Liu Bo Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit ce02f0326680562a905216d6601c8ac5020feaba Author: Filipe Manana Date: Fri Oct 26 21:26:40 2018 +0100 Btrfs: remove no longer used logged range variables when logging extents The logged_start and logged_end variables, at btrfs_log_changed_extents, were added in commit 8c6c592831a0 ("btrfs: log csums for all modified extents"). However since the recent simplification for fsync, which makes us wait for all ordered extents to complete before logging extents, we no longer need those variables. Commit a2120a473a80 ("btrfs: clean up the left over logged_list usage") forgot to remove them. Reviewed-by: Nikolay Borisov Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 2074e8a7d0257185c290e25d29a52d9601ee8701 Author: Dominic Braun Date: Fri Dec 14 13:05:10 2018 +0100 staging: vc04_services: Remove VCHIU_QUEUE_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 2d0a0291135fd2f5591e0920d5eec04cba7846e3 Author: Dominic Braun Date: Fri Dec 14 13:05:09 2018 +0100 staging: vc04_services: Remove VCHIQ_STATE_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit f5a98269861a92e60e7c9caa12ae6fc3b36bb752 Author: Dominic Braun Date: Fri Dec 14 13:05:08 2018 +0100 staging: vc04_services: Remove VCHIQ_SLOT_ZERO_T Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 6f1e4141c7516a2e1c5d380ed8f8da2db953299c Author: Dominic Braun Date: Fri Dec 14 13:05:07 2018 +0100 staging: vc04_services: Remove VCHIQ_SLOT_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit a610360370329cdf6ba2ec98940810629843d179 Author: Dominic Braun Date: Fri Dec 14 13:05:06 2018 +0100 staging: vc04_services: Remove VCHIQ_SLOT_INFO_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit c55aedfe60d06a7f8c6816583020c6035388a813 Author: Dominic Braun Date: Fri Dec 14 13:05:05 2018 +0100 staging: vc04_services: Remove VCHIQ_SHARED_STATE_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 4f0922c87d47d95f87cfef3acf2d7549c5a6dfd8 Author: Dominic Braun Date: Fri Dec 14 13:05:04 2018 +0100 staging: vc04_services: Remove VCHIQ_SET_SERVICE_OPTION_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 7926c328d9586dcc5c5e993351d7c46442493102 Author: Dominic Braun Date: Fri Dec 14 13:05:03 2018 +0100 staging: vc04_services: Remove VCHIQ_SERVICE_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit d3af2bcc6ea4e55884ee11b05a7d95002026017f Author: Dominic Braun Date: Fri Dec 14 13:05:02 2018 +0100 staging: vc04_services: Remove VCHIQ_SERVICE_QUOTA_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 0b53ca3127a674f9bdc94f6a4e1e6b92eb6b17fa Author: Dominic Braun Date: Fri Dec 14 13:05:01 2018 +0100 staging: vc04_services: Remove VCHIQ_SERVICE_PARAMS_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit c18cbdee798ce80688538c7820a9a399dc4b3f46 Author: Dominic Braun Date: Fri Dec 14 13:05:00 2018 +0100 staging: vc04_services: Remove VCHIQ_SERVICE_BASE_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 87c091aadfacbf8c2d7d5329f923c7bbd46c840a Author: Dominic Braun Date: Fri Dec 14 13:04:59 2018 +0100 staging: vc04_services: Remove VCHIQ_QUEUE_MESSAGE_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 4040a7ee5346c6d7e3f425acad1684298830ccc2 Author: Dominic Braun Date: Fri Dec 14 13:04:58 2018 +0100 staging: vc04_services: Remove VCHIQ_QUEUE_BULK_TRANSFER_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit e8968525282f6c12355f9ee1375ab36cb0bc0cbd Author: Dominic Braun Date: Fri Dec 14 13:04:57 2018 +0100 staging: vc04_services: Remove VCHIQ_HEADER_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 3515279e6ed1304085e044804d4906adf47ce501 Author: Dominic Braun Date: Fri Dec 14 13:04:56 2018 +0100 staging: vc04_services: Remove VCHIQ_GET_CONFIG_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 392342b77c26b1c7dc33e6d8dd000e40ab47a0f8 Author: Dominic Braun Date: Fri Dec 14 13:04:55 2018 +0100 staging: vc04_services: Remove VCHIQ_DUMP_MEM_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 8ca743a19a37a2c5374fb425e12b0e7065df6443 Author: Dominic Braun Date: Fri Dec 14 13:04:54 2018 +0100 staging: vc04_services: Remove VCHIQ_DEQUEUE_MESSAGE_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit aa987e55132f78143b799b1e63167354b3029a67 Author: Dominic Braun Date: Fri Dec 14 13:04:53 2018 +0100 staging: vc04_services: Remove VCHIQ_DEBUGFS_NODE_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 562943286c7466c44651a0e2972c54381e756601 Author: Dominic Braun Date: Fri Dec 14 13:04:52 2018 +0100 staging: vc04_services: Remove VCHIQ_CREATE_SERVICE_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 8b867447536c0c9ee19bbc250c52e1c6412fe6a5 Author: Dominic Braun Date: Fri Dec 14 13:04:51 2018 +0100 staging: vc04_services: Remove VCHIQ_CONFIG_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit e69106e55d82375c2397099021366e03bbabc204 Author: Dominic Braun Date: Fri Dec 14 13:04:50 2018 +0100 staging: vc04_services: Remove VCHIQ_COMPLETION_DATA_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit bc96a5f0f7761731209b361380a9fb6614e4484a Author: Dominic Braun Date: Fri Dec 14 13:04:49 2018 +0100 staging: vc04_services: Remove VCHIQ_BULK_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 029a8a189478d05b7772316a59aaf4a67180e847 Author: Dominic Braun Date: Fri Dec 14 13:04:48 2018 +0100 staging: vc04_services: Remove VCHIQ_BULK_QUEUE_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit cf69fc521676ccedad3cfd51fa50a98498f92484 Author: Dominic Braun Date: Fri Dec 14 13:04:47 2018 +0100 staging: vc04_services: Remove VCHIQ_AWAIT_COMPLETION_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit e376ef3535b6afe14083be3fa7bec320d85dd2bf Author: Dominic Braun Date: Fri Dec 14 13:04:46 2018 +0100 staging: vc04_services: Remove VCHIQ_ARM_STATE_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 2be0bef086200fabe924ceefb5778ebf3dca20c7 Author: Dominic Braun Date: Fri Dec 14 13:04:45 2018 +0100 staging: vc04_services: Remove VCHI_MSG_VECTOR_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 2a6e3234d64acc4c292e16922abfb4ed046f5814 Author: Dominic Braun Date: Fri Dec 14 13:04:44 2018 +0100 staging: vc04_services: Remove VCHI_MSG_ITER_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 9d4d3ac473912a246b4cee119a44647f20ff4e57 Author: Dominic Braun Date: Fri Dec 14 13:04:43 2018 +0100 staging: vc04_services: Remove VCHI_HELD_MSG_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 4dfc415fc20e1897c5d83ee859b44fe312479413 Author: Dominic Braun Date: Fri Dec 14 13:04:42 2018 +0100 staging: vc04_services: Remove USER_SERVICE_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 477e5caec4ee1eff40bc46ea6fc2aa9a76a23752 Author: Dominic Braun Date: Fri Dec 14 13:04:41 2018 +0100 staging: vc04_services: Remove SERVICE_CREATION_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 4075fa9efc4ee653d3fbdfacf182a7a18340c6fc Author: Dominic Braun Date: Fri Dec 14 13:04:40 2018 +0100 staging: vc04_services: Remove REMOTE_EVENT_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 313b5681a37cffad9ae3793b78588d5f190d56f6 Author: Dominic Braun Date: Fri Dec 14 13:04:39 2018 +0100 staging: vc04_services: Remove PAGELIST_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit 4eef62d61c16f8a4042209c247afbf69132d0d9b Author: Dominic Braun Date: Fri Dec 14 13:04:38 2018 +0100 staging: vc04_services: Remove DUMP_CONTEXT_T typedef Typedefing structs is not encouraged in the kernel. Signed-off-by: Dominic Braun Signed-off-by: Tobias Büttner Signed-off-by: Greg Kroah-Hartman commit cb9a242c33cab509bd09dadeb3bc83a57f0d5abd Author: Hardik Singh Rathore Date: Wed Dec 12 19:24:55 2018 +0530 Staging: rtl8723bs: Fix code style issue in rtl8723bs driver Add space between 'else' and '{' to solve code style issue in all the files for rtl8723bs driver. Signed-off-by: Hardik Singh Rathore Signed-off-by: Greg Kroah-Hartman commit 0022290f1e12e87512d37dec702cab2090a91dc4 Author: Yangtao Li Date: Sat Dec 15 03:53:12 2018 -0500 staging: greybus: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Greg Kroah-Hartman commit 892cb81ecec9a7bf7c4224119959b21580a40870 Author: Yangtao Li Date: Sat Dec 15 04:01:13 2018 -0500 staging: vc04_services: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Greg Kroah-Hartman commit 2be13945966afc600360b2fe146dde75b0f443ab Author: Yangtao Li Date: Sat Dec 15 03:59:12 2018 -0500 staging: unisys: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Greg Kroah-Hartman commit 29f85260edbb42308c21c063e2b6006117161d34 Author: Yangtao Li Date: Sat Dec 15 03:51:07 2018 -0500 staging: fwserial: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Greg Kroah-Hartman commit 0b7b9b6c3dee8232c7c6dd2a5a56100e20576717 Author: Ajay Singh Date: Sat Dec 15 02:32:29 2018 +0000 staging: wilc1000: fix NULL dereference inside wilc_scan() Added NULL check before accessing 'hidden_net' pointer inside wilc_scan() to fix the issue found by static code checker. Fixes: 8f1a0ac1eba7 ("staging: wilc1000: handle scan operation callback from cfg80211 context") Reported-by: Dan Carpenter Signed-off-by: Ajay Singh Signed-off-by: Greg Kroah-Hartman commit 2da56630b1cc422f58408033102b8f91ae97bc91 Author: Nicolas Saenz Julienne Date: Wed Dec 12 19:51:35 2018 +0100 staging: vchiq: delete vchiq_killable.h There are no users for that header file. Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman commit ff5979ad86368425b7da3a25f4e84650b51ff5fd Author: Nicolas Saenz Julienne Date: Wed Dec 12 19:51:34 2018 +0100 staging: vchiq_2835_arm: quit using custom down_interruptible() vchi_killable.h overrides down_interruptible() by implementing a function similar to down_killable(). To make things simpler we turn calls to down_interruptible() into kernel's implementation of down_killable(). Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman commit a772f116702e3f0afdd7e6acadc1b8fb3b20b9ff Author: Nicolas Saenz Julienne Date: Wed Dec 12 19:51:33 2018 +0100 staging: vchiq: switch to wait_for_completion_killable This fixes f27e47bc6b8b ("staging: vchiq: use completions instead of semaphores") as it neglected the subtle down_interruptible() macro override in vchiq_killable.h. Hence all completions should be killable instead of interruptible. Fixes: f27e47bc6b8b ("staging: vchiq: use completions instead of semaphores") Reported-by: Arnd Bergmann Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman commit 649496b603000135683ee76d7ea499456617bf17 Author: Dan Carpenter Date: Mon Dec 17 10:08:54 2018 +0300 staging: bcm2835-audio: double free in init error path We free instance here and in the caller. It should be only the caller which handles it. Fixes: d7ca3a71545b ("staging: bcm2835-audio: Operate non-atomic PCM ops") Signed-off-by: Dan Carpenter Reviewed-by: Takashi Iwai Cc: stable Signed-off-by: Greg Kroah-Hartman commit 4765f68374cfda16031fc747218c73aac6ca51c7 Author: Lou Knauer Date: Thu Dec 13 10:43:17 2018 +0100 staging: mt7621-dma: fix unbalanced braces Add braces to conditional statements if the other branch has them in order to be more compliant with the linux kernel coding style. Remaining checkpatch.pl issues include unnecessary line continuations and use of non-conventional types. Signed-off-by: Lou Knauer Signed-off-by: Philipp Panzer Reviewed-by: Matthias Brugger Signed-off-by: Greg Kroah-Hartman commit 3dbf37c03bc6b1a460e88e1864f7fc184d206496 Author: Amir Mahdi Ghorbanian Date: Thu Dec 13 10:26:24 2018 -0800 Staging: comedi: cb_pcidas: fixed a spelling mistake coding style issue Fixed a coding style issue. Signed-off-by: Amir Mahdi Ghorbanian Signed-off-by: Greg Kroah-Hartman commit 1d6e81a288e28d8d0e38e0501a324216f79bba35 Author: Fabrizio Castro Date: Fri Dec 14 08:27:03 2018 +0000 usb: renesas_usbhs: add support for RZ/G2E HS-USB found in RZ/G2E (a.k.a. r8a774c0) is very similar to the one found in R-Car E3 (a.k.a. r8a77990), as it needs to release the PLL reset by the UGCTRL register like R-Car E3, therefore add r8a774c0 support in a similar fashion to what was done for the r8a77990. Signed-off-by: Fabrizio Castro Reviewed-by: Simon Horman Acked-by: Yoshihiro Shimoda Signed-off-by: Greg Kroah-Hartman commit 8dc7623bf608495b6e6743e805807c7840673573 Author: Roger Quadros Date: Fri Dec 14 11:36:15 2018 +0200 usb: ehci-omap: Fix deferred probe for phy handling PHY model is being used on omap5 platforms even if port mode is not OMAP_EHCI_PORT_MODE_PHY. So don't guess if PHY is required or not based on PHY mode. If PHY is provided in device tree, it must be required. So, if devm_usb_get_phy_by_phandle() gives us an error code other than -ENODEV (no PHY) then error out. This fixes USB Ethernet on omap5-uevm if PHY happens to probe after EHCI thus causing a -EPROBE_DEFER. Cc: Johan Hovold Cc: Ladislav Michl Reported-by: Peter Ujfalusi Signed-off-by: Roger Quadros Tested-by: Peter Ujfalusi Acked-by: Tony Lindgren Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman commit c3788cd9963eb2e77de3c24142fb7c67b61f1a26 Author: Heikki Krogerus Date: Wed Dec 12 20:13:55 2018 +0300 usb: roles: Add a description for the class to Kconfig That makes the USB role switch support option visible and selectable for the user. The class driver is also moved to drivers/usb/roles/ directory. This will fix an issue that we have with the Intel USB role switch driver on systems that don't have USB Type-C connectors: Intel USB role switch driver depends on the USB role switch class as it should, but since there was no way for the user to enable the USB role switch class, there was also no way to select that driver. USB Type-C drivers select the USB role switch class which makes the Intel USB role switch driver available and therefore hides the problem. So in practice Intel USB role switch driver was depending on USB Type-C drivers. Fixes: f6fb9ec02be1 ("usb: roles: Add Intel xHCI USB role switch driver") Cc: Signed-off-by: Heikki Krogerus Signed-off-by: Greg Kroah-Hartman commit 732774437ae01d9882e60314e303898e63c7f038 Author: Boris Brezillon Date: Sun Dec 16 09:34:17 2018 +0100 mtd: rawnand: sunxi: Write pageprog related opcodes to WCMD_SET The opcodes used by the controller when doing batched page prog should be written in NFC_REG_WCMD_SET not FC_REG_RCMD_SET. Luckily, the default NFC_REG_WCMD_SET value matches the one we set in the driver which explains why we didn't notice the problem. Fixes: 614049a8d904 ("mtd: nand: sunxi: add support for DMA assisted operations") Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 4733c0b4666dadd155d7fb006d41b04ade002fc1 Merge: eaf3074e0a8c2 9049fce897eda Author: Greg Kroah-Hartman Date: Mon Dec 17 13:58:44 2018 +0100 Merge tag 'usb-ci-v4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb into usb-next Peter writes: - Improve the over-current handling for imx - Add the HSIC support for imx * tag 'usb-ci-v4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/peter.chen/usb: usb: chipidea: imx: allow to configure oc polarity on i.MX25 usb: chipidea: imx: Warn if oc polarity isn't specified usb: chipidea: imx: support configuring for active low oc signal doc: usb: ci-hdrc-usb2: Add pinctrl properties for HSIC pin groups usb: chipidea: host: override ehci->hub_control usb: chipidea: imx: add HSIC support usb: chipidea: add flag for imx hsic implementation commit 7e849dd9cf37bc52aff9b5236377c405040c959c Author: Christoph Hellwig Date: Mon Dec 17 12:16:27 2018 +0100 nvme-pci: don't share queue maps Now that the block layer checks if a queue map has any queues inside it there is no more reason to duplicate the maps for the non-default types. Reviewed-by: Ming Lei Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 5aceaeb26394538858a9dbae5830d628469a44cf Author: Christoph Hellwig Date: Mon Dec 17 12:16:26 2018 +0100 blk-mq: only dispatch to non-defauly queue maps if they have queues We should check if a given queue map actually has queues enabled before dispatching to it. This allows drivers to not initialize optional but not used map types, which subsequently will allow fixing problems with queue map rebuilds for that case. Reviewed-by: Ming Lei Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 346fc1089e5d4734990b4b6c3cd0cdeae9ae482d Author: Ming Lei Date: Mon Dec 17 18:42:48 2018 +0800 blk-mq: export hctx->type in debugfs instead of sysfs Now we only export hctx->type via sysfs, and there isn't such info in hctx entry under debugfs. We often use debugfs only to diagnose queue mapping issue, so add the support in debugfs. Queue mapping becomes a bit more complicated after multiple queue mapping is supported, we may write blktest to verify if queue mapping is valid based on blk-mq-debugfs. Given not necessary to export hctx->type twice, so remove the export from sysfs. Cc: Jeff Moyer Cc: Mike Snitzer Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 07b35eb5a364fa59f88f65e6c786192f2c9163be Author: Ming Lei Date: Mon Dec 17 18:42:45 2018 +0800 blk-mq: fix allocation for queue mapping table Type of each element in queue mapping table is 'unsigned int, intead of 'struct blk_mq_queue_map)', so fix it. Cc: Jeff Moyer Cc: Mike Snitzer Cc: Christoph Hellwig Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 22a5a4a44c43e2993e96183039aef71566e1a514 Author: Claudiu Beznea Date: Mon Dec 17 10:37:51 2018 +0000 regulator: act8945a-regulator: fix 'defined but not used' compiler warning Fix 'defined but not used' compiler warning for act8945a_suspend() function in case CONFIG_PM_SLEEP is not defined. Fixes: b5ebba46e694 ("regulator: act8945a-regulator: add shutdown function") Signed-off-by: Claudiu Beznea Reported-by: Andrei Stefanescu Signed-off-by: Mark Brown commit 918446c96595636be81a224bf663b0f4e669aad7 Author: Priit Laes Date: Fri Dec 14 22:54:07 2018 +0200 regulator: axp20x: fix set_ramp_delay for AXP209/dcdc2 Initial commit of set_ramp_delay feature was missing an assignment which should have populated slew_rate table for dcdc2 regulator. Add it. Fixes: d29f54df8b16 ("regulator: axp20x: add support for set_ramp_delay for AXP209") Signed-off-by: Priit Laes Signed-off-by: Mark Brown commit 052b8cfa4070caa53125cd589da0cfe744132a94 Author: Nikolay Borisov Date: Tue Dec 11 10:29:25 2018 +0200 locks: Use inode_is_open_for_write Use the aptly named function rather than open coding it. No functional changes. Signed-off-by: Nikolay Borisov Signed-off-by: Jeff Layton commit d2e1a003af569e912d5f115a3c20b89a19f5caa0 Author: Joerg Roedel Date: Wed Dec 5 14:39:45 2018 +0100 ACPI/IORT: Don't call iommu_ops->add_device directly Make sure to invoke this call-back through the proper function of the IOMMU-API. Acked-by: Hanjun Guo Signed-off-by: Joerg Roedel commit 641fb0efbff063ed57f108c2eb4a4d26dbd5badd Author: Joerg Roedel Date: Wed Dec 5 14:39:45 2018 +0100 iommu/of: Don't call iommu_ops->add_device directly Make sure to invoke this call-back through the proper function of the IOMMU-API. Signed-off-by: Joerg Roedel commit cc5aed44a3a8e4fca721636cf881a52f8d68a098 Author: Joerg Roedel Date: Fri Nov 30 10:31:59 2018 +0100 iommu: Consolitate ->add/remove_device() calls Put them into separate functions and call those where the plain ops have been called before. Signed-off-by: Joerg Roedel commit 6954cf9bfda153f9544c63761aabf0199710aec3 Author: Joerg Roedel Date: Wed Dec 5 13:57:43 2018 +0100 iommu/sysfs: Rename iommu_release_device() Remove the iommu_ prefix from the function and a few other static data structures so that the iommu_release_device name can be re-used in iommu core code. Signed-off-by: Joerg Roedel commit f884f6ee62604aec60fe1760f94724be192d97c0 Author: Joerg Roedel Date: Fri Nov 30 14:29:01 2018 +0100 dmaengine: sh: rcar-dmac: Use device_iommu_mapped() Use Use device_iommu_mapped() to check if the device is already mapped by an IOMMU. Acked-by: Vinod Koul Signed-off-by: Joerg Roedel commit 05afde1a7ef3ddde5e7657b9faeb6347423a9acb Author: Joerg Roedel Date: Fri Nov 30 13:16:38 2018 +0100 xhci: Use device_iommu_mapped() Replace the dev->iommu_group check with a proper function call that better reprensents its purpose. Cc: Mathias Nyman Acked-by: Robin Murphy Acked-by: Mathias Nyman Signed-off-by: Joerg Roedel commit 9488585b21bef0df1217e510c7134905d1d376a7 Author: Tadeusz Struk Date: Wed Nov 21 06:50:37 2018 -0800 tpm: add support for partial reads Currently to read a response from the TPM device an application needs provide big enough buffer for the whole response and read it in one go. The application doesn't know how big the response it beforehand so it always needs to maintain a 4K buffer and read the max (4K). In case if the user of the TSS library doesn't provide big enough buffer the TCTI spec says that the library should set the required size and return TSS2_TCTI_RC_INSUFFICIENT_BUFFER error code so that the application could allocate a bigger buffer and call receive again. To make it possible in the TSS library, this requires being able to do partial reads from the driver. The library would read the 10 bytes header first to get the actual size of the response from the header, and then read the rest of the response. This patch adds support for partial reads, i.e. the user can read the response in one or multiple reads, until the whole response is consumed. The user can also read only part of the response and ignore the rest by issuing a new write to send a new command. Signed-off-by: Tadeusz Struk Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 10fdf838e5f540beca466e9d1325999c072e5d3f Author: Christophe Leroy Date: Mon Dec 10 08:08:28 2018 +0000 lib: fix build failure in CONFIG_DEBUG_VIRTUAL test On several arches, virt_to_phys() is in io.h Build fails without it: CC lib/test_debug_virtual.o lib/test_debug_virtual.c: In function 'test_debug_virtual_init': lib/test_debug_virtual.c:26:7: error: implicit declaration of function 'virt_to_phys' [-Werror=implicit-function-declaration] pa = virt_to_phys(va); ^ Fixes: e4dace361552 ("lib: add test module for CONFIG_DEBUG_VIRTUAL") CC: stable@vger.kernel.org Signed-off-by: Christophe Leroy Reviewed-by: Kees Cook Signed-off-by: Michael Ellerman commit ebd1d3b74f8542a8f3bb80b453692d6d18f84071 Author: Mathieu Malaterre Date: Wed Dec 5 18:53:55 2018 +0100 powerpc/32: Move the old 6xx -mcpu logic before the TARGET_CPU logic The code: ifdef CONFIG_6xx KBUILD_CFLAGS += -mcpu=powerpc endif was added in 2006 in commit f48b8296b315 ("[PATCH] powerpc32: Set cpu explicitly in kernel compiles"). This change was acceptable since the TARGET_CPU logic was 64-bit only. Since commit 0e00a8c9fd92 ("powerpc: Allow CPU selection also on PPC32") this logic is no longer acceptable after the TARGET_CPU specific. It currently appends -mcpu=powerpc at the end of the command line, after any TARGET_CPU specific: gcc -Wp,-MD,init/.do_mounts.o.d ... -mcpu=powerpc -mbig-endian -m32 ... -mcpu=e300c2 ... -mcpu=powerpc ... ../init/do_mounts.c Fixes: 0e00a8c9fd92 ("powerpc: Allow CPU selection also on PPC32") Signed-off-by: Mathieu Malaterre Signed-off-by: Michael Ellerman commit c7e900c05b8f10894b649bdae50cf58656088dd0 Author: Michael Ellerman Date: Tue Dec 4 21:09:14 2018 +1100 powerpc/ipic: Remove unused ipic_set_priority() ipic_set_priority() has been unused since 2006 when the last usage was removed in commit b9f0f1bb2bca ("[POWERPC] Adapt ipic driver to new host_ops interface, add set_irq_type to set IRQ sense"). Reported-by: Dan Carpenter Signed-off-by: Michael Ellerman commit 4d6a19827387d8448afa1f5959b809ed2ba090d6 Merge: 7c91efce16083 a225f15674055 Author: Michael Ellerman Date: Mon Dec 17 22:11:54 2018 +1100 Merge branch 'fixes' into next Merge our fixes branch again, this has a couple of build fixes and also a change to do_syscall_trace_enter() that will conflict with a patch we want to apply in next. commit 0e1f37d120ec316e78b62ee570eec98e808ff0a4 Author: Aleix Roca Nonell Date: Sun Dec 16 16:53:19 2018 +0100 HID: asus: Add support for the ASUS T101HA keyboard dock The ASUS T101HA keyboard dock generates HID events using the ASUS vendor specific UsagePage 0xff31. In consequence, some multimedia keys such as brightness up and down are not working with hid-generic. This commit adds the T101HA dock into the supported device list of the hid-asus driver. It also prevents the dock's integrated touchpad to be bound with hid-asus given that it is already working fine with hid-multitouch. Signed-off-by: Aleix Roca Nonell Signed-off-by: Benjamin Tissoires commit bf8763d8f8376e98ea2a8e0fc4803f25ff91393e Author: Joerg Roedel Date: Fri Nov 30 14:23:19 2018 +0100 powerpc/iommu: Use device_iommu_mapped() Use the new function to replace the open-coded iommu check. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Russell Currey Cc: Sam Bobroff Acked-by: Robin Murphy Signed-off-by: Joerg Roedel commit 13e6a84d697e8eb8b61a3fe55b4109a666c4851d Author: Joerg Roedel Date: Fri Nov 30 13:14:05 2018 +0100 ACPI/IORT: Use device_iommu_mapped() Replace the iommu-check with a proper and readable function call. Cc: Lorenzo Pieralisi Acked-by: Robin Murphy Acked-by: Hanjun Guo Signed-off-by: Joerg Roedel commit 170ecbd5ff09aa9c8c1025a8563f76e01a24bb50 Author: Joerg Roedel Date: Fri Nov 30 14:29:01 2018 +0100 iommu/of: Use device_iommu_mapped() Use Use device_iommu_mapped() to check if the device is already mapped by an IOMMU. Acked-by: Robin Murphy Signed-off-by: Joerg Roedel commit dbba197edf32209d110727a02d3a91de4c88520f Author: Joerg Roedel Date: Fri Nov 30 12:51:52 2018 +0100 driver core: Introduce device_iommu_mapped() function Some places in the kernel check the iommu_group pointer in 'struct device' in order to find out whether a device is mapped by an IOMMU. This is not good way to make this check, as the pointer will be moved to 'struct dev_iommu_data'. This way to make the check is also not very readable. Introduce an explicit function to perform this check. Acked-by: Greg Kroah-Hartman Acked-by: Robin Murphy Signed-off-by: Joerg Roedel commit db5d6a70043a0073e59af99cd4fd6bcb5bd3ace2 Author: Joerg Roedel Date: Thu Nov 29 14:01:00 2018 +0100 iommu/tegra: Use helper functions to access dev->iommu_fwspec Use the new helpers dev_iommu_fwspec_get()/set() to access the dev->iommu_fwspec pointer. This makes it easier to move that pointer later into another struct. Cc: Thierry Reding Acked-by: Thierry Reding Signed-off-by: Joerg Roedel commit 2000e5f70322dcd612a9ccddfb56bf6716e0da9a Author: Joerg Roedel Date: Thu Nov 29 14:01:00 2018 +0100 iommu/qcom: Use helper functions to access dev->iommu_fwspec Use the new helpers dev_iommu_fwspec_get()/set() to access the dev->iommu_fwspec pointer. This makes it easier to move that pointer later into another struct. Cc: Rob Clark Signed-off-by: Joerg Roedel commit 5c7e6bd71bfd96a65adb62593ea1b7d51a445b26 Author: Joerg Roedel Date: Thu Nov 29 14:01:00 2018 +0100 iommu/of: Use helper functions to access dev->iommu_fwspec Use the new helpers dev_iommu_fwspec_get()/set() to access the dev->iommu_fwspec pointer. This makes it easier to move that pointer later into another struct. Signed-off-by: Joerg Roedel commit a9bf2eec5a6fc01a0a5250eaf0bf61dfd382a78a Author: Joerg Roedel Date: Thu Nov 29 14:01:00 2018 +0100 iommu/mediatek: Use helper functions to access dev->iommu_fwspec Use the new helpers dev_iommu_fwspec_get()/set() to access the dev->iommu_fwspec pointer. This makes it easier to move that pointer later into another struct. Cc: Matthias Brugger Tested-by: Yong Wu Signed-off-by: Joerg Roedel commit df90365580623b5c53cd9a46c14375191123d776 Author: Joerg Roedel Date: Thu Nov 29 14:01:00 2018 +0100 iommu/ipmmu-vmsa: Use helper functions to access dev->iommu_fwspec Use the new helpers dev_iommu_fwspec_get()/set() to access the dev->iommu_fwspec pointer. This makes it easier to move that pointer later into another struct. Signed-off-by: Joerg Roedel commit 98cc4f7196422ee20e00e2067e484e3136dbe4a5 Author: Joerg Roedel Date: Thu Nov 29 14:01:00 2018 +0100 iommu/dma: Use helper functions to access dev->iommu_fwspec Use the new helpers dev_iommu_fwspec_get()/set() to access the dev->iommu_fwspec pointer. This makes it easier to move that pointer later into another struct. Signed-off-by: Joerg Roedel commit 9b468f7d9cf1f089b7287865776eb100504681b7 Author: Joerg Roedel Date: Thu Nov 29 14:01:00 2018 +0100 iommu/arm-smmu: Use helper functions to access dev->iommu_fwspec Use the new helpers dev_iommu_fwspec_get()/set() to access the dev->iommu_fwspec pointer. This makes it easier to move that pointer later into another struct. Cc: Will Deacon Cc: Robin Murphy Acked-by: Will Deacon Signed-off-by: Joerg Roedel commit 8097e53eaba2bbae99dee661778ca20490b73951 Author: Joerg Roedel Date: Thu Nov 29 14:01:00 2018 +0100 ACPI/IORT: Use helper functions to access dev->iommu_fwspec Use the new helpers dev_iommu_fwspec_get()/set() to access the dev->iommu_fwspec pointer. This makes it easier to move that pointer later into another struct. Acked-by: Hanjun Guo Signed-off-by: Joerg Roedel commit b4ef725eeba158f365da9de1f05149094643ddea Author: Joerg Roedel Date: Wed Nov 28 13:35:24 2018 +0100 iommu: Introduce wrappers around dev->iommu_fwspec These wrappers will be used to easily change the location of the field later when all users are converted. Signed-off-by: Joerg Roedel commit b6d39cd82241bfc14a910eab032c53aabe678df7 Author: Fabrizio Castro Date: Thu Dec 13 20:22:44 2018 +0000 iommu/ipmmu-vmsa: Hook up r8a774c0 DT matching code Support RZ/G2E (a.k.a. R8A774C0) IPMMU. Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Joerg Roedel commit a6cf933a359f6cf0c642580602a0f5afc40d991a Author: Fabrizio Castro Date: Thu Dec 13 20:19:28 2018 +0000 dt-bindings: iommu: ipmmu-vmsa: Add r8a774c0 support Document RZ/G2E (R8A774C0) SoC bindings. Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Joerg Roedel commit 2713fe37153efb90b7a8427a2f53fa49216faf5c Author: Yong Wu Date: Thu Dec 13 17:19:48 2018 +0800 Revert "iommu/io-pgtable-arm: Check for v7s-incapable systems" This reverts commit 82db33dc5e49fb625262d81125625d07a0d6184e. After the commit 29859aeb8a6e ("iommu/io-pgtable-arm-v7s: Abort allocation when table address overflows the PTE"), v7s will return fail if the page table allocation isn't expected. this PHYS_OFFSET check is unnecessary now. And this check may lead to fail. For example, If CONFIG_RANDOMIZE_BASE is enabled, the "memstart_addr" will be updated randomly, then the PHYS_OFFSET may be random. Reported-by: CK Hu Signed-off-by: Yong Wu Reviewed-by: Robin Murphy Signed-off-by: Joerg Roedel commit 69d24c6ed67c1e15f76284fccd62feffe77c8d38 Author: Vivek Gautam Date: Thu Dec 13 14:35:07 2018 +0530 dt-bindings: arm-smmu: Add binding doc for Qcom smmu-500 Qcom's implementation of arm,mmu-500 works well with current arm-smmu driver implementation. Adding a soc specific compatible along with arm,mmu-500 makes the bindings future safe. Signed-off-by: Vivek Gautam Reviewed-by: Rob Herring Cc: Will Deacon Acked-by: Will Deacon Signed-off-by: Joerg Roedel commit ca804a5615a7c282dfb402805e657e735e1d864a Author: Biju Das Date: Thu Dec 13 20:22:27 2018 +0000 mmc: renesas_sdhi_internal_dmac: Whitelist r8a774c0 We need r8a774c0 to be whitelisted for SDHI to work on the RZ/G2E, but we don't care about the revision of the SoC, so just whitelist the generic part number. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Reviewed-by: Simon Horman Signed-off-by: Ulf Hansson commit ab409be2be555e61516214885537dcb619f12e9e Author: Fabrizio Castro Date: Thu Dec 13 20:22:09 2018 +0000 dt-bindings: mmc: renesas_sdhi: Add r8a774c0 support Document RZ/G2E (R8A774C0) SoC bindings. Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Ulf Hansson commit 0c204979c691f05666ecfb74501e7adfdde8fbf9 Author: Ulf Hansson Date: Mon Dec 10 17:52:40 2018 +0100 mmc: core: Cleanup BKOPS support It's been ~6 years ago since we introduced the BKOPS support for eMMC cards. The current code is a bit messy and primarily that's because it prepares to support running BKOPS in an asynchronous mode. However, that mode has never been fully implemented/enabled. Instead BKOPS is always executed in synchronously, when the card has reported an urgent BKOPS level. For these reasons, let's make the code more readable by dropping the unused parts. Let's also rename mmc_start_bkops() to mmc_run_bkops(), as to make it more descriptive. Cc: Jaehoon Chung Signed-off-by: Ulf Hansson commit 1217e61544922ab649fe4df94e2f272c01c159ea Author: Ulf Hansson Date: Mon Dec 10 17:52:39 2018 +0100 mmc: core: Drop redundant check in mmc_send_hpi_cmd() There is no point checking if HPI is supported in mmc_send_hpi_cmd() as mmc_interrupt_hpi(), which is the only caller, already checks if HPI has been enabled. Therefore, let's drop the check and the corresponding error path. Signed-off-by: Ulf Hansson commit 01e421feec0817bb3141eaae4c517410d193d440 Merge: 961de0a856e3a e3ae3401aa194 Author: Ulf Hansson Date: Mon Dec 17 09:00:52 2018 +0100 Merge branch 'fixes' into next commit 961de0a856e3a30c0238d1269c0b17f9b179b6c3 Author: Faiz Abbas Date: Tue Dec 11 19:52:53 2018 +0530 mmc: sdhci-omap: Workaround errata regarding SDR104/HS200 tuning failures (i929) Errata i929 in certain OMAP5/DRA7XX/AM57XX silicon revisions (SPRZ426D - November 2014 - Revised February 2018 [1]) mentions unexpected tuning pattern errors. A small failure band may be present in the tuning range which may be missed by the current algorithm. Furthermore, the failure bands vary with temperature leading to different optimum tuning values for different temperatures. As suggested in the related Application Report (SPRACA9B - October 2017 - Revised July 2018 [2]), tuning should be done in two stages. In stage 1, assign the optimum ratio in the maximum pass window for the current temperature. In stage 2, if the chosen value is close to the small failure band, move away from it in the appropriate direction. References: [1] http://www.ti.com/lit/pdf/sprz426 [2] http://www.ti.com/lit/pdf/SPRACA9 Signed-off-by: Faiz Abbas Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 58fe8bbacd285af44831f68da1d2d50f0e2fc9a9 Author: Faiz Abbas Date: Tue Dec 11 19:52:52 2018 +0530 dt-bindings: sdhci-omap: Add note for cpu_thermal The driver fetches a thermal zone using the string "cpu_thermal" for tuning operation. Add a note for the same. Signed-off-by: Faiz Abbas Signed-off-by: Ulf Hansson commit 197ce1a5a0e9c27ca92f7dab51cd5bce4f09bdea Author: Adrian Hunter Date: Tue Dec 11 15:10:44 2018 +0200 mmc: sdhci-acpi: Disable LED control for Intel BYT-based controllers Intel BYT-based controllers do not have a LED signal line. Nevertheless sdhci_led_control() takes more than twice as long as sdhci_send_command(), even though it does nothing. Use the new SDHCI_QUIRK_NO_LED quirk to disable LED control for Intel BYT-based controllers. Signed-off-by: Adrian Hunter Signed-off-by: Ulf Hansson commit aeae6ad35e973d9c31449de6868ef37ce6b7d05e Author: Adrian Hunter Date: Tue Dec 11 15:10:43 2018 +0200 mmc: sdhci-pci: Disable LED control for Intel BYT-based controllers Intel BYT-based controllers do not have a LED signal line. Nevertheless sdhci_led_control() takes more than twice as long as sdhci_send_command(), even though it does nothing. Use the new SDHCI_QUIRK_NO_LED quirk to disable LED control for Intel BYT-based controllers. Signed-off-by: Adrian Hunter Signed-off-by: Ulf Hansson commit bd29f58bc0611ea9ebddc4091f71a8229572eb6a Author: Adrian Hunter Date: Tue Dec 11 15:10:42 2018 +0200 mmc: sdhci: Add quirk to disable LED control Host controllers may not have a LED signal line, whereas the register updates to control the non-existent LED can be relatively time consuming. Add a quirk to disable LED control. Signed-off-by: Adrian Hunter Signed-off-by: Ulf Hansson commit c8073e52851477514e98a032ae70f2dc8be19d32 Author: Ludovic Barre Date: Thu Dec 6 16:13:31 2018 +0100 mmc: mmci: add variant property to set command stop bit On cmd12 (STOP_TRANSMISSION), STM32 sdmmc variant needs to set cmdstop bit in command register. The CPSM ("Command Path State Machine") treats the command as a Stop Transmission command and signals abort to the DPSM ("Data Path State Machine"). Signed-off-by: Ludovic Barre Signed-off-by: Ulf Hansson commit 9e89a1526a9c23ce81584a0b612174342c611e47 Author: Colin Ian King Date: Thu Dec 6 09:19:36 2018 +0000 misc: alcor_pci: fix spelling mistake "invailid" -> "invalid" There are spelling mistakes in a couple of dev_dbg messages, fix these. Signed-off-by: Colin Ian King Reviewed-by: Oleksij Rempel Signed-off-by: Ulf Hansson commit 71645e65729f0c5aef8dccf961c97fa766835bd4 Author: Jerome Brunet Date: Thu Dec 6 16:18:28 2018 +0100 mmc: meson-gx: add signal resampling With some eMMC devices, there is still issues with the new phase settings. Enabling signal resampling seems to solve the problem for these. Signed-off-by: Jerome Brunet Signed-off-by: Ulf Hansson commit c5e1766d3ac0abe4dde14e7ee620f6f3ac2a0bb9 Author: Jerome Brunet Date: Thu Dec 6 16:18:27 2018 +0100 mmc: meson-gx: align default phase on soc vendor tree Align the default Core and Tx phase with the SoC vendor tree. Even if the Tx phase is different from what the documentation recommends, it seems to provide better results. Signed-off-by: Jerome Brunet Signed-off-by: Ulf Hansson commit 83076d2268c72d123f3d1eaf186a9f56ec1b943a Author: Jerome Brunet Date: Thu Dec 6 16:18:26 2018 +0100 mmc: meson-gx: remove useless lock The spinlock is only used within the irq handler so it does not seem very useful. Signed-off-by: Jerome Brunet Signed-off-by: Ulf Hansson commit 18f92bc02f1739b5c4d5b70009fbb7eada45bca3 Author: Jerome Brunet Date: Thu Dec 6 16:18:25 2018 +0100 mmc: meson-gx: make sure the descriptor is stopped on errors On errors, if we don't stop the descriptor chain, it may continue to run and raise IRQ after we have called mmc_request_done(). This is bad because we won't be able to get cmd anymore and properly deal with the IRQ. This patch makes sure the descriptor chain is stopped before calling mmc_request_done() Fixes: 79ed05e329c3 ("mmc: meson-gx: add support for descriptor chain mode") Signed-off-by: Jerome Brunet Signed-off-by: Ulf Hansson commit 41fd4caeb00bbd6dc55f056f3e8e956697b0760d Author: Faiz Abbas Date: Tue Dec 11 00:05:07 2018 +0530 mmc: sdhci_am654: Add Initial Support for AM654 SDHCI driver The host controllers on TI's AM654 SOCs are not compatible with the phy and consumer model of the sdhci-of-arasan driver. It turns out that for optimal operation at higher speeds, a special tuning procedure needs to be implemented which involves configuration of platform specific phy registers. Therefore, branch out to a new sdhci_am654 driver and add the phy register space with all phy configurations to it. Populate AM654 specific callbacks to sdhci_ops and add SDHCI_QUIRKS wherever applicable. Only add support for upto High Speed for SD card and upto DDR52 speed mode for eMMC. Higher speeds will be added in subsequent patches. Signed-off-by: Faiz Abbas Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 49d14adb0031e380e6a0d52d2b853a7f8db3f65f Author: Faiz Abbas Date: Tue Dec 11 00:05:06 2018 +0530 dt-bindings: mmc: sdhci-of-arasan: Add deprecated message for AM65 Commit 26a4f38d1316 ("dt-bindings: mmc: sdhci-of-arasan: Add new compatible for AM654 MMC PHY") added a new compatible for supporting controllers on TI's AM65x SOCs. It turns out that the controller is not compatible with the arasan driver's phy and consumer model as it requires some phy registers for core sdhci functionality. This calls for the binding to branch out to a new driver. Therefore, add a deprecated message for the ti,am654-sdhci-5.1 binding. Signed-off-by: Faiz Abbas Signed-off-by: Ulf Hansson commit f98b4f98bbc823d2f376f2c6c33d21bde20423cf Author: Faiz Abbas Date: Tue Dec 11 00:05:05 2018 +0530 dt-bindings: mmc: sdhci-am654: Document bindings for the host controllers on TI's AM654 SOCs Add binding documentation for mmc host controllers present on TI's AM654 SOCs. Signed-off-by: Faiz Abbas Signed-off-by: Ulf Hansson commit 6809a5f7366ff0db60647bf4a860f4a07942276e Author: Arnd Bergmann Date: Mon Dec 10 21:45:36 2018 +0100 mmc: sdhci-msm: avoid unused function warning The newly added sdhci_msm_restore_sdr_dll_config() function is only called if CONFIG_PM is enabled: drivers/mmc/host/sdhci-msm.c:1050:12: error: 'sdhci_msm_restore_sdr_dll_config' defined but not used [-Werror=unused-function] Better remove the incorrect #ifdef altogether and just use __maybe_unused, which is harder to get wrong. Signed-off-by: Arnd Bergmann Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 0e6e7c2ff397e1bbebc882ca3132148aaaef1ddd Author: Adrian Hunter Date: Mon Dec 10 10:56:26 2018 +0200 mmc: sdhci-xenon: Fix timeout checks Always check the wait condition before returning timeout. Signed-off-by: Adrian Hunter Reviewed-by: Zhoujie Wu Signed-off-by: Ulf Hansson commit 9f0ea0bda1d06120b053bb0c283f54afec59293d Author: Adrian Hunter Date: Mon Dec 10 10:56:25 2018 +0200 mmc: sdhci-omap: Fix timeout checks Always check the wait condition before returning timeout. Signed-off-by: Adrian Hunter Acked-by: Kishon Vijay Abraham I Signed-off-by: Ulf Hansson commit ea6d027312111c6d96309ad1a684b33cb37e6764 Author: Adrian Hunter Date: Mon Dec 10 10:56:24 2018 +0200 mmc: sdhci-of-esdhc: Fix timeout checks Always check the wait condition before returning timeout. Signed-off-by: Adrian Hunter Reviewed-by: Yangbo Lu Signed-off-by: Ulf Hansson commit 566b60209427ed6b442b0b0cb3dba04187fba330 Author: YueHaibing Date: Fri Dec 7 06:34:47 2018 +0000 mmc: alcor: remove set but not used variables 'len, clock_out' Fixes gcc '-Wunused-but-set-variable' warning: drivers/mmc/host/alcor.c: In function 'alcor_data_set_dma': drivers/mmc/host/alcor.c:124:12: warning: variable 'len' set but not used [-Wunused-but-set-variable] drivers/mmc/host/alcor.c:648:15: warning: variable 'clock_out' set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing Reviewed-by: Oleksij Rempel Signed-off-by: Ulf Hansson commit c4916c24ff54fb3dcf07fb64353f8e74e3482b64 Author: Linus Walleij Date: Thu Dec 6 13:08:17 2018 +0100 sh: ecovec24: Fix an ifdef I managed to put the ifdef/else statements wrong when registering the GPIO descriptor table for MMC CD/WP. Fixing it up! Cc: Laurent Pinchart Cc: Kuninori Morimoto Fixes: babd0b238d11 ("mmc: host: tmio: Use GPIO descriptors") Signed-off-by: Linus Walleij Signed-off-by: Ulf Hansson commit b11c36d5d8e393c5766d829c2af75f40e66706c9 Author: Colin Ian King Date: Thu Dec 6 09:24:11 2018 +0000 mmc: sdhci-of-esdhc: fix spelling mistake "upsupported" -> "unsupported" There is a spelling mistake in a pr_warn message, fix it. Signed-off-by: Colin Ian King Signed-off-by: Ulf Hansson commit 6827ca573c03385439fdfc8b512d556dc7c54fc9 Author: Kai-Heng Feng Date: Mon Nov 5 16:45:06 2018 +0800 memstick: rtsx_usb_ms: Support runtime power management In order to let host's parent device, rtsx_usb, to use USB remote wake up signaling to do card detection, it needs to be suspended. Hence it's necessary to add runtime PM support for the memstick host. To keep memstick host stays suspended when it's not in use, convert the card detection function from kthread to delayed_work, which can be scheduled when the host is resumed and can be canceled when the host is suspended. Put the device to suspend when there's no card and the power mode is MEMSTICK_POWER_OFF. Signed-off-by: Kai-Heng Feng Tested-by: Oleksandr Natalenko Signed-off-by: Ulf Hansson commit ba9d5f83735fc00297e39ba5cd9ece1c61eb3995 Author: Kai-Heng Feng Date: Mon Nov 5 16:45:05 2018 +0800 memstick: rtsx_usb_ms: Use ms_dev() helper Use ms_dev() helper for consistency. Signed-off-by: Kai-Heng Feng Tested-by: Oleksandr Natalenko Signed-off-by: Ulf Hansson commit e03e303edf1c63e6dd455ccd568c74e93ef3ba8c Author: Kai-Heng Feng Date: Mon Nov 5 16:45:04 2018 +0800 memstick: Prevent memstick host from getting runtime suspended during card detection We can use MEMSTICK_POWER_{ON,OFF} along with pm_runtime_{get,put} helpers to let memstick host support runtime pm. The rpm count may go down to zero before the memstick host powers on, so the host can be runtime suspended. So before doing card detection, increment the rpm count to avoid the host gets runtime suspended. Balance the rpm count after card detection is done. Signed-off-by: Kai-Heng Feng Tested-by: Oleksandr Natalenko Signed-off-by: Ulf Hansson commit 883a87ddf2f118fbce617b1b3472b8224803eb14 Author: Kai-Heng Feng Date: Mon Nov 5 16:45:03 2018 +0800 misc: rtsx_usb: Use USB remote wakeup signaling for card insertion detection Although rtsx_usb doesn't support card removal detection, card insertion will resume rtsx_usb by USB remote wakeup signaling. When rtsx_usb gets resumed, also resumes its child devices, rtsx_usb_sdmmc and rtsx_usb_ms, to notify them there's a card in its slot. Signed-off-by: Kai-Heng Feng Tested-by: Oleksandr Natalenko Signed-off-by: Ulf Hansson commit 01a7e8e066a505933b43a8df6da1ae1a1e7bddf2 Author: Kai-Heng Feng Date: Mon Nov 5 16:45:02 2018 +0800 memstick: rtsx_usb_ms: Add missing pm_runtime_disable() in probe function If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). Add missing pm_runtime_disable() for rtsx_usb_ms. Signed-off-by: Kai-Heng Feng Tested-by: Oleksandr Natalenko Signed-off-by: Ulf Hansson commit 4dad599b8b5d1ffc5ef12a2edb13d15d537202ba Author: Ulf Hansson Date: Mon Jun 4 08:30:24 2018 +0200 mmc: rtsx_usb_sdmmc: Re-work card detection/removal support The rtsx USB parent device, has logic to detect when a card is inserted into the card slot. Although, the logic can't detect when a card is removed. This makes things a bit tricky, which is why the current method is simply to turn on MMC_CAP_NEEDS_POLL during probe. Using MMC_CAP_NEEDS_POLL means lots of energy being wasted, as the mmc host becomes runtime resumed frequently by the mmc core, while it polls for new cards being inserted. To address this problem, let's start relying on that the rtsx USB driver runtime resumes its child device, which is the rtsx_usb_sdmmc device, when it detects that a new card being inserted. This means dropping MMC_CAP_NEEDS_POLL from being set during probe. Instead let's implement a ->runtime_resume() callback to schedule a detect work and to set MMC_CAP_NEEDS_POLL. In this way, polling is enabled as long as there is card inserted, thus we can rely on the mmc core to detect also when the card becomes removed. Furthermore, to avoid polling forever after a card has been removed, let's implement a ->runtime_suspend() callback and make it clear MMC_CAP_NEEDS_POLL. Signed-off-by: Ulf Hansson Tested-by: Kai-Heng Feng Tested-by: Oleksandr Natalenko commit f275179f7bdcf08f4c74c2d1d19c4e8269be3454 Author: Ulf Hansson Date: Thu May 31 11:40:40 2018 +0200 mmc: rtsx_usb_sdmmc: Re-work runtime PM support The current implementation uses the runtime PM autosuspend feature with a default timeout set to 50ms. This really doesn't makes sense, as it's a USB driven host device, which needs it rtsx USB device (parent device) to be runtime resumed to provide power to the card. In practise, using the autosuspend or any async runtime PM suspend method, means unnecessary delaying the host device and thus the parent, to be runtime suspended when a card is removed/powered off. For this reasons, let's simply drop the support for runtime PM autosuspend and tell the mmc core to use synced runtime PM suspend methods, via setting MMC_CAP_SYNC_RUNTIME_PM during probe. Moreover, as the mmc core nowadays deploys runtime PM reference counting of the mmc host device, convert ->set_ios() to use the more lightweight pm_runtime_get_noresume() and pm_runtime_put_noidle() APIs. Signed-off-by: Ulf Hansson Tested-by: Kai-Heng Feng Tested-by: Oleksandr Natalenko commit 4bfdd76dcb672dd55121b04ed7f1c1ff4343f1ef Author: Ulf Hansson Date: Thu May 31 11:40:39 2018 +0200 mmc: rtsx_usb_sdmmc: Don't runtime resume the device while changing led In case the card has been powered off, it seems silly to continue to allow the led to be updated. Instead let's forbid that, as it enables us to prevent runtime resuming the device and thus avoids wasting energy. Signed-off-by: Ulf Hansson Tested-by: Kai-Heng Feng Tested-by: Oleksandr Natalenko commit 7d5ef512575663695cf85f3aeb985a0aeb03e364 Author: Ulf Hansson Date: Thu May 31 11:40:38 2018 +0200 mmc: core: Introduce MMC_CAP_SYNC_RUNTIME_PM To allow mmc host drivers to inform the mmc core about rather using pm_runtime_put_sync_suspend() instead of pm_runtime_put_autosuspend(), let's introduce MMC_CAP_SYNC_RUNTIME_PM. This is especially useful for those mmc host drivers that don't benefit from using the runtime PM autosuspend feature. Typically this is those that relies on parent devices to power the card via runtime PM, like some USB host drivers for example. Signed-off-by: Ulf Hansson Tested-by: Kai-Heng Feng Tested-by: Oleksandr Natalenko commit a89e7bcb18081c611eb6cf50edd440fa4983a71a Author: Loic Poulain Date: Tue Dec 4 13:25:32 2018 +0100 mmc: sdhci-msm: Disable CDR function on TX The Clock Data Recovery (CDR) circuit allows to automatically adjust the RX sampling-point/phase for high frequency cards (SDR104, HS200...). CDR is automatically enabled during DLL configuration. However, according to the APQ8016 reference manual, this function must be disabled during TX and tuning phase in order to prevent any interferences during tuning challenges and unexpected phase alteration during TX transfers. This patch enables/disables CDR according to the current transfer mode. This fixes sporadic write transfer issues observed with some SDR104 and HS200 cards. Inspired by sdhci-msm downstream patch: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/432516/ Reported-by: Leonid Segal Reported-by: Manabu Igusa Signed-off-by: Loic Poulain Acked-by: Adrian Hunter Acked-by: Georgi Djakov Signed-off-by: Ulf Hansson commit c5413ad815a675b5c98a002353d8e96b44b164e9 Author: Oleksij Rempel Date: Sun Dec 2 11:30:46 2018 +0100 mmc: add new Alcor Micro Cardreader SD/MMC driver This driver provides support for Alcor Micro AU6601 and AU6621 SD/MMC controller. Signed-off-by: Oleksij Rempel Signed-off-by: Ulf Hansson commit 4f556bc04e3c0de2f5c69adc9e9f2bcefcad079d Author: Oleksij Rempel Date: Sun Dec 2 11:30:45 2018 +0100 misc: cardreader: add new Alcor Micro Cardreader PCI driver This driver provides support for Alcor Micro AU6601 and AU6621 card readers. This is single LUN HW and it is expected to work with following standards: - Support SDR104 / SDR50 - MultiMedia Card (MMC) - Memory Stick (MS) - Memory Stick PRO (MS_Pro) Since it is a PCIe controller, it should work on any architecture supporting PCIe. For now, it was developed and tested only on x86_64. This driver is a result of RE work and was created without any documentation or real knowledge of HW internals. Signed-off-by: Oleksij Rempel Signed-off-by: Ulf Hansson commit 8ceb29436c3acf90e5c3c4d1dc7758a828df969f Author: Yangtao Li Date: Sat Dec 1 10:24:57 2018 -0500 mmc: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Ulf Hansson commit feb357458baa0bd0f644a5bd790841555b959b48 Author: YueHaibing Date: Sat Dec 1 01:45:46 2018 +0000 mmc: jz4740: Use PTR_ERR_OR_ZERO in jz4740_mmc_request_gpios() Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Signed-off-by: YueHaibing Acked-by: Joey Pabalinas Reviewed-by: Linus Walleij Signed-off-by: Ulf Hansson commit 67b4ff9fb796d8e572a9bb82d851639a81812aa9 Author: Evan Green Date: Wed Nov 28 14:34:26 2018 -0800 dt-bindings: mmc: sdhci-msm: Clarify register requirements In sdhci-msm-v5 and beyond, the MCI registers are removed, so there is only one register region required. Signed-off-by: Evan Green Signed-off-by: Ulf Hansson commit 809090e8e212c88fe011452b827d7a9a7e9c914b Author: Adrian Hunter Date: Tue Nov 27 13:58:33 2018 +0200 mmc: sdhci-pci: Add max-frequency device property for Intel controllers Add support for the mmc max-frequency device property for Intel BYT-based host controllers. Signed-off-by: Adrian Hunter Signed-off-by: Ulf Hansson commit a622bb0a1e1f6224e2dae0f936006d937db94852 Author: Linus Walleij Date: Sun Dec 2 09:43:28 2018 +0100 mmc: slot-gpio: Delete legacy GPIO handling All host drivers are converted to look up GPIO descriptors from device tree, ACPI or machine descriptor tables, so now we can delete the legacy GPIO handling using hardcoded GPIO numbers from the kernel. Signed-off-by: Linus Walleij Signed-off-by: Ulf Hansson commit f54005b508b9a9d9c375b445cd48b0e792b877c6 Author: Linus Walleij Date: Sun Dec 2 09:43:27 2018 +0100 mmc: pxa: Use GPIO descriptor for power After converting the PXA driver to use GPIO descriptors for card detect and write protect it is relatively simple to convert it to also use a descriptor for getting the optional power control GPIO. The polarity inversion flag can also go away from the platform data since this is indicated in the GPIO machine descriptor table. Cc: Daniel Mack Cc: Robert Jarzmik Cc: Bartosz Golaszewski Cc: Andrea Adami Signed-off-by: Linus Walleij Acked-by: Robert Jarzmik Signed-off-by: Ulf Hansson commit 80a68f387cd69da11aed9cf4911ce8f1a590cd5b Author: Linus Walleij Date: Sun Dec 2 09:43:26 2018 +0100 mmc: pxamci: Delete platform data handling of CD and WP This deletes the code dealing with handling card detect and write protect passed in as platform data and makes the host rely on just GPIO descriptors. The card read only inversion flag has to be kept around for now, as the core cannot handle the inversion flags on the descriptors yet. Since we can now rely on the descriptors to have the right polarity, we set the "override_active_level" to false in mmc_gpiod_request_cd() and mmc_gpiod_request_ro(). Cc: Daniel Mack Cc: Robert Jarzmik Cc: Bartosz Golaszewski Cc: Andrea Adami Signed-off-by: Linus Walleij Acked-by: Robert Jarzmik Signed-off-by: Ulf Hansson commit e114cd33e678a0d206d60b709f0f0dc26431fde4 Author: Linus Walleij Date: Sun Dec 2 09:43:25 2018 +0100 ARM: pxa: Delete platform data for CD/WP This deletes the platform data passed for card detect and write protect from various PXA machines. Make sure to keep .gpio_card_ro_invert as this is still in use by some machines and needed to set the right flag to the MMC core (will be cleaned up later). Cc: Daniel Mack Cc: Robert Jarzmik Cc: Bartosz Golaszewski Cc: Andrea Adami Signed-off-by: Linus Walleij Acked-by: Robert Jarzmik Signed-off-by: Ulf Hansson commit c914a27c92f91fe2206a035a3d1f9ac8f7ea1fe5 Author: Linus Walleij Date: Sun Dec 2 09:43:24 2018 +0100 mmc: pxamci: Support getting GPIO descs for RO and WP This implements the code path for the PXAMCI hostso that it can retrieve GPIO descriptors rather than use the global GPIO numberspace for GPIO lines. If the GPIO descriptor is present, it will take precedence and get used in place of the platform data GPIO number. We move the code around a bit so we request the card detect first and the write protect second. We keep the code setting the host flag for the write protect polarity inversion semantics since the slot GPIO core needs to be refactored to deal with this before we can get rid of this. Cc: Daniel Mack Cc: Robert Jarzmik Cc: Bartosz Golaszewski Cc: Andrea Adami Signed-off-by: Linus Walleij Acked-by: Robert Jarzmik Signed-off-by: Ulf Hansson commit 58e2d877e37018b3804ab2601d9c9ad3fbcc74e7 Author: Linus Walleij Date: Sun Dec 2 09:43:23 2018 +0100 ARM: pxa: Add GPIO descriptors for Palm27x The Palm27x devices set up the MMC card detect and write protect lines with a special helper function. Augment this helper function to also accept an optional GPIO descriptor table and pass and register this for all the Palm27x devices in that family. Cc: Daniel Mack Cc: Robert Jarzmik Cc: Bartosz Golaszewski Cc: Andrea Adami Acked-by: Robert Jarzmik Signed-off-by: Linus Walleij Signed-off-by: Ulf Hansson commit 32d1544880aa87aebe4d20babb48615c65874b02 Author: Linus Walleij Date: Sun Dec 2 09:43:22 2018 +0100 ARM: pxa: Add gpio descriptor lookup tables for MMC CD/WP This adds GPIO descriptor look-up tables for a whole bunch of PXA boards with MMC card detect (CD) and write protect (WP) GPIO lines, so we can move away from the hard-coded GPIO numberspace. In some cases the platforms were compulsively including the header even if they weren't actually using it, and in these cases I simply replaced that inclusion with the more appropriate which is what board files should be including most of the time. Cc: Daniel Mack Cc: Robert Jarzmik Cc: Bartosz Golaszewski Cc: Andrea Adami Signed-off-by: Linus Walleij Acked-by: Robert Jarzmik Signed-off-by: Ulf Hansson commit 5128f8d4450159f59565d247437d3bedda3994cb Author: Linus Walleij Date: Sun Dec 2 09:43:21 2018 +0100 gpio: name PCA953x gpio chips after device name Instead of using the name directly from the I2C client to name the gpio_chip, use dev_name() on the client->dev, so we get the sometimes more unique device name, as I2C has a mechanism for naming its devices explicitly in e.g. board data. This is a prerequisite for being able to reference uniquely any I2C GPIO expander defined in a board file when setting up GPIO descriptor tables. Reviewed-by: Robert Jarzmik Signed-off-by: Linus Walleij Signed-off-by: Ulf Hansson commit d2951dfa070ddb3ae3c48ea8a5d7acb2fa8614bd Author: Linus Walleij Date: Sun Dec 2 09:43:20 2018 +0100 mmc: s3cmci: Use the slot GPIO descriptor Simplify things by making the S3CMCI driver just use slot GPIO with descriptors instead of passing around the global GPIO numbers that we want to get rid of. Getting the names of the GPIO chips into the machine descriptor tables was a bit of a challenge but I think I have them right. The platform data supports passing in inversion flags, but no platform is using them, and it is highly unlikely that we will add more, so drop them. The long term plan is to let the inversion flags on the GPIO machine descriptor do the job. The lines are flagged as GPIO_ACTIVE_[LOW|HIGH] as that is what they are, and since we can now rely on the descriptors to have the right polarity, we set the "override_active_level" to false in mmc_gpiod_request_cd() and mmc_gpiod_request_ro(). Cc: Jaehoon Chung Cc: Sylwester Nawrocki Cc: Sergio Prado Reviewed-by: Krzysztof Kozlowski Signed-off-by: Linus Walleij Signed-off-by: Ulf Hansson commit faed9303067a0bd9d8ddb09c0de3bc742334773a Author: Linus Walleij Date: Sun Dec 2 09:43:19 2018 +0100 mmc: host: tmio: Use GPIO descriptors The TMIO MMC driver was passing global GPIO numbers around for card detect. It turns out only one single board in the kernel was actually making use of this feature so it is pretty easy to convert the driver to use only GPIO descriptors. The lines are flagged as GPIO_ACTIVE_[LOW|HIGH] as that is what they are, and since we can now rely on the descriptors to have the right polarity, we set the "override_active_level" to false in mmc_gpiod_request_cd() and mmc_gpiod_request_ro(). Reviewed-by: Laurent Pinchart Acked-by: Kuninori Morimoto Signed-off-by: Linus Walleij Signed-off-by: Ulf Hansson commit 5716fb9bd9c6d3e56da07d6ed219dfcfce7d7006 Author: Linus Walleij Date: Sun Dec 2 09:43:18 2018 +0100 mmc: spi: Convert to use GPIO descriptors Switch the SPI MMC driver to use GPIO descriptors internally and just look those up using the standard slot GPIO functions mmc_gpiod_request_cd() and mmc_gpiod_request_ro(). Make sure to request index 0 and 1 in accordance with the SPI MMC DT binding, and add the same GPIOs in machine descriptor tables on all boards that use SPI MMC in board files. The lines are flagged as GPIO_ACTIVE_[LOW|HIGH] as that is what they are, and since we can now rely on the descriptors to have the right polarity, we set the "override_active_level" to false in mmc_gpiod_request_cd() and mmc_gpiod_request_ro(). Cc: Hartley Sweeten # Vision EP9307 Cc: Kuninori Morimoto Reviewed-by: Laurent Pinchart Signed-off-by: Linus Walleij Signed-off-by: Ulf Hansson commit b0d06f1cb0e2079a3c64fb6e27c19d9a55c723a1 Author: Nicholas Mc Guire Date: Thu Nov 22 10:35:19 2018 +0100 mmc: meson-mx-sdio: check devm_kasprintf for failure devm_kasprintf() may return NULL on failure of internal allocation thus the assignments to init.name are not safe if not checked. On error meson_mx_mmc_register_clks() returns negative values so -ENOMEM in the (unlikely) failure case of devm_kasprintf() should be fine here. Signed-off-by: Nicholas Mc Guire Fixes: ed80a13bb4c4 ("mmc: meson-mx-sdio: Add a driver for the Amlogic Meson8 and Meson8b SoCs") Acked-by: Martin Blumenstingl Signed-off-by: Ulf Hansson commit 48e304cc1970b65f43c0d2f82aaf48285f0eccd2 Author: Yangbo Lu Date: Fri Nov 23 11:15:37 2018 +0800 mmc: sdhci-of-esdhc: workaround for unreliable pulse width detection This was a SoC issue on LX2160A Rev1.0. eSDHC_DLLCFG1[DLL_PD_PULSE_STRETCH_SEL] must be set to 0 to get 4 delay cells in the pulse width detection logic for eMMC HS400 mode. Otherwise it would cause unexpected HS400 issue. This patch is to clear this bit always for affected SoC when reset for all, since this bit doesn't affect other speed modes. Signed-off-by: Yangbo Lu Signed-off-by: Ulf Hansson commit 58d0bf843b49fa99588ac9f85178bd8dfd651b53 Author: Yangbo Lu Date: Fri Nov 23 11:15:36 2018 +0800 mmc: sdhci-of-esdhc: temporary fixup for eMMC HS400 issue Currently only LX2160A eSDHC supports eMMC HS400. According to a large number of tests, eMMC HS400 failed to work at 150MHz, and for a few boards failed to work at 175MHz. But eMMC HS400 worked fine on 200MHz. We hadn't found the root cause but setting eSDHC_DLLCFG0[DLL_FREQ_SEL] = 0 using slow delay chain seemed to resovle this issue. Let's use this as fixup for now. Signed-off-by: Yangbo Lu Signed-off-by: Ulf Hansson commit 6079e63cdeac804bbf3ee7301d447812e5b81d84 Author: Yangbo Lu Date: Fri Nov 23 11:15:35 2018 +0800 mmc: sdhci-of-esdhc: add erratum A011334 support There are timing violations in case of few division ratio options are selected for card clock frequency. prescaler*divisor options /3,/5,/6,/7,/9,/10,/11,/13,/14 and /15 are not available in LX2 Rev1.0. prescaler*divisor options /4,/8 and /12 only available in LX2 Rev1.0. Applicable only for HS400 mode. so by add the erratum A011334 support to limit the prescaler*divisor in LX2 REV1.0 Signed-off-by: Yangbo Lu Signed-off-by: Yinbo Zhu Signed-off-by: Ulf Hansson commit 54e08d9a95ca54a192a9aef76742a4f7e81f6780 Author: Yangbo Lu Date: Fri Nov 23 11:15:34 2018 +0800 mmc: sdhci-of-esdhc: add hs400 mode support 1. Perform the Tuning Process at the HS400 target operating frequency. Latched the clock division value. 2. if read transaction, then set the SDTIMNGCTL[FLW_CTL_BG]. 3. Switch to High Speed mode and then set the card clock frequency to a value not greater than 52Mhz 4. Clear TBCTL[TB_EN],tuning block enable bit. 5. Change to 8 bit DDR Mode 6. Switch the card to HS400 mode. 7. Set TBCTL[TB_EN], tuning block enable bit. 8. Clear SYSCTL[SDCLKEN] 9. Wait for PRSSTAT[SDSTB] to be set 10. Change the clock division to latched value.Set TBCTL[HS 400 mode] and Set SDCLKCTL[CMD_CLK_CTRL] 11. Set SYSCTL[SDCLKEN] 12. Wait for PRSSTAT[SDSTB] to be set 13. Set DLLCFG0[DLL_ENABLE] and DLLCFG0[DLL_FREQ_SEL]. 14. Wait for delay chain to lock. 15. Set TBCTL[HS400_WNDW_ADJUST] 16. Again clear SYSCTL[SDCLKEN] 17. Wait for PRSSTAT[SDSTB] to be set 18. Set ESDHCCTL[FAF] 19. Wait for ESDHCCTL[FAF] to be cleared 20. Set SYSCTL[SDCLKEN] 21. Wait for PRSSTAT[SDSTB] to be set. Signed-off-by: Yangbo Lu Signed-off-by: Yinbo Zhu Signed-off-by: Ulf Hansson commit cc14eec0889bb06abab3d6ea1e0e0676521542c8 Author: Yinbo Zhu Date: Fri Nov 23 11:15:33 2018 +0800 mmc: core: Add ->hs400_prepare_ddr() callback Some eMMC controllers need specific settings for HS400 mode before the speed mode can be switched to DDR mode, during the HS400 initialization sequence. For that reason, let's introduce a new host callback, ->hs400_prepare_ddr() and invoked it just before switching to DDR mode. Signed-off-by: Yinbo Zhu Signed-off-by: Ulf Hansson commit 52b5f5cfa2f736f3e478b65490736b62412dc11c Author: Faiz Abbas Date: Wed Nov 21 16:03:57 2018 +0530 mmc: sdhci-omap: Remove redundant structure assignments The sdhci_execute_tuning() function has assignment of private pointers multiple times. Remove the redundant assignment. Acked-by: Kishon Vijay Abraham I Signed-off-by: Faiz Abbas Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 5b0d62108b468b13410533c0ceea3821942bf592 Author: Faiz Abbas Date: Wed Nov 21 16:03:56 2018 +0530 mmc: sdhci-omap: Add platform specific reset callback The TRM (SPRUIC2C - January 2017 - Revised May 2018 [1]) forbids assertion of data reset while tuning is happening. Implement a platform specific callback that takes care of this condition. [1] http://www.ti.com/lit/pdf/spruic2 Section 25.5.1.2.4 Acked-by: Kishon Vijay Abraham I Signed-off-by: Faiz Abbas Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 96e03fffa306f3a02e34c1dbc271ea040b8705d0 Author: Ezequiel Garcia Date: Tue Nov 20 15:21:21 2018 -0300 mmc: jz4740: rework pre_req/post_req implementation As reported by Aaro, the JZ4740 MMC driver throws a warning when the kernel is built without preemption (CONFIG_PREEMPT_NONE=y). [ 16.461094] jz4740-mmc 13450000.mmc: [jz4740_mmc_prepare_dma_data] invalid cookie: data->host_cookie 567 host->next_data.cookie 568 [ 16.473120] jz4740-mmc 13450000.mmc: [jz4740_mmc_prepare_dma_data] invalid cookie: data->host_cookie 568 host->next_data.cookie 569 [ 16.485144] jz4740-mmc 13450000.mmc: [jz4740_mmc_prepare_dma_data] invalid cookie: data->host_cookie 569 host->next_data.cookie 570 [ 16.497170] jz4740-mmc 13450000.mmc: [jz4740_mmc_prepare_dma_data] invalid cookie: data->host_cookie 570 host->next_data.cookie 571 The problem seems to be related to how pre_req/post_req is implemented. Currently, it seems the driver expects jz4740_mmc_prepare_dma_data() to be called with monotonically increasing host_cookie values, which is wrong. Moreover, the implementation is overly complicated, keeping track of unneeded "next cookie" state. So, instead of attempting to fix the current pre_req/post_req implementation, this commit refactors the driver, dropping the state, following other drivers such as dw_mmc and sdhci. Cc: Paul Cercueil Cc: Mathieu Malaterre Reported-by: Aaro Koskinen Signed-off-by: Ezequiel Garcia Tested-by: Aaro Koskinen Signed-off-by: Ulf Hansson commit 09b4f706736fb9f9af763d8af41bf6f99944dc0c Author: Ludovic Barre Date: Wed Nov 7 10:30:40 2018 +0100 mmc: mmci: send stop command if sbc error issue Refer to "4.15 set block count command" of sd specification: Host needs to issue CMD12 if any error is detected in the CMD18 and CMD25 operations. In sbc case, the data->stop is fill by framework. Signed-off-by: Ludovic Barre Tested-by: Ulf Hansson Signed-off-by: Ulf Hansson commit 20427e5db3f96fc054c6a6ad95606906b834deb1 Author: Wolfram Sang Date: Mon Dec 3 20:56:47 2018 +0100 mmc: document 'Reliable Write' bit in uapi header If we use it this way, people should know about it. Also, replace true/false with nonzero/zero because the flag is not strictly a bool anymore. Signed-off-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Ulf Hansson commit 1970701f808095d28289c4add99a81be4ddd3790 Author: Wolfram Sang Date: Mon Nov 19 14:13:57 2018 +0100 mmc: tmio: introduce mask for 'always 1' bits Some variants (namely Renesas SDHI) have bits in the STATS and IRQ_MASK registers which are 'always 1' and should be written as such. Introduce a seperate mask for this and apply it whenever such a register is written. Signed-off-by: Wolfram Sang Reviewed-by: Simon Horman Reviewed-by: Niklas Söderlund Signed-off-by: Ulf Hansson commit 0f4e2054c971c827dc9463ff14c7f8f90972eb52 Author: Niklas Söderlund Date: Wed Nov 28 17:18:29 2018 +0100 mmc: renesas_sdhi: disable HS400 on H3 ES1.x and M3-W ES1.[012] The Renesas BSP confirms that H3 ES1.x and M3-W ES1.[012] do not properly support HS400. Add a quirk to indicate this and disable HS400 in the MMC capabilities if the quirk is set. Signed-off-by: Niklas Söderlund Tested-by: Wolfram Sang Reviewed-by: Wolfram Sang Reviewed-by: Simon Horman Signed-off-by: Ulf Hansson commit 2c907f05dc3d8d130e732a4a5035f399e2f7f2c1 Author: Niklas Söderlund Date: Wed Nov 28 17:18:28 2018 +0100 mmc: renesas_sdhi: align compatibility properties for H3 and M3-W It was though all ES revisions of H3 and M3-W SoCs required the TMIO_MMC_HAVE_4TAP_HS400 flag. Recent datasheet updates tells us this is not true, only early ES revisions of the SoC do. Since quirk matching based on ES revisions is now used to handle the flag it's possible to align all Gen3 compatibility properties. This will allow later ES revisions of H3 and M3-W to use the correct 8-tap HS400 mode. Signed-off-by: Niklas Söderlund Tested-by: Wolfram Sang Reviewed-by: Wolfram Sang Reviewed-by: Simon Horman Signed-off-by: Ulf Hansson commit 164691aae88d7fb75c1b2a3e83737b2a52c2f956 Author: Niklas Söderlund Date: Wed Nov 28 17:18:27 2018 +0100 mmc: renesas_sdhi: handle 4tap hs400 mode quirk based on SoC revision Latest datasheet makes it clear that not all ES revisions of the H3 and M3-W have the 4-tap HS400 mode quirk, currently the quirk is set unconditionally for these two SoCs. Prepare to handle the quirk based on SoC revision instead of compatibility value by using soc_device_match() and set the TMIO_MMC_HAVE_4TAP_HS400 flag explicitly. The reason for adding a new quirks struct instead of just a flag is that looking ahead it seems more quirks needs to be handled in a SoC revision basis. Signed-off-by: Niklas Söderlund Tested-by: Wolfram Sang Reviewed-by: Wolfram Sang Reviewed-by: Simon Horman Signed-off-by: Ulf Hansson commit 202367cb8d09c5b003ba4a07860ecd0ea50148b8 Author: Niklas Söderlund Date: Mon Nov 26 18:02:47 2018 +0100 mmc: renesas_sdhi: add initial setting of interrupt mask register The initial value of the interrupt mask register may be different from the H/W manual at the startup of the kernel by setting from the bootloader. Since the error interrupts may be unmasked, the driver sets initial value. The initial value is only known for R-Car Gen2 and Gen3 platforms so limit the initialization to those platforms. Based on work from Masaharu Hayakawa. Signed-off-by: Niklas Söderlund Tested-by: Wolfram Sang Reviewed-by: Wolfram Sang Reviewed-by: Simon Horman Signed-off-by: Ulf Hansson commit a87852c6b8827b7fece78ae57d871d56e4348e30 Author: Niklas Söderlund Date: Mon Nov 26 18:02:46 2018 +0100 mmc: tmio: fix reset operation SD / MMC did not operate properly when suspend transition failed. Because the SCC was not reset at resume, issue of the command failed. Call the host specific reset function and reset the hardware in order to add reset of SCC. This change also fixes tuning on some stubborn cards on Gen2. Based on work from Masaharu Hayakawa. Signed-off-by: Niklas Söderlund Reviewed-by: Simon Horman Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Signed-off-by: Ulf Hansson commit ac1e25c870d30d43c626f2f9f073e74b383554d1 Author: Niklas Söderlund Date: Mon Nov 26 18:02:45 2018 +0100 mmc: tmio: enable module clock before resetting when resuming On runtime power management resume, the host clock needs to be enabled before calling tmio_mmc_reset. If the mmc device has a power domain entry, the host clock is enabled via genpd_runtime_resume, running before tmio_mmc_host_runtime_resume. If the mmc device has no power domain entry, however, genpd_runtime_resume is not called. This patch changes tmio_mmc_host_runtime_resume to enable the host clock before calling tmio_mmc_reset. Based on work from Masaharu Hayakawa. Signed-off-by: Niklas Söderlund Tested-by: Wolfram Sang Reviewed-by: Wolfram Sang Reviewed-by: Masahiro Yamada Reviewed-by: Simon Horman Signed-off-by: Ulf Hansson commit b0715f04d0c136280da0cfd172f2bee49a64d2d2 Author: Wolfram Sang Date: Mon Nov 26 14:38:14 2018 +0100 mmc: core: remove obsolete mmc_set_blockcount() function The only user was converted to fill a sbc command which is the proper way to do it because of AutoCMD23 feature of some hosts. Signed-off-by: Wolfram Sang Tested-by: Clément Péron Reviewed-by: Avri Altman Reviewed-by: Niklas Söderlund Signed-off-by: Ulf Hansson commit 2f5da678351f0d504966fab113968202aa5713fb Author: Stefan Wahren Date: Sun Nov 11 21:23:59 2018 +0100 mmc: bcm2835: Properly handle dmaengine_prep_slave_sg In case dmaengine_prep_slave_sg fails we need to call dma_unmap_sg. Signed-off-by: Stefan Wahren Acked-by: Eric Anholt Signed-off-by: Ulf Hansson commit 6dc6f2619017109e45550accc120f823fdc31c3e Author: Stefan Wahren Date: Sun Nov 11 21:23:58 2018 +0100 mmc: bcm2835: Refactor dma_map_sg handling There are two variables len within bcm2835_prepare_dma. So rename the result of dma_map_sg to sg_len. While we are at this add a bail out to simplify the following change. Signed-off-by: Stefan Wahren Acked-by: Eric Anholt Signed-off-by: Ulf Hansson commit 37fefadee8bb665ae337a15aa635dabff9f66ade Author: Stefan Wahren Date: Sun Nov 11 21:23:57 2018 +0100 mmc: bcm2835: Terminate timeout work synchronously It's better to make sure that the timeout work is really terminated before calling mmc_request_done. Signed-off-by: Stefan Wahren Acked-by: Eric Anholt Signed-off-by: Ulf Hansson commit af19b7ce76ba220f358c82b0a5e7d68909a23aa5 Author: Stefan Wahren Date: Sun Nov 11 21:23:56 2018 +0100 mmc: bcm2835: Avoid possible races on data requests There are two accesses on the data requests which are not protected by the mutex. So fix this accordingly. Signed-off-by: Stefan Wahren Acked-by: Eric Anholt Signed-off-by: Ulf Hansson commit 5eae252db3856e62c778832d4d59f6efc5b0aaf9 Author: Stefan Wahren Date: Sun Nov 11 21:23:55 2018 +0100 mmc: bcm2835: Release DMA channel on driver unload We need to release the slave DMA channel during driver unload. Signed-off-by: Stefan Wahren Acked-by: Eric Anholt Signed-off-by: Ulf Hansson commit 07d405769afea5718529fc9e341f0b13b3189b6f Author: Phil Elwell Date: Sun Nov 11 21:23:54 2018 +0100 mmc: bcm2835: Recover from MMC_SEND_EXT_CSD If the user issues an "mmc extcsd read", the SD controller receives what it thinks is a SEND_IF_COND command with an unexpected data block. The resulting operations leave the FSM stuck in READWAIT, a state which persists until the MMC framework resets the controller, by which point the root filesystem is likely to have been unmounted. A less heavyweight solution is to detect the condition and nudge the FSM by asserting the (self-clearing) FORCE_DATA_MODE bit. Link: https://github.com/raspberrypi/linux/issues/2728 Signed-off-by: Phil Elwell Signed-off-by: Stefan Wahren Acked-by: Eric Anholt Signed-off-by: Ulf Hansson commit f6000a4eb34e6462bc0dd39809c1bb99f9633269 Author: Michal Suchanek Date: Sun Nov 11 21:23:53 2018 +0100 mmc: bcm2835: reset host on timeout The bcm2835 mmc host tends to lock up for unknown reason so reset it on timeout. The upper mmc block layer tries retransimitting with single blocks which tends to work out after a long wait. This is better than giving up and leaving the machine broken for no obvious reason. Fixes: 660fc733bd74 ("mmc: bcm2835: Add new driver for the sdhost controller.") Signed-off-by: Michal Suchanek Signed-off-by: Stefan Wahren Acked-by: Eric Anholt Signed-off-by: Ulf Hansson commit 74ff81e16c3275a7d0fd4137c8f2279b7a491810 Author: Linus Walleij Date: Mon Nov 12 15:12:35 2018 +0100 mmc: sdhci: imx: Use the slot GPIO descriptor Simplify things by making the i.MX SDHCI driver just use slot GPIO with descriptors instead of passing around the global GPIO numbers that we want to get rid of. As it turns out, just one single board is using the platform data to pass in GPIOs numbers for CD and WP, so we augment this to use a machine descriptor table instead. Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: Bartosz Golaszewski Signed-off-by: Linus Walleij Reviewed-by: Dong Aisheng Signed-off-by: Ulf Hansson commit 0f6f3235b816ef7e6692d6f31920bf6aa2d1623d Author: Linus Walleij Date: Mon Nov 12 15:12:32 2018 +0100 mmc: jz4740: Use GPIO descriptor for power The power GPIO line is passed with inversion flags and all from the platform data. Switch to using an optional GPIO descriptor and use this to switch the power. Augment the only boardfile to pass in the proper "power" descriptor in the GPIO descriptor machine table instead. As the GPIO handling is now much simpler, we can cut down on some overhead code. Cc: Paul Cercueil Cc: linux-mips@linux-mips.org Signed-off-by: Linus Walleij Acked-by: Paul Burton Signed-off-by: Ulf Hansson commit 0c901c0566fb4edc2631c3786e5085a037be91f8 Author: Linus Walleij Date: Mon Nov 12 15:12:31 2018 +0100 mmc: jz4740: Get CD/WP GPIOs from descriptors Modifty the JZ4740 driver to retrieve card detect and write protect GPIO pins from GPIO descriptors instead of hard-coded global numbers. Augment the only board file using this in the process and cut down on passed in platform data. Preserve the code setting the caps2 flags for CD and WP as active low or high since the slot GPIO code currently ignores the gpiolib polarity inversion semantice and uses the raw accessors to read the GPIO lines, but set the right polarity flags in the descriptor table for jz4740. Cc: Paul Cercueil Cc: linux-mips@linux-mips.org Signed-off-by: Linus Walleij Acked-by: Paul Burton Signed-off-by: Ulf Hansson commit ec5af091b28abf6b61c219f08b3407ae24073495 Author: Linus Walleij Date: Mon Nov 12 15:12:30 2018 +0100 mmc: slot-gpio: Allocate GPIO labels dynamically The use of string pointers in the MMC slot GPIO context is pretty dubious, allocating some 2*len extra bytes for each label of the ro and wp pins. Tidy this up using kasprintf() with dynamic allocation of labels for these strings. Signed-off-by: Linus Walleij Signed-off-by: Ulf Hansson commit 21f1e2d457ce678adc1269cef6e83cd66dc6fdc6 Author: Veerabhadrarao Badiganti Date: Mon Nov 12 12:22:17 2018 +0530 mmc: sdhci-msm: Re-initialize DLL if MCLK is gated dynamically On few SDHCI-MSM controllers, the host controller's clock tuning circuit may go out of sync if controller clocks are gated which eventually will result in data CRC, command CRC/timeout errors. To overcome this h/w limitation, the DLL needs to be re-initialized and restored with its old settings once clocks are ungated. Signed-off-by: Veerabhadrarao Badiganti Reviewed-by: Evan Green Signed-off-by: Ulf Hansson commit 247cb8b7a79670ff37b992012431b7f5ec0e196d Author: Veerabhadrarao Badiganti Date: Mon Nov 12 12:22:16 2018 +0530 dt-bindings: mmc: sdhci-msm: Add SoC-specific compatible strings Add SoC-specific compatible strings for qcom-sdhci controller. Signed-off-by: Veerabhadrarao Badiganti Reviewed-by: Rob Herring Signed-off-by: Ulf Hansson commit af849c86109d79222e549826068bbf4e7f9a2472 Author: Adrian Hunter Date: Thu Nov 15 15:53:43 2018 +0200 mmc: sdhci: Handle auto-command errors If the host controller supports auto-commands then enable the auto-command error interrupt and handle it. In the case of auto-CMD23, the error is treated the same as manual CMD23 error. In the case of auto-CMD12, commands-during-transfer are not permitted, so the error handling is treated the same as a data error. Signed-off-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 869f8a69bb3a4aec4eb914a330d4ba53a9eed495 Author: Adrian Hunter Date: Thu Nov 15 15:53:42 2018 +0200 mmc: sdhci: Rename SDHCI_ACMD12_ERR and SDHCI_INT_ACMD12ERR The SDHCI_ACMD12_ERR register is used for auto-CMD23 and auto-CMD12 errors, as is the SDHCI_INT_ACMD12ERR interrupt bit. Rename them to SDHCI_AUTO_CMD_STATUS and SDHCI_INT_AUTO_CMD_ERR respectively. Signed-off-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 4bf780996669280171c9cd58196512849b93434e Author: Adrian Hunter Date: Thu Nov 15 15:53:41 2018 +0200 mmc: sdhci: Fix data command CRC error handling Existing data command CRC error handling is non-standard and does not work with some Intel host controllers. Specifically, the assumption that the host controller will continue operating normally after the error interrupt, is not valid. Change the driver to handle the error in the same manner as a data CRC error, taking care to ensure that the data line reset is done for single or multi-block transfers, and it is done before unmapping DMA. Signed-off-by: Adrian Hunter Signed-off-by: Ulf Hansson commit 7e2d23ec3a7d84fa5f64f2f6c66619d40adfdec3 Author: Stefan Wahren Date: Sat Nov 10 17:10:05 2018 +0100 mmc: bcm2835: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Cc: Phil Elwell Signed-off-by: Stefan Wahren Reviewed-by: Eric Anholt Signed-off-by: Ulf Hansson commit 0204da24a735150310adc8f7530426dfb076f432 Author: Marek Vasut Date: Mon Nov 5 22:39:35 2018 +0100 mmc: renesas_sdhi: Whitelist R8A77990 SDHI Whitelist R8A77990 E3 SoC in the SDHI driver. The SDHI core present in the SoC is an 8tap variant of the Gen3 SDHI core. Signed-off-by: Marek Vasut Cc: Geert Uytterhoeven Cc: Simon Horman Cc: Wolfram Sang Cc: Yoshihiro Shimoda Cc: Ulf Hansson Cc: linux-renesas-soc@vger.kernel.org Reviewed-by: Yoshihiro Shimoda Reviewed-by: Wolfram Sang Signed-off-by: Ulf Hansson commit 2cec67865b0c5f5ce3c2db1a1addf33b24bbf044 Author: Masaharu Hayakawa Date: Thu Nov 1 00:00:43 2018 +0100 mmc: tmio: delete wait in tuning process The manual does not contain information that a wait is needed in the tuning process, this might be a leftover from early development. Removing the wait don't have any effect on operation so delete the wait to shorten the initialization time. Signed-off-by: Masaharu Hayakawa Signed-off-by: Takeshi Saito [Niklas: fixup commit message] Signed-off-by: Niklas Söderlund Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Reviewed-by: Simon Horman Signed-off-by: Ulf Hansson commit df7507b50b496ad9c2da6ad1405ea04c4dfdcc4d Author: Niklas Söderlund Date: Wed Oct 31 23:59:44 2018 +0100 mmc: renesas_sdhi: remove workaround for HS400 clock The driver sets an incorrect clock and depends on the clock driver knowledge of this incorrect setting to still set a 200Mhz SDn clock. Instead of spreading the workaround between the two drivers the clock driver should be made aware of the ES versions where the special clock handling is needed no need to keep this workaround in the SDHI driver. Signed-off-by: Niklas Söderlund Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Reviewed-by: Simon Horman Signed-off-by: Ulf Hansson commit cd7a0d211386c1464a7565d01ed00c2d7d2adeae Author: Masahiro Yamada Date: Tue Oct 30 20:05:06 2018 +0900 mmc: sdhci-cadence: include instead of The reason of including here is just for BIT() and GENMASK() macros. Since commit 8bd9cb51daac8 ("locking/atomics, asm-generic: Move some macros from to a new file"), is enough for such compile-time macros. Signed-off-by: Masahiro Yamada Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson commit a68dd9a008e190420f8d44df5c1ba9650fc341f8 Author: Chunyan Zhang Date: Thu Oct 25 10:12:36 2018 +0800 mmc: sdhci: Convert sdhci_allocate_bounce_buffer() to return void The function sdhci_allocate_bounce_buffer() always return zero at present, so there's no need to have a return value, that will also make error path easier. CC: Linus Walleij Signed-off-by: Chunyan Zhang Reviewed-by: Linus Walleij Signed-off-by: Ulf Hansson commit bb16956e239e8d859b18a008e783550d6200aa7c Author: Chris Brandt Date: Wed Oct 24 17:23:01 2018 -0500 dt-bindings: mmc: tmio_mmc: Document Renesas R7S9210 Document support for the RZ/A2 (R7S9210) SoC. Signed-off-by: Chris Brandt Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring Reviewed-by: Simon Horman Signed-off-by: Ulf Hansson commit 9706b4722e120f2b6ed59e71ff2ff908c264558d Author: Chris Brandt Date: Wed Oct 24 17:23:00 2018 -0500 mmc: renesas_sdhi_internal_dmac: Add R7S9210 support The SDHI/MMC controller in the RZ/A2 is almost the same as R-Car gen3, but with some minor differences. Signed-off-by: Chris Brandt Signed-off-by: Ulf Hansson commit c42160d8efd885b54e681893b615e31b38e3d207 Author: A.s. Dong Date: Thu Oct 18 18:19:24 2018 +0000 dt-bindings: mmc: fsl-imx-esdhc: add imx8qxp compatible string Add imx8qxp compatible string Cc: Rob Herring Cc: Mark Rutland Cc: Ulf Hansson Cc: linux-serial@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-mmc@vger.kernel.org Cc: Haibo Chen Signed-off-by: Dong Aisheng Reviewed-by: Rob Herring Signed-off-by: Ulf Hansson commit ae460c115b7aa50c9a36cf78fced07b27962c9d0 Author: Jonas Danielsson Date: Fri Oct 19 16:40:05 2018 +0200 mmc: atmel-mci: do not assume idle after atmci_request_end On our AT91SAM9260 board we use the same sdio bus for wifi and for the sd card slot. This caused the atmel-mci to give the following splat on the serial console: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 538 at drivers/mmc/host/atmel-mci.c:859 atmci_send_command+0x24/0x44 Modules linked in: CPU: 0 PID: 538 Comm: mmcqd/0 Not tainted 4.14.76 #14 Hardware name: Atmel AT91SAM9 [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (__warn+0xd8/0xf4) [] (__warn) from [] (warn_slowpath_null+0x1c/0x24) [] (warn_slowpath_null) from [] (atmci_send_command+0x24/0x44) [] (atmci_send_command) from [] (atmci_start_request+0x1f4/0x2dc) [] (atmci_start_request) from [] (atmci_request+0xf0/0x164) [] (atmci_request) from [] (mmc_start_request+0x280/0x2d0) [] (mmc_start_request) from [] (mmc_start_areq+0x230/0x330) [] (mmc_start_areq) from [] (mmc_blk_issue_rw_rq+0xc4/0x310) [] (mmc_blk_issue_rw_rq) from [] (mmc_blk_issue_rq+0x118/0x5ac) [] (mmc_blk_issue_rq) from [] (mmc_queue_thread+0xc4/0x118) [] (mmc_queue_thread) from [] (kthread+0x100/0x118) [] (kthread) from [] (ret_from_fork+0x14/0x34) ---[ end trace 594371ddfa284bd6 ]--- This is: WARN_ON(host->cmd); This was fixed on our board by letting atmci_request_end determine what state we are in. Instead of unconditionally setting it to STATE_IDLE on STATE_END_REQUEST. Signed-off-by: Jonas Danielsson Signed-off-by: Ulf Hansson commit 3df407b2a5346db1c48809706ece7a8616c79e0b Author: Liming Sun Date: Fri Oct 19 10:26:14 2018 -0400 mmc: dw_mmc-bluefield: simplify the probe() function This commit removes the unnecessary of-node check since the dw_mci_bluefield_match[] structure has only one entry. Signed-off-by: Liming Sun Signed-off-by: Ulf Hansson commit f7f41722efacc121cbfd36a8480cd2e66223479d Author: Yangtao Li Date: Wed Dec 5 11:19:00 2018 -0500 dmaengine: qcom_hidma: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Acked-by: Sinan Kaya Signed-off-by: Vinod Koul commit e00f50a79e61396ca531b71e04857120332948d5 Author: Yangtao Li Date: Wed Dec 5 11:18:59 2018 -0500 dmaengine: pxa: remove DBGFS_FUNC_DECL() We already have the DEFINE_SHOW_ATTRIBUTE, There is no need to define such a macro, so remove DBGFS_FUNC_DECL. Signed-off-by: Yangtao Li Acked-by: Robert Jarzmik Signed-off-by: Vinod Koul commit 0f7ab39a6b401a4fef3f3b7004a2e58ef67079af Author: Yangtao Li Date: Wed Dec 5 11:18:58 2018 -0500 dmaengine: mic_x100_dma: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Vinod Koul commit 8e1897bc8eaf1383d6b33d5232136221ffd9c818 Author: Yangtao Li Date: Wed Dec 5 11:18:57 2018 -0500 dmaengine: amba-pl08x: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Vinod Koul commit f80f9988a26d71a37dd56c927bb87d2865cc5c29 Author: Seraj Alijan Date: Mon Dec 10 08:52:42 2018 +0000 dmaengine: Documentation: Add documentation for multi chan testing Modify documentation to add multi channel testing support. Signed-off-by: Seraj Alijan Signed-off-by: Vinod Koul commit 13396a130ffec45a736bcc08ad92d35e45f67dd8 Author: Seraj Alijan Date: Mon Dec 10 08:52:39 2018 +0000 dmaengine: dmatest: Add transfer_size parameter Existing transfer size "len" is either generated randomly or set to the size of test_buf_size. In some cases we need to explicitly specify a transfer size that is different from the buffer size and non aligned to test the target device's ability to handle unaligned transfers. This patch adds optional parameter "transfer_size" to allow setting explicit transfer size for dma transfers. Signed-off-by: Seraj Alijan Signed-off-by: Vinod Koul commit a875abfadf265cb1970036898068b34fc63759b7 Author: Seraj Alijan Date: Mon Dec 10 08:52:37 2018 +0000 dmaengine: dmatest: Add alignment parameter Add parameter "alignment" to allow setting the address alignment manually. Having the ability to configure address alignment from user space adds new testing capabilities where different alignments can be configured for testing without having to modify the dma device alignment properties. If configured, the alignment value will override the device alignment property of the target device. Signed-off-by: Seraj Alijan Signed-off-by: Vinod Koul commit 6138f967bccc7a84a167769c2e045c346ad37191 Author: Seraj Alijan Date: Mon Dec 10 08:52:34 2018 +0000 dmaengine: dmatest: Use fixed point div to calculate iops Use fixed point division to calculate iops to prevent reporting 0 iops when operations last for longer than a second. Signed-off-by: Seraj Alijan Signed-off-by: Vinod Koul commit d53513d5dc285d9a95a534fc41c5c08af6b60eac Author: Seraj Alijan Date: Mon Dec 10 08:52:31 2018 +0000 dmaengine: dmatest: Add support for multi channel testing Add support for running tests on multiple channels simultaneously as the driver currently limits to 1 channel per test run. This will add support for stress testing DMA controllers with multi channel capabilities. This is done by adding a callback function to the "channel" parameter that registers the requested channel prior to the "run" parameter being set to 1. Each time the "channel" parameter is populated with a new dma channel, a new test is appended to the thread queue. Once the "run" parameter is set to 1, the test will kick start all pending threads. Signed-off-by: Seraj Alijan Signed-off-by: Vinod Koul commit 47ec4cf405e238dac55df5e380bfe97842e0be68 Author: Fabrizio Castro Date: Thu Dec 13 20:17:43 2018 +0000 dmaengine: rcar-dmac: Document R8A774C0 bindings Renesas' RZ/G2E (R8A774C0) SoC has DMA controllers compatible with this driver, therefore document RZ/G2E specific bindings. Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Vinod Koul commit 3eaba568b54e572187a3f4a08d5582d4d623e7e3 Author: Fabrizio Castro Date: Thu Dec 13 20:21:31 2018 +0000 dt-bindings: dmaengine: usb-dmac: Add binding for r8a774c0 This patch adds bindings for the r8a774c0 (RZ/G2E). Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Signed-off-by: Vinod Koul commit d19afebca47602bd9909944eb0ee406dce66174d Author: Ming Lei Date: Mon Dec 17 09:46:01 2018 +0800 blk-wbt: export internal state via debugfs This information is helpful to either investigate issues, or understand wbt's internal behaviour. Cc: Bart Van Assche Cc: Omar Sandoval Cc: Christoph Hellwig Cc: Josef Bacik Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit cc56694f132a8f5fa9334e3afe990de8c3378866 Author: Ming Lei Date: Mon Dec 17 09:46:00 2018 +0800 blk-mq-debugfs: support rq_qos blk-mq-debugfs has been proved as very helpful for debug some tough issues, such as IO hang. We have seen blk-wbt related IO hang several times, even inside Red Hat BZ, there is such report not sovled yet, so this patch adds support debugfs on rq_qos. Cc: Bart Van Assche Cc: Omar Sandoval Cc: Christoph Hellwig Cc: Josef Bacik Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit f9824952ee1cd02ae1a74e35e0e8653f8a4db772 Author: Damien Le Moal Date: Fri Nov 30 14:36:24 2018 +0900 block: update sysfs documentation Add the description of the zoned, nr_zones and chunk_sectors sysfs queue attributes to Documentation/block/queue-sysfs.txt. The description of the zoned and chunk_sector attributes are mostly copied from ABI/testing/sysfs-block (added a typo fix). While at it, also fix a typo in the description of the io_poll_delay attribute. nr_zones description is also added to ABI/testing/sysfs-block and contact email address updated for the zoned attribute. Signed-off-by: Damien Le Moal Signed-off-by: Jens Axboe commit 95d386c2d2e7660a6447df1507a9845665dab7d8 Author: Suraj Jitindar Singh Date: Fri Dec 14 16:29:10 2018 +1100 KVM: PPC: Book3S HV: Allow passthrough of an emulated device to an L3 guest Previously when a device was being emulated by an L1 guest for an L2 guest, that device couldn't then be passed through to an L3 guest. This was because the L1 guest had no method for accessing L3 memory. The hcall H_COPY_TOFROM_GUEST provides this access. Thus this setup for passthrough can now be allowed. Signed-off-by: Suraj Jitindar Singh Signed-off-by: Paul Mackerras commit 6ff887b8bd0d820d9f3371c0ce093d96b73035d6 Author: Suraj Jitindar Singh Date: Fri Dec 14 16:29:09 2018 +1100 KVM: PPC: Book3S: Introduce new hcall H_COPY_TOFROM_GUEST to access quadrants 1 & 2 A guest cannot access quadrants 1 or 2 as this would result in an exception. Thus introduce the hcall H_COPY_TOFROM_GUEST to be used by a guest when it wants to perform an access to quadrants 1 or 2, for example when it wants to access memory for one of its nested guests. Also provide an implementation for the kvm-hv module. Signed-off-by: Suraj Jitindar Singh Signed-off-by: Paul Mackerras commit 873db2cd9a6d7f017d8f4c637cf4166c038c27d6 Author: Suraj Jitindar Singh Date: Fri Dec 14 16:29:08 2018 +1100 KVM: PPC: Book3S HV: Allow passthrough of an emulated device to an L2 guest Allow for a device which is being emulated at L0 (the host) for an L1 guest to be passed through to a nested (L2) guest. The existing kvmppc_hv_emulate_mmio function can be used here. The main challenge is that for a load the result must be stored into the L2 gpr, not an L1 gpr as would normally be the case after going out to qemu to complete the operation. This presents a challenge as at this point the L2 gpr state has been written back into L1 memory. To work around this we store the address in L1 memory of the L2 gpr where the result of the load is to be stored and use the new io_gpr value KVM_MMIO_REG_NESTED_GPR to indicate that this is a nested load for which completion must be done when returning back into the kernel. Then in kvmppc_complete_mmio_load() the resultant value is written into L1 memory at the location of the indicated L2 gpr. Note that we don't currently let an L1 guest emulate a device for an L2 guest which is then passed through to an L3 guest. Signed-off-by: Suraj Jitindar Singh Signed-off-by: Paul Mackerras commit cc6929cc842cceee714c66cd55346b1a9f114a98 Author: Suraj Jitindar Singh Date: Fri Dec 14 16:29:07 2018 +1100 KVM: PPC: Update kvmppc_st and kvmppc_ld to use quadrants The functions kvmppc_st and kvmppc_ld are used to access guest memory from the host using a guest effective address. They do so by translating through the process table to obtain a guest real address and then using kvm_read_guest or kvm_write_guest to make the access with the guest real address. This method of access however only works for L1 guests and will give the incorrect results for a nested guest. We can however use the store_to_eaddr and load_from_eaddr kvmppc_ops to perform the access for a nested guesti (and a L1 guest). So attempt this method first and fall back to the old method if this fails and we aren't running a nested guest. At this stage there is no fall back method to perform the access for a nested guest and this is left as a future improvement. For now we will return to the nested guest and rely on the fact that a translation should be faulted in before retrying the access. Signed-off-by: Suraj Jitindar Singh Signed-off-by: Paul Mackerras commit dceadcf91b2e0971abe706b6d605ed25de61db0e Author: Suraj Jitindar Singh Date: Fri Dec 14 16:29:06 2018 +1100 KVM: PPC: Add load_from_eaddr and store_to_eaddr to the kvmppc_ops struct The kvmppc_ops struct is used to store function pointers to kvm implementation specific functions. Introduce two new functions load_from_eaddr and store_to_eaddr to be used to load from and store to a guest effective address respectively. Also implement these for the kvm-hv module. If we are using the radix mmu then we can call the functions to access quadrant 1 and 2. Signed-off-by: Suraj Jitindar Singh Signed-off-by: Paul Mackerras commit d7b456152230fcec3e98699dc137c763199f509a Author: Suraj Jitindar Singh Date: Fri Dec 14 16:29:05 2018 +1100 KVM: PPC: Book3S HV: Implement functions to access quadrants 1 & 2 The POWER9 radix mmu has the concept of quadrants. The quadrant number is the two high bits of the effective address and determines the fully qualified address to be used for the translation. The fully qualified address consists of the effective lpid, the effective pid and the effective address. This gives then 4 possible quadrants 0, 1, 2, and 3. When accessing these quadrants the fully qualified address is obtained as follows: Quadrant | Hypervisor | Guest -------------------------------------------------------------------------- | EA[0:1] = 0b00 | EA[0:1] = 0b00 0 | effLPID = 0 | effLPID = LPIDR | effPID = PIDR | effPID = PIDR -------------------------------------------------------------------------- | EA[0:1] = 0b01 | 1 | effLPID = LPIDR | Invalid Access | effPID = PIDR | -------------------------------------------------------------------------- | EA[0:1] = 0b10 | 2 | effLPID = LPIDR | Invalid Access | effPID = 0 | -------------------------------------------------------------------------- | EA[0:1] = 0b11 | EA[0:1] = 0b11 3 | effLPID = 0 | effLPID = LPIDR | effPID = 0 | effPID = 0 -------------------------------------------------------------------------- In the Guest; Quadrant 3 is normally used to address the operating system since this uses effPID=0 and effLPID=LPIDR, meaning the PID register doesn't need to be switched. Quadrant 0 is normally used to address user space since the effLPID and effPID are taken from the corresponding registers. In the Host; Quadrant 0 and 3 are used as above, however the effLPID is always 0 to address the host. Quadrants 1 and 2 can be used by the host to address guest memory using a guest effective address. Since the effLPID comes from the LPID register, the host loads the LPID of the guest it would like to access (and the PID of the process) and can perform accesses to a guest effective address. This means quadrant 1 can be used to address the guest user space and quadrant 2 can be used to address the guest operating system from the hypervisor, using a guest effective address. Access to the quadrants can cause a Hypervisor Data Storage Interrupt (HDSI) due to being unable to perform partition scoped translation. Previously this could only be generated from a guest and so the code path expects us to take the KVM trampoline in the interrupt handler. This is no longer the case so we modify the handler to call bad_page_fault() to check if we were expecting this fault so we can handle it gracefully and just return with an error code. In the hash mmu case we still raise an unknown exception since quadrants aren't defined for the hash mmu. Signed-off-by: Suraj Jitindar Singh Signed-off-by: Paul Mackerras commit d232afebf97168487e83d1366e41d53609cd1f55 Author: Suraj Jitindar Singh Date: Fri Dec 14 16:29:04 2018 +1100 KVM: PPC: Book3S HV: Add function kvmhv_vcpu_is_radix() There exists a function kvm_is_radix() which is used to determine if a kvm instance is using the radix mmu. However this only applies to the first level (L1) guest. Add a function kvmhv_vcpu_is_radix() which can be used to determine if the current execution context of the vcpu is radix, accounting for if the vcpu is running a nested guest. Currently all nested guests must be radix but this may change in the future. Signed-off-by: Suraj Jitindar Singh Signed-off-by: Paul Mackerras commit 693ac10a88a2219bde553b2e8460dbec97e594e6 Author: Suraj Jitindar Singh Date: Fri Dec 14 16:29:03 2018 +1100 KVM: PPC: Book3S: Only report KVM_CAP_SPAPR_TCE_VFIO on powernv machines The kvm capability KVM_CAP_SPAPR_TCE_VFIO is used to indicate the availability of in kernel tce acceleration for vfio. However it is currently the case that this is only available on a powernv machine, not for a pseries machine. Thus make this capability dependent on having the cpu feature CPU_FTR_HVMODE. [paulus@ozlabs.org - fixed compilation for Book E.] Signed-off-by: Suraj Jitindar Singh Signed-off-by: Paul Mackerras commit 5af3e9d06d830d52864b39c86724dc39b463eddd Author: Paul Mackerras Date: Wed Dec 12 15:17:17 2018 +1100 KVM: PPC: Book3S HV: Flush guest mappings when turning dirty tracking on/off This adds code to flush the partition-scoped page tables for a radix guest when dirty tracking is turned on or off for a memslot. Only the guest real addresses covered by the memslot are flushed. The reason for this is to get rid of any 2M PTEs in the partition-scoped page tables that correspond to host transparent huge pages, so that page dirtiness is tracked at a system page (4k or 64k) granularity rather than a 2M granularity. The page tables are also flushed when turning dirty tracking off so that the memslot's address space can be repopulated with THPs if possible. To do this, we add a new function kvmppc_radix_flush_memslot(). Since this does what's needed for kvmppc_core_flush_memslot_hv() on a radix guest, we now make kvmppc_core_flush_memslot_hv() call the new kvmppc_radix_flush_memslot() rather than calling kvm_unmap_radix() for each page in the memslot. This has the effect of fixing a bug in that kvmppc_core_flush_memslot_hv() was previously calling kvm_unmap_radix() without holding the kvm->mmu_lock spinlock, which is required to be held. Signed-off-by: Paul Mackerras Reviewed-by: Suraj Jitindar Singh Reviewed-by: David Gibson Signed-off-by: Paul Mackerras commit c43c3a8683fe624b67b91a06f1c25cd752a05b3b Author: Paul Mackerras Date: Wed Dec 12 15:16:48 2018 +1100 KVM: PPC: Book3S HV: Cleanups - constify memslots, fix comments This adds 'const' to the declarations for the struct kvm_memory_slot pointer parameters of some functions, which will make it possible to call those functions from kvmppc_core_commit_memory_region_hv() in the next patch. This also fixes some comments about locking. Signed-off-by: Paul Mackerras Reviewed-by: Suraj Jitindar Singh Reviewed-by: David Gibson Signed-off-by: Paul Mackerras commit f460f6791a0224cfb019462363caa014c3aec8d7 Author: Paul Mackerras Date: Wed Dec 12 15:16:17 2018 +1100 KVM: PPC: Book3S HV: Map single pages when doing dirty page logging For radix guests, this makes KVM map guest memory as individual pages when dirty page logging is enabled for the memslot corresponding to the guest real address. Having a separate partition-scoped PTE for each system page mapped to the guest means that we have a separate dirty bit for each page, thus making the reported dirty bitmap more accurate. Without this, if part of guest memory is backed by transparent huge pages, the dirty status is reported at a 2MB granularity rather than a 64kB (or 4kB) granularity for that part, causing userspace to have to transmit more data when migrating the guest. Signed-off-by: Paul Mackerras Reviewed-by: Suraj Jitindar Singh Reviewed-by: David Gibson Signed-off-by: Paul Mackerras commit f032b73459eed4897bcafee2b1d37a817f1bb596 Author: Bharata B Rao Date: Wed Dec 12 15:15:30 2018 +1100 KVM: PPC: Pass change type down to memslot commit function Currently, kvm_arch_commit_memory_region() gets called with a parameter indicating what type of change is being made to the memslot, but it doesn't pass it down to the platform-specific memslot commit functions. This adds the `change' parameter to the lower-level functions so that they can use it in future. [paulus@ozlabs.org - fix book E also.] Signed-off-by: Bharata B Rao Reviewed-by: Suraj Jitindar Singh Reviewed-by: David Gibson Signed-off-by: Paul Mackerras commit ae6750e0a5ef3ec93b01008306183fd7a6d2721f Merge: 0634d694b06fb 5d06a76d9e6d2 Author: David S. Miller Date: Sun Dec 16 15:20:35 2018 -0800 Merge branch 'mlxsw-spectrum_acl-Add-Bloom-filter-support' Ido Schimmel says: ==================== mlxsw: spectrum_acl: Add Bloom filter support Nir says: Spectrum-2 uses Bloom filter to reduce the number of lookups in the algorithmic TCAM (A-TCAM). HW performs multiple exact match lookups in a given region using a key composed of { packet & mask, mask ID, region ID }. The masks which are used in a region are called rule patterns or RP. When such multiple masks are used, the A-TCAM region uses an eRP (extended RP) table that describes which rule patterns are in use and defines the order of the lookup. When eRP table is used in a region, one way to reduce the number of the lookups is to consult a Bloom filter before doing the lookup. A Bloom filter is a space-efficient probabilistic data structure, on which a query returns either "possibly in set" or "definitely not in set". HW can skip a lookup if a query on the Bloom filter results a "definitely not set" response. The mlxsw driver implements a "counting filter" and when either a new entry is marked or the last entry is removed it will update the HW. Update of this counting filter occurs when rule is configured or deleted from a region. Patch #1 adds PEABFE register which is used for setting Bloom filter entries. Patch #2 adds Bloom filter resources. Patch #3 and patch #4 provide Bloom filter handling within mlxsw, by adding initialization and logic for updating the Bloom bit vector in HW. Patch #5 and patch #6 add required calls for Bloom filter update as part of rule configuration flow. Patch #7 handles transitions to and from eRP table. It uses a list to keep A-TCAM rules in order to update rules in Bloom filter, in cases of transitions from master mask based A-TCAM region to an eRP table based region and vice versa. Patch #8 removes a trick done on master RP index to a remaining RP, since Bloom filter is updated on eRP transitions. Finally, patch #9 activates Bloom filter mechanism in HW, by cancelling the bypass that was configured before and the remaining three patches are selftests that exercise the new code. ==================== Signed-off-by: David S. Miller commit 5d06a76d9e6d2d00eadba72548636ff0ff6fabde Author: Nir Dotan Date: Sun Dec 16 08:49:37 2018 +0000 selftests: mlxsw: Add Bloom delta test The eRP table is active when there is more than a single rule pattern. It may be that the patterns are close enough and use delta mechanism. Bloom filter index computation is based on the values of {rule & mask, mask ID, region ID} where the rule delta bits must be cleared. Add a test that exercises Bloom filter with delta mechanism. Configure rules within delta range and pass a packet which is supposed to hit the correct rule. Signed-off-by: Nir Dotan Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 5118ca4edf9939ed3812ffbfabe7b97164f29635 Author: Nir Dotan Date: Sun Dec 16 08:49:36 2018 +0000 selftests: mlxsw: Add Bloom filter complex test Bloom filter index computation is based on the values of {rule & mask, mask ID, region ID} and the computation also varies according to the region key size. Add a test that exercises the possible combinations by creating multiple chains using different key sizes and then pass a frame that is supposed to to produce a hit on all of the regions. Signed-off-by: Nir Dotan Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 095c720807499953b7e16528f705d09675c96c0c Author: Nir Dotan Date: Sun Dec 16 08:49:35 2018 +0000 selftests: mlxsw: Add Bloom filter simple test Add a test that exercises Bloom filter code. Activate eRP table in the region by adding multiple rule patterns which with very high probability use different entries in the Bloom filter. Then send packets in order to check lookup hits on all relevant rules. Signed-off-by: Nir Dotan Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 03ce5bd187603ca916ca53843426526f38eab659 Author: Nir Dotan Date: Sun Dec 16 08:49:34 2018 +0000 mlxsw: reg: Activate Bloom filter Now that mlxsw driver handles all aspects of updating the Bloom filter mechanism, set bf_bypass value to false and allow HW to use Bloom filter. Signed-off-by: Nir Dotan Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit dd97d85f1e4daaa86d7a2813d718b91e5261df57 Author: Nir Dotan Date: Sun Dec 16 08:49:33 2018 +0000 mlxsw: spectrum_acl: Set master RP index on transition to eRP Bloom filter is updated on transitions from a single rule pattern, also called master RP, to eRP table and vice versa. Since rules are being written to or deleted from the Bloom filter on such transitions, it is not required to keep the same eRP bank ID for the master RP. Change master RP index assignment so it will be assigned with zero. This is consistent with the assignment of the first available spot that is used for allocating eRP's indices. Signed-off-by: Nir Dotan Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 135fd957288ed5f6a4ae490373a7910b3e7f7722 Author: Nir Dotan Date: Sun Dec 16 08:49:32 2018 +0000 mlxsw: spectrum_acl: Update Bloom filter on eRP transitions Bloom filter update is required only for rules which reside on an eRP. When the region has only a single rule pattern then eRP table is not used, however insertion of another pattern would trigger a move to an active eRP table so it is imperative to update the Bloom filter with all previously configured rules. Add a method that updates Bloom filter entries for all rules currently configured in the region, on the event of a transition from master mask to eRP, or vice versa. For that purpose, maintain a list of all A-TCAM rules within mlxsw_sp_acl_atcam_region. Signed-off-by: Nir Dotan Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 8c81b7438bf6abb035ee3009394a837ac8af64a8 Author: Nir Dotan Date: Sun Dec 16 08:49:30 2018 +0000 mlxsw: spectrum_acl: Set A-TCAM rules in Bloom filter Add calls to eRP module for updating Bloom filter when a rule is added or removed from the A-TCAM. eRP module will update the Bloom filter only for cases in which the region has an active eRP table. Signed-off-by: Nir Dotan Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit f5a2852ed0d74a9b6d9c92bc1ad5124e5e4a703c Author: Nir Dotan Date: Sun Dec 16 08:49:29 2018 +0000 mlxsw: spectrum_acl: Add Bloom filter update Add Bloom filter update for rule insertion and rule removal scenarios. This is done within eRP module in order to assure that Bloom filter updates are done only for rules which are part of an eRP, as HW does not consult Bloom filter for entries when there is a single (master) mask in the region. Signed-off-by: Nir Dotan Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 7585cacdb978a0cd8d47bff9e5dcecdc9d903add Author: Nir Dotan Date: Sun Dec 16 08:49:28 2018 +0000 mlxsw: spectrum_acl: Add Bloom filter handling Spectrum-2 HW uses Bloom filter in order to skip lookups on specific eRPs. It uses crc-16-Msbit-first calculation over a specific layout of a rule's key fields combined with eRP ID as well as region ID. Per potential lookup, iff the Bloom filter entry of the calculated index is empty, then the lookup can be skipped. Hence, the mlxsw driver should update the Bloom filter entry per each rule insertion or deletion when rules are part of an eRP. Add functions for adding and deleting entries in the Bloom filter. In order to do so also add crc-16 computation based on the specific Spectrum-2 polynomial and a function for encoding the crc-16 input in the manner dictated by HW implementation. Signed-off-by: Nir Dotan Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 0487cfba866a7f985c51ce7553d37439e10e71c1 Author: Nir Dotan Date: Sun Dec 16 08:49:26 2018 +0000 mlxsw: spectrum_acl: Introduce Bloom filter Lay the foundations for Bloom filter handling. Introduce a new file for Bloom filter actions. Add struct mlxsw_sp_acl_bf to struct mlxsw_sp_acl_erp_core and initialize the Bloom filter data structure. Also take care of proper destruction when terminating. Signed-off-by: Nir Dotan Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 944068582fe6e69fd76cb7b90ba2fd5cac04d78e Author: Nir Dotan Date: Sun Dec 16 08:49:25 2018 +0000 mlxsw: resources: Add Spectrum-2 Bloom filter resource Add the maximum Bloom filter logarithmic size per eRP table bank. Signed-off-by: Nir Dotan Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 418089a850c751ada5e3535d0e71c3312fe3c432 Author: Nir Dotan Date: Sun Dec 16 08:49:24 2018 +0000 mlxsw: reg: Add Policy Engine Algorithmic Bloom Filter Entries Register Bloom filter is a bit vector which allows the HW a fast lookup on a small size bit vector, that may reduce the number of lookups on the A-TCAM memory. PEABFE register allows setting values to the bits of the bit vector mentioned above. Add the register to be later used in A-TCAM optimizations. Signed-off-by: Nir Dotan Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit f9facc24a6441d6a82d6cca942b162a394ecba66 Author: YueHaibing Date: Wed Dec 12 08:36:36 2018 +0000 hwmon: (asus_atk0110) Fix debugfs_simple_attr.cocci warnings Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE for debugfs files. Semantic patch information: Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file() imposes some significant overhead as compared to DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe(). Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci Signed-off-by: YueHaibing Signed-off-by: Guenter Roeck commit 626f5eaed15ab81e9ece29d3dc1cf9e5881110f3 Author: Guenter Roeck Date: Mon Dec 10 14:02:06 2018 -0800 hwmon: (ftsteutates) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit 22ed7883c138ee5f7c8eec3c12f494f8bd59d8fe Author: Guenter Roeck Date: Mon Dec 10 14:02:06 2018 -0800 hwmon: (fschmd) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit 7a61d7197b8eb43fdbc036cd0eeea44986267202 Author: Guenter Roeck Date: Mon Dec 10 14:02:06 2018 -0800 hwmon: (emc6w201) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit 94bf70da8ac3f815411a24a6ca42e7327c4a4bbb Author: Guenter Roeck Date: Mon Dec 10 14:02:06 2018 -0800 hwmon: (emc2103) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Cc: Steve Glendinning Signed-off-by: Guenter Roeck commit ae66d2d9e881148acb0092be5a3e39982603ac07 Author: Guenter Roeck Date: Mon Dec 10 14:02:05 2018 -0800 hwmon: (emc1403) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit 57549f3360eefde08b63886b1477c5751fe2e446 Author: Guenter Roeck Date: Mon Dec 10 14:02:05 2018 -0800 hwmon: (ds620) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit 0ad85c07a1053bf95cae6218f4d06328b6dd1b2f Author: Guenter Roeck Date: Mon Dec 10 14:02:05 2018 -0800 hwmon: (ds1621) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit ba949ed62dcd51ba2a514f9a7b6b7de252621536 Author: Guenter Roeck Date: Mon Dec 10 14:02:04 2018 -0800 hwmon: (dell-smm-hwmon) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Cc: "Pali Rohár" Signed-off-by: Guenter Roeck commit 4b76a6c9b7bb9d0198e2f4e75979a2178925a762 Author: Guenter Roeck Date: Mon Dec 10 14:02:04 2018 -0800 hwmon: (da9055-hwmon) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Cc: Support Opensource Acked-by: Steve Twiss Signed-off-by: Guenter Roeck commit 6db587b73fcebf254454468590b93d294a3368f9 Author: Guenter Roeck Date: Mon Dec 10 14:02:04 2018 -0800 hwmon: (da9052-hwmon) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Cc: Support Opensource Acked-by: Steve Twiss Signed-off-by: Guenter Roeck commit 0cd709d0ddbfc2ed64ecbe2dbe8819b90b977684 Author: Guenter Roeck Date: Mon Dec 10 14:02:04 2018 -0800 hwmon: (coretemp) Replace S_ with octal values Replace S_ with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Cc: Fenghua Yu Signed-off-by: Guenter Roeck commit b51c14c736e355c7c7c642a2ea766d8eedf49907 Author: Guenter Roeck Date: Mon Dec 10 14:02:03 2018 -0800 hwmon: (asus_atk0110) Replace S_ with octal values Replace S_ with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Cc: Luca Tettamanti Signed-off-by: Guenter Roeck commit e98dd5388b24f8516a058e83a251681dbccfb0c0 Author: Guenter Roeck Date: Mon Dec 10 14:02:03 2018 -0800 hwmon: (aspeed-pwm-tacho) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Cc: Joel Stanley Cc: Andrew Jeffery Tested-by: Joel Stanley Signed-off-by: Guenter Roeck commit 71ee4a400013ad187393b9cb32faee98d520516e Author: Guenter Roeck Date: Mon Dec 10 14:02:03 2018 -0800 hwmon: (applesmc) Replace S_ with octal values Replace S_ with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Cc: Henrik Rydberg Signed-off-by: Guenter Roeck commit a7818350f60e69737fa053f6b1fb9441bc4d11a6 Author: Guenter Roeck Date: Mon Dec 10 14:02:02 2018 -0800 hwmon: (amc6821) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit f9fe9de0e62d02a1e64abfde55b1032f0d43aec8 Author: Guenter Roeck Date: Mon Dec 10 14:02:02 2018 -0800 hwmon: (adt7x10) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit c24f9ba9adfb0de712da83c626355da29a9e5462 Author: Guenter Roeck Date: Mon Dec 10 14:02:02 2018 -0800 hwmon: (adt7475) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit 42291a5aaed748a88dc69c0854a8101cf8f3b3eb Author: Guenter Roeck Date: Mon Dec 10 14:02:02 2018 -0800 hwmon: (adt7470) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit d60a51a690dd359a2973c4f6a58319abbf20a0b0 Author: Guenter Roeck Date: Mon Dec 10 14:02:01 2018 -0800 hwmon: (adt7462) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit 595a86af49f0bfba8bf89a69b4b91c1aa038a373 Author: Guenter Roeck Date: Mon Dec 10 14:02:01 2018 -0800 hwmon: (ads7871) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit 3ecd2783839c28e41baff1a7f8e9dfa6aa805616 Author: Guenter Roeck Date: Mon Dec 10 14:02:01 2018 -0800 hwmon: (ads7828) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit 7e77d1e76d36a231498d17265a1dae9dd337d397 Author: Guenter Roeck Date: Mon Dec 10 14:02:00 2018 -0800 hwmon: (ads1015) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Cc: Dirk Eibach Signed-off-by: Guenter Roeck commit cfc5bca6db53eb9ddc062a89993a29731d96c619 Author: Guenter Roeck Date: Mon Dec 10 14:02:00 2018 -0800 hwmon: (adm1021) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit b0c130fdaac18b69abcf577dfd21f84ec53c1eb9 Author: Guenter Roeck Date: Mon Dec 10 14:02:00 2018 -0800 hwmon: (adcxx) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit 0594462f97058cb620ffb849b2ffb85e34cb43fe Author: Guenter Roeck Date: Mon Dec 10 14:02:00 2018 -0800 hwmon: (adc128d818) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit 6fdc5d7fa9471aba8eba6a1950dab704d313227f Author: Guenter Roeck Date: Mon Dec 10 14:01:59 2018 -0800 hwmon: (ad7418) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit cbf6cb2b7eeac1a87386f3275b3c724019e4401d Author: Guenter Roeck Date: Mon Dec 10 14:01:59 2018 -0800 hwmon: (ad7414) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit 1ba3e02376497661348f6ad9a734287d171f4fd7 Author: Guenter Roeck Date: Mon Dec 10 14:01:59 2018 -0800 hwmon: (ad7314) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit 419eeabc0df6a13e03ed175b85d74d9c1b599d52 Author: Guenter Roeck Date: Mon Dec 10 14:01:58 2018 -0800 hwmon: (acpi_power_meter) Replace S_ with octal values Replace S_ with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit 4708e96831aa21df56aad1b65c74e265687042ea Author: Guenter Roeck Date: Mon Dec 10 14:01:58 2018 -0800 hwmon: (abx500) Use permission specific SENSOR[_DEVICE]_ATTR variants Use SENSOR[_DEVICE]_ATTR[_2]_{RO,RW,WO} to simplify the source code, to improve readbility, and to reduce the chance of inconsistencies. Also replace any remaining S_ in the driver with octal values. The conversion was done automatically with coccinelle. The semantic patches and the scripts used to generate this commit log are available at https://github.com/groeck/coccinelle-patches/hwmon/. This patch does not introduce functional changes. It was verified by compiling the old and new files and comparing text and data sizes. Signed-off-by: Guenter Roeck commit d93217d84c6c7ef74bfeb606a1fb1ee28720646b Author: Pu Wen Date: Sat Dec 8 14:33:28 2018 +0800 hwmon: (k10temp) Add Hygon Dhyana support Add support for Hygon Dhyana family 18h processor for k10temp to get the temperature. As Hygon Dhyana shares the same function interface with AMD family 17h, so add Hygon PCI Vendor ID and reuse the code path of AMD. Signed-off-by: Pu Wen Acked-by: Borislav Petkov Signed-off-by: Guenter Roeck commit d7f2a8f596ba2a8c7b7cc6d7a86f1e419def87b6 Author: Guenter Roeck Date: Thu Dec 6 11:07:32 2018 -0800 hwmon: (ltc4215) Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO} Conversion was done done using the coccinelle script at https://github.com/groeck/coccinelle-patches/raw/master/hwmon/sensor-devattr-w6.cocci Signed-off-by: Guenter Roeck commit 6a0f234fb42111545f071971b25e5f8462621a8a Author: Guenter Roeck Date: Thu Dec 6 11:06:23 2018 -0800 hwmon: (ina2xx) Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO} Conversion was done done using the coccinelle script at https://github.com/groeck/coccinelle-patches/raw/master/hwmon/sensor-devattr-w6.cocci Signed-off-by: Guenter Roeck commit e36917f486a85e81ed02490a476cde8179e6b14f Author: Guenter Roeck Date: Thu Dec 6 10:59:49 2018 -0800 hwmon: (tmp401) Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO} Conversion was done done using the coccinelle script at https://github.com/groeck/coccinelle-patches/raw/master/hwmon/sensor-devattr-w6.cocci Signed-off-by: Guenter Roeck commit 740c2f2b86a71ad673f329241ac25cfe647aacd4 Author: Guenter Roeck Date: Thu Dec 6 10:54:38 2018 -0800 hwmon: (max6697) Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO} Conversion was done done using the coccinelle script at https://github.com/groeck/coccinelle-patches/raw/master/hwmon/sensor-devattr-w6.cocci Signed-off-by: Guenter Roeck commit cb1d85341fd781ef166525cfd5e3b33c5c05f7c9 Author: Guenter Roeck Date: Thu Dec 6 10:48:56 2018 -0800 hwmon: (pwm-fan) Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO} Conversion was done done using the coccinelle script at https://github.com/groeck/coccinelle-patches/raw/master/hwmon/sensor-devattr-w6.cocci Signed-off-by: Guenter Roeck commit c4043410f73d76e07b85685366758e4e16ee0082 Author: Guenter Roeck Date: Thu Dec 6 10:47:37 2018 -0800 hwmon: (ntc_thermistor) Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO} Conversion was done done using the coccinelle script at https://github.com/groeck/coccinelle-patches/raw/master/hwmon/sensor-devattr-w6.cocci Signed-off-by: Guenter Roeck commit 4400711732fb1f9451d4f86319118148c3da670b Author: Guenter Roeck Date: Thu Dec 6 10:46:16 2018 -0800 hwmon: (max6650) Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO} Conversion was done done using the coccinelle script at https://github.com/groeck/coccinelle-patches/raw/master/hwmon/sensor-devattr-w6.cocci Signed-off-by: Guenter Roeck commit 3d628b29dbec70d7a0eda3d6bcf30198586666e2 Author: Guenter Roeck Date: Thu Dec 6 10:44:42 2018 -0800 hwmon: (ltc4260) Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO} Conversion was done done using the coccinelle script at https://github.com/groeck/coccinelle-patches/raw/master/hwmon/sensor-devattr-w6.cocci Signed-off-by: Guenter Roeck commit 4aabaf30976eac011b70aa7c0e1fb385331e22f2 Author: Guenter Roeck Date: Thu Dec 6 10:41:54 2018 -0800 hwmon: (nct7802) Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO} Auto-conversion was done done using the coccinelle script at https://github.com/groeck/coccinelle-patches/raw/master/hwmon/sensor-devattr-w6.cocci Signed-off-by: Guenter Roeck commit 33721d90c0444133219f9773cb6d88f380699fa4 Author: Guenter Roeck Date: Thu Dec 6 10:38:29 2018 -0800 hwmon: (lm95234) Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO} Auto-conversion was done done using the coccinelle script at https://github.com/groeck/coccinelle-patches/blob/master/hwmon/sensor-devattr-w6.cocci Signed-off-by: Guenter Roeck commit fac5ba6f5bf7fe9d2923ac4bbd85fa905f249633 Author: Guenter Roeck Date: Thu Dec 6 10:33:21 2018 -0800 hwmon: (k10temp) Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO} Auto-conversion was done done using the coccinelle script at https://github.com/groeck/coccinelle-patches/blob/master/hwmon/sensor-devattr-w6.cocci Signed-off-by: Guenter Roeck commit 5614e26d84a99a83f8b7092f1f68d3b04895506f Author: Guenter Roeck Date: Thu Dec 6 10:23:25 2018 -0800 hwmon: (ltc2945): Auto-convert to use SENSOR_DEVICE_ATTR_{RO, RW, WO} Conversion was done done using the coccinelle script at https://github.com/groeck/coccinelle-patches/raw/master/hwmon/sensor-devattr-w6.cocci Signed-off-by: Guenter Roeck commit a5c47c0d388b939dd578fd466aa804b7f2445390 Author: Guenter Roeck Date: Tue Dec 27 15:28:19 2016 -0800 hwmon: Introduce SENSOR_DEVICE_ATTR_{RO, RW, WO} and variants Introduce SENSOR_DEVICE_ATTR_{RO,RW,WO} and SENSOR_DEVICE_ATTR_2_{RO,RW,WO} as simplified variants of SENSOR_DEVICE_ATTR and SENSOR_DEVICE_ATTR_2 to simplify the source code, improve readbility, and reduce the chance of inconsistencies. Signed-off-by: Guenter Roeck commit 2e9a41bbc1079776dabe42ed8113b086b99ae56c Author: Jagan Teki Date: Thu Dec 6 02:44:22 2018 +0530 hwmon: (lm75) Add STLM75 support The STLM75 is a high-precision digital CMOS temperature sensor IC with a sigma-delta temperature-to-digital converter. The configuration register mapping is similar to existing lm75 but the sample rate is 150ms(max). Tested on real hardware and verified temperature readings are correct. Signed-off-by: Jagan Teki Signed-off-by: Guenter Roeck commit 48049e205e7071c733508e12b036c3845d0e84a9 Author: Thierry Reding Date: Fri Nov 23 13:08:46 2018 +0100 dt-bindings: hwmon: (lm90) Document ti,tmp451 compatible string The TI TMP451 temperature sensors are compatible with the National LM90 temperature sensors. Signed-off-by: Thierry Reding Signed-off-by: Guenter Roeck commit 737c086eddab6fae699ad7fc6963a91837b62b51 Author: Peter Rosin Date: Wed Nov 21 16:03:46 2018 +0000 hwmon: (ntc_thermistor) use a table to lookup the thermistor type Sort the entries while at it. Signed-off-by: Peter Rosin Signed-off-by: Guenter Roeck commit e056fe25d9f021d45c3fb6068d11e56e9579754b Author: Peter Rosin Date: Wed Nov 21 16:03:39 2018 +0000 hwmon: (ntc_thermistor) sort thermistor id lists alphabetically Use an enum to index the array, so that it is possible to add sorted entries without causing churn. Signed-off-by: Peter Rosin Signed-off-by: Guenter Roeck commit e8fda2c8646e504a732fbe7507c543279323c3d9 Author: Peter Rosin Date: Sat Nov 17 12:13:00 2018 +0000 hwmon: (ntc_thermistor): add support for B57891S0103 from Epcos More of the same... Signed-off-by: Peter Rosin Signed-off-by: Guenter Roeck commit e1fd3be613e9d00c4b04ba0e9de1a6233fceedf2 Author: Peter Rosin Date: Sat Nov 17 12:12:57 2018 +0000 dt-bindings: hwmon: (ntc_thermistor) add B57891S0103 thermistor from Epcos These are Negative Temperature Coefficient thermistors, like the others in the list. Signed-off-by: Peter Rosin Signed-off-by: Guenter Roeck commit 89688e8d1ecda59edc4e0ceb430aedaac18ca071 Author: Colin Ian King Date: Mon Nov 26 16:28:32 2018 +0000 hwmon: (ltc2978) Fix spelling mistake "comppatible" -> "compatible" There is a spelling mistake in the module description text, fix it. Signed-off-by: Colin Ian King Signed-off-by: Guenter Roeck commit 772df3c51e808bb6a71f8540c3c9a2b4ce4e2ead Author: Corentin Labbe Date: Thu Nov 29 20:09:15 2018 +0000 hwmon: Remove multiple space after dot This patch remove extra space after a dot. Signed-off-by: Corentin Labbe Signed-off-by: Guenter Roeck commit b71464c937f19f4e33d03c8379f03142d2381811 Author: Corentin Labbe Date: Thu Nov 29 20:09:14 2018 +0000 hwmon: fix typo build -> built This patch fix a typo where build is used instead of built. Signed-off-by: Corentin Labbe Signed-off-by: Guenter Roeck commit 162372b08879e970a4ca4b65e5acede6ebe7d1dc Author: Michele Sorcinelli Date: Fri Nov 30 18:42:56 2018 +0000 dell-smm-hwmon.c: Add XPS 9570 to supported devices list Allow the module to be loaded on Dell XPS 9570, without having to provide the "force=1" option. Signed-off-by: Michele Sorcinelli Reviewed-by: Pali Rohár Signed-off-by: Guenter Roeck commit 3f9ffa5c3a25bf2a3c880b07f620c8ef029dc261 Author: Vadim Pasternak Date: Tue Nov 20 23:16:36 2018 +0000 hwmon: (mlxreg-fan) Modify macros for tachometer fault status reading Modify macros for tachometer fault status reading for making it more simple and clear. Signed-off-by: Vadim Pasternak Signed-off-by: Guenter Roeck commit 9a629d7ada78c32e2100eb5ca6a25c6248d90bd9 Author: Nicolin Chen Date: Mon Nov 19 12:31:16 2018 -0800 Documentation: hwmon: Add descriptions for ina2xx sysfs entries There are a few sysfs entries being exposed to user space by the ina2xx hwmon driver while not getting explicitly documented. So this patch just adds a description section for them. Signed-off-by: Nicolin Chen Signed-off-by: Guenter Roeck commit 1b1f4efab0e4c8a75b772369682ff423d2df59f3 Author: Rob Herring Date: Fri Nov 16 16:05:38 2018 -0600 hwmon: (ina3221) Convert to using %pOFn instead of device_node.name In preparation to remove the node name pointer from struct device_node, convert printf users to use the %pOFn format specifier. Cc: Jean Delvare Cc: Guenter Roeck Signed-off-by: Rob Herring Signed-off-by: Guenter Roeck commit 25bbdccfcd8c07c44feb74700f556546ef340f0f Author: Heiko Stuebner Date: Wed Nov 7 16:47:08 2018 +0100 dt-bindings: hwmon: tmp108: add optional interrupts and #thermal-sensor-cells The tmp108 does have an alert output that can be used as interrupt source and can of course also be used as part of a thermal sensor setup for things like thermal-based cpu frequencies, so document the necessary properties. Signed-off-by: Heiko Stuebner Reviewed-by: Rob Herring Signed-off-by: Guenter Roeck commit b6611bcd5144e61a9cc21ee55c74aff688dff3f0 Author: Nicolin Chen Date: Mon Nov 12 20:36:56 2018 -0800 hwmon (lm63) Do not overwrite data->kind According to the code right before the removed line, data->kind should be either from DT or from id pointer. So there shouldn't be an additional overwriting after the if-else statement. So this patch just removes the overwriting line. Signed-off-by: Nicolin Chen Signed-off-by: Guenter Roeck commit 323aeb0eb5d9a6820130dfab1214a83edf385dcd Author: Nicolin Chen Date: Mon Nov 5 12:48:43 2018 -0800 hwmon: (ina3221) Add PM runtime support If all three channels are disabled via in[123]_enable ABI, the driver could suspend the chip for power saving purpose. So this patch adds the PM runtime support in order to gain more power control than system suspend and resume use case. For PM runtime, there are a few related changes happening: 1) Added a new pm_dev device pointer for all the PM runtime callbacks. This is because hwmon core registers a child device for each hwmon driver and passes it back to each driver. So there might be a mismatch between two device pointers in the driver if mixing using them. 2) Added a check in ina3221_is_enabled() to make sure that the chip is resumed. 3) Bypassed the unchanged status in ina3221_write_enable() in order to keep the PM runtime refcount being matched. 4) Removed the reset routine in the probe() by calling the resume() via pm_runtime_get_sync() instead, as they're similar. It's also necessary to do so to match initial PM refcount with the number of enabled channels. Signed-off-by: Nicolin Chen Signed-off-by: Guenter Roeck commit 4c0415a371fdbac6531d435a50745255e32d0e0e Author: Nicolin Chen Date: Mon Nov 5 12:48:42 2018 -0800 hwmon: (ina3221) Make sure data is ready before reading The data might need some time to get ready after channel enabling, although the data register is always readable. The CVRF bit is to indicate that data conversion is finished, so polling the CVRF bit before data reading could ensure the result being valid. An alternative way could be to wait for expected time between the channel enabling and the data reading. And this could avoid extra I2C communications. However, INA3221 seemly takes longer time than what's stated in the datasheet. Test results show that sometimes it couldn't finish data conversion in time. So this patch plays safe by adding a CVRF polling to make sure the data register is updated with the new data. Signed-off-by: Nicolin Chen Signed-off-by: Guenter Roeck commit 87625b24986bc2aeea20cf8a795b01a799a471b0 Author: Nicolin Chen Date: Mon Nov 5 12:48:41 2018 -0800 hwmon: (ina3221) Serialize sysfs ABI accesses This change adds a mutex to serialize accesses of sysfs attributes. This is required when polling CVRF bit of the MASK/ENABLE register because this bit is cleared on a read of this MASK/ENABLE register or a write to CONFIG register, which means that this bit might be accidentally cleared by reading other fields like alert flags. So this patch adds a mutex lock to protect the write() and read() callbacks. The read_string() callback won't need the lock since it just returns the label without touching any hardware register. Signed-off-by: Nicolin Chen Signed-off-by: Guenter Roeck commit efb0489ea8fa12c6a5b51c0b3e35f4f3d5d54939 Author: Nicolin Chen Date: Mon Nov 5 12:48:40 2018 -0800 hwmon: (ina3221) Check channel status for alarms attribute read There is nothing critically wrong to read these two attributes without having a is_enabled() check at this point. But reading the MASK_ENABLE register would clear the CVRF bit according to the datasheet. So it'd be safer to fence for disabled channels in order to add pm runtime feature. Signed-off-by: Nicolin Chen Signed-off-by: Guenter Roeck commit df04ced684d48f6ec5729ccd034702952160c6b3 Author: Eddie James Date: Thu Nov 8 15:05:29 2018 -0600 hwmon (occ): Add sysfs attributes for additional OCC data The OCC provides a variety of additional information about the state of the host processor, such as throttling, error conditions, and the number of OCCs detected in the system. This information is essential to service processor applications such as fan control and host management. Therefore, export this data in the form of sysfs attributes attached to the platform device (to which the hwmon device is also attached). Signed-off-by: Eddie James Signed-off-by: Guenter Roeck commit 54076cb3b5ff21f6474f5fd254a0b018b24771df Author: Eddie James Date: Thu Nov 8 15:05:28 2018 -0600 hwmon (occ): Add sensor attributes and register hwmon device Setup the sensor attributes for every OCC sensor found by the first poll response. Register the attributes with hwmon. Signed-off-by: Eddie James Signed-off-by: Guenter Roeck commit c10e753d43ebd1d17e1c62bcee20c6124c2c7cca Author: Eddie James Date: Thu Nov 8 15:05:27 2018 -0600 hwmon (occ): Add sensor types and versions Add structures to define all sensor types and versions. Add sysfs show and store functions for each sensor type. Add a method to construct the "set user power cap" command and send it to the OCC. Add rate limit to polling the OCC (in case user-space reads our hwmon entries rapidly). Signed-off-by: Eddie James Signed-off-by: Guenter Roeck commit aa195fe49b033db545ad986cdb2c431c37bea557 Author: Eddie James Date: Thu Nov 8 15:05:26 2018 -0600 hwmon (occ): Parse OCC poll response Add method to parse the response from the OCC poll command. This only needs to be done during probe(), since the OCC shouldn't change the number or format of sensors while it's running. The parsed response allows quick access to sensor data, as well as information on the number and version of sensors, which we need to instantiate hwmon attributes. Signed-off-by: Eddie James Signed-off-by: Guenter Roeck commit 88be37c07c1524102aed5736094cfacf24407b46 Author: Eddie James Date: Thu Nov 8 15:05:25 2018 -0600 hwmon (occ): Add command transport method for P8 and P9 For the P8 OCC, add the procedure to send a command to the OCC over I2C bus. This involves writing the OCC command registers with serial communication operations (SCOMs) interpreted by the I2C slave. For the P9 OCC, add a procedure to use the OCC in-kernel API to send a command to the OCC through the SBE. Signed-off-by: Eddie James Signed-off-by: Guenter Roeck commit 5b5513b8800291226a8fa63fd22a14cc235b313e Author: Eddie James Date: Thu Nov 8 15:05:24 2018 -0600 hwmon: Add On-Chip Controller (OCC) hwmon driver The OCC is a device embedded on a POWER processor that collects and aggregates sensor data from the processor and system. The OCC can provide the raw sensor data as well as perform thermal and power management on the system. This driver provides a hwmon interface to the OCC from a service processor (e.g. a BMC). The driver supports both POWER8 and POWER9 OCCs. Communications with the POWER8 OCC are established over standard I2C bus. The driver communicates with the POWER9 OCC through the FSI-based OCC driver, which handles the lower-level communication details. This patch lays out the structure of the OCC hwmon driver. There are two platform drivers, one each for P8 and P9 OCCs. These are probed through the I2C tree and the FSI-based OCC driver, respectively. The patch also defines the first common structures and methods between the two OCC versions. Signed-off-by: Eddie James [groeck: Fix up SPDX license identifier] Signed-off-by: Guenter Roeck commit 0634d694b06fb522ec6bc8001b24c4b828897f69 Merge: 5312b93b04208 31d31951d00a3 Author: David S. Miller Date: Sun Dec 16 14:42:35 2018 -0800 Merge branch 'rtnl-fdb-get' Roopa Prabhu says: ==================== rtnl fdb get This series adds support for rtnl fdb get similar to route get. v2: add nda_policy, fixes to exact msgs, strict nlmsg parsing v3: remove unnecessary attribute length checks + simplify code as pointed out by david ==================== Signed-off-by: David S. Miller commit 31d31951d00a3ec6335dad36cd49a4767e2bb304 Author: Roopa Prabhu Date: Sat Dec 15 22:35:11 2018 -0800 selftests: net: rtnetlink.sh: add fdb get test tests the below three cases of bridge fdb get: [bridge, mac, vlan] [bridge_port, mac, vlan, flags=[NTF_MASTER]] [vxlandev, mac, flags=NTF_SELF] depends on iproute2 support for bridge fdb get. Signed-off-by: Roopa Prabhu Signed-off-by: David S. Miller commit 474c3c896ff29fbd69b13d99f2f66dd6da3b6634 Author: Roopa Prabhu Date: Sat Dec 15 22:35:10 2018 -0800 vxlan: support for ndo_fdb_get This patch implements ndo_fdb_get for a vxlan device. Signed-off-by: Roopa Prabhu Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 4767456212f8cd70775dc55d9bc72e184ff84642 Author: Roopa Prabhu Date: Sat Dec 15 22:35:09 2018 -0800 bridge: support for ndo_fdb_get This patch implements ndo_fdb_get for the bridge fdb. Signed-off-by: Roopa Prabhu Acked-by: Nikolay Aleksandrov Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 5b2f94b27622d5b92d1cebf4bb5a627db4444607 Author: Roopa Prabhu Date: Sat Dec 15 22:35:08 2018 -0800 net: rtnetlink: support for fdb get This patch adds support for fdb get similar to route get. arguments can be any of the following (similar to fdb add/del/dump): [bridge, mac, vlan] or [bridge_port, mac, vlan, flags=[NTF_MASTER]] or [dev, mac, [vni|vlan], flags=[NTF_SELF]] Signed-off-by: Roopa Prabhu Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 5312b93b04208bb055a2ee1fd6c8617905d8b330 Merge: 036b9e7caeb09 8a75b9d4c9d32 Author: David S. Miller Date: Sun Dec 16 14:23:33 2018 -0800 Merge branch 'dsa-tag-cleanups' Marek Vasut says: ==================== net: dsa: ksz: Clean up the tag code in prep for more switches Clean up the KSZ DSA tag code in preparation for adding more switches. ==================== Signed-off-by: David S. Miller commit 8a75b9d4c9d32c88b487bd98bf8019f029215165 Author: Marek Vasut Date: Sat Dec 15 01:58:06 2018 +0100 net: dsa: ksz: Add STP multicast handling In case the destination address is link local, add override bit into the switch tag to let such a packet through the switch even if the port is blocked. Signed-off-by: Marek Vasut Cc: Tristram Ha Cc: Vivien Didelot Cc: Woojung Huh Cc: David S. Miller Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit bafe9ba7d908f6240b3ca898b167072c55502609 Author: Tristram Ha Date: Sat Dec 15 01:58:05 2018 +0100 net: dsa: ksz: Factor out common tag code Factor out common code from the tag_ksz , so that the code can be used with other KSZ family switches which use differenly sized tags. Signed-off-by: Tristram Ha Signed-off-by: Marek Vasut Cc: Vivien Didelot Cc: Woojung Huh Cc: David S. Miller Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 39d6b96f9fc2d99c4619954f462ba32e5d48502e Author: Tristram Ha Date: Sat Dec 15 01:58:04 2018 +0100 net: dsa: ksz: Rename NET_DSA_TAG_KSZ to _KSZ9477 Rename the tag Kconfig option and related macros in preparation for addition of new KSZ family switches with different tag formats. Signed-off-by: Tristram Ha Signed-off-by: Marek Vasut Cc: Vivien Didelot Cc: Woojung Huh Cc: David S. Miller Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 036b9e7caeb09598afb297a6d4fb36b477a4f6b2 Author: Jakub Kicinski Date: Fri Dec 14 15:01:54 2018 -0800 nfp: abm: allow to opt-out of RED offload FW team asks to be able to not support RED even if NIC is capable of buffering for testing and experimentation. Add an opt-out flag. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: David S. Miller commit 9c46ae0ea1ee84012737c3da3af2930b494d56f7 Author: David S. Miller Date: Sun Dec 16 12:36:41 2018 -0800 Revert "net: dccp: initialize (addr,port) listening hashtable" This reverts commit ec49d83f245453515a9b6e88324e27bbcb69fbae. Cause build failures when DCCP is modular. ERROR: "inet_hashinfo2_init" [net/dccp/dccp.ko] undefined! Signed-off-by: David S. Miller commit df9b0e30d44c901ac27c0f38cd54511b3f130c6d Author: David Ahern Date: Sat Dec 15 14:09:06 2018 -0800 neighbor: Add protocol attribute Similar to routes and rules, add protocol attribute to neighbor entries for easier tracking of how each was created. Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 11fb60d1089f52dd9003d02cf2590c9b56eda840 Author: Peter Oskolkov Date: Sat Dec 15 14:27:24 2018 -0800 selftests: net: reuseport_addr_any: add DCCP This patch adds coverage of DCCP to reuseport_addr_any selftest. Signed-off-by: Peter Oskolkov Signed-off-by: David S. Miller commit ec49d83f245453515a9b6e88324e27bbcb69fbae Author: Peter Oskolkov Date: Sat Dec 15 14:27:23 2018 -0800 net: dccp: initialize (addr,port) listening hashtable Commit d9fbc7f6431f "net: tcp: prefer listeners bound to an address" removes port-only listener lookups. This caused segfaults in DCCP lookups because DCCP did not initialize the (addr,port) hashtable. This patch adds said initialization. The only non-trivial issue here is the size of the new hashtable. It seemed reasonable to make it match the size of the port-only hashtable (= INET_LHTABLE_SIZE) that was used previously. Other parameters to inet_hashinfo2_init() match those used in TCP. Tested: syzcaller issues fixed; the second patch in the patchset tests that DCCP lookups work correctly. Fixes: d9fbc7f6431f "net: tcp: prefer listeners bound to an address" Reported-by: syzcaller Signed-off-by: Peter Oskolkov Signed-off-by: David S. Miller commit 38a3499f6d0cb15bd673e517b0656807e22bfd24 Author: Chengguang Xu Date: Sun Dec 16 17:35:00 2018 +0800 block: loop: check error using IS_ERR instead of IS_ERR_OR_NULL in loop_add() blk_mq_init_queue() will not return NULL pointer to its caller, so it's better to replace IS_ERR_OR_NULL using IS_ERR in loop_add(). If in the future things change to check NULL pointer inside loop_add(), we should return -ENOMEM as return code instead of PTR_ERR(NULL). Signed-off-by: Chengguang Xu Signed-off-by: Jens Axboe commit e7cc005fef03d2b13246d800e497418d570ad6da Author: Chengguang Xu Date: Sun Dec 16 14:08:18 2018 +0800 aoe: add __exit annotation Add __exit annotation to cleanup helper which is only called once in the module. Signed-off-by: Chengguang Xu Signed-off-by: Jens Axboe commit d04c406f29d9f4dbcb5eb5aa79ce0445c7e9d652 Author: Christoph Hellwig Date: Fri Dec 14 17:21:22 2018 +0100 block: clear REQ_HIPRI if polling is not supported This prevents a HIPRI bio from being submitted through a stacking driver that does not support polling and thus won't poll for I/O completion. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit d6a51a97c0b2e21fec224746c2683ff739bcf4ae Author: Jianchao Wang Date: Fri Dec 14 09:28:20 2018 +0800 blk-mq: replace and kill blk_mq_request_issue_directly Replace blk_mq_request_issue_directly with blk_mq_try_issue_directly in blk_insert_cloned_request and kill it as nobody uses it any more. Signed-off-by: Jianchao Wang Signed-off-by: Jens Axboe commit 5b7a6f128aad761b471ca0ff620b4841b38e596f Author: Jianchao Wang Date: Fri Dec 14 09:28:19 2018 +0800 blk-mq: issue directly with bypass 'false' in blk_mq_sched_insert_requests It is not necessary to issue request directly with bypass 'true' in blk_mq_sched_insert_requests and handle the non-issued requests itself. Just set bypass to 'false' and let blk_mq_try_issue_directly handle them totally. Remove the blk_rq_can_direct_dispatch check, because blk_mq_try_issue_directly can handle it well.If request is direct-issued unsuccessfully, insert the reset. Signed-off-by: Jianchao Wang Signed-off-by: Jens Axboe commit 7f556a44e61d0b62d78db9a2662a5f0daef010f2 Author: Jianchao Wang Date: Fri Dec 14 09:28:18 2018 +0800 blk-mq: refactor the code of issue request directly Merge blk_mq_try_issue_directly and __blk_mq_try_issue_directly into one interface to unify the interfaces to issue requests directly. The merged interface takes over the requests totally, it could insert, end or do nothing based on the return value of .queue_rq and 'bypass' parameter. Then caller needn't any other handling any more and then code could be cleaned up. And also the commit c616cbee ( blk-mq: punt failed direct issue to dispatch list ) always inserts requests to hctx dispatch list whenever get a BLK_STS_RESOURCE or BLK_STS_DEV_RESOURCE, this is overkill and will harm the merging. We just need to do that for the requests that has been through .queue_rq. This patch also could fix this. Signed-off-by: Jianchao Wang Signed-off-by: Jens Axboe commit 4c9770c90fc5b6d6b6d190d108c061015f5804f7 Author: Christoph Hellwig Date: Thu Dec 13 21:32:14 2018 +0100 block: remove the bio_integrity_advance export Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 61a0902a06d602377cb6526deacfe4f0a7eade73 Author: Masahiro Yamada Date: Fri Dec 14 17:05:39 2018 +0900 kbuild: add -Werror=implicit-int flag unconditionally This flag is documented in the GCC 4.6 manual, and recognized by Clang as well. Let's rip off the cc-option switch. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit eeb5687a7139649e1724674441580b778f5ff7ab Author: Masahiro Yamada Date: Fri Dec 14 17:05:38 2018 +0900 kbuild: add -Werror=strict-prototypes flag unconditionally -Wstrict-prototypes is added to KBUILD_CFLAGS first, then overridden by -Werror=strict-prototypes later. Let's add -Werror=strict-prototypes unconditionally because it is supported by GCC 4.6, and also by Clang. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 42a92bccd213ce4b7198d2e943ac0efe88cbe1aa Author: Masahiro Yamada Date: Fri Dec 14 17:05:37 2018 +0900 kbuild: add -fno-PIE flag unconditionally This flag is documented in the GCC 4.6 manual, and recognized by Clang as well. Let's rip off the cc-option switch. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 518d8a5644197abd3d5efb23c71afff25194da7e Author: Julia Lawall Date: Wed Dec 12 12:55:57 2018 +0100 scripts: coccinelle: Correct warning message "Assignment" requires the assigned value before the place that value is stored into. Signed-off-by: Julia Lawall Signed-off-by: Masahiro Yamada commit b825b4325354db65fd632b26ba585ced85f33902 Author: Julia Lawall Date: Wed Dec 12 12:55:56 2018 +0100 scripts: coccinelle: only suggest true/false in files that already use them Some code may overall use 0 and 1, so don't introduce occasional uses of true and false in these cases. Signed-off-by: Julia Lawall Signed-off-by: Masahiro Yamada commit 1d467bb8a8b95caa01a240362589215739505233 Author: Masahiro Yamada Date: Tue Dec 11 21:01:56 2018 +0900 kbuild: handle part-of-module correctly for *.ll and *.symtypes The single targets *.ll and *.symtypes have never been treated as a module. Fix it. Signed-off-by: Masahiro Yamada commit 96c0a9180a1279c8ca5d9ea3096f2944828194d3 Author: Masahiro Yamada Date: Tue Dec 11 21:01:55 2018 +0900 kbuild: refactor part-of-module Use $(foreach ...) to make it shorter. Signed-off-by: Masahiro Yamada commit 45c4372d002bbf7342ea0426af896691ebc3a2f7 Author: Masahiro Yamada Date: Tue Dec 11 21:01:54 2018 +0900 kbuild: refactor quiet_modtag part-of-module and quiet_modtag are set for the same targets. Define quiet_modtag based on part-of-module. Signed-off-by: Masahiro Yamada commit b39a691617e4a7ba83bb33386e09206e60261a22 Author: Masahiro Yamada Date: Tue Dec 11 21:01:53 2018 +0900 kbuild: remove redundant quiet_modtag for $(obj-m) All objects in $(obj-m) are contained in $(real-obj-m) as well. It is true composite objects are only contained in $(obj-m), but [M] is hard-coded in quiet_cmd_link_multi-m. This line is redundant. Signed-off-by: Masahiro Yamada commit 74030653f0b9736f179c1c4e713ba1f2070aa0dd Author: Christoph Hellwig Date: Thu Dec 13 21:32:13 2018 +0100 block: remove the bioset_integrity_free export Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 7d0e5c2056c70ff443188b6e603b6254af1304cc Author: Masahiro Yamada Date: Wed Dec 5 20:28:04 2018 +0900 kbuild: refactor Makefile.asm-generic - Use conventional $(MAKE) $(asm-generic)= style for directory descending - Remove unneeded FORCE since "all" is a phony target - Remove unneeded "_dummy :=" assignment - Skip $(shell mkdir ...) when headers exist in the directory - Misc cleanups Signed-off-by: Masahiro Yamada Acked-by: Sam Ravnborg commit 40906ebe3af6a48457151b3c6726b480f6a6cb13 Author: Mantas Mikulėnas Date: Sun Dec 16 15:44:47 2018 +0200 ALSA: hda: add mute LED support for HP EliteBook 840 G4 Tested with 4.19.9. v2: Changed from CXT_FIXUP_MUTE_LED_GPIO to CXT_FIXUP_HP_DOCK because that's what the existing fixups for EliteBooks use. Signed-off-by: Mantas Mikulėnas Cc: Signed-off-by: Takashi Iwai commit 3bbc9abbfb8cc6d76b388699501eeda005850929 Author: Baruch Siach Date: Sun Dec 9 14:26:11 2018 +0000 arm64: dts: imx8mq-evk: enable watchdog The external nWDOG signal connects to the EVK board reset circuit. Tested on the i.MX8MQ EVK rev B3. Signed-off-by: Baruch Siach Signed-off-by: Lucas Stach Signed-off-by: Abel Vesa Signed-off-by: Shawn Guo commit d3a2d72bcf17b3f26d88454b4b34d1742e5b06ac Author: Baruch Siach Date: Sun Dec 9 14:26:10 2018 +0000 arm64: dts: imx8mq: add watchdog devices Signed-off-by: Baruch Siach Signed-off-by: Lucas Stach Signed-off-by: Abel Vesa Signed-off-by: Shawn Guo commit 915975757d982391848c538713d3c4963f3a9725 Author: Lucas Stach Date: Sun Dec 9 14:26:09 2018 +0000 MAINTAINERS: add i.MX8 DT path to i.MX architecture Shawn agreed to take patches for the i.MX8 parts through his tree. Signed-off-by: Lucas Stach Reviewed-by: Dong Aisheng Signed-off-by: Abel Vesa Signed-off-by: Shawn Guo commit 9079aca4aacd2c13cc0a8e3f7c9e9e2e9154ff08 Author: Lucas Stach Date: Sun Dec 9 14:26:08 2018 +0000 arm64: add support for i.MX8M EVK board This is the evaluation kit board for the i.MX8M. The current level of support yields a working console and is able to boot userspace from SD card or Network. Signed-off-by: Lucas Stach Reviewed-by: Fabio Estevam (v1) Reviewed-by: Rob Herring (v3) Tested-by: Tested-by: Baruch Siach (v1) Reviewed-by: Dong Aisheng Signed-off-by: Abel Vesa Signed-off-by: Shawn Guo commit 748f908cc882021df5a917baf19ef7363eaa5776 Author: Lucas Stach Date: Sun Dec 9 14:26:07 2018 +0000 arm64: add basic DTS for i.MX8MQ This adds the basic DTS for the i.MX8MQ. For now only the following peripherals are supported: - IOMUXC (pin controller) - CCM (clock controller) - GPIO - UART - uSDHC (SD/eMMC controller) - FEC (ethernet controller) - i2c This is enough to get a very basic board support up and running. One known limitation is that the driver for the GPC interrupt controller is still missing, rendering the CPU sleep states unusable as there is nothing waking them up anymore. Signed-off-by: Lucas Stach Reviewed-by: Dong Aisheng Signed-off-by: Abel Vesa Reviewed-by: Rob Herring Signed-off-by: Shawn Guo commit 930507c1830498e00ede089890f188de4a108cc7 Author: Lucas Stach Date: Sun Dec 9 14:26:06 2018 +0000 arm64: add basic Kconfig symbols for i.MX8 Add basic Kconfig symbols to make the MXC architecture available in the ARM64 world. Signed-off-by: Lucas Stach Reviewed-by: Fabio Estevam Signed-off-by: Abel Vesa Signed-off-by: Shawn Guo commit 35a38903b9a579f5c6305b4424fdd715aec75eef Merge: 58f5fa6837250 1cf3817bf1f52 Author: Shawn Guo Date: Sun Dec 16 17:27:56 2018 +0800 Merge commit '1cf3817bf1f52e57b3f5eb0413ee0d7f0c2e9829' into imx8mq/dt commit 6d1ef1bbfed5f903aaab743a08bde41cc372d646 Author: Takashi Sakamoto Date: Sun Dec 16 17:32:33 2018 +0900 ALSA: fireface: code refactoring to handle model-specific registers As a result of investigation for Fireface 800, 'struct snd_ff_spec.regs' is just for higher address to receive tx asynchronous packets of MIDI messages, thus it can be simplified. This commit simplifies it. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit fc716397a5c7a20247a39c9347fb7a543e0ae4ad Author: Takashi Sakamoto Date: Sun Dec 16 17:32:32 2018 +0900 ALSA: fireface: add support for packet streaming on Fireface 800 This commit adds a functionality to multiplex PCM frames into isochronous packets and demultiplex PCM frames from isochronous packets for ALSA PCM applications. Fireface 800 voluntarily maintains resources for tx isochronous communication. It performs reservation of isochronous channel and allocation/update of bandwidth in some cases below: - at a first request to allocation after bus resets - at requests to allocation when further bandwidth is required When request is grant and the unit is prepared, read data from 0x0000801c0008 represents isochronous channel for tx stream, then the unit can handle requests to start communication. If driver send the request without checking the register, the unit takes panic to continue bus resets. The unit starts transmission of tx packets after receiving several rx packets from driver. I note that the unit can process tx/rx packets and generate/record sound regardless of HOST LED. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 365c00d0b91bb347945982845c9af1b7c0f2bdce Author: Takashi Sakamoto Date: Sun Dec 16 17:32:31 2018 +0900 ALSA: fireface: allocate isochronous resources in mode-specific implementation The way to maintain isochronous resources on bus is different between Fireface 400/800. This commit is a preparation. This commit moves a function to allocate resource to model-dependent implementation. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 76ea46887729d0765b1fd39291a69c2c6781ada0 Author: Takashi Sakamoto Date: Sun Dec 16 17:32:30 2018 +0900 ALSA: fireface: code refactoring to handle multiplier mode Fireface 400/800 use three modes against the number of data channels in data block for both tx/rx packets. This commit adds refactoring for it. Some enumerators are added to represent each of mode and a function is added to calculate the mode from sampling frequency code (sfc). Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit d4a0b6cbf26ce7c22bcb070595957590736fec85 Author: Takashi Sakamoto Date: Sun Dec 16 17:32:29 2018 +0900 ALSA: fireface: share helper function to switch fetching mode Both of Fireface 400/800 have the same register to switch frame fetching mode regardless of difference of available number of PCM frames in rx isochronous packet. This commit moves a helper function from model-dependent implementation. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 3d16200a3e55a39caa1c88419cb559c00316f721 Author: Takashi Sakamoto Date: Sat Dec 15 19:06:48 2018 +0900 ALSA: fireface: fix for state to fetch PCM frames According to my memo at hand and saved records, writing 0x00000001 to SND_FF_REG_FETCH_PCM_FRAMES disables fetching PCM frames in corresponding channel, however current implement uses reversed logic. This results in muted volume in device side during playback. This commit corrects the bug. Cc: # v4.12+ Fixes: 76fdb3a9e13a ('ALSA: fireface: add support for Fireface 400') Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 5ef108c53e6efd695e32aad969638ccbc35b4be9 Author: Takashi Sakamoto Date: Sat Dec 15 19:03:21 2018 +0900 ALSA: firewire-lib: use the same print format for 'without_header' tracepoints An initial commit to add tracepoints for packets without CIP headers uses different print formats for added tracepoints. However this is not convenient for users/developers to prepare debug tools. This commit uses the same format for the two tracepoints. Cc: # v4.12+ Fixes: b164d2fd6e49 ('ALSA: firewire_lib: add tracepoints for packets without CIP headers') Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit aa9a9e39b4f65733bf19d90cbd026e85a74efb99 Author: Takashi Sakamoto Date: Sat Dec 15 19:03:20 2018 +0900 ALSA: firewire-lib: fix wrong assignment for 'out_packet_without_header' tracepoint An initial commit to add tracepoints for packets without CIP headers introduces a wrong assignment to 'data_blocks' value of 'out_packet_without_header' tracepoint. This commit fixes the bug. Cc: # v4.12+ Fixes: b164d2fd6e49 ('ALSA: firewire_lib: add tracepoints for packets without CIP headers') Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit ada79fa5a0b374dd2c2262137c734da7524a8263 Author: Takashi Sakamoto Date: Sat Dec 15 19:03:19 2018 +0900 ALSA: firewire-lib: fix wrong handling payload_length as payload_quadlet In IEC 61883-1/6 engine of ALSA firewire stack, a packet handler has a second argument for 'the number of bytes in payload of isochronous packet'. However, an incoming packet handler without CIP header uses the value as 'the number of quadlets in the payload'. This brings userspace applications to receive the number of PCM frames as four times against real time. This commit fixes the bug. Cc: # v4.12+ Fixes: 3b196c394dd ('ALSA: firewire-lib: add no-header packet processing') Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 30648e9f864774388d261f42e79955362f4739e7 Author: Frieder Schrempf Date: Mon Dec 10 16:28:49 2018 +0000 arm64: dts: Add spi-[tx/rx]-bus-width for the FSL QSPI controller We will move the FSL QSPI driver to the SPI framework soon. To prepare and to make sure the full buswidth is used (as it is with the current driver), let's add the right properties. Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit a0578d2419e1833b3014c6ef63ba8139549d875b Author: Frieder Schrempf Date: Mon Dec 10 16:28:48 2018 +0000 arm64: dts: Remove unused properties from FSL QSPI driver nodes The properties 'num-cs' and 'bus-num' were never read by the driver and can be removed. Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit 4f15a4e0d21b9b171aaa78efde2fd60f44f2e62c Author: Frieder Schrempf Date: Mon Dec 10 16:28:50 2018 +0000 ARM: dts: Add spi-[tx/rx]-bus-width for the FSL QSPI controller We will move the FSL QSPI driver to the SPI framework soon. To prepare and to make sure the full buswidth is used (as it is with the current driver), let's add the right properties. Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit 00b79b07cb2aab508e00d4a80ba2525e34b8b9c6 Author: Frieder Schrempf Date: Mon Dec 10 16:28:49 2018 +0000 ARM: dts: imx6sx-sdb: Fix the reg properties for the FSL QSPI nodes The current driver does not use the reg properties, but we will add a new driver soon. To make sure we have a consistent scheme, let's fix the reg properties here. Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit 63f2d2a34011e8326c18d691b7c6261624e39667 Author: Frieder Schrempf Date: Mon Dec 10 16:28:48 2018 +0000 ARM: dts: Remove unused properties from FSL QSPI driver nodes The properties 'bus-num', 'fsl,spi-num-chipselects' and 'fsl,spi-flash-chipselects' were never read by the driver and can be removed. Signed-off-by: Frieder Schrempf Signed-off-by: Shawn Guo commit 744284fa15a1acc8601ddc0a349678e033100925 Merge: 79da07dec740a 58f5fa6837250 Author: Shawn Guo Date: Sun Dec 16 16:20:47 2018 +0800 Merge tag 'imx-dt64-4.21' into imx/qspi-dt Freescale arm64 device tree update for 4.21: - Add device tree for LS1028A SoC and NXP FRWY & QDS boards support based on this SoC. - Add device tree for LX2160A SoC and NXP QDS & RDB boards support based on this SoC. - Add qdma devices for LS1043A and LS1046A SoC. - Disable PCIe device by default in SoC device tree and let board level device tree to enable as needed. - Drop compatible string "snps,dw-pcie" from LayerScape PCIe devices to avoid incorrect matching. - Move fsl-mc device as a child node of soc node, and add missing dma-ranges property for LS1088A SoC. - Update LayerScape SoCs' cooling maps to include all devices affected by individual trip points. commit c151acc6e9ffa08972aa20d8bc07a66081922c1e Author: Sam Protsenko Date: Fri Dec 14 19:59:21 2018 +0200 l2tp: Add protocol field decompression When Protocol Field Compression (PFC) is enabled, the "Protocol" field in PPP packet will be received without leading 0x00. See section 6.5 in RFC 1661 for details. So let's decompress protocol field if needed, the same way it's done in drivers/net/ppp/pptp.c. In case when "nopcomp" pppd option is not enabled, PFC (pcomp) can be negotiated during LCP handshake, and L2TP driver in kernel will receive PPP packets with compressed Protocol field, which in turn leads to next error: Protocol Rejected (unsupported protocol 0x2145) because instead of Protocol=0x0021 in PPP packet there will be Protocol=0x21. This patch unwraps it back to 0x0021, which fixes the issue. Sending the compressed Protocol field will be implemented in subsequent patch, this one is self-sufficient. Signed-off-by: Sam Protsenko Signed-off-by: David S. Miller commit 7f07675c117aac08c403ee02d4a865f76a0ce55a Author: Nathan Chancellor Date: Mon Dec 10 17:05:06 2018 -0700 pinctrl: aspeed: Wrap -Woverride-init with cc-option Clang does not support this option: warning: unknown warning option '-Woverride-init'; did you mean '-Woverride-module'? [-Wunknown-warning-option] 1 warning generated. Signed-off-by: Nathan Chancellor Acked-by: Andrew Jeffery Acked-by: Joel Stanley Signed-off-by: Linus Walleij commit 63de273f34b5eeb5ead8440f20516fae9b7b1165 Merge: bedf3b332034c 9582466640432 Author: David S. Miller Date: Sat Dec 15 13:29:56 2018 -0800 Merge tag 'mlx5e-updates-2018-12-14' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5e-updates-2018-12-14 (VF Lag) From Aviv Heller, Subsequent patches introduce VF LAG, which provdies load-balancing and high-availability capabilities for VFs associated with different physical ports of the same Connect-X card. This series consists of the following: - mlx5 devcom, driver infrastructure that facilitates operations that involve both core devices (physical functions) of the same card, to synchronize and communicate between two driver instances of the same card. - Infrastructure for TC rule duplication. - Changes to LAG logic to enable its use when SR-IOV is enabled - PFs in switchdev mode is the only mode currently supported. ==================== Signed-off-by: David S. Miller commit bedf3b332034c82af4f15ff6afa90ec5aa7cfc84 Merge: 35e07d2347397 4f24ed77dec9b Author: David S. Miller Date: Sat Dec 15 13:23:03 2018 -0800 Merge branch 'net-mitigate-retpoline-overhead' Paolo Abeni says: ==================== net: mitigate retpoline overhead The spectre v2 counter-measures, aka retpolines, are a source of measurable overhead[1]. We can partially address that when the function pointer refers to a builtin symbol resorting to a list of tests vs well-known builtin function and direct calls. Experimental results show that replacing a single indirect call via retpoline with several branches and a direct call gives performance gains even when multiple branches are added - 5 or more, as reported in [2]. This may lead to some uglification around the indirect calls. In netconf 2018 Eric Dumazet described a technique to hide the most relevant part of the needed boilerplate with some macro help. This series is a [re-]implementation of such idea, exposing the introduced helpers in a new header file. They are later leveraged to avoid the indirect call overhead in the GRO path, when possible. Overall this gives > 10% performance improvement for UDP GRO benchmark and smaller but measurable for TCP syn flood. The added infra can be used in follow-up patches to cope with retpoline overhead in other points of the networking stack (e.g. at the qdisc layer) and possibly even in other subsystems. v2 -> v3: - fix build error with CONFIG_IPV6=m v1 -> v2: - list explicitly the builtin function names in INDIRECT_CALL_*(), as suggested by Ed Cree - expand the recipients list rfc -> v1: - use branch prediction hints, as suggested by Eric [1] http://vger.kernel.org/netconf2018_files/PaoloAbeni_netconf2018.pdf [2] https://linuxplumbersconf.org/event/2/contributions/99/attachments/98/117/lpc18_paper_af_xdp_perf-v2.pdf ==================== Signed-off-by: David S. Miller commit 4f24ed77dec9b067d08f7958a287cbf48665f35e Author: Paolo Abeni Date: Fri Dec 14 11:52:00 2018 +0100 udp: use indirect call wrappers for GRO socket lookup This avoids another indirect call for UDP GRO. Again, the test for the IPv6 variant is performed first. v1 -> v2: - adapted to INDIRECT_CALL_ changes Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 028e0a4766844e7eeb31b93479ea6dd40cfc2895 Author: Paolo Abeni Date: Fri Dec 14 11:51:59 2018 +0100 net: use indirect call wrappers at GRO transport layer This avoids an indirect call in the receive path for TCP and UDP packets. TCP takes precedence on UDP, so that we have a single additional conditional in the common case. When IPV6 is build as module, all gro symbols except UDPv6 are builtin, while the latter belong to the ipv6 module, so we need some special care. v1 -> v2: - adapted to INDIRECT_CALL_ changes v2 -> v3: - fix build issue with CONFIG_IPV6=m Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit aaa5d90b395a72faff797b00d815165ee0e664c0 Author: Paolo Abeni Date: Fri Dec 14 11:51:58 2018 +0100 net: use indirect call wrappers at GRO network layer This avoids an indirect calls for L3 GRO receive path, both for ipv4 and ipv6, if the latter is not compiled as a module. Note that when IPv6 is compiled as builtin, it will be checked first, so we have a single additional compare for the more common path. v1 -> v2: - adapted to INDIRECT_CALL_ changes Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 283c16a2dfd332bf5610c874f7b9f9c8b601ce53 Author: Paolo Abeni Date: Fri Dec 14 11:51:57 2018 +0100 indirect call wrappers: helpers to speed-up indirect calls of builtin This header define a bunch of helpers that allow avoiding the retpoline overhead when calling builtin functions via function pointers. It boils down to explicitly comparing the function pointers to known builtin functions and eventually invoke directly the latter. The macros defined here implement the boilerplate for the above schema and will be used by the next patches. rfc -> v1: - use branch prediction hint, as suggested by Eric v1 -> v2: - list explicitly the builtin function names in INDIRECT_CALL_*(), as suggested by Ed Cree Suggested-by: Eric Dumazet Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller commit 35e07d23473972b8876f98bcfc631ebcf779e870 Author: Ilias Apalodimas Date: Fri Dec 14 10:59:01 2018 +0200 net: socionext: remove mmio reads on Tx Currently the driver issues 2 mmio reads to figure out the number of transmitted packets and clean them. We can get rid of the expensive reads since BIT 31 of the Tx descriptor can be used for that. We can also remove the budget counting of Tx completions since all of the descriptors are not deliberately processed. Performance numbers using pktgen are: size pre-patch(pps) post-patch(pps) 64 362483 427916 128 358315 411686 256 352725 389683 512 215675 216464 1024 113812 114442 Signed-off-by: Ilias Apalodimas Signed-off-by: David S. Miller commit 17a12eaaf09a2fa3ea6997e3b5be8bc05fc60ee4 Author: Ilias Apalodimas Date: Fri Dec 14 10:59:00 2018 +0200 net: socionext: correctly recover txq after being full Running pktgen with packets sizes > 512b ends up in the interface Txq getting stuck. "netsec 522d0000.ethernet eth0: netsec_netdev_start_xmit: TxQFull!" appears on dmesg but the interface never recovers. It requires an ifconfig down/up to make the interface usable again. The reason that triggers this, is a race condition between .ndo_start_xmit and the napi completion. The available budget is calculated first and indicates the queue is full. Due to a costly netif_err() the queue is not stopped in time while the napi completion runs, clears the irq and frees up descriptors, thus the queue never wakes up again. Fix this by moving the print after stopping the queue, make the print ratelimited, add barriers and check for cleaned descriptors.. Signed-off-by: Ilias Apalodimas Signed-off-by: David S. Miller commit 1811caa0cf91320baff40c82cbb157c772cfd365 Author: Fabrizio Castro Date: Thu Dec 13 20:18:34 2018 +0000 dt-bindings: net: ravb: Add support for r8a774c0 SoC Document RZ/G2E (R8A774C0) SoC bindings. Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Reviewed-by: Simon Horman Reviewed-by: Sergei Shtylyov Signed-off-by: David S. Miller commit 4b7cd11f22e5e62b68c543ee74ed3c9f9e70baba Author: David Ahern Date: Thu Dec 13 08:16:50 2018 -0800 neighbor: Improve neighbour struct layout Move arp_queue_len_bytes ahead of arp_queue to remove two 4-byte holes. Ensure ha element is always 8-byte aligned. Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 2561f97267d656c9b2c62b32614870abb3eabfe6 Author: Tonghao Zhang Date: Thu Dec 13 00:43:23 2018 -0800 net: sched: simplify the qdisc_leaf code Except for returning, the var leaf is not used in the qdisc_leaf(). For simplicity, remove it. Signed-off-by: Tonghao Zhang Acked-by: Cong Wang Signed-off-by: David S. Miller commit c2027d1e17582903e368abf5d4838b22a98f2b7b Author: David Ahern Date: Wed Dec 12 15:27:38 2018 -0800 ipv6: Fix handling of LLA with VRF and sockets bound to VRF A recent commit allows sockets bound to a VRF to receive ipv6 link local packets. However, it only works for UDP and worse TCP connection attempts to the LLA with the only listener bound to the VRF just hang where as before the client gets a reset and connection refused. Fix by adjusting ir_iif for LL addresses and packets received through a device enslaved to a VRF. Fixes: 6f12fa775530 ("vrf: mark skb for multicast or link-local as enslaved to VRF") Reported-by: Donald Sharp Cc: Mike Manning Signed-off-by: David Ahern Signed-off-by: David S. Miller commit e782410ed2378a2ddac58d944c3cf0c6f96b1ff3 Author: Heiner Kallweit Date: Sat Dec 15 16:25:05 2018 +0100 r8169: improve spurious interrupt detection Improve detection of spurious interrupts by checking against the interrupt mask as currently set in the chip. Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller commit b09026c6913eeef1b21914a9d441ba275df40f27 Author: Yangtao Li Date: Sat Dec 15 02:59:30 2018 -0500 cxgb4: remove DEFINE_SIMPLE_DEBUGFS_FILE() We already have the DEFINE_SHOW_ATTRIBUTE. There is no need to define such a macro, so remove DEFINE_SIMPLE_DEBUGFS_FILE. Also use the DEFINE_SHOW_ATTRIBUTE macro to simplify some code. Signed-off-by: Yangtao Li Signed-off-by: David S. Miller commit 70f98d7c7d51402e7b40c9ec0299bd46b7890da9 Author: Yangtao Li Date: Sat Dec 15 02:19:53 2018 -0500 ipconfig: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: David S. Miller commit a6b981079c766d4783fc29d9d3811d412192bbed Merge: b9948e1113913 82e00b86a5b60 Author: David S. Miller Date: Sat Dec 15 10:54:18 2018 -0800 Merge branch 'hns3-Add-more-commands-to-Debugfs-in-HNS3-driver' Salil Mehta says: ==================== net: hns3: Add more commands to Debugfs in HNS3 driver This patch-set adds few more debugfs commands to HNS3 Ethernet Driver. Support has been added to query info related to below items: 1. Packet buffer descriptor ("echo bd info [queue no] [bd index] > cmd") 2. Manager table("echo dump mng tbl > cmd") 3. Dfx status register("echo dump reg ssu [prt id] > cmd") 4. Dcb status register("echo dump reg dcb [port id] > cmd") 5. Queue map ("echo queue map [queue no] > cmd") 6. Tm map ("echo tm map [queue no] > cmd") NOTE: Above commands are *read-only* and are only intended to query the information from the SoC(and dump inside the kernel, for now) and in no way tries to perform write operations for the purpose of configuration etc. Change Log: V1-->V2: 1. Addressed the GCC-8.2 compiler issue reported by David S. Miller. Link: https://lkml.org/lkml/2018/12/14/1298 ==================== Signed-off-by: David S. Miller commit 82e00b86a5b60d21e85564ec7dccaddc37ec2b00 Author: liuzhongzhu Date: Sat Dec 15 15:31:58 2018 +0000 net: hns3: Add "tm map" status information query function This patch prints dcb register status information by module. debugfs command: root@(none)# echo dump tm map 100 > cmd queue_id | qset_id | pri_id | tc_id 0100 | 0065 | 08 | 00 root@(none)# Signed-off-by: liuzhongzhu Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 0c29d1912b81a0d8ab7eb46ce7036a8c0fb073e3 Author: liuzhongzhu Date: Sat Dec 15 15:31:57 2018 +0000 net: hns3: Add "queue map" information query function This patch prints queue map information. debugfs command: echo dump queue map > cmd Sample Command: root@(none)# echo queue map > cmd local queue id | global queue id | vector id 0 32 769 1 33 770 2 34 771 3 35 772 4 36 773 5 37 774 6 38 775 7 39 776 8 40 777 9 41 778 10 42 779 11 43 780 12 44 781 13 45 782 14 46 783 15 47 784 root@(none)# Signed-off-by: liuzhongzhu Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit c0ebebb9ccc1363e117b52189e93d6ec646b33df Author: liuzhongzhu Date: Sat Dec 15 15:31:56 2018 +0000 net: hns3: Add "dcb register" status information query function This patch prints dcb register status information by module. debugfs command: root@(none)# echo dump reg dcb > cmd roce_qset_mask: 0x0 nic_qs_mask: 0x0 qs_shaping_pass: 0x0 qs_bp_sts: 0x0 pri_mask: 0x0 pri_cshaping_pass: 0x0 pri_pshaping_pass: 0x0 root@(none)# Signed-off-by: liuzhongzhu Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 27cf979a15841eed5de06b6f46ae490ce2fda46b Author: liuzhongzhu Date: Sat Dec 15 15:31:55 2018 +0000 net: hns3: Add "status register" information query function This patch prints status register information by module. debugfs command: echo dump reg [mode name] > cmd Sample Command: root@(none)# echo dump reg bios common > cmd BP_CPU_STATE: 0x0 DFX_MSIX_INFO_NIC_0: 0xc000 DFX_MSIX_INFO_NIC_1: 0xf DFX_MSIX_INFO_NIC_2: 0x2 DFX_MSIX_INFO_NIC_3: 0x2 DFX_MSIX_INFO_ROC_0: 0xc000 DFX_MSIX_INFO_ROC_1: 0x0 DFX_MSIX_INFO_ROC_2: 0x0 DFX_MSIX_INFO_ROC_3: 0x0 root@(none)# Signed-off-by: liuzhongzhu Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 7737f1fbb5ba1581e8b77ed4b2302485fa237f1e Author: liuzhongzhu Date: Sat Dec 15 15:31:54 2018 +0000 net: hns3: Add "manager table" information query function This patch prints manager table information. debugfs command: echo dump mng tbl > cmd Sample Command: root@(none)# echo dump mng tbl > cmd entry|mac_addr |mask|ether|mask|vlan|mask|i_map|i_dir|e_type 00 |01:00:5e:00:00:01|0 |00000|0 |0000|0 |00 |00 |0 01 |c2:f1:c5:82:68:17|0 |00000|0 |0000|0 |00 |00 |0 root@(none)# Signed-off-by: liuzhongzhu Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 122bedc56a6c4f5be3bc56fdc59d4b3a25097ead Author: liuzhongzhu Date: Sat Dec 15 15:31:53 2018 +0000 net: hns3: Add "bd info" query function This patch prints Sending and receiving package descriptor information. debugfs command: echo dump bd info 1 > cmd Sample Command: root@(none)# echo bd info 1 > cmd hns3 0000:7d:00.0: TX Queue Num: 0, BD Index: 0 hns3 0000:7d:00.0: (TX) addr: 0x0 hns3 0000:7d:00.0: (TX)vlan_tag: 0 hns3 0000:7d:00.0: (TX)send_size: 0 hns3 0000:7d:00.0: (TX)vlan_tso: 0 hns3 0000:7d:00.0: (TX)l2_len: 0 hns3 0000:7d:00.0: (TX)l3_len: 0 hns3 0000:7d:00.0: (TX)l4_len: 0 hns3 0000:7d:00.0: (TX)vlan_tag: 0 hns3 0000:7d:00.0: (TX)tv: 0 hns3 0000:7d:00.0: (TX)vlan_msec: 0 hns3 0000:7d:00.0: (TX)ol2_len: 0 hns3 0000:7d:00.0: (TX)ol3_len: 0 hns3 0000:7d:00.0: (TX)ol4_len: 0 hns3 0000:7d:00.0: (TX)paylen: 0 hns3 0000:7d:00.0: (TX)vld_ra_ri: 0 hns3 0000:7d:00.0: (TX)mss: 0 hns3 0000:7d:00.0: RX Queue Num: 0, BD Index: 120 hns3 0000:7d:00.0: (RX)addr: 0xffee7000 hns3 0000:7d:00.0: (RX)pkt_len: 0 hns3 0000:7d:00.0: (RX)size: 0 hns3 0000:7d:00.0: (RX)rss_hash: 0 hns3 0000:7d:00.0: (RX)fd_id: 0 hns3 0000:7d:00.0: (RX)vlan_tag: 0 hns3 0000:7d:00.0: (RX)o_dm_vlan_id_fb: 0 hns3 0000:7d:00.0: (RX)ot_vlan_tag: 0 hns3 0000:7d:00.0: (RX)bd_base_info: 0 Signed-off-by: liuzhongzhu Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 7677ea0e8843e1a45e35253c0c5e22db11a99a62 Author: Boris Brezillon Date: Mon Dec 3 11:23:15 2018 +0100 MAINTAINERS: Update my email address Use my korg address instead of the bootlin one. Signed-off-by: Boris Brezillon commit cafb56dd741e61c99709bcd2b193a9a1d36def3b Author: Miquel Raynal Date: Tue Dec 11 18:38:28 2018 +0100 mtd: rawnand: marvell: prevent timeouts on a loaded machine marvell_nfc_wait_op() waits for completion during 'timeout_ms' milliseconds before throwing an error. While the logic is fine, the value of 'timeout_ms' is given by the core and actually correspond to the maximum time the NAND chip will take to complete the operation. Assuming there is no overhead in the propagation of the interrupt signal to the the NAND controller (through the Ready/Busy line), this delay does not take into account the latency of the operating system. For instance, for a page write, the delay given by the core is rounded up to 1ms. Hence, when the machine is over loaded, there is chances that this timeout will be reached. There are two ways to solve this issue that are not incompatible: 1/ Enlarge the timeout value (if so, how much?). 2/ Check after the waiting method if we did not miss any interrupt because of the OS latency (an interrupt is still pending). In this case, we assume the operation exited successfully. We choose the second approach that is a must in all cases, with the possibility to also modify the timeout value to be, e.g. at least 1 second in all cases. Fixes: 02f26ecf8c77 ("mtd: nand: add reworked Marvell NAND controller driver") Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 664204410afb3b0f538d176ad0c2713b04abd4b9 Author: Nathan Chancellor Date: Fri Dec 14 18:49:01 2018 -0700 PCI: Remove unused attr variable in pci_dma_configure Clang warns: drivers/pci/pci-driver.c:1603:21: error: unused variable 'attr' [-Werror,-Wunused-variable] Commit e5361ca29f2f ("ACPI / scan: Refactor _CCA enforcement") removed attr's use and replaced it with its assigned value so it is no longer needed. Signed-off-by: Nathan Chancellor Signed-off-by: Christoph Hellwig commit 8ee94e3fc54d989897969d7ca8deacfe7850855c Author: Christoph Hellwig Date: Sat Dec 15 11:01:25 2018 +0100 ia64: only select ARCH_HAS_DMA_COHERENT_TO_PFN if swiotlb is enabled Otherwise we get a build failure due in swiotlb-less configs with non-generic kernels. Signed-off-by: Christoph Hellwig commit 893b0aff9a7aa68d2fcc999f16d66d142f180ca8 Author: Marc Zyngier Date: Sat Dec 15 09:10:46 2018 +0000 irqchip/irq-imx-gpcv2: Silence "fall through" warning The -Wimplicit-fallthrough option requires that the /* fall through */ comment is placed in the 'case' statement that falls through, rather than in the following one. Case seems to matter as well. Reported-by: Stephen Rothwell Signed-off-by: Marc Zyngier commit a01e5d242d932f67f2657ceb0d76be777cd05a04 Author: Masahiro Yamada Date: Tue Dec 11 20:00:58 2018 +0900 kconfig: remove redundant token defines These are already defined as %left. Signed-off-by: Masahiro Yamada commit 4b5ec81bfeda09bda9cd8f545226c65291e4952b Author: Masahiro Yamada Date: Tue Dec 11 20:00:57 2018 +0900 kconfig: rename depends_list to comment_option_list Now the comment_stmt is the only user of depends_list. Rename it to comment_option_list Signed-off-by: Masahiro Yamada commit 1f31be9ec0a9d59053fb3d78591f6dd7a64a174e Author: Masahiro Yamada Date: Tue Dec 11 20:00:56 2018 +0900 kconfig: loosen the order of "visible" and "depends on" in menu entry Currently, "visible" and "depends on", if defined in a menu entry, must appear in that order. The real example is in drivers/media/tuners/Kconfig: menu "Customize TV tuners" visible if depends on ... is fine, but you cannot change the property order like this: menu "Customize TV tuners" depends on visible if Kconfig does not require a specific order of properties. In this case, menu_add_visibility(() and menu_add_dep() are orthogonal. Loosen this unreasonable restriction. Signed-off-by: Masahiro Yamada commit 94d4e1b6021b8d63274c9961c70f95dd2b43e6fb Author: Masahiro Yamada Date: Tue Dec 11 20:00:55 2018 +0900 kconfig: remove redundant menu_block rule The code block surrounded by "menu" ... "endmenu" is stmt_list. Remove the redundant menu_block symbol entirely. Signed-off-by: Masahiro Yamada commit 4891796c6f83bb3be5567b3053428a40329d7e37 Author: Masahiro Yamada Date: Tue Dec 11 20:00:54 2018 +0900 kconfig: remove redundant if_block rule The code block surrounded by "if" ... "endif" is stmt_list. Remove the redundant if_block symbol entirely. Remove "stmt_list: stmt_list end" rule as well since it would obviously cause conflicts. Signed-off-by: Masahiro Yamada commit 2f60e46e605a9bcd8dc4fe7745b5576084900850 Author: Masahiro Yamada Date: Tue Dec 11 20:00:53 2018 +0900 kconfig: remove grammatically ambiguous option_error This commit decreases 6 shift/reduce conflicts, and finally achieves conflict-free parser. Since Kconfig has no terminator for a config block, detecting the end of config_stmt is not easy. For example, there are two ways for handling the error in the following code: 1 config FOO 2 = [A] Print "unknown option" error, assuming the line 2 is a part of config_option_list [B] Print "invalid statement", assuming the line 1 is reduced into a config_stmt by itself Bison actually chooses [A] because it performs the shift rather than the reduction where both are possible. However, there is no reason to choose one over the other. Let's remove the option_error, and let it fall back to [B]. Signed-off-by: Masahiro Yamada commit 6900ae9eeee397436df25ef51835a8b27865d46d Author: Masahiro Yamada Date: Tue Dec 11 20:00:52 2018 +0900 kconfig: remove grammatically ambiguous "unexpected option" diagnostic This commit decreases 15 shift/reduce conflicts. The location of this error recovery is ambiguous. For example, there are two ways to interpret the following code: 1 config FOO 2 bool "foo" [A] Both lines are reduced together into a config_stmt. [B] The only line 1 is reduced into a config_stmt, and the line 2 matches to "option_name error T_EOL" Of course, we expect [A], but [B] could be grammatically possible. Kconfig has no terminator for a config block. So, we cannot detect its end until we see a non-property keyword. People often insert a blank line between two config blocks, but it is just a coding convention. Blank lines are actually allowed anywhere in Kconfig files. The real error is when a property keyword appears right after "endif", "endchoice", "endmenu", "source", "comment", or variable assignment. Instead of fixing the grammatical ambiguity, I chose to simply remove this error recovery. The difference is unexpected option "bool" ... is turned into a more generic message: invalid statement Signed-off-by: Masahiro Yamada commit 723679339d087d79e36c0af67f4be84d866fee20 Author: Masahiro Yamada Date: Tue Dec 11 20:00:51 2018 +0900 kconfig: warn no new line at end of file It would be nice to warn if a new line is missing at end of file. We could do this by checkpatch.pl for arbitrary files, but new line is rather essential as a statement terminator in Kconfig. The warning message looks like this: kernel/Kconfig.preempt:60:warning: no new line at end of file Currently, kernel/Kconfig.preempt is the only file with no new line at end of file. Fix it. I know there are some false negative cases. For example, no warning is displayed when the last line contains some whitespaces/comments, but no new line. Yet, this commit works well for most cases. Signed-off-by: Masahiro Yamada commit f5a4c76ad7de96d47baef3d8810a88b10d60ec82 Author: Len Brown Date: Fri Dec 14 16:26:37 2018 -0500 tools/power turbostat: consolidate duplicate model numbers Often a new processor gets a new model number, but from a turbostat point of view, it is the same as a previous model. Support duplicates with 1-line updates, rather than error-prone scattering of model #'s. Signed-off-by: Len Brown commit 445640a563493f28d15f47e151e671281101e7dc Author: Len Brown Date: Fri Dec 14 20:02:27 2018 -0500 tools/power turbostat: fix goldmont C-state limit decoding When the C-state limit is 8 on Goldmont, PC10 is enabled. Previously turbostat saw this as "undefined", and thus assumed it should not show some counters, such as pc3, pc6, pc7. Signed-off-by: Len Brown commit 034565da0fe6cc60c4df26805c8c78d8f365173b Merge: bab89add3e7b7 c101189bc9680 Author: Daniel Borkmann Date: Sat Dec 15 01:31:49 2018 +0100 Merge branch 'bpf-bpftool-cleanups' Quentin Monnet says: ==================== This series contains several minor fixes for bpftool source and documentation. The first patches focus on documentation: addition of an option in the page for "bpftool prog", clean up and update of the same page, and addition of an example of prog array map manipulation in "bpftool map" page. The last two fix warnings susceptible to appear when libbfd is not present (patch 4), or with additional warning flags passed to the compiler (last patch). ==================== Signed-off-by: Daniel Borkmann commit c101189bc9680675a2686bafe908015a07a0da51 Author: Quentin Monnet Date: Fri Dec 14 13:56:01 2018 +0000 tools: bpftool: fix -Wmissing declaration warnings Help compiler check arguments for several utility functions used to print items to the console by adding the "printf" attribute when declaring those functions. Also, declare as "static" two functions that are only used in prog.c. All of them discovered by compiling bpftool with -Wmissing-format-attribute -Wmissing-declarations. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 8c03ecf712f5bbbb9d353ed69715aef3cc2b4029 Author: Quentin Monnet Date: Fri Dec 14 13:56:00 2018 +0000 tools: bpftool: fix warning on struct bpf_prog_linfo definition The following warning appears when compiling bpftool without BFD support: main.h:198:23: warning: 'struct bpf_prog_linfo' declared inside parameter list will not be visible outside of this definition or declaration const struct bpf_prog_linfo *prog_linfo, Fix it by declaring struct bpf_prog_linfo even in the case BFD is not supported. Fixes: b053b439b72a ("bpf: libbpf: bpftool: Print bpf_line_info during prog dump") Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit bd0fb9d0078edbfa2c983ad61901d90f1c0f5747 Author: Quentin Monnet Date: Fri Dec 14 13:55:59 2018 +0000 tools: bpftool: add a prog array map update example to documentation Add an example in map documentation to show how to use bpftool in order to update the references to programs hold by prog array maps. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 32870ba4078c3b4deac7ccb35b078c9ab69488a3 Author: Quentin Monnet Date: Fri Dec 14 13:55:58 2018 +0000 tools: bpftool: fix examples in documentation for bpftool prog Bring various fixes to the manual page for "bpftool prog" set of commands: - Fix typos ("dum" -> "dump") - Harmonise indentation and format for command output - Update date format for program load time - Add instruction numbers on program dumps - Fix JSON format for the example program listing Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit bc6cd664609b92aa437ed3f384e332faab5949c8 Author: Quentin Monnet Date: Fri Dec 14 13:55:57 2018 +0000 tools: bpftool: add doc for -m option to bpftool-prog.rst The --mapcompat|-m option has been documented on the main bpftool.rst page, and on the interactive help. As this option is useful for loading programs with maps with the "bpftool prog load" command, it should also appear in the related bpftool-prog.rst documentation page. Let's add it. Signed-off-by: Quentin Monnet Reviewed-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit bab89add3e7b74be46e319d1fcba7835cb60ea2b Merge: eb415c98980fd 9242b5f5615c8 Author: Daniel Borkmann Date: Sat Dec 15 01:28:33 2018 +0100 Merge branch 'bpf-improve-verifier-state-analysis' Alexei Starovoitov says: ==================== v1->v2: With optimization suggested by Jakub patch 4 safety check became cheap enough. Several improvements to verifier state logic. Patch 1 - trivial optimization Patch 3 - significant optimization for stack state equivalence Patch 4 - safety check for liveness and prep for future state merging ==================== Signed-off-by: Daniel Borkmann commit 9242b5f5615c823bfc1e9aea284617ff25a55f10 Author: Alexei Starovoitov Date: Thu Dec 13 11:42:34 2018 -0800 bpf: add self-check logic to liveness analysis Introduce REG_LIVE_DONE to check the liveness propagation and prepare the states for merging. See algorithm description in clean_live_states(). Signed-off-by: Alexei Starovoitov Acked-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 19e2dbb7dd978d24505e918ac54d6f7dfdc88b1d Author: Alexei Starovoitov Date: Thu Dec 13 11:42:33 2018 -0800 bpf: improve stacksafe state comparison "if (old->allocated_stack > cur->allocated_stack)" check is too conservative. In some cases explored stack could have allocated more space, but that stack space was not live. The test case improves from 19 to 15 processed insns and improvement on real programs is significant as well: before after bpf_lb-DLB_L3.o 1940 1831 bpf_lb-DLB_L4.o 3089 3029 bpf_lb-DUNKNOWN.o 1065 1064 bpf_lxc-DDROP_ALL.o 28052 26309 bpf_lxc-DUNKNOWN.o 35487 33517 bpf_netdev.o 10864 9713 bpf_overlay.o 6643 6184 bpf_lcx_jit.o 38437 37335 Signed-off-by: Alexei Starovoitov Acked-by: Edward Cree Acked-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit 730ff40f80c5b09b2402958321f2762a3f852e30 Author: Alexei Starovoitov Date: Thu Dec 13 11:42:32 2018 -0800 selftests/bpf: check insn processed in test_verifier Teach test_verifier to parse verifier output for insn processed and compare with expected number. Signed-off-by: Alexei Starovoitov Acked-by: Edward Cree Acked-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit b233920c97a6201eb47fbafd78365c6946e6d7b6 Author: Alexei Starovoitov Date: Thu Dec 13 11:42:31 2018 -0800 bpf: speed up stacksafe check Don't check the same stack liveness condition 8 times. once is enough. Signed-off-by: Alexei Starovoitov Acked-by: Edward Cree Acked-by: Jakub Kicinski Signed-off-by: Daniel Borkmann commit b9948e1113913237d6ee5d30c886514220f69163 Merge: 8e2ea53a83dfb 6254e5c6a8d7c Author: David S. Miller Date: Fri Dec 14 15:55:21 2018 -0800 Merge branch 'net-prefer-listeners-bound-to-an-address' Peter Oskolkov says: ==================== net: prefer listeners bound to an address A relatively common use case is to have several IPs configured on a host, and have different listeners for each of them. We would like to add a "catch all" listener on addr_any, to match incoming connections not served by any of the listeners bound to a specific address. However, port-only lookups can match addr_any sockets when sockets listening on specific addresses are present if so_reuseport flag is set. This patchset eliminates lookups into port-only hashtable, as lookups by (addr,port) tuple are easily available. In a future patchset I plan to explore whether it is possible to remove port-only hashtables completely: additional refactoring will be required, as some non-lookup code uses the hashtables. ==================== Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 6254e5c6a8d7c19e51e671e2648de2db06f8d504 Author: Peter Oskolkov Date: Wed Dec 12 13:15:37 2018 -0800 selftests: net: test that listening sockets match on address properly This patch adds a selftest that verifies that a socket listening on a specific address is chosen in preference over sockets that listen on any address. The test covers UDP/UDP6/TCP/TCP6. It is based on, and similar to, reuseport_dualstack.c selftest. Signed-off-by: Peter Oskolkov Signed-off-by: David S. Miller commit 0ee58dad5b065f5910c2c926d8c9f07cbe2db86c Author: Peter Oskolkov Date: Wed Dec 12 13:15:36 2018 -0800 net: tcp6: prefer listeners bound to an address A relatively common use case is to have several IPs configured on a host, and have different listeners for each of them. We would like to add a "catch all" listener on addr_any, to match incoming connections not served by any of the listeners bound to a specific address. However, port-only lookups can match addr_any sockets when sockets listening on specific addresses are present if so_reuseport flag is set. This patch eliminates lookups into port-only hashtable, as lookups by (addr,port) tuple are easily available. In addition, compute_score() is tweaked to _not_ match addr_any sockets to specific addresses, as hash collisions could result in the unwanted behavior described above. Tested: the patch compiles; full test in the last patch in this patchset. Existing reuseport_* selftests also pass. Suggested-by: Eric Dumazet Signed-off-by: Peter Oskolkov Signed-off-by: David S. Miller commit d9fbc7f6431fc0e5c0ddedf72206d7c5175c5c9a Author: Peter Oskolkov Date: Wed Dec 12 13:15:35 2018 -0800 net: tcp: prefer listeners bound to an address A relatively common use case is to have several IPs configured on a host, and have different listeners for each of them. We would like to add a "catch all" listener on addr_any, to match incoming connections not served by any of the listeners bound to a specific address. However, port-only lookups can match addr_any sockets when sockets listening on specific addresses are present if so_reuseport flag is set. This patch eliminates lookups into port-only hashtable, as lookups by (addr,port) tuple are easily available. In addition, compute_score() is tweaked to _not_ match addr_any sockets to specific addresses, as hash collisions could result in the unwanted behavior described above. Tested: the patch compiles; full test in the last patch in this patchset. Existing reuseport_* selftests also pass. Suggested-by: Eric Dumazet Signed-off-by: Peter Oskolkov Signed-off-by: David S. Miller commit 23b0269e58aee1165133b9696e43992f969b5088 Author: Peter Oskolkov Date: Wed Dec 12 13:15:34 2018 -0800 net: udp6: prefer listeners bound to an address A relatively common use case is to have several IPs configured on a host, and have different listeners for each of them. We would like to add a "catch all" listener on addr_any, to match incoming connections not served by any of the listeners bound to a specific address. However, port-only lookups can match addr_any sockets when sockets listening on specific addresses are present if so_reuseport flag is set. This patch eliminates lookups into port-only hashtable, as lookups by (addr,port) tuple are easily available. In addition, compute_score() is tweaked to _not_ match addr_any sockets to specific addresses, as hash collisions could result in the unwanted behavior described above. Tested: the patch compiles; full test in the last patch in this patchset. Existing reuseport_* selftests also pass. Suggested-by: Eric Dumazet Signed-off-by: Peter Oskolkov Signed-off-by: David S. Miller commit 4cdeeee9252af1ba50482f91d615f326365306bd Author: Peter Oskolkov Date: Wed Dec 12 13:15:33 2018 -0800 net: udp: prefer listeners bound to an address A relatively common use case is to have several IPs configured on a host, and have different listeners for each of them. We would like to add a "catch all" listener on addr_any, to match incoming connections not served by any of the listeners bound to a specific address. However, port-only lookups can match addr_any sockets when sockets listening on specific addresses are present if so_reuseport flag is set. This patch eliminates lookups into port-only hashtable, as lookups by (addr,port) tuple are easily available. In addition, compute_score() is tweaked to _not_ match addr_any sockets to specific addresses, as hash collisions could result in the unwanted behavior described above. Tested: the patch compiles; full test in the last patch in this patchset. Existing reuseport_* selftests also pass. Suggested-by: Eric Dumazet Signed-off-by: Peter Oskolkov Signed-off-by: David S. Miller commit 8e2ea53a83dfb4b892ba35ddd9e78e6091202fa6 Author: yupeng Date: Wed Dec 12 00:14:10 2018 -0800 add snmp counters document Add explainations for some general IP counters, SACK and DSACK related counters Signed-off-by: yupeng Signed-off-by: David S. Miller commit 384aee46ca942db05195c32b03e856ceceb1127c Merge: aeb3fecde811d e997f8a20a57c Author: David S. Miller Date: Fri Dec 14 15:44:47 2018 -0800 Merge branch 'neighbor-More-gc_list-changes' David Ahern says: ==================== neighbor: More gc_list changes More gc_list changes and cleanups. The first 2 patches are bug fixes from the first gc_list change. Specifically, fix the locking order to be consistent - table lock followed by neighbor lock, and then entries in the FAILED state should always be candidates for forced_gc without waiting for any time span (return to the eviction logic prior to the separate gc_list). Patch 3 removes 2 now unnecessary arguments to neigh_del. Patch 4 moves a helper from a header file to core code in preparation for Patch 5 which removes NTF_EXT_LEARNED entries from the gc_list. These entries are already exempt from forced_gc; patch 5 removes them from consideration and makes them on par with PERMANENT entries given that they are also managed by userspace. ==================== Signed-off-by: David S. Miller commit e997f8a20a57cae16ed0c7a2bff6d3ab75f58123 Author: David Ahern Date: Tue Dec 11 18:57:25 2018 -0700 neighbor: Remove externally learned entries from gc_list Externally learned entries are similar to PERMANENT entries in the sense they are managed by userspace and can not be garbage collected. As such remove them from the gc_list, remove the flags check from neigh_forced_gc and skip threshold checks in neigh_alloc. As with PERMANENT entries, this allows unlimited number of NTF_EXT_LEARNED entries. Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 526f1b587cf826d78c3e522428ce6b24a8da0d65 Author: David Ahern Date: Tue Dec 11 18:57:24 2018 -0700 neighbor: Move neigh_update_ext_learned to core file neigh_update_ext_learned has one caller in neighbour.c so does not need to be defined in the header. Move it and in the process remove the intialization of ndm_flags and just set it based on the flags check. Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 7e6f182bec7debb420a2c12ae0ea1813645a7ac4 Author: David Ahern Date: Tue Dec 11 18:57:23 2018 -0700 neighbor: Remove state and flags arguments to neigh_del neigh_del now only has 1 caller, and the state and flags arguments are both 0. Remove them and simplify neigh_del. Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 758a7f0b32ab890831d321145c3fe72bb85c0350 Author: David Ahern Date: Tue Dec 11 18:57:22 2018 -0700 neighbor: Fix state check in neigh_forced_gc PERMANENT entries are not on the gc_list so the state check is now redundant. Also, the move to not purge entries until after 5 seconds should not apply to FAILED entries; those can be removed immediately to make way for newer ones. This restores the previous logic prior to the gc_list. Fixes: 58956317c8de ("neighbor: Improve garbage collection") Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 9c29a2f55ec05cc8b525ee3b2d75d3cd37911123 Author: David Ahern Date: Tue Dec 11 18:57:21 2018 -0700 neighbor: Fix locking order for gc_list changes Lock checker noted an inverted lock order between neigh_change_state (neighbor lock then table lock) and neigh_periodic_work (table lock and then neighbor lock) resulting in: [ 121.057652] ====================================================== [ 121.058740] WARNING: possible circular locking dependency detected [ 121.059861] 4.20.0-rc6+ #43 Not tainted [ 121.060546] ------------------------------------------------------ [ 121.061630] kworker/0:2/65 is trying to acquire lock: [ 121.062519] (____ptrval____) (&n->lock){++--}, at: neigh_periodic_work+0x237/0x324 [ 121.063894] [ 121.063894] but task is already holding lock: [ 121.064920] (____ptrval____) (&tbl->lock){+.-.}, at: neigh_periodic_work+0x194/0x324 [ 121.066274] [ 121.066274] which lock already depends on the new lock. [ 121.066274] [ 121.067693] [ 121.067693] the existing dependency chain (in reverse order) is: ... Fix by renaming neigh_change_state to neigh_update_gc_list, changing it to only manage whether an entry should be on the gc_list and taking locks in the same order as neigh_periodic_work. Invoke at the end of neigh_update only if diff between old or new states has the PERMANENT flag set. Fixes: 8cc196d6ef86 ("neighbor: gc_list changes should be protected by table lock") Signed-off-by: David Ahern Signed-off-by: David S. Miller commit aeb3fecde811d5392ed481d8558f5751ac542e77 Author: Cong Wang Date: Tue Dec 11 11:15:46 2018 -0800 net_sched: fold tcf_block_cb_call() into tc_setup_cb_call() After commit 69bd48404f25 ("net/sched: Remove egdev mechanism"), tc_setup_cb_call() is nearly identical to tcf_block_cb_call(), so we can just fold tcf_block_cb_call() into tc_setup_cb_call() and remove its unused parameter 'exts'. Fixes: 69bd48404f25 ("net/sched: Remove egdev mechanism") Cc: Oz Shlomo Cc: Jiri Pirko Signed-off-by: Cong Wang Acked-by: Jiri Pirko Acked-by: Oz Shlomo Signed-off-by: David S. Miller commit eb415c98980fd13618c64b0d88c2439103b4a627 Merge: 28c1272914613 d9762e84ede3e Author: Alexei Starovoitov Date: Fri Dec 14 14:17:34 2018 -0800 Merge branch 'bpf_line_info-in-verifier' Martin Lau says: ==================== This patch set provides bpf_line_info during the verifier's verbose log. Please see individual patch for details. ==================== Signed-off-by: Alexei Starovoitov commit d9762e84ede3eae9636f5dbbe0c8f0390d37e114 Author: Martin KaFai Lau Date: Thu Dec 13 10:41:48 2018 -0800 bpf: verbose log bpf_line_info in verifier This patch adds bpf_line_info during the verifier's verbose. It can give error context for debug purpose. ~~~~~~~~~~ Here is the verbose log for backedge: while (a) { a += bpf_get_smp_processor_id(); bpf_trace_printk(fmt, sizeof(fmt), a); } ~> bpftool prog load ./test_loop.o /sys/fs/bpf/test_loop type tracepoint 13: while (a) { 3: a += bpf_get_smp_processor_id(); back-edge from insn 13 to 3 ~~~~~~~~~~ Here is the verbose log for invalid pkt access: Modification to test_xdp_noinline.c: data = (void *)(long)xdp->data; data_end = (void *)(long)xdp->data_end; /* if (data + 4 > data_end) return XDP_DROP; */ *(u32 *)data = dst->dst; ~> bpftool prog load ./test_xdp_noinline.o /sys/fs/bpf/test_xdp_noinline type xdp ; data = (void *)(long)xdp->data; 224: (79) r2 = *(u64 *)(r10 -112) 225: (61) r2 = *(u32 *)(r2 +0) ; *(u32 *)data = dst->dst; 226: (63) *(u32 *)(r2 +0) = r1 invalid access to packet, off=0 size=4, R2(id=0,off=0,r=0) R2 offset is outside of the packet Signed-off-by: Martin KaFai Lau Acked-by: Yonghong Song Signed-off-by: Alexei Starovoitov commit 23127b33ec80e656921362d7dc82a0064bac20a2 Author: Martin KaFai Lau Date: Thu Dec 13 10:41:46 2018 -0800 bpf: Create a new btf_name_by_offset() for non type name use case The current btf_name_by_offset() is returning "(anon)" type name for the offset == 0 case and "(invalid-name-offset)" for the out-of-bound offset case. It fits well for the internal BTF verbose log purpose which is focusing on type. For example, offset == 0 => "(anon)" => anonymous type/name. Returning non-NULL for the bad offset case is needed during the BTF verification process because the BTF verifier may complain about another field first before discovering the name_off is invalid. However, it may not be ideal for the newer use case which does not necessary mean type name. For example, when logging line_info in the BPF verifier in the next patch, it is better to log an empty src line instead of logging "(anon)". The existing bpf_name_by_offset() is renamed to __bpf_name_by_offset() and static to btf.c. A new bpf_name_by_offset() is added for generic context usage. It returns "\0" for name_off == 0 (note that btf->strings[0] is "\0") and NULL for invalid offset. It allows the caller to decide what is the best output in its context. The new btf_name_by_offset() is overlapped with btf_name_offset_valid(). Hence, btf_name_offset_valid() is removed from btf.h to keep the btf.h API minimal. The existing btf_name_offset_valid() usage in btf.c could also be replaced later. Signed-off-by: Martin KaFai Lau Acked-by: Yonghong Song Signed-off-by: Alexei Starovoitov commit b677574bdf292e31c8f9810ff0fc0b35839d4636 Merge: 2de34ed964891 7128d7f7bae11 Author: Stephen Boyd Date: Fri Dec 14 14:03:38 2018 -0800 Merge branch 'clk-imx7ulp' into clk-next * clk-imx7ulp: clk: imx: imx7ulp: add arm hsrun mode clocks support dt-bindings: clock: imx7ulp: add HSRUN mode related clocks commit 7128d7f7bae11217cdd304b0620a4461102e599b Author: Anson Huang Date: Fri Dec 7 10:03:34 2018 +0000 clk: imx: imx7ulp: add arm hsrun mode clocks support i.MX7ULP has a Cortex-A7 CPU which can run in RUN mode or HSRUN mode, it is controlled in SMC1 module. The RUN mode and HSRUN mode will use different clock source for ARM, "divcore" for RUN mode and "hsrun_divcore" for HSRUN mode, so the control bits in SMC1 module can be abstracted as a HW clock mux, this patch adds HSRUN mode related clocks in SCG1 module and adds "arm" clock in SMC1 module to support RUN mode and HSRUN mode switch. Latest clock tree in RUN mode as below: firc 0 0 0 48000000 0 0 50000 firc_bus_clk 0 0 0 48000000 0 0 50000 hsrun_scs_sel 0 0 0 48000000 0 0 50000 hsrun_divcore 0 0 0 48000000 0 0 50000 sosc 3 3 3 24000000 0 0 50000 spll_pre_sel 1 1 1 24000000 0 0 50000 spll_pre_div 1 1 2 24000000 0 0 50000 spll 1 1 2 528000000 0 0 50000 spll_pfd0 1 1 1 500210526 0 0 50000 spll_pfd_sel 1 1 0 500210526 0 0 50000 spll_sel 1 1 0 500210526 0 0 50000 scs_sel 1 1 0 500210526 0 0 50000 divcore 1 1 0 500210526 0 0 50000 arm 1 1 0 500210526 0 0 50000 Signed-off-by: Anson Huang Signed-off-by: Stephen Boyd commit 401371fb597e035c3e7de5b69a4fa0e8243cb6a4 Author: Anson Huang Date: Fri Dec 7 10:03:29 2018 +0000 dt-bindings: clock: imx7ulp: add HSRUN mode related clocks There are HSRUN mode clock mux and divider in SCG1 module, and SMC1 can control i.MX7ULP CPU to run in RUN mode or HSRUN mode, the mode switch bits are actually a clock mux, add these clocks for clock driver and dtb to use. Signed-off-by: Anson Huang Signed-off-by: Stephen Boyd commit 2de34ed964891c0a58d03b20705437d8831fd6de Merge: 5964ac60131c0 87ab115185e11 Author: Stephen Boyd Date: Fri Dec 14 14:02:55 2018 -0800 Merge branch 'clk-of' into clk-next * clk-of: clk: Use of_node_name_eq for node name comparisons commit 87ab115185e116f0349ba5bd0555d0b0e935166b Author: Rob Herring Date: Wed Dec 5 13:50:21 2018 -0600 clk: 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. For instances using of_node_cmp, this has the side effect of now using case sensitive comparisons. This should not matter for any FDT based system which all of these are. Cc: Geert Uytterhoeven Cc: Michael Turquette Cc: Stephen Boyd Cc: Tero Kristo Cc: Ulf Hansson Cc: linux-renesas-soc@vger.kernel.org Cc: linux-clk@vger.kernel.org Cc: linux-omap@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Rob Herring Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven (clk-mstp) Acked-by: Ulf Hansson (ux500) Signed-off-by: Stephen Boyd commit 3e42f200c195fd3a39142028194b67ffaf2b5f6d Merge: c5510b8dafce5 b76574300504e Author: Linus Walleij Date: Fri Dec 14 22:51:05 2018 +0100 Merge branch 'ib-pca953x' into devel commit 9b432630e0150b777c423fdef6a7b8d17dfa70b6 Author: Boris Brezillon Date: Thu Dec 13 20:22:27 2018 +0100 mtd: rawnand: omap2: Pass the parent of pdev to dma_request_chan() Commit e1e6255c311b ("mtd: rawnand: omap2: convert driver to nand_scan()") moved part of the init code in the ->attach_chip hook and at the same time changed the struct device object passed to dma_request_chan() (&pdev->dev instead of pdev->dev.parent). Fixes: e1e6255c311b ("mtd: rawnand: omap2: convert driver to nand_scan()") Reported-by: Alexander Sverdlin Cc: Signed-off-by: Boris Brezillon Tested-by: Alexander Sverdlin Signed-off-by: Miquel Raynal commit b637ef779575a977068025f842ecd480a9671f3f Author: Boris Brezillon Date: Thu Dec 13 11:55:26 2018 +0100 mtd: rawnand: Fix JEDEC detection nand_jedec_detect() should return 1 when the PARAM page parsing succeeds, otherwise the core considers JEDEC detection failed and falls back to ID-based detection. Fixes: 480139d9229e ("mtd: rawnand: get rid of the JEDEC parameter page in nand_chip") Cc: Signed-off-by: Boris Brezillon Acked-by: Miquel Raynal Signed-off-by: Miquel Raynal commit 5964ac60131c0829f6fa9883c6c578028f553267 Merge: 9dc3204247083 8cbdc1f09f7ac Author: Stephen Boyd Date: Fri Dec 14 13:44:19 2018 -0800 Merge branch 'clk-vc5-suspend' into clk-next - Proper suspend/resume on VersaClock5 * clk-vc5-suspend: clk: vc5: Add suspend/resume support commit 8cbdc1f09f7ac5c082818909da104f92d3f38d77 Author: Marek Vasut Date: Thu Dec 13 17:15:28 2018 +0100 clk: vc5: Add suspend/resume support Add simple suspend/resume handlers to the driver to restore the chip configuration after resume. It is possible that the chip was configured with non-default values before suspend-resume cycle and that the chip is powered down during this cycle, so the configuration could get lost. Signed-off-by: Marek Vasut Cc: Alexey Firago Cc: Laurent Pinchart Cc: Michael Turquette Cc: Stephen Boyd Cc: linux-renesas-soc@vger.kernel.org Reviewed-by: Laurent Pinchart Tested-by: Laurent Pinchart Signed-off-by: Stephen Boyd commit 9dc320424708378b7a2137a148fc4fc816105ba2 Merge: 44a6951777a3c 8a034aad4892b Author: Stephen Boyd Date: Fri Dec 14 13:42:08 2018 -0800 Merge branch 'clk-fixes' into clk-next * clk-fixes: clk: qcom: qcs404: Fix gpll0_out_main parent clk: zynqmp: Off by one in zynqmp_is_valid_clock() clk: mmp: Off by one in mmp_clk_add() clk: mvebu: Off by one bugs in cp110_of_clk_get() arm64: dts: qcom: sdm845-mtp: Mark protected gcc clocks clk: zynqmp: handle fixed factor param query error clk: qcom: gcc: Fix board clock node name clk: meson: axg: mark fdiv2 and fdiv3 as critical clk: meson-gxbb: set fclk_div3 as CLK_IS_CRITICAL clk: fixed-factor: fix of_node_get-put imbalance commit 44a6951777a3c6bd6f934e23537c2965a0283985 Merge: 58c05c823b834 0f1c6ca83fb48 Author: Stephen Boyd Date: Fri Dec 14 13:42:00 2018 -0800 Merge branch 'clk-qcom-8998-resets' into clk-next - Add resets and make Qualcomm MSM8998 GCC driver more functional * clk-qcom-8998-resets: clk: qcom: Drop unused 8998 clock clk: qcom: Leave mmss noc on for 8998 clk: qcom: Add missing msm8998 resets clk: qcom: gcc-msm8998: Add clkref clocks clk: qcom: gcc-msm8998: Disable halt check of UFS clocks clk: qcom: gcc-msm8998: Drop hmss_dvm and lpass_at clk: qcom: Enumerate remaining msm8998 resets clk: qcom: Add xo dummy clk on msm8998 clk: qcom: Fix MSM8998 resets commit 0f1c6ca83fb483a5ea85fe239588a90bb29d519d Author: Jeffrey Hugo Date: Thu Dec 13 10:09:09 2018 -0700 clk: qcom: Drop unused 8998 clock gcc_lpass_trig_clk is not used downstream, therefore there is no reason to expect it to be needed for clients. Let's remove it because messing with the clock has been observed to cause Linux hangs when the qdss_clk is initialized by rpmcc. Signed-off-by: Jeffrey Hugo Reviewed-by: Marc Gonzalez Fixes: 4807c71cc688 (arm64: dts: Add msm8998 SoC and MTP board support) Signed-off-by: Stephen Boyd commit 12eced09cd301aa7b1868a67c50a651c2aacd363 Author: Jeffrey Hugo Date: Thu Dec 13 15:43:40 2018 -0700 clk: qcom: Leave mmss noc on for 8998 Similar to other qcom targets, gcc_mmss_noc_cfg_ahb_clk should not be disabled. Any mmss access depends on this clock, and its been observed that enabling mmssnoc_axi_rpm_clk with rpmcc results in an implicit access to mmss and will crash the system if gcc_mmss_noc_cfg_ahb_clk is disabled. Signed-off-by: Jeffrey Hugo Fixes: 4807c71cc688 (arm64: dts: Add msm8998 SoC and MTP board support) Signed-off-by: Stephen Boyd commit 390de1940441a72625283098dd0d9303d0ceb8fb Author: Wen Yang Date: Tue Dec 11 12:20:46 2018 +0800 net/ibmvnic: Remove tests of member address The driver was checking for non-NULL address. - adapter->napi[i] This is pointless as these will be always non-NULL, since the 'dapter->napi' is allocated in init_napi(). It is safe to get rid of useless checks for addresses to fix the coccinelle warning: >>drivers/net/ethernet/ibm/ibmvnic.c: test of a variable/field address Since such statements always return true, they are redundant. Signed-off-by: Wen Yang CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Michael Ellerman CC: Thomas Falcon CC: John Allen CC: "David S. Miller" CC: linuxppc-dev@lists.ozlabs.org CC: netdev@vger.kernel.org CC: linux-kernel@vger.kernel.org Signed-off-by: David S. Miller commit 6342ca644713601b42dcb8f35e3751afc0943373 Author: Prashant Bhole Date: Tue Dec 11 11:43:07 2018 +0900 tun: replace get_cpu_ptr with this_cpu_ptr when bh disabled tun_xdp_one() runs with local bh disabled. So there is no need to disable preemption by calling get_cpu_ptr while updating stats. This patch replaces the use of get_cpu_ptr() with this_cpu_ptr() as a micro-optimization. Also removes related put_cpu_ptr call. Acked-by: Jason Wang Signed-off-by: Prashant Bhole Acked-by: Michael S. Tsirkin Signed-off-by: David S. Miller commit 58c05c823b8347daf03a8448e38318820fad6645 Merge: ffe05540d1801 b1260067ac3dd 3cc48976e9763 929914946fa61 1e3121bfe51a3 d360b130e210f Author: Stephen Boyd Date: Fri Dec 14 13:34:47 2018 -0800 Merge branches 'clk-imx7ulp', 'clk-imx6-fixes', 'clk-imx-fixes', 'clk-imx8qxp' and 'clk-imx8mq' into clk-next - NXP i.MX7ULP SoC clock support - Support for i.MX8QXP SoC clocks - Support for NXP i.MX8MQ clock controllers * clk-imx7ulp: clk: imx: add imx7ulp clk driver clk: imx: implement new clk_hw based APIs clk: imx: make mux parent strings const dt-bindings: clock: add imx7ulp clock binding doc clk: imx: add imx7ulp composite clk support clk: imx: add pfdv2 support clk: imx: add pllv4 support clk: fractional-divider: add CLK_FRAC_DIVIDER_ZERO_BASED flag support clk: imx: add gatable clock divider support * clk-imx6-fixes: clk: imx6q: handle ENET PLL bypass clk: imx6q: optionally get CCM inputs via standard clock handles clk: imx6q: reset exclusive gates on init * clk-imx-fixes: clk: imx6q: add DCICx clocks gate clk: imx6sl: ensure MMDC CH0 handshake is bypassed clk: imx7d: remove UART1 clock setting * clk-imx8qxp: clk: imx: add imx8qxp lpcg driver clk: imx: add lpcg clock support clk: imx: add imx8qxp clk driver clk: imx: add scu clock common part clk: imx: add configuration option for mmio clks dt-bindings: clock: add imx8qxp lpcg clock binding dt-bindings: clock: imx8qxp: add SCU clock IDs firmware: imx: add pm svc headfile dt-bindings: fsl: scu: update power domain binding firmware: imx: remove resource id enums dt-bindings: imx: add scu resource id headfile * clk-imx8mq: clk: imx: Make the i.MX8MQ CCM clock driver CLK_IMX8MQ dependant clk: imx: remove redundant initialization of ret to zero clk: imx: Add SCCG PLL type clk: imx: Add fractional PLL output clock clk: imx: Add clock driver for i.MX8MQ CCM clk: imx: Add imx composite clock dt-bindings: Add binding for i.MX8MQ CCM commit ffe05540d18013db62c43627836a3638e9a2c7aa Merge: 1a501c8defe95 60baf75e3f5b7 67ee606a6bbb5 08441a966219a e74581b79ddd9 5b5bb7c77a87f Author: Stephen Boyd Date: Fri Dec 14 13:34:00 2018 -0800 Merge branches 'clk-renesas', 'clk-allwinner', 'clk-tegra', 'clk-meson' and 'clk-rockchip' into clk-next * clk-renesas: clk: renesas: rcar-gen3: Add HS400 quirk for SD clock clk: renesas: rcar-gen3: Add documentation for SD clocks clk: renesas: rcar-gen3: Set state when registering SD clocks clk: renesas: r8a77995: Simplify PLL3 multiplier/divider clk: renesas: r8a77995: Add missing CPEX clock clk: renesas: r8a77995: Remove non-existent SSP clocks clk: renesas: r8a77995: Remove non-existent VIN5-7 module clocks clk: renesas: r8a77995: Correct parent clock of DU clk: renesas: r8a77990: Correct parent clock of DU clk: renesas: r8a77970: Add CPEX clock clk: renesas: r8a77965: Add CPEX clock clk: renesas: r8a7796: Add CPEX clock clk: renesas: r8a7795: Add CPEX clock clk: renesas: r8a774a1: Add CPEX clock dt-bindings: clock: r8a7796: Remove CSIREF clock dt-bindings: clock: r8a7795: Remove CSIREF clock clk: renesas: Mark rza2_cpg_clk_register static clk: renesas: r7s9210: Add USB clocks clk: renesas: r8a77970: Add RPC clocks clk: renesas: r7s9210: Add SDHI clocks * clk-allwinner: clk: sunxi-ng: a64: Allow parent change for VE clock clk: sunxi-ng: a33: Set CLK_SET_RATE_PARENT for all audio module clocks clk: sunxi-ng: a33: Use sigma-delta modulation for audio PLL clk: sunxi-ng: h3: Allow parent change for ve clock clk: sunxi-ng: add support for suniv F1C100s SoC dt-bindings: clock: Add Allwinner suniv F1C100s CCU clk: sunxi-ng: h3/h5: Fix CSI_MCLK parent clk: sunxi-ng: r40: Force LOSC parent to RTC LOSC output clk: sunxi-ng: sun50i: a64: Use sigma-delta modulation for audio PLL clk: sunxi-ng: a64: Fix gate bit of DSI DPHY clk: sunxi-ng: Enable DE2_CCU for SUN8I and SUN50I clk: sunxi-ng: Add support for H6 DE3 clocks dt-bindings: clock: sun8i-de2: Add H6 DE3 clock description clk: sunxi-ng: h6: Set video PLLs limits clk: sunxi-ng: Use u64 for calculation of NM rate clk: sunxi-ng: Adjust MP clock parent rate when allowed clk: sunxi-ng: sun50i: h6: Fix MMC clock mux width clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock * clk-tegra: clk: tegra: Return the exact clock rate from clk_round_rate clk: tegra30: Use Tegra CPU powergate helper function soc/tegra: pmc: Drop SMP dependency from CPU APIs clk: tegra: Fix maximum audio sync clock for Tegra124/210 clk: tegra: get rid of duplicate defines clk: tegra20: Check whether direct PLLM sourcing is turned off for EMC clk: tegra20: Turn EMC clock gate into divider * clk-meson: (25 commits) clk: meson: axg-audio: use the clk input helper function clk: meson: add clk-input helper function clk: meson: Mark some things static clk: meson: meson8b: add the read-only video clock trees clk: meson: meson8b: add the fractional divider for vid_pll_dco clk: meson: meson8b: fix the offset of vid_pll_dco's N value clk: meson: Fix GXL HDMI PLL fractional bits width clk: meson: meson8b: add the CPU clock post divider clocks clk: meson: meson8b: rename cpu_div2/cpu_div3 to cpu_in_div2/cpu_in_div3 clk: meson: clk-regmap: add read-only gate ops clk: meson: meson8b: allow changing the CPU clock tree clk: meson: meson8b: run from the XTAL when changing the CPU frequency clk: meson: meson8b: add support for more M/N values in sys_pll clk: meson: meson8b: mark the CPU clock as CLK_IS_CRITICAL clk: meson: meson8b: do not use cpu_div3 for cpu_scale_out_sel clk: meson: clk-pll: check if the clock is already enabled clk: meson: meson8b: fix the width of the cpu_scale_div clock clk: meson: meson8b: fix incorrect divider mapping in cpu_scale_table clk: meson: meson8b: use the HHI syscon if available dt-bindings: clock: meson8b: use the registers from the HHI syscon ... * clk-rockchip: clk: rockchip: add clock-id to gate of ACODEC for rk3328 clk: rockchip: add clock ID of ACODEC for rk3328 clk: rockchip: fix ID of 8ch clock of I2S1 for rk3328 clk: rockchip: fix I2S1 clock gate register for rk3328 clk: rockchip: make rk3188 hclk_vio_bus critical clk: rockchip: fix rk3188 sclk_mac_lbtest parameter ordering clk: rockchip: fix rk3188 sclk_smc gate data clk: rockchip: fix typo in rk3188 spdif_frac parent commit 1a501c8defe950571316d5ddd917bf44f5ed7bd4 Merge: 3315fe5faff4e 2e62246b08a69 e1bd55e5a567a 0f51659a438ee 56950ff82325b Author: Stephen Boyd Date: Fri Dec 14 13:33:44 2018 -0800 Merge branches 'clk-managed-registration', 'clk-spdx', 'clk-remove-basic' and 'clk-ops-const' into clk-next - Make devm_of_clk_add_hw_provider() use parent dt node if necessary - Various SPDX taggings - Mark clk_ops const when possible * clk-managed-registration: clk: bd718x7: Initial support for ROHM bd71837/bd71847 PMIC clock clk: apcs-msm8916: simplify probe cleanup by using devm clk: clk-twl6040: Free of_provider at remove clk: rk808: use managed version of of_provider registration clk: clk-hi655x: Free of_provider at remove clk: of-provider: look at parent if registered device has no provider info clk: Add kerneldoc to managed of-provider interfaces * clk-spdx: clk: Tag basic clk types with SPDX clk: Tag clk core files with SPDX clk: bcm2835: Switch to SPDX identifier * clk-remove-basic: clk: Loongson1: Remove usage of CLK_IS_BASIC clk: samsung: s3c2410: Remove usage of CLK_IS_BASIC clk: versatile: sp810: Remove usage of CLK_IS_BASIC clk: hisilicon: Remove usage of CLK_IS_BASIC clk: h8300: Remove usage of CLK_IS_BASIC clk: axm5516: Remove usage of CLK_IS_BASIC clk: st: Remove usage of CLK_IS_BASIC clk: renesas: Remove usage of CLK_IS_BASIC * clk-ops-const: clk: s2mps11: constify clk_ops structure clk: pxa: constify clk_ops structures clk: pistachio: constify clk_ops structures clk: palmas: constify clk_ops structure clk: max77686: constify clk_ops structure commit 08441a966219aee513cf802ca8de170c6655c61a Author: Robert Yang Date: Tue Sep 25 17:49:40 2018 -0400 clk: tegra: Return the exact clock rate from clk_round_rate The current behavior is that clk_round_rate would return the same clock rate passed to it for valid PLL configurations. This change will return the exact rate the PLL will provide in accordance with clk API. Signed-off-by: Robert Yang Reviewed-by: Dmitry Osipenko Tested-by: Dmitry Osipenko Acked-by: Thierry Reding Signed-off-by: Stephen Boyd commit b158aeeacc551a689dc26824800a0a27f3668bb1 Author: Jon Hunter Date: Mon Dec 3 10:28:41 2018 +0000 clk: tegra30: Use Tegra CPU powergate helper function Rather than using the tegra_powergate_is_powered() function for determining if a CPU is powered, use the tegra_pmc_cpu_is_powered() instead which was created to get the CPU power status. Internally tegra_pmc_cpu_is_powered() calls tegra_powergate_is_powered() and so is equivalent. The Tegra30 clock driver is the only public user of tegra_powergate_is_powered() and so by updating the Tegra30 clock driver to use tegra_pmc_cpu_is_powered(), we can then make tegra_powergate_is_powered() a non-public function. Signed-off-by: Jon Hunter Acked-by: Thierry Reding Signed-off-by: Stephen Boyd commit f9c380efa792f313d3366a935fe38091d4c98ccb Author: Jon Hunter Date: Thu Dec 13 09:46:14 2018 +0000 soc/tegra: pmc: Drop SMP dependency from CPU APIs When CONFIG_SMP is disabled, the tegra clk driver now fails to build: drivers/clk/tegra/clk-tegra30.c: In function ‘tegra30_cpu_rail_off_ready’: drivers/clk/tegra/clk-tegra30.c:1151:2: error: implicit declaration of function ‘tegra_pmc_cpu_is_powered’ [-Werror=implicit-function-declaration] cpu_pwr_status = tegra_pmc_cpu_is_powered(1) || ^ Fix the above error by removing the CONFIG_SMP ifdef around the declaration around the PMC CPU APIs because although these are not needed for non-SMP configurations, there is no harm in including these for non-SMP builds either. Fixes: 61866523ed6e ("clk: tegra30: Use Tegra CPU powergate helper function") Reported-by: Arnd Bergmann Signed-off-by: Jon Hunter Acked-by: Thierry Reding Signed-off-by: Stephen Boyd commit 845d782d91448e0fbca686bca2cc9f9c2a9ba3e7 Author: Jon Hunter Date: Mon Dec 3 10:28:40 2018 +0000 clk: tegra: Fix maximum audio sync clock for Tegra124/210 The maximum frequency supported for I2S on Tegra124 and Tegra210 is 24.576MHz (as stated in the Tegra TK1 data sheet for Tegra124 and the Jetson TX1 module data sheet for Tegra210). However, the maximum I2S frequency is limited to 24MHz because that is the maximum frequency of the audio sync clock. Increase the maximum audio sync clock frequency to 24.576MHz for Tegra124 and Tegra210 in order to support 24.576MHz for I2S. Update the tegra_clk_register_sync_source() function so that it does not set the initial rate for the sync clocks and use the clock init tables to set the initial rate instead. Signed-off-by: Jon Hunter Acked-by: Thierry Reding Signed-off-by: Stephen Boyd commit 7514557c1c57c1973b7c2c6095c160f0a18f5da1 Author: Marcel Ziswiler Date: Thu Nov 1 02:52:28 2018 +0100 clk: tegra: get rid of duplicate defines Get rid of 3 duplicate defines. Signed-off-by: Marcel Ziswiler Acked-by: Thierry Reding Signed-off-by: Stephen Boyd commit 9582466640432c86fb060a4fa4d9d3c48e708ca6 Author: Aviv Heller Date: Mon Aug 27 15:39:40 2018 +0300 net/mlx5: Handle LAG FW commands failure gracefully When create_lag or destroy_lag FW commands fail, display an appropriate error message, and try to recover, if possible. Signed-off-by: Aviv Heller Reviewed-by: Roi Dayan Reviewed-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed commit 7c34ec19e10c0d13ca2f3435fb85d2dddccad917 Author: Aviv Heller Date: Thu Aug 23 13:47:53 2018 +0300 net/mlx5: Make RoCE and SR-IOV LAG modes explicit With the introduction of SR-IOV LAG, checking whether LAG is active is no longer good enough, since RoCE and SR-IOV LAG each entails different behavior by both the core and infiniband drivers. This patch introduces facilities to discern LAG type, in addition to mlx5_lag_is_active(). These are implemented in such a way as to allow more complex mode combinations in the future. Signed-off-by: Aviv Heller Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 292612d68c4ed3063cdc99512e865a819b8c9423 Author: Aviv Heller Date: Thu Aug 23 13:34:10 2018 +0300 net/mlx5: Rename mlx5_lag_is_bonded() to __mlx5_lag_is_active() The new name better represents the function's aim, and sets a precedent for a '__' prefix for internal, non-locked versions of LAG APIs. Signed-off-by: Aviv Heller Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 8aaca1976e2757e15edf43866a0549b321a4222f Author: Rabie Loulou Date: Wed May 23 14:19:07 2018 +0300 net/mlx5: Allow co-enablement of uplink LAG and SRIOV Enable setting uplink LAG if sriov is enabled on both ports in switchdev mode. Once the sriov mode is changed from switchdev for any of the ports, the LAG instance is disabled. Signed-off-by: Rabie Loulou Signed-off-by: Aviv Heller Signed-off-by: Jianbo Liu Signed-off-by: Saeed Mahameed commit eff849b2c669ebf0df88762f082bcb252f8e883c Author: Rabie Loulou Date: Wed Jun 6 16:31:34 2018 +0300 net/mlx5: Allow/disallow LAG according to pre-req only Remove the lag forbid/allow functions, change the lag prereq check to run in the do-bond logic, so every change in the prereq state will cause LAG to be disabled/enabled accordingly after the next do-bond run. Add lag update function, so every component which changes the prereq state and want the LAG to re-calc the conditions can call the update function. Signed-off-by: Rabie Loulou Signed-off-by: Aviv Heller Signed-off-by: Saeed Mahameed commit 3b5ff59fd851d8e8c7c3ba08b01011baffa60cb6 Author: Rabie Loulou Date: Thu Apr 26 16:45:41 2018 +0300 net/mlx5: Adjustments for the activate LAG logic to run under sriov When HW lag is set/unset, roce must not be enabled on the port, as such we wrap such changes with roce enable/disable either directly or through re-creation of IB device. Currently, lag and sriov are mutually exclusive, so by definition this code doesn't run under sriov. Towards changing this exclusion, we need to make sure that roce will not be enabled on the eswitch manager port under sriov since this is requirement of the switchdev mode. We are going strict here and avoiding this all together under sriov. Signed-off-by: Rabie Loulou Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 1418ddd96afdb097ab9a2fe09c94e820d596321a Author: Aviv Heller Date: Tue Oct 2 17:18:44 2018 +0300 net/mlx5e: Duplicate offloaded TC eswitch rules under uplink LAG Under uplink LAG, packets that match a flow might arrive on both uplink ports and transmitted through both as part of supporting aggregation and high-availability. When the netdevs representing the uplinks are set into LAG (bonding, teaming), duplicate the TC flow offloading into each of the per-uplink e-switches. Duplication is not required if the source is the bond device, since in this case it is assumed that the bond and the uplink netdevs share the same TC block, and thus duplication will occur naturally by the stack. Note that under encapsulation scheme, both flows will use the same neighbour and hence both will contribute to the last-used feedback towards the stack. Signed-off-by: Aviv Heller Signed-off-by: Rabie Loulou Reviewed-by: Or Gerlitz Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 7ba58ba7ba5e19324b3879000ef341966b19727b Author: Rabie Loulou Date: Wed Jun 6 16:27:08 2018 +0300 net/mlx5e: Offload TC e-switch rules with egress LAG device When parsing TC FDB actions, if the egress device is a bond/team net-device which enslaved the uplink representor of the e-switch, use the uplink representor as the destination in the HW rule. Signed-off-by: Rabie Loulou Signed-off-by: Aviv Heller Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 491c37e49b48e7a18dc79e29f3ac13e0c3d0fb54 Author: Rabie Loulou Date: Wed Jun 6 15:49:27 2018 +0300 net/mlx5e: In case of LAG, one switch parent id is used for all representors When the uplink representors are put into lag, set all the representors (VFs and uplinks) of the same NIC to return the same switchdev id. Currently, the route lookup code on the encapsulation offload path assumes that same switchdev id for the source and dest devices means that the dest is also mlx5 HW netdev. This doesn't hold anymore when we align the switchdev Id of the uplinks to be same, which in turn causes the bond/team to return that id to the caller. As such, enhance the relevant check to take into account the uplink lag case. Signed-off-by: Rabie Loulou Signed-off-by: Aviv Heller Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit f9392795e2e35449a7dca46574b1a86eace20e9c Author: Shahar Klein Date: Thu Nov 30 17:55:46 2017 +0200 net/mlx5e: Enhance flow counter scheme for offloaded TC eswitch rules Assign a counter dev attribute according to device capability and use it for management of counters related to offloaded eswitch TC flows. With upcoming support for uplink LAG, we have two HW rules per one logical SW (TC) rule. Although the HW supports attaching one counter to multiple rules, we are allocating counter per HW rule. We need this separation for two reasons: 1. "flow eswitch" counter affinity HW require the counter to be allocated on the device where the eswitch rule is set. 2. for some use-cases (multi-path routing) each HW flow relates to different neighbour, hence our neigh update logic must have a per-rule HW accountant in order to provide the proper feedback to the kernel. Signed-off-by: Shahar Klein Signed-off-by: Roi Dayan Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 04de7dda7394fa9c2b0fc9cec65661d9b4f0d04d Author: Roi Dayan Date: Sun Nov 11 22:24:03 2018 +0200 net/mlx5e: Infrastructure for duplicated offloading of TC flows Under uplink LAG or multipath schemes, traffic that matches one flow might arrive on both uplink ports and transmitted through both as part of supporting aggregation and high-availability. To cope with the fact that the SW model might use logical SW port (e.g uplink team or bond) but we have two HW ports with e-switch on each, there are cases where in order to offload a SW TC rule we need to duplicate it to two HW flows. Since each HW rule has its own counter we also aggregate the counter of both rules when a flow stats query is executed from user-space. Introduce the changes for the different elements (add/delete/stats), currently nothing is duplicated. Signed-off-by: Roi Dayan Signed-off-by: Aviv Heller Signed-off-by: Shahar Klein Signed-off-by: Saeed Mahameed commit ac004b8321281b9da7d9a99674241e60e49ffc8a Author: Roi Dayan Date: Sun Nov 11 17:50:16 2018 +0200 net/mlx5e: E-Switch, Add peer miss rules In the sriov offloads mode, packets that are not matched by any other rule are sent towards the e-switch vport manager for further processing. Under upcoming patches (e.g for uplink LAG), packets sent from VF vports belonging to esw0 (e-switch related to PF0) might end up in esw1 (e-switch related to PF1) due to muxing logic applied by the FW. In such a case we still want the missed packet to be sent to the "base" esw manager vport in order to present the control plane a consistent view of the source (VF reresentor) port. Signed-off-by: Roi Dayan Signed-off-by: Aviv Heller Signed-off-by: Shahar Klein Signed-off-by: Saeed Mahameed commit fadd59fc50d010145f251db583c7ccef37393d19 Author: Aviv Heller Date: Tue Dec 4 21:24:46 2018 +0200 net/mlx5: Introduce inter-device communication mechanism This introduces devcom, a generic mechanism for performing operations on both physical functions of the same Connect-X card. The first user of this API is merged eswitch, which will be introduced in subsequent patches. Signed-off-by: Aviv Heller Signed-off-by: Saeed Mahameed commit 3315fe5faff4e38fafba8434ea75d90ed66a44c6 Merge: f4ad7fba066f7 8d3e5b9c1f2cd Author: Stephen Boyd Date: Fri Dec 14 13:27:39 2018 -0800 Merge branch 'clk-qcom-sdm845-lpass' into clk-next - Qualcomm SDM845 audio subsystem clks * clk-qcom-sdm845-lpass: clk: qcom: Add lpass clock controller driver for SDM845 dt-bindings: clock: Introduce QCOM LPASS clock bindings dt-bindings: clock: Update GCC bindings for protected-clocks commit f4ad7fba066f70ccd50816476e2f8700013c0724 Merge: aab184d23b450 f071bcebee0ad 922b8fae085d6 eaeee28db2893 f87d33e663d65 c51ba54f6349e Author: Stephen Boyd Date: Fri Dec 14 13:26:21 2018 -0800 Merge branches 'clk-qcom-kconfig', 'clk-qcom-gpucc', 'clk-qcom-qcs404-rpm', 'clk-qcom-spi' and 'clk-qcom-videocc-binding' into clk-next - Qualcomm SDM845 GPU clock controllers - Qualcomm QCS404 RPM clk support * clk-qcom-kconfig: clk: qcom: Move to menuconfig and reduce lines * clk-qcom-gpucc: dt-bindings: clock: qcom: Fix the xo parent in gpucc example clk: qcom: gpu_cc_gmu_clk_src has 5 parents, not 6 clk: qcom: Add a dummy enable function for GX gdsc clk: qcom: gdsc: Don't override existing gdsc pd functions clk: qcom: Add graphics clock controller driver for SDM845 dt-bindings: clock: Introduce QCOM Graphics clock bindings * clk-qcom-qcs404-rpm: clk: qcom: smd: Add support for QCS404 rpm clocks * clk-qcom-spi: clk: qcom: msm8916: Additional clock rates for spi * clk-qcom-videocc-binding: dt-bindings: clock: Require #reset-cells in sdm845-videocc commit c2c79a32fb860ee374afe58fee6d67ab6aa83081 Author: Arnd Bergmann Date: Mon Dec 10 22:52:56 2018 +0100 hamradio, ppp: change semaphore to completion ppp and hamradio have copies of the same code that uses a semaphore in place of a completion for historic reasons. Make it use the proper interface instead in all copies. Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit aab184d23b4502c21f35a80e5e75fe7a78d00812 Merge: d7d458cb29e1e b8b211ca763a6 b181b3b801da8 e374e06880f93 25bf466bd2bd0 Author: Stephen Boyd Date: Fri Dec 14 13:24:54 2018 -0800 Merge branches 'clk-qoriq-t1023', 'clk-protected-binding', 'clk-define-show-macro' and 'clk-static' into clk-next - NXP QorIQ T1023 SoC support - Introduce a 'protected-clocks' binding for firmware protected clks - Shrink code some with DEFINE_SHOW_ATTRIBUTE() * clk-qoriq-t1023: clk: qoriq: add more chips support * clk-protected-binding: clk: qcom: Support 'protected-clocks' property dt-bindings: clk: Introduce 'protected-clocks' property * clk-define-show-macro: clk: tegra: Change to use DEFINE_SHOW_ATTRIBUTE macro clk: nomadik: Change to use DEFINE_SHOW_ATTRIBUTE macro * clk-static: clk: stm32mp1: drop pointless static qualifier in stm32_register_hw_clk() commit d7d458cb29e1ec5857a7d73ca89846e4240bb5a4 Merge: 819ed0ad91cdd 8b627f616ed63 d42925189b416 Author: Stephen Boyd Date: Fri Dec 14 13:24:47 2018 -0800 Merge branches 'clk-bcm-module-license', 'clk-boston-leak' and 'clk-mtk-mt7629' into clk-next - Mediatek MT7629 SoC clk controllers * clk-bcm-module-license: clk: bcm2835: make license text and module license match * clk-boston-leak: clk: boston: unregister clks on failure in clk_boston_setup() clk: boston: fix possible memory leak in clk_boston_setup() * clk-mtk-mt7629: clk: mediatek: fix the PCIe MAC clock parent clk: mediatek: Drop more __init markings for driver probe clk: mediatek: Drop __init from mtk_clk_register_cpumuxes() dt-bindings: arm: mediatek: document clk bindings for MT7629 clk: mediatek: add clock support for MT7629 SoC commit 2aa55dccf83d7ca9f1da59ae005426c44fbeb890 Author: Arnd Bergmann Date: Mon Dec 10 21:44:34 2018 +0100 hns3: prevent building without CONFIG_INET We now get a link failure when CONFIG_INET is disabled, since tcp_gro_complete is unavailable: drivers/net/ethernet/hisilicon/hns3/hns3_enet.o: In function `hns3_set_gro_param': hns3_enet.c:(.text+0x230c): undefined reference to `tcp_gro_complete' Add an explicit CONFIG_INET dependency here to avoid the broken configuration. Fixes: a6d53b97a2e7 ("net: hns3: Adds GRO params to SKB for the stack") Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller commit 1e3121bfe51a3424050ae66326e8a113f0ed7fb8 Author: Aisheng Dong Date: Thu Dec 13 15:43:05 2018 +0000 clk: imx: add imx8qxp lpcg driver Add imx8qxp lpcg driver support Cc: Stephen Boyd Cc: Shawn Guo Cc: Sascha Hauer Cc: Fabio Estevam Cc: Michael Turquette Signed-off-by: Dong Aisheng Signed-off-by: Stephen Boyd commit 2f77296d3df9915490f41fc8a971cba00e0b4a2c Author: Aisheng Dong Date: Thu Dec 13 15:43:01 2018 +0000 clk: imx: add lpcg clock support The Low-Power Clock Gate (LPCG) modules contain a local programming model to control the clock gates for the peripherals. An LPCG module is used to locally gate the clocks for the associated peripheral. And they're bedind the SCU clock. Cc: Stephen Boyd Cc: Shawn Guo Cc: Sascha Hauer Cc: Fabio Estevam Cc: Michael Turquette Signed-off-by: Dong Aisheng Signed-off-by: Stephen Boyd commit c2cccb6d0b33bad71154ec0c208d060456bcf6d4 Author: Aisheng Dong Date: Thu Dec 13 15:42:58 2018 +0000 clk: imx: add imx8qxp clk driver Add imx8qxp clk driver which is based on SCU firmware clock service. Cc: Shawn Guo Cc: Sascha Hauer Cc: Fabio Estevam Cc: Stephen Boyd Cc: Michael Turquette Signed-off-by: Dong Aisheng [sboyd@kernel.org: Move the makefile rule higher in the file] Signed-off-by: Stephen Boyd commit d360b130e210f2468b2ff9cae5177c6cba780e83 Author: Abel Vesa Date: Fri Dec 14 14:20:34 2018 +0000 clk: imx: Make the i.MX8MQ CCM clock driver CLK_IMX8MQ dependant Remove the dependency between the i.MX8MQ CCM clock driver and the CONFIG_SOC_IMX8MQ and use CONFIG_CLK_IMX8MQ instead. CONFIG_CLK_IMX8MQ depends on ARCH_MXC && ARM64. Signed-off-by: Abel Vesa Signed-off-by: Stephen Boyd commit a3a0ebd10a9b6cf6c33885016393729112c85083 Author: Michel Dänzer Date: Thu Dec 13 17:05:31 2018 +0100 drm/amdgpu: WARN once if amdgpu_bo_unpin is called for an unpinned BO It indicates a pin/unpin imbalance bug somewhere. While the bug isn't necessarily in the call chain hitting this, it's at least one part involved. Reviewed-by: Alex Deucher Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit 344e7ad467f5bd057b9d4d66adafbfa8077ccaa6 Author: Evan Quan Date: Tue Dec 11 11:28:20 2018 +0800 drm/amdgpu: enable Vega20 page queue support Page queue is supported on Vega20 with SDMA firmware 123 onwards. Signed-off-by: Evan Quan Acked-by: Christian König Signed-off-by: Alex Deucher commit fefdc6cc0af87fff149b797ce308e98c302fddd3 Author: Evan Quan Date: Mon Dec 10 15:12:29 2018 +0800 drm/amdgpu: use different irq ring ID for Vega20 page queues Vega20 uses ring id 1 for page queues EOP irq while previous ASICs take ring id 3. Signed-off-by: Evan Quan Acked-by: Christian König Signed-off-by: Alex Deucher commit c713a461459202504050305242cd854bad57837c Author: Evan Quan Date: Wed Nov 21 13:04:48 2018 +0800 drm/amdgpu: update the vm invalidation engine layout V2 We need new invalidation engine layout due to new SDMA page queues added. V2: fix coding style and add correct return value Signed-off-by: Evan Quan Reviewed-by: Christian König Reviewed-by: Oak Zeng Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 1b3f6bc96883f685224b14f04f587643a47109dd Author: Evan Quan Date: Wed Nov 21 11:25:53 2018 +0800 drm/amdgpu: increase the MAX ring number As two more SDMA page queue rings are added on Vega20. Signed-off-by: Evan Quan Reviewed-by: Oak Zeng Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 4e9177134e7dd992dd96875143413dbc303f355e Author: Christian König Date: Mon Dec 3 14:05:34 2018 +0100 drm/amdgpu: fix NULL fence handling in amdgpu_cs_fence_to_handle_ioctl When the fence is already signaled it is perfectly normal to get a NULL fence here. But since we can't export that we need to use a stub fence. Signed-off-by: Christian König Reviewed-by: Chunming Zhou Signed-off-by: Alex Deucher commit 93d77e7f1410c366050d6035dcba1a5167c7cf0b Author: Vincent Whitchurch Date: Fri Dec 14 17:05:55 2018 +0100 ARM: module: Fix function kallsyms on Thumb-2 Thumb-2 functions have the lowest bit set in the symbol value in the symtab. When kallsyms are generated for the vmlinux, the kallsyms are generated from the output of nm, and nm clears the lowest bit. $ arm-linux-gnueabihf-readelf -a vmlinux | grep show_interrupts 95947: 8015dc89 686 FUNC GLOBAL DEFAULT 2 show_interrupts $ arm-linux-gnueabihf-nm vmlinux | grep show_interrupts 8015dc88 T show_interrupts $ cat /proc/kallsyms | grep show_interrupts 8015dc88 T show_interrupts However, for modules, the kallsyms uses the values in the symbol table without modification, so for functions in modules, the lowest bit is set in kallsyms. $ arm-linux-gnueabihf-readelf -a drivers/net/tun.ko | grep tun_get_socket 333: 00002d4d 36 FUNC GLOBAL DEFAULT 1 tun_get_socket $ arm-linux-gnueabihf-nm drivers/net/tun.ko | grep tun_get_socket 00002d4c T tun_get_socket $ cat /proc/kallsyms | grep tun_get_socket 7f802d4d t tun_get_socket [tun] Because of this, the symbol+offset of the crashing instruction shown in oopses is incorrect when the crash is in a module. For example, given a tun_get_socket which starts like this, 00002d4c : 2d4c: 6943 ldr r3, [r0, #20] 2d4e: 4a07 ldr r2, [pc, #28] 2d50: 4293 cmp r3, r2 a crash when tun_get_socket is called with NULL results in: PC is at tun_xdp+0xa3/0xa4 [tun] pc : [<7f802d4c>] As can be seen, the "PC is at" line reports the wrong symbol name, and the symbol+offset will point to the wrong source line if it is passed to gdb. To solve this, add a way for archs to fixup the reading of these module kallsyms values, and use that to clear the lowest bit for function symbols on Thumb-2. After the fix: # cat /proc/kallsyms | grep tun_get_socket 7f802d4c t tun_get_socket [tun] PC is at tun_get_socket+0x0/0x24 [tun] pc : [<7f802d4c>] Signed-off-by: Vincent Whitchurch Signed-off-by: Jessica Yu commit 5439c985c5a83a8419f762115afdf560ab72a452 Author: Vincent Whitchurch Date: Fri Dec 14 17:05:54 2018 +0100 module: Overwrite st_size instead of st_info st_info is currently overwritten after relocation and used to store the elf_type(). However, we're going to need it fix kallsyms on ARM's Thumb-2 kernels, so preserve st_info and overwrite the st_size field instead. st_size is neither used by the module core nor by any architecture. Reviewed-by: Miroslav Benes Reviewed-by: Dave Martin Signed-off-by: Vincent Whitchurch Signed-off-by: Jessica Yu commit 99bf73ebf9c4193dbcc5331b29d316a89ada43d1 Author: Firoz Khan Date: Thu Dec 13 14:37:39 2018 +0530 mips: generate uapi header and system call table files System call table generation script must be run to gener- ate unistd_(nr_)n64/n32/o32.h and syscall_table_32_o32/ 64_n64/64_n32/64-o32.h files. This patch will have changes which will invokes the script. This patch will generate unistd_(nr_)n64/n32/o32.h and syscall_table_32_o32/64_n64/64-n32/64-o32.h files by the syscall table generation script invoked by parisc/Make- file and the generated files against the removed files must be identical. The generated uapi header file will be included in uapi/- asm/unistd.h and generated system call table header file will be included by kernel/scall32-o32/64-n64/64-n32/- 64-o32.Sfile. Signed-off-by: Firoz Khan Signed-off-by: Paul Burton Cc: linux-mips@vger.kernel.org Cc: Ralf Baechle Cc: James Hogan Cc: Greg Kroah-Hartman Cc: Philippe Ombredanne Cc: Thomas Gleixner Cc: Kate Stewart Cc: y2038@lists.linaro.org Cc: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: arnd@arndb.de Cc: deepa.kernel@gmail.com Cc: marcin.juszkiewicz@linaro.org commit 9bcbf97c62931f27ab2c52f0848dec0cd48aee78 Author: Firoz Khan Date: Thu Dec 13 14:37:38 2018 +0530 mips: add system call table generation support The system call tables are in different format in all architecture and it will be difficult to manually add, modify or delete the syscall table entries in the res- pective files. To make it easy by keeping a script and which will generate the uapi header and syscall table file. This change will also help to unify the implemen- tation across all architectures. The system call table generation script is added in kernel/syscalls directory which contain the scripts to generate both uapi header file and system call table files. The syscall.tbl will be input for the scripts. syscall.tbl contains the list of available system calls along with system call number and corresponding entry point. Add a new system call in this architecture will be possible by adding new entry in the syscall.tbl file. Adding a new table entry consisting of: - System call number. - ABI. - System call name. - Entry point name. - Compat entry name, if required. syscallhdr.sh, syscallnr.sh and syscalltbl.sh will gene- rate uapi header unistd_n64/n32/o32.h, unistd_nr_n64/n32/- o32.h and syscall_table_32_o32/64_n64/64-n32/64-o32.h files respectively. All *.sh files will parse the content sys- call.tbl to generate the header and table files. unistd- _n64/n32/o32.h and unistd_nr_n64/n32/o32.h will be included by uapi/asm/unistd.h and syscall_table_32_o32/64_n64/64-n32- /64-o32.h is included by kernel/syscall_table32_o32/64- _n64/64-n32/64-o32.S - the real system call table. ARM, s390 and x86 architecuture does have similar support. I leverage their implementation to come up with a generic solution. Signed-off-by: Firoz Khan [paul.burton@mips.com: - Change sysnr_pfx_unistd_nr_n64 to 64.] Signed-off-by: Paul Burton Cc: linux-mips@vger.kernel.org Cc: Ralf Baechle Cc: James Hogan Cc: Greg Kroah-Hartman Cc: Philippe Ombredanne Cc: Thomas Gleixner Cc: Kate Stewart Cc: y2038@lists.linaro.org Cc: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: arnd@arndb.de Cc: deepa.kernel@gmail.com Cc: marcin.juszkiewicz@linaro.org commit 6a00cb6175a4212e314a8f3166a66cfc2eee9e05 Author: Firoz Khan Date: Thu Dec 13 14:37:37 2018 +0530 mips: remove syscall table entries The config flag - CONFIG_MIPS_MT_FPAFF uses to check whether which syscall entries need to be used in scall32-o32.S file. One of the patch in this patch series will generate syscall table file. But CONFIG_MIPS_MT_FPAFF flag will add more complexity in the script to generate the syscall table file. In order to come up with a common implementation across all archit- ecture, we need to remove mipsmt_sys_sched_setaffinity and mipsmt- _sys_sched_getaffinity from the table and define it in other way. Signed-off-by: Firoz Khan Signed-off-by: Paul Burton Cc: linux-mips@vger.kernel.org Cc: Ralf Baechle Cc: James Hogan Cc: Greg Kroah-Hartman Cc: Philippe Ombredanne Cc: Thomas Gleixner Cc: Kate Stewart Cc: y2038@lists.linaro.org Cc: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: arnd@arndb.de Cc: deepa.kernel@gmail.com Cc: marcin.juszkiewicz@linaro.org commit be856439c998854c009b1f2ef9084a39b1295cec Author: Firoz Khan Date: Thu Dec 13 14:37:36 2018 +0530 mips: add +1 to __NR_syscalls in uapi header All other architectures are hold a value for __NR_syscalls will be equal to the last system call number +1. But in mips architecture, __NR_syscalls hold the value equal to total number of system exits in the architecture. One of the patch in this patch series will genarate uapi header files. In order to make the implementation common across all architect- ures, add +1 to __NR_syscalls, which will be equal to the last system call number +1. Signed-off-by: Firoz Khan Signed-off-by: Paul Burton Cc: linux-mips@vger.kernel.org Cc: Ralf Baechle Cc: James Hogan Cc: Greg Kroah-Hartman Cc: Philippe Ombredanne Cc: Thomas Gleixner Cc: Kate Stewart Cc: y2038@lists.linaro.org Cc: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: arnd@arndb.de Cc: deepa.kernel@gmail.com Cc: marcin.juszkiewicz@linaro.org commit 6d92c26815c57682fad35eeb3e5747ce75d79212 Author: Firoz Khan Date: Thu Dec 13 14:37:35 2018 +0530 mips: rename scall64-64.S to scall64-n64.S When we get nanoMIPS support we'll be introducing the p32 ABI, and there's a reasonable chance that the equivalent p64 ABI may come along in the future. Using 'n64' now would avoid confusion in that case where we may have 2 different 64-bit ABIs. Suggested-by: Paul Burton Signed-off-by: Firoz Khan [paul.burton@mips.com: - Remove UAPI macro renaming, github code search shows at least the chromium project uses __NR_64_Linux & __NR_64_Linux_syscalls.] Signed-off-by: Paul Burton Cc: linux-mips@vger.kernel.org Cc: Ralf Baechle Cc: James Hogan Cc: Greg Kroah-Hartman Cc: Philippe Ombredanne Cc: Thomas Gleixner Cc: Kate Stewart Cc: y2038@lists.linaro.org Cc: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: arnd@arndb.de Cc: deepa.kernel@gmail.com Cc: marcin.juszkiewicz@linaro.org commit 64e4cf0dab16ad432fcbe7ac1109488e5a282c7b Merge: 522185d5cb40f 4c283e6155988 Author: Saeed Mahameed Date: Fri Dec 14 11:15:25 2018 -0800 Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux mlx5-next shared branch with rdma subtree to avoid mlx5 rdma v.s. netdev conflicts. Highlights: 1) Lag refactroing and flow counter affinity bits. 2) mlx5 core cleanups By Roi Dayan (2) and others * 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux: net/mlx5: Fold the modify lag code into function net/mlx5: Add lag affinity info to log net/mlx5: Split the activate lag function into two routines net/mlx5: E-Switch, Introduce flow counter affinity IB/mlx5: Unify e-switch representors load approach between uplink and VFs net/mlx5: Use lowercase 'X' for hex values net/mlx5: Remove duplicated include from eswitch.c Signed-off-by: Saeed Mahameed commit a5ee2be91acb6fcee6c70d5f7d62da7c6804e1eb Author: Firoz Khan Date: Thu Dec 13 14:37:34 2018 +0530 mips: remove unused macros Remove __NR_Linux_syscalls from uapi/asm/unistd.h as there is no users to use NR_syscalls macro in mips kernel. MAX_SYSCALL_NO can also remove as there is commit 2957c9e61ee9 ("[MIPS] IRIX: Goodbye and thanks for all the fish"), eight years ago. Signed-off-by: Firoz Khan [paul.burton@mips.com: - Drop the removal of NR_syscalls which is used by kernel/trace/trace.h.] Signed-off-by: Paul Burton Cc: linux-mips@vger.kernel.org Cc: Ralf Baechle Cc: James Hogan Cc: Greg Kroah-Hartman Cc: Philippe Ombredanne Cc: Thomas Gleixner Cc: Kate Stewart Cc: y2038@lists.linaro.org Cc: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: arnd@arndb.de Cc: deepa.kernel@gmail.com Cc: marcin.juszkiewicz@linaro.org commit 4c283e6155988486e2c83a2f273f919ecd3ce721 Author: Shahar Klein Date: Wed Dec 12 19:11:41 2018 -0800 net/mlx5: Fold the modify lag code into function Handle the code of modifying the lag affinity within a separate function. Signed-off-by: Shahar Klein Signed-off-by: Roi Dayan Reviewed-by: Aviv Heller Signed-off-by: Saeed Mahameed commit 3cfe432e1b3a6f5b48f146f72d6dde029a1640a1 Author: Roi Dayan Date: Wed Dec 12 19:11:40 2018 -0800 net/mlx5: Add lag affinity info to log Report the initial LAG port affinity upon LAG creation. Signed-off-by: Roi Dayan Signed-off-by: Shahar Klein Reviewed-by: Aviv Heller Signed-off-by: Saeed Mahameed commit 8252cf728ce230bab2f5898449ffe94ff02c3622 Author: Roi Dayan Date: Wed Dec 12 19:11:39 2018 -0800 net/mlx5: Split the activate lag function into two routines Split the activate lag function in order to be symmetric with the deactivate lag function. Signed-off-by: Roi Dayan Signed-off-by: Shahar Klein Reviewed-by: Aviv Heller Signed-off-by: Saeed Mahameed commit 8bb957d2557db072b46f6a1339c2dd709bb25ef6 Author: Shahar Klein Date: Wed Dec 12 19:11:38 2018 -0800 net/mlx5: E-Switch, Introduce flow counter affinity This dictates the device affinity for eswitch flow counters, set by the FW according to the HW device capabilities. Under "source eswitch" affinity, the counter should be allocated on the device related to the source vport in the match. This covers both non merged e-switch mode as well as old FW that does not advertise this cap. Under "flow eswitch" affinity, the counter should be allocated on the device where the eswitch rule is set. Signed-off-by: Shahar Klein Signed-off-by: Roi Dayan Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 06cc74af05c33091a9877b54f1821966b446003c Author: Mark Bloch Date: Wed Dec 12 19:11:37 2018 -0800 IB/mlx5: Unify e-switch representors load approach between uplink and VFs When in switchdev mode and the add function is called by the core level driver, make sure we only register the callbacks, but don't create the mlx5 IB device or initialize anything. With this change all the IB devices in switchdev mode are created only once the load callback is invoked by the e-switch core sub-module. This follows the design paradigm under which the all the Eth representors must be loaded before any of IB reprs is loaded. Signed-off-by: Mark Bloch Acked-by: Or Gerlitz Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 4c8b85187c22ee65637035efd2ae0cb10836d8e8 Author: Saeed Mahameed Date: Wed Dec 12 19:11:36 2018 -0800 net/mlx5: Use lowercase 'X' for hex values Apparently gcc is cool with upper case '0X' but it is not commonly used. Replace '0X' with lowercase '0x' in mlx5_ifc.h file. Signed-off-by: Saeed Mahameed commit b8eee0e90f9797b747113638bc75e739b192ad38 Author: Benjamin Coddington Date: Thu Nov 1 13:39:49 2018 -0400 lockd: Show pid of lockd for remote locks Commit 9d5b86ac13c5 ("fs/locks: Remove fl_nspid and use fs-specific l_pid for remote locks") specified that the l_pid returned for F_GETLK on a local file that has a remote lock should be the pid of the lock manager process. That commit, while updating other filesystems, failed to update lockd, such that locks created by lockd had their fl_pid set to that of the remote process holding the lock. Fix that here to be the pid of lockd. Also, fix the client case so that the returned lock pid is negative, which indicates a remote lock on a remote file. Fixes: 9d5b86ac13c5 ("fs/locks: Remove fl_nspid and use fs-specific...") Cc: stable@vger.kernel.org Signed-off-by: Benjamin Coddington Signed-off-by: J. Bruce Fields commit 03b31f489614d8ac7a08bd458451a037cc0b1149 Author: Olga Kornievskaia Date: Tue Dec 4 14:09:21 2018 -0500 NFSD remove OP_CACHEME from 4.2 op_flags OP_CACHEME is only for the 4.0 operations. Signed-off-by: Olga Kornievskaia Signed-off-by: J. Bruce Fields commit d406db524c32ca35bd85cada28a547fff3115715 Author: YueHaibing Date: Sun Dec 9 14:25:02 2018 +0800 audit: remove duplicated include from audit.c Remove duplicated include. Signed-off-by: YueHaibing Signed-off-by: Paul Moore commit e27a73d1305f22cc093b16ea9f2a81cfa9e5193c Author: Emily Deng Date: Wed Dec 12 18:06:16 2018 +0800 drm/amdgpu/psp: Correct and refine the vmr support. (v2) Currently driver only psp v11 support vmr. v2: squash in unused variable removal (Alex) Signed-off-by: Emily Deng Reviewed-by: Xiangliang Yu Signed-off-by: Alex Deucher commit e30c50cd79f088f33098b76ed01a33c724eafee3 Author: Emily Deng Date: Wed Dec 12 18:08:24 2018 +0800 drm/amdgpu/psp_v3_1: Get psp fw version through reading register If PSP FW is running already, driver will not load PSP FW again and skip it. So psp fw version is not correct if reading it from FW binary file, need to get right version from register. Signed-off-by: Emily Deng Reviewed-by: Xiangliang Yu Signed-off-by: Alex Deucher commit 07944623c775a3ef2b85beab769a4e68b2bed979 Author: Emily Deng Date: Wed Dec 12 17:00:13 2018 +0800 drm/amdgpu: access register without KIQ There is no need to access register such as mmSMC_IND_INDEX_11 and mmSMC_IND_DATA_11, PCIE_INDEX, PCIE_DATA through KIQ because they are VF-copy. Signed-off-by: Emily Deng Acked-by: Christian König Signed-off-by: Alex Deucher commit 7b184b006185215daf4e911f8de212964c99a514 Author: wentalou Date: Fri Dec 7 13:53:18 2018 +0800 drm/amdgpu: kfd_pre_reset outside req_full_gpu cause sriov hang XGMI hive put kfd_pre_reset into amdgpu_device_lock_adev, but outside req_full_gpu of sriov. It would make sriov hang during reset. Signed-off-by: Wentao Lou Reviewed-by: Shaoyun Liu Signed-off-by: Alex Deucher commit 5132411985e14b8dda69173abee8ea9ba942698f Author: Paolo Bonzini Date: Fri Dec 14 12:29:43 2018 +0100 kvm: selftests: ucall: improve ucall placement in memory, fix unsigned comparison Based on a patch by Andrew Jones. Reported-by: Dan Carpenter Signed-off-by: Paolo Bonzini commit b666a4b697397f8492dc11a2a1877557d3e0af56 Author: Marc Orr Date: Tue Nov 6 14:53:56 2018 -0800 kvm: x86: Dynamically allocate guest_fpu Previously, the guest_fpu field was embedded in the kvm_vcpu_arch struct. Unfortunately, the field is quite large, (e.g., 4352 bytes on my current setup). This bloats the kvm_vcpu_arch struct for x86 into an order 3 memory allocation, which can become a problem on overcommitted machines. Thus, this patch moves the fpu state outside of the kvm_vcpu_arch struct. With this patch applied, the kvm_vcpu_arch struct is reduced to 15168 bytes for vmx on my setup when building the kernel with kvmconfig. Suggested-by: Dave Hansen Signed-off-by: Marc Orr Signed-off-by: Paolo Bonzini commit 240c35a3783ab9b3a0afaba0dde7291295680a6b Author: Marc Orr Date: Tue Nov 6 14:53:55 2018 -0800 kvm: x86: Use task structs fpu field for user Previously, x86's instantiation of 'struct kvm_vcpu_arch' added an fpu field to save/restore fpu-related architectural state, which will differ from kvm's fpu state. However, this is redundant to the 'struct fpu' field, called fpu, embedded in the task struct, via the thread field. Thus, this patch removes the user_fpu field from the kvm_vcpu_arch struct and replaces it with the task struct's fpu field. This change is significant because the fpu struct is actually quite large. For example, on the system used to develop this patch, this change reduces the size of the vcpu_vmx struct from 23680 bytes down to 19520 bytes, when building the kernel with kvmconfig. This reduction in the size of the vcpu_vmx struct moves us closer to being able to allocate the struct at order 2, rather than order 3. Suggested-by: Dave Hansen Signed-off-by: Marc Orr Signed-off-by: Paolo Bonzini commit 4e445aee9654dc4aee61919d4f1d379b77cf3435 Author: Krish Sadhukhan Date: Wed Dec 12 13:30:12 2018 -0500 KVM: nVMX: Move the checks for Guest Non-Register States to a separate helper function .. to improve readability and maintainability, and to align the code as per the layout of the checks in chapter "VM Entries" in Intel SDM vol 3C. Signed-off-by: Krish Sadhukhan Reviewed-by: Mihai Carabas Reviewed-by: Mark Kanda Signed-off-by: Paolo Bonzini commit 254b2f3b0f7b45c2f2232a2e0da77577233750e2 Author: Krish Sadhukhan Date: Wed Dec 12 13:30:11 2018 -0500 KVM: nVMX: Move the checks for Host Control Registers and MSRs to a separate helper function .. to improve readability and maintainability, and to align the code as per the layout of the checks in chapter "VM Entries" in Intel SDM vol 3C. Signed-off-by: Krish Sadhukhan Reviewed-by: Mihai Carabas Reviewed-by: Mark Kanda Signed-off-by: Paolo Bonzini commit 5fbf963400a39919e53d20fe43bd3be072622944 Author: Krish Sadhukhan Date: Wed Dec 12 13:30:10 2018 -0500 KVM: nVMX: Move the checks for VM-Entry Control Fields to a separate helper function .. to improve readability and maintainability, and to align the code as per the layout of the checks in chapter "VM Entries" in Intel SDM vol 3C. Signed-off-by: Krish Sadhukhan Reviewed-by: Mihai Carabas Reviewed-by: Mark Kanda Signed-off-by: Paolo Bonzini commit 61446ba75e9ad95446e057ac59e23e257493a3b3 Author: Krish Sadhukhan Date: Wed Dec 12 13:30:09 2018 -0500 KVM: nVMX: Move the checks for VM-Exit Control Fields to a separate helper function .. to improve readability and maintainability, and to align the code as per the layout of the checks in chapter "VM Entries" in Intel SDM vol 3C. Signed-off-by: Krish Sadhukhan Reviewed-by: Mihai Carabas Reviewed-by: Mark Kanda Signed-off-by: Paolo Bonzini commit f9b245e182ac9beb40f48faa0fd04ed3f3830d50 Author: Sean Christopherson Date: Wed Dec 12 13:30:08 2018 -0500 KVM: nVMX: Remove param indirection from nested_vmx_check_msr_switch() Passing the enum and doing an indirect lookup is silly when we can simply pass the field directly. Remove the "fast path" code in nested_vmx_check_msr_switch_controls() as it's now nothing more than a redundant check. Remove the debug message rather than continue passing the enum for the address field. Having debug messages for the MSRs themselves is useful as MSR legality is a huge space, whereas messing up a physical address means the VMM is fundamentally broken. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 461b4ba4c7ad79137171de2887e5d4d05a0ec8c1 Author: Krish Sadhukhan Date: Wed Dec 12 13:30:07 2018 -0500 KVM: nVMX: Move the checks for VM-Execution Control Fields to a separate helper function .. to improve readability and maintainability, and to align the code as per the layout of the checks in chapter "VM Entries" in Intel SDM vol 3C. Signed-off-by: Krish Sadhukhan Reviewed-by: Mihai Carabas Reviewed-by: Mark Kanda Signed-off-by: Paolo Bonzini commit 16322a3b5e7ce8250025361c092903a7259c1677 Author: Krish Sadhukhan Date: Wed Dec 12 13:30:06 2018 -0500 KVM: nVMX: Prepend "nested_vmx_" to check_vmentry_{pre,post}reqs() .. as they are used only in nested vmx context. Signed-off-by: Krish Sadhukhan Reviewed-by: Liran Alon Reviewed-by: Mihai Carabas Reviewed-by: Mark Kanda Signed-off-by: Paolo Bonzini commit 53963a70ac268c8e813e6d5cd24cbd1b03f56059 Author: Lan Tianyu Date: Thu Dec 6 15:34:36 2018 +0800 KVM/VMX: Check ept_pointer before flushing ept tlb This patch is to initialize ept_pointer to INVALID_PAGE and check it before flushing ept tlb. If ept_pointer is invalid, bypass the flush request. Signed-off-by: Lan Tianyu Signed-off-by: Paolo Bonzini commit a0d4f8034446df402a879dac04cab61f71c4fafc Author: Krish Sadhukhan Date: Tue Dec 4 19:00:13 2018 -0500 KVM nVMX: MSRs should not be stored if VM-entry fails during or after loading guest state According to section "VM-entry Failures During or After Loading Guest State" in Intel SDM vol 3C, "No MSRs are saved into the VM-exit MSR-store area." when bit 31 of the exit reason is set. Reported-by: Krish Sadhukhan Suggested-by: Jim Mattson Signed-off-by: Krish Sadhukhan Reviewed-by: Darren Kenny Signed-off-by: Paolo Bonzini commit e53d88af63ab4104e1226b8f9959f1e9903da10b Author: Jim Mattson Date: Tue Oct 30 12:20:21 2018 -0700 kvm: x86: Don't modify MSR_PLATFORM_INFO on vCPU reset If userspace has provided a different value for this MSR (e.g with the turbo bits set), the userspace-provided value should survive a vCPU reset. For backwards compatibility, MSR_PLATFORM_INFO is initialized in kvm_arch_vcpu_setup. Signed-off-by: Jim Mattson Reviewed-by: Drew Schmitt Cc: Abhiroop Dabral Signed-off-by: Paolo Bonzini commit 3d82c565a7a237b9dd4666f17c84dcc028d2bed5 Author: Wei Huang Date: Mon Dec 3 14:13:32 2018 -0600 kvm: vmx: add cpu into VMX preemption timer bug list This patch adds Intel "Xeon CPU E3-1220 V2", with CPUID.01H.EAX=0x000306A8, into the list of known broken CPUs which fail to support VMX preemption timer. This bug was found while running the APIC timer test of kvm-unit-test on this specific CPU, even though the errata info can't be located in the public domain for this CPU. Signed-off-by: Wei Huang Signed-off-by: Paolo Bonzini commit d7b09c827a6cf291f66637a36f46928dd1423184 Author: Eduardo Habkost Date: Wed Dec 5 17:19:56 2018 -0200 kvm: x86: Report STIBP on GET_SUPPORTED_CPUID Months ago, we have added code to allow direct access to MSR_IA32_SPEC_CTRL to the guest, which makes STIBP available to guests. This was implemented by commits d28b387fb74d ("KVM/VMX: Allow direct access to MSR_IA32_SPEC_CTRL") and b2ac58f90540 ("KVM/SVM: Allow direct access to MSR_IA32_SPEC_CTRL"). However, we never updated GET_SUPPORTED_CPUID to let userspace know that STIBP can be enabled in CPUID. Fix that by updating kvm_cpuid_8000_0008_ebx_x86_features and kvm_cpuid_7_0_edx_x86_features. Signed-off-by: Eduardo Habkost Reviewed-by: Jim Mattson Reviewed-by: Konrad Rzeszutek Wilk Signed-off-by: Paolo Bonzini commit 87a8d795b2f1d926b4e831d27144d3e6ab7e33dc Author: Vitaly Kuznetsov Date: Wed Dec 5 16:36:21 2018 +0100 x86/hyper-v: Stop caring about EOI for direct stimers Turns out we over-engineered Direct Mode for stimers a bit: unlike traditional stimers where we may want to try to re-inject the message upon EOI, Direct Mode stimers just set the irq in APIC and kvm_apic_set_irq() fails only when APIC is disabled (see APIC_DM_FIXED case in __apic_accept_irq()). Remove the redundant part. Suggested-by: Roman Kagan Signed-off-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 08a800ac257a2eeed1fad34b55ed55b2578e9b4e Author: Vitaly Kuznetsov Date: Mon Nov 26 16:47:32 2018 +0100 x86/kvm/hyper-v: avoid open-coding stimer_mark_pending() in kvm_hv_notify_acked_sint() stimers_pending optimization only helps us to avoid multiple kvm_make_request() calls. This doesn't happen very often and these calls are very cheap in the first place, remove open-coded version of stimer_mark_pending() from kvm_hv_notify_acked_sint(). Suggested-by: Paolo Bonzini Signed-off-by: Vitaly Kuznetsov Reviewed-by: Roman Kagan Signed-off-by: Paolo Bonzini commit 8644f771e07c52617627dffa4c67ba0ea120fd13 Author: Vitaly Kuznetsov Date: Mon Nov 26 16:47:31 2018 +0100 x86/kvm/hyper-v: direct mode for synthetic timers Turns out Hyper-V on KVM (as of 2016) will only use synthetic timers if direct mode is available. With direct mode we notify the guest by asserting APIC irq instead of sending a SynIC message. The implementation uses existing vec_bitmap for letting lapic code know that we're interested in the particular IRQ's EOI request. We assume that the same APIC irq won't be used by the guest for both direct mode stimer and as sint source (especially with AutoEOI semantics). It is unclear how things should be handled if that's not true. Direct mode is also somewhat less expensive; in my testing stimer_send_msg() takes not less than 1500 cpu cycles and stimer_notify_direct() can usually be done in 300-400. WS2016 without Hyper-V, however, always sticks to non-direct version. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Roman Kagan Signed-off-by: Paolo Bonzini commit 6a058a1eadc3882eff6efaa757f2c71a31fe9906 Author: Vitaly Kuznetsov Date: Mon Nov 26 16:47:30 2018 +0100 x86/kvm/hyper-v: use stimer config definition from hyperv-tlfs.h As a preparation to implementing Direct Mode for Hyper-V synthetic timers switch to using stimer config definition from hyperv-tlfs.h. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 0aa67255f54df192d29aec7ac6abb1249d45bda7 Author: Vitaly Kuznetsov Date: Mon Nov 26 16:47:29 2018 +0100 x86/hyper-v: move synic/stimer control structures definitions to hyperv-tlfs.h We implement Hyper-V SynIC and synthetic timers in KVM too so there's some room for code sharing. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Michael Kelley Signed-off-by: Paolo Bonzini commit 7edcb73433276d1b7bc82863df0aa9d229f5686c Author: Vitaly Kuznetsov Date: Mon Dec 10 18:21:59 2018 +0100 KVM: selftests: Add hyperv_cpuid test Add a simple (and stupid) hyperv_cpuid test: check that we got the expected number of entries with and without Enlightened VMCS enabled and that all currently reserved fields are zeroed. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 7e50c424f8e2315182540a32edb6f19024d26c8b Author: Vitaly Kuznetsov Date: Mon Dec 10 18:21:58 2018 +0100 KVM: selftests: implement an unchecked version of vcpu_ioctl() In case we want to test failing ioctls we need an option to not fail. Following _vcpu_run() precedent implement _vcpu_ioctl(). Signed-off-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 2bc39970e9327ceb06cb210f86ba35f81d00e350 Author: Vitaly Kuznetsov Date: Mon Dec 10 18:21:56 2018 +0100 x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID With every new Hyper-V Enlightenment we implement we're forced to add a KVM_CAP_HYPERV_* capability. While this approach works it is fairly inconvenient: the majority of the enlightenments we do have corresponding CPUID feature bit(s) and userspace has to know this anyways to be able to expose the feature to the guest. Add KVM_GET_SUPPORTED_HV_CPUID ioctl (backed by KVM_CAP_HYPERV_CPUID, "one cap to rule them all!") returning all Hyper-V CPUID feature leaves. Using the existing KVM_GET_SUPPORTED_CPUID doesn't seem to be possible: Hyper-V CPUID feature leaves intersect with KVM's (e.g. 0x40000000, 0x40000001) and we would probably confuse userspace in case we decide to return these twice. KVM_CAP_HYPERV_CPUID's number is interim: we're intended to drop KVM_CAP_HYPERV_STIMER_DIRECT and use its number instead. Suggested-by: Paolo Bonzini Signed-off-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit e2e871ab2f02dc9ca5f06065234475393dcec38b Author: Vitaly Kuznetsov Date: Mon Dec 10 18:21:55 2018 +0100 x86/kvm/hyper-v: Introduce nested_get_evmcs_version() helper The upcoming KVM_GET_SUPPORTED_HV_CPUID ioctl will need to return Enlightened VMCS version in HYPERV_CPUID_NESTED_FEATURES.EAX when it was enabled. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 220d6586ecb46c163e13576d3143097eebc907e7 Author: Vitaly Kuznetsov Date: Mon Dec 10 18:21:54 2018 +0100 x86/hyper-v: Drop HV_X64_CONFIGURE_PROFILER definition BIT(13) in HYPERV_CPUID_FEATURES.EBX is described as "ConfigureProfiler" in TLFS v4.0 but starting 5.0 it is replaced with 'Reserved'. As we don't currently us it in kernel it can just be dropped. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Michael Kelley Acked-by: Thomas Gleixner Signed-off-by: Paolo Bonzini commit a4987defc1e66c5b88c2a97e3a0ef386631587fa Author: Vitaly Kuznetsov Date: Mon Dec 10 18:21:53 2018 +0100 x86/hyper-v: Do some housekeeping in hyperv-tlfs.h hyperv-tlfs.h is a bit messy: CPUID feature bits are not always sorted, it's hard to get which CPUID they belong to, some items are duplicated (e.g. HV_X64_MSR_CRASH_CTL_NOTIFY/HV_CRASH_CTL_CRASH_NOTIFY). Do some housekeeping work. While on it, replace all (1 << X) with BIT(X) macro. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Michael Kelley Acked-by: Thomas Gleixner Signed-off-by: Paolo Bonzini commit ec084491727b078a6628c690ec96f9c3a2253a61 Author: Vitaly Kuznetsov Date: Wed Dec 12 18:57:01 2018 +0100 x86/hyper-v: Mark TLFS structures packed The TLFS structures are used for hypervisor-guest communication and must exactly meet the specification. Compilers can add alignment padding to structures or reorder struct members for randomization and optimization, which would break the hypervisor ABI. Mark the structures as packed to prevent this. 'struct hv_vp_assist_page' and 'struct hv_enlightened_vmcs' need to be properly padded to support the change. Suggested-by: Nadav Amit Signed-off-by: Vitaly Kuznetsov Acked-by: Thomas Gleixner Acked-by: Nadav Amit Reviewed-by: Michael Kelley Signed-off-by: Paolo Bonzini commit 7deec5e0df741102c9b54156c88cd1476d272ae5 Author: Roman Kagan Date: Mon Dec 10 18:47:27 2018 +0000 x86: kvm: hyperv: don't retry message delivery for periodic timers The SynIC message delivery protocol allows the message originator to request, should the message slot be busy, to be notified when it's free. However, this is unnecessary and even undesirable for messages generated by SynIC timers in periodic mode: if the period is short enough compared to the time the guest spends in the timer interrupt handler, so the timer ticks start piling up, the excessive interactions due to this notification and retried message delivery only makes the things worse. [This was observed, in particular, with Windows L2 guests setting (temporarily) the periodic timer to 2 kHz, and spending hundreds of microseconds in the timer interrupt handler due to several L2->L1 exits; under some load in L0 this could exceed 500 us so the timer ticks started to pile up and the guest livelocked.] Relieve the situation somewhat by not retrying message delivery for periodic SynIC timers. This appears to remain within the "lazy" lost ticks policy for SynIC timers as implemented in KVM. Note that it doesn't solve the fundamental problem of livelocking the guest with a periodic timer whose period is smaller than the time needed to process a tick, but it makes it a bit less likely to be triggered. Signed-off-by: Roman Kagan Signed-off-by: Paolo Bonzini commit 3a0e7731724f6ac684129f1763eef4d2d3e7dec7 Author: Roman Kagan Date: Mon Dec 10 18:47:26 2018 +0000 x86: kvm: hyperv: simplify SynIC message delivery SynIC message delivery is somewhat overengineered: it pretends to follow the ordering rules when grabbing the message slot, using atomic operations and all that, but does it incorrectly and unnecessarily. The correct order would be to first set .msg_pending, then atomically replace .message_type if it was zero, and then clear .msg_pending if the previous step was successful. But this all is done in vcpu context so the whole update looks atomic to the guest (it's assumed to only access the message page from this cpu), and therefore can be done in whatever order is most convenient (and is also the reason why the incorrect order didn't trigger any bugs so far). While at this, also switch to kvm_vcpu_{read,write}_guest_page, and drop the no longer needed synic_clear_sint_msg_pending. Signed-off-by: Roman Kagan Signed-off-by: Paolo Bonzini commit eb1ff0a913ca092ae5a4e7c9277b0a634c645eee Author: Peng Hao Date: Tue Dec 4 17:42:50 2018 +0800 kvm: x86: remove unnecessary recalculate_apic_map In the previous code, the variable apic_sw_disabled influences recalculate_apic_map. But in "KVM: x86: simplify kvm_apic_map" (commit: 3b5a5ffa928a3f875b0d5dd284eeb7c322e1688a), the access to apic_sw_disabled in recalculate_apic_map has been deleted. Signed-off-by: Peng Hao Reviewed-by: Radim Krčmář Signed-off-by: Paolo Bonzini commit b2227ddec1cca6c52f49a19ec1c7a40cd27e0566 Author: Peng Hao Date: Fri Dec 14 16:18:03 2018 +0800 kvm: svm: remove unused struct definition structure svm_init_data is never used. So remove it. Signed-off-by: Peng Hao Signed-off-by: Paolo Bonzini commit 84c8c5b8f82f9939b1bcb3b5e25da2b5fc47ab50 Author: Jim Mattson Date: Wed Dec 5 15:29:01 2018 -0800 kvm: vmx: Skip all SYSCALL MSRs in setup_msrs() when !EFER.SCE Like IA32_STAR, IA32_LSTAR and IA32_FMASK only need to contain guest values on VM-entry when the guest is in long mode and EFER.SCE is set. Signed-off-by: Jim Mattson Reviewed-by: Peter Shier Reviewed-by: Marc Orr Signed-off-by: Paolo Bonzini commit db31c8f5af7de0e78f63fd4c255cf3868d667bf4 Author: Jim Mattson Date: Wed Dec 5 15:29:00 2018 -0800 kvm: vmx: Don't set hardware IA32_CSTAR MSR on VM-entry SYSCALL raises #UD in compatibility mode on Intel CPUs, so it's pointless to load the guest's IA32_CSTAR value into the hardware MSR. IA32_CSTAR still provides 48 bits of storage on Intel CPUs that have CPUID.80000001:EDX.LM[bit 29] set, so we cannot remove it from the vmx_msr_index[] array. Signed-off-by: Jim Mattson Reviewed-by: Peter Shier Signed-off-by: Paolo Bonzini commit 898a811f1486df3209ce857027d0564d6a616cf2 Author: Jim Mattson Date: Wed Dec 5 15:28:59 2018 -0800 kvm: vmx: Document the need for MSR_STAR in i386 builds Add a comment explaining why MSR_STAR must be included in vmx_msr_index[] even for i386 builds. The elided comment has not been relevant since move_msr_up() was introduced in commit a75beee6e4f5d ("KVM: VMX: Avoid saving and restoring msrs on lightweight vmexit"). Signed-off-by: Jim Mattson Reviewed-by: Peter Shier Signed-off-by: Paolo Bonzini commit 0023ef39dc35c773c436eaa46ca539a26b308b55 Author: Jim Mattson Date: Wed Dec 5 15:28:58 2018 -0800 kvm: vmx: Set IA32_TSC_AUX for legacy mode guests RDTSCP is supported in legacy mode as well as long mode. The IA32_TSC_AUX MSR should be set to the correct guest value before entering any guest that supports RDTSCP. Fixes: 4e47c7a6d714 ("KVM: VMX: Add instruction rdtscp support for guest") Signed-off-by: Jim Mattson Reviewed-by: Peter Shier Reviewed-by: Marc Orr Reviewed-by: Liran Alon Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 55d2375e58a61be072431dd3d3c8a320f4a4a01b Author: Sean Christopherson Date: Mon Dec 3 13:53:18 2018 -0800 KVM: nVMX: Move nested code to dedicated files From a functional perspective, this is (supposed to be) a straight copy-paste of code. Code was moved piecemeal to nested.c as not all code that could/should be moved was obviously nested-only. The nested code was then re-ordered as needed to compile, i.e. stats may not show this is being a "pure" move despite there not being any intended changes in functionality. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 7c97fcb3b68cd4d48a071bc1929c753d255dea47 Author: Sean Christopherson Date: Mon Dec 3 13:53:17 2018 -0800 KVM: VMX: Expose nested_vmx_allowed() to nested VMX as a non-inline Exposing only the function allows @nested, i.e. the module param, to be statically defined in vmx.c, ensuring we aren't unnecessarily checking said variable in the nested code. nested_vmx_allowed() is exposed due to the need to verify nested support in vmx_{get,set}_nested_state(). The downside is that nested_vmx_allowed() likely won't be inlined in vmx_{get,set}_nested_state(), but that should be a non-issue as they're not a hot path. Keeping vmx_{get,set}_nested_state() in vmx.c isn't a viable option as they need access to several nested-only functions. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 97b7ead392637247569818b6603e54b0a6277dd0 Author: Sean Christopherson Date: Mon Dec 3 13:53:16 2018 -0800 KVM: VMX: Expose various getters and setters to nested VMX ...as they're used directly by the nested code. This will allow moving the bulk of the nested code out of vmx.c without concurrent changes to vmx.h. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit cf3646eb3adfd9149e3c29fc765a59e8bd6ff82d Author: Sean Christopherson Date: Mon Dec 3 13:53:15 2018 -0800 KVM: VMX: Expose misc variables needed for nested VMX Exposed vmx_msr_index, vmx_return and host_efer via vmx.h so that the nested code can be moved out of vmx.c. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit ff241486ac90671ddf7c18e38c474f32b832af3a Author: Sean Christopherson Date: Mon Dec 3 13:53:14 2018 -0800 KVM: nVMX: Move "vmcs12 to shadow/evmcs sync" to helper function ...so that the function doesn't need to be created when moving the nested code out of vmx.c. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 3e8eacccae9d998e0f5074f4fe411c747d85dfd8 Author: Sean Christopherson Date: Mon Dec 3 13:53:13 2018 -0800 KVM: nVMX: Call nested_vmx_setup_ctls_msrs() iff @nested is true ...so that it doesn't need access to @nested. The only case where the provided struct isn't already zeroed is the call from vmx_create_vcpu() as setup_vmcs_config() zeroes the struct in the other use cases. This will allow @nested to be statically defined in vmx.c, i.e. this removes the last direct reference from nested code. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit e4027cfafd7846cf795217ce6d1829728d95ad89 Author: Sean Christopherson Date: Mon Dec 3 13:53:12 2018 -0800 KVM: nVMX: Set callbacks for nested functions during hardware setup ...in nested-specific code so that they can eventually be moved out of vmx.c, e.g. into nested.c. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit a3203381ca95dcf1faa4053e84bd0cd10bc0ca8c Author: Sean Christopherson Date: Mon Dec 3 13:53:11 2018 -0800 KVM: VMX: Move the hardware {un}setup functions to the bottom ...so that future patches can reference e.g. @kvm_vmx_exit_handlers without having to simultaneously move a big chunk of code. Speaking from experience, resolving merge conflicts is an absolute nightmare without pre-moving the code. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 5158917c7b0196aefc1a4e9bc4458777dd2c41ec Author: Sean Christopherson Date: Mon Dec 3 13:53:10 2018 -0800 KVM: x86: nVMX: Allow nested_enable_evmcs to be NULL ...so that it can conditionally set by the VMX code, i.e. iff @nested is true. This will in turn allow it to be moved out of vmx.c and into a nested-specified file. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 944c3464538de42b92284a922f0929b5fe6bd893 Author: Sean Christopherson Date: Mon Dec 3 13:53:09 2018 -0800 KVM: VMX: Move nested hardware/vcpu {un}setup to helper functions Eventually this will allow us to move the nested VMX code out of vmx.c. Note that this also effectively wraps @enable_shadow_vmcs with @nested so that it too can be moved out of vmx.c. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 89b0c9f58350f6820f062ea12000e8a171177f3b Author: Sean Christopherson Date: Mon Dec 3 13:53:07 2018 -0800 KVM: VMX: Move VMX instruction wrappers to a dedicated header file VMX has a few hundred lines of code just to wrap various VMX specific instructions, e.g. VMWREAD, INVVPID, etc... Move them to a dedicated header so it's easier to find/isolate the boilerplate. With this change, more inlines can be moved from vmx.c to vmx.h. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 9a2a566adb00a44bfb9243462a8d5b2330afc756 Author: Maxime Ripard Date: Thu Dec 6 15:02:03 2018 +0100 pinctrl: sunxi: Deal with per-bank regulators The Allwinner SoCs have on most of their GPIO banks a regulator input. This issue was mainly ignored so far because either the regulator was a static regulator that would be providing power anyway, or the bank was used for a feature unsupported so far (CSI). For the odd cases, enabling it in the bootloader was the preferred option. However, now that we are starting to support those features, and that we can't really rely on the bootloader for this, we need to model those regulators as such in the DT. This is slightly more complicated than what it looks like, since some regulators will be tied to the PMIC, and in order to have access to the PMIC bus, you need to mux its pins, which will need the pinctrl driver, that needs the regulator driver to be registered. And this is how you get a circular dependency. In practice however, the hardware cannot fall into this case since it would result in a completely unusable bus. In order to avoid that circular dependency, we can thus get and enable the regulators at pin_request time. We'll then need to account for the references of all the pins of a particular branch to know when to put the reference, but it works pretty nicely once implemented. Signed-off-by: Maxime Ripard Signed-off-by: Linus Walleij commit c5510b8dafce5f3f5a039c9b262ebcae0092c462 Author: Krzysztof Kozlowski Date: Thu Dec 6 10:45:49 2018 +0100 gpiolib: Fix return value of gpio_to_desc() stub if !GPIOLIB If CONFIG_GPOILIB is not set, the stub of gpio_to_desc() should return the same type of error as regular version: NULL. All the callers compare the return value of gpio_to_desc() against NULL, so returned ERR_PTR would be treated as non-error case leading to dereferencing of error value. Fixes: 79a9becda894 ("gpiolib: export descriptor-based GPIO interface") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Linus Walleij commit eaeee373c97c638769c1e3546b32f46d30df1dbe Author: Rob Herring Date: Wed Dec 5 13:50:36 2018 -0600 pinctrl: 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. Cc: Sylwester Nawrocki Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-gpio@vger.kernel.org Signed-off-by: Rob Herring Reviewed-by: Tomasz Figa Reviewed-by: Krzysztof Kozlowski Signed-off-by: Linus Walleij commit 30ed3c6c0922a1f67c3409b9e81087442614db7b Merge: e3e454b7047a8 55ed14cdaec50 Author: Kalle Valo Date: Fri Dec 14 16:58:00 2018 +0200 Merge tag 'iwlwifi-next-for-kalle-2018-12-14' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next Third batch of iwlwifi patches intended for v4.21 * Some cleanups in the HW configuration structures; * More work on the debugging infrastructure; * Fixes related to 802.11ax; * Other cleanups and small fixes; commit 07a496de4c7eb0b1e80ab53f9d6465ea55ac1bd7 Author: Russell King Date: Thu Dec 13 12:54:26 2018 +0000 ARM: omap2: remove unnecessary boot_lock The boot_lock is something that was required for ARM development platforms to ensure that the delay calibration worked properly. This is not necessary for modern platforms that have better bus bandwidth and do not need to calibrate the delay loop for secondary cores. Remove the boot_lock entirely. Acked-by: Tony Lindgren Signed-off-by: Russell King commit d9b778e7bf2d37251d7ce365b39ebe86332c7a10 Author: Russell King Date: Thu Dec 13 12:54:26 2018 +0000 ARM: versatile: rename and comment SMP implementation Rename pen_release and boot_lock in the Versatile specific SMP implementation, describe why these exist and state clearly that they should not be used in production implementations. Signed-off-by: Russell King commit 830eec24673a982bff4df85ba4d17e4a6ff201a7 Author: Sebastian Andrzej Siewior Date: Tue Dec 11 22:23:22 2018 +0100 ARM: versatile: convert boot_lock to raw The arm boot_lock is used by the secondary processor startup code. The locking task is the idle thread, which has idle->sched_class == &idle_sched_class. idle_sched_class->enqueue_task == NULL, so if the idle task blocks on the lock, the attempt to wake it when the lock becomes available will fail: try_to_wake_up() ... activate_task() enqueue_task() p->sched_class->enqueue_task(rq, p, flags) Fix by converting boot_lock to a raw spin lock. Cc: Linus Walleij Signed-off-by: Frank Rowand Link: http://lkml.kernel.org/r/4E77B952.3010606@am.sony.com Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Russell King commit 4fb68e12f2cf93176f1b7542c754a4d0413eb290 Author: Russell King Date: Thu Dec 13 12:54:26 2018 +0000 ARM: vexpress/realview: consolidate immitation CPU hotplug The only difference between the hotplug implementation for Realview and Versatile Express are the bit in the auxiliary control register to disable coherency. Combine the two implentations accounting for that difference. Rename the functions to try to discourage cargo-cult copying of this code. Tested-by: Sudeep Holla Acked-by: Sudeep Holla Signed-off-by: Russell King commit 8d64d365aed355b2e2465d19ba61df02462fff4d Author: Chao Yu Date: Wed Dec 12 18:12:30 2018 +0800 f2fs: fix to reorder set_page_dirty and wait_on_page_writeback This patch reorders flow from - update page - set_page_dirty - wait_on_page_writeback to - wait_on_page_writeback - update page - set_page_dirty The reason is: - set_page_dirty will increase reference of dirty page, the reference should be cleared before wait_on_page_writeback to keep its consistency. - some devices need stable page during page writebacking, so we should not change page's data. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 2062e0c3daa0bcfc806f4f7331f8bba16dd42632 Author: Sheng Yong Date: Tue Dec 4 22:59:21 2018 +0800 f2fs: clear PG_writeback if IPU failed If IPU failed, nothing is commited, we should end page writeback. Signed-off-by: Sheng Yong Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 0cd6d9b0d23416af3bfb8736f8be5bb66bc8060b Author: Jaegeuk Kim Date: Wed Nov 28 13:26:03 2018 -0800 f2fs: add an ioctl() to explicitly trigger fsck later This adds an option in ioctl(F2FS_IOC_SHUTDOWN) in order to trigger fsck by setting a NEED_FSCK flag. Generally, shutdown is used for the test to validate filesystem consistency, and setting NEED_FSCK flag can be used for Android to trigger fsck.f2fs at boot time explicitly so that we could measure the elapsed time as well as force filesystem check. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit b76574300504e56e2878ade185d5f47893512d25 Author: Marek Vasut Date: Wed Dec 12 02:40:02 2018 +0100 gpio: pca953x: Restore registers after suspend/resume cycle It is possible that the PCA953x is powered down during suspend. Use regmap cache to assure the registers in the PCA953x are in line with the driver state after resume. Signed-off-by: Marek Vasut Cc: Bartosz Golaszewski Signed-off-by: Linus Walleij commit 87813cf30a89012d77012347284ad7dd71c7b0b9 Author: Marek Vasut Date: Wed Dec 12 02:40:01 2018 +0100 gpio: pca953x: Zap single use of pca953x_read_single() Drop pca953x_write_single() which is used in one place. Signed-off-by: Marek Vasut Cc: Bartosz Golaszewski Signed-off-by: Linus Walleij commit ec82d1eba346190171f9fa0f24e2e6eff5e5304c Author: Marek Vasut Date: Wed Dec 12 02:40:00 2018 +0100 gpio: pca953x: Zap ad-hoc reg_output cache Replace the ad-hoc reg_output output register caching with generic regcache cache. Drop pca953x_write_single() which is no longer used. This reduces code duplication. Signed-off-by: Marek Vasut Cc: Bartosz Golaszewski Signed-off-by: Linus Walleij commit 0f25fda840a9420172dfa6a3f333066017b78a04 Author: Marek Vasut Date: Wed Dec 12 02:39:59 2018 +0100 gpio: pca953x: Zap ad-hoc reg_direction cache Replace the ad-hoc reg_direction direction register caching with generic regcache cache. This reduces code duplication. Signed-off-by: Marek Vasut Cc: Bartosz Golaszewski Signed-off-by: Linus Walleij commit 49427232764d62e5933b2c23cc841739abc9804c Author: Marek Vasut Date: Wed Dec 12 02:39:58 2018 +0100 gpio: pca953x: Perform basic regmap conversion Convert the driver to use regmap to access the chips. Due to the convoluted register mapping scheme, implement read/write/volatile check functions that untangle the mess and perform check accordingly. This patch does not zap the internal register cache of the PCA953x driver, nor does it push the regmap access down into the gpiochip accessors to simplify the review. All that is in subsequent patches. Signed-off-by: Marek Vasut Cc: Bartosz Golaszewski Signed-off-by: Linus Walleij commit b32cecb46bdc8b3ea36c7a71aaca1853c0342cae Author: Marek Vasut Date: Wed Dec 12 02:39:57 2018 +0100 gpio: pca953x: Extract the register address mangling to single function Instead of having the I2C register calculation function spread across multiple accessor functions, pull it out into a single function which returns the adjusted register address. Signed-off-by: Marek Vasut Cc: Bartosz Golaszewski Signed-off-by: Linus Walleij commit 25a1b7102f3f1181be1feaa0ed6ff82f1b526acd Author: Marek Vasut Date: Wed Dec 12 02:39:56 2018 +0100 gpio: pca953x: Zap ad-hoc I2C block write in multi GPIO set The ad-hoc i2c block write can be replaced by standard register accessor function, which correctly handles all the chip details and differences. Do so to simplify the code. Signed-off-by: Marek Vasut Cc: Bartosz Golaszewski Signed-off-by: Linus Walleij commit 7a04aaa32cbc449588fecc77da637e0da771283f Author: Marek Vasut Date: Wed Dec 12 02:39:55 2018 +0100 gpio: pca953x: Factor out common code from device_pca95xx_init() The PCA957x and PCA953x init functions are almost the same, except for the different register mapping and one extra write to BKEN register in case of PCA957x. Factor out the common code. Signed-off-by: Marek Vasut Cc: Bartosz Golaszewski Signed-off-by: Linus Walleij commit 90adb0979947ab9ee2bd5fffa28c6812a47cd7f2 Author: Marek Vasut Date: Wed Dec 12 02:39:54 2018 +0100 gpio: pca953x: Unify pca953x_{read,write}_regs_{8,mul}() At this point, the pca953x_{read,write}_regs_mul() can read single bank PCA953x GPIO chips as well. Merge the _8 and _mul functions together to simplify the code a bit. Signed-off-by: Marek Vasut Cc: Bartosz Golaszewski Signed-off-by: Linus Walleij commit 49e713738f9ebfe659d16bff3ff1fb0a054aa9f7 Author: Marek Vasut Date: Wed Dec 12 02:39:53 2018 +0100 gpio: pca953x: Unify pca953x_{read,write}_regs_{16,24}() At this point, these two functions only differ in whether they do or do not set the address increment bit. The 16 GPIO case does not need to set the AI bit, except for PCA9575 on write, while the 24 GPIO and more case does set the AI bit always. Merge these two functions together to simplify the code a bit. Signed-off-by: Marek Vasut Cc: Bartosz Golaszewski Signed-off-by: Linus Walleij commit 028a219ae5b4661ccc400d7f182766853275f0eb Author: Marek Vasut Date: Wed Dec 12 02:39:52 2018 +0100 gpio: pca953x: Unify pca95{3,7}x_write_regs_16() At this point, these two functions only differ in whether they do or do not set the address increment bit on PCA9575. Merge these two functions together to simplify the code a bit. Signed-off-by: Marek Vasut Cc: Bartosz Golaszewski Signed-off-by: Linus Walleij commit 8958262af3fb832c9817e50f599c5552957ceaba Author: Marek Vasut Date: Wed Dec 12 02:39:51 2018 +0100 gpio: pca953x: Repair multi-byte IO address increment on PCA9575 The multi-byte IO on various pca953x chips requires the auto-increment bit, while other chips toggle the LSbit automatically. Note that LSbit toggling only alternates between two registers during the IO, it is not the same as address auto-increment. The driver currently assumes that #gpios > 16 implies auto-increment, while #gpios <= 16 implies LSbit toggling. This is incorrect at there are chips with 16 GPIOs which require the auto-increment bit. The PCA9575, according to NXP datasheet rev. 4.2 from 16 April 2015, section 7.3 Command Register, the bit 7 in command register is the auto-increment bit, which allows programming multiple registers sequentially. Set this bit both in pca953x_gpio_set_multiple(), where it fixes the multi register programming, and in pca957x_write_regs_16(), where is simplifies the function. In fact, the pca957x_write_regs_16() now looks rather similar to pca953x_write_regs_24() and pca953x_write_regs_16(), which is intended for subsequent patches. Signed-off-by: Marek Vasut Signed-off-by: Linus Walleij commit 92f45ebe68181c2d7f76633ffae55bc9447d62cd Author: Marek Vasut Date: Wed Dec 12 02:39:50 2018 +0100 gpio: pca953x: Fix AI overflow on PCAL6524 The PCAL_PINCTRL_MASK is too large. The extended register block on PCAL6524, which is the largest chip with this block, has the block limited to address range 0x40..0x7f. This is because the bit 7 in the command register is used for the Address Increment functionality. Trim the mask to 0x60 to match the datasheet and to prevent accidental overwrite of the AI bit. Signed-off-by: Marek Vasut Reviewed-by: Bartosz Golaszewski Signed-off-by: Linus Walleij commit 873d1e8e6fafabc7750e5ef0fe0289548f540f5b Author: Marek Vasut Date: Wed Dec 12 02:39:49 2018 +0100 gpio: pca953x: Deduplicate the bank_shift The bank_shift = fls(...) code was duplicated in the driver 5 times, pull it into separate function. Signed-off-by: Marek Vasut Cc: Bartosz Golaszewski Reviewed-by: Kieran Bingham Signed-off-by: Linus Walleij commit 3a2fa906c0a92d1a0813162a3252f24d383a5374 Author: Thierry Reding Date: Thu Nov 29 18:03:10 2018 +0100 gpio: tegra186: Rename flow variable to type The IRQ core code refers to the interrupt type by that name, whereas the term flow is almost never used. Some GPIO controllers use the term flow_type, but it is most consistent to just go with the IRQ core terminology. Signed-off-by: Thierry Reding Signed-off-by: Linus Walleij commit 493872e074148ae11d5dd5d78453101003829485 Merge: 21abf103818a4 aaa21231698c0 Author: Linus Walleij Date: Fri Dec 14 14:27:41 2018 +0100 Merge tag 'intel-gpio-v4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel into devel intel-gpio for v4.21-1 Use managed resource allocation in pch and sodaville drivers. Switch to use for_each_set_bit() in IRQ handlers. Headers clean up. Sort headers in inclusion block alphabetically for better maintenance. Convert to SPDX identifier and fixing MODULE_LICENSE() when appropriate. Additional format fixes to rectify debug and message printing. There is a commit which had been applied to v4.20-rc4, that's why dup. - c3bc3ff9e8019fba74ce62bfb501d710c2fca9d3 MAINTAINERS: Do maintain Intel GPIO drivers via separate tree The following is an automated git shortlog grouped by driver: ich: - Convert to use SPDX identifier - Sort headers alphabetically - Join string literals back - Convert pr_ to dev_ - Switch to use struct device instead of platform_device - Simplify error handling in ichx_write_bit() intel-mid: - Convert to use SPDX identifier - Remove linux/module.h and sort headers lynxpoint: - Convert to use SPDX identifier - Remove linux/init.h and sort headers - Use for_each_set_bit() in IRQ handler MAINTAINERS: - Do maintain Intel GPIO drivers via separate tree merrifield: - Convert to use SPDX identifier - Remove linux/init.h pch: - Convert to use SPDX identifier - Sort headers alphabetically - Remove duplicate assignments - Remove redundant __func__ from debug print - Use for_each_set_bit() in IRQ handler - Convert to dev_pm_ops - Convert to use managed functions pcim_* and devm_* sch: - Convert to use SPDX identifier - Remove linux/init.h and sort headers sodaville: - Convert to use SPDX identifier - Sort headers alphabetically - Use for_each_set_bit() in IRQ handler - Convert to use managed functions pcim_* and devm_* commit 21abf103818a4735e80fb0ab03934bed8ae9a028 Author: Linus Walleij Date: Tue Sep 4 13:31:45 2018 +0200 gpio: Pass a flag to gpiochip_request_own_desc() Before things go out of hand, make it possible to pass flags when requesting "own" descriptors from a gpio_chip. This is necessary if the chip wants to request a GPIO with active low semantics, for example. Cc: Janusz Krzysztofik Cc: Thomas Petazzoni Cc: Jason Cooper Cc: Jiri Kosina Cc: Roger Quadros Reviewed-by: Gregory CLEMENT Signed-off-by: Linus Walleij commit a45eb575cdb44d8b493fead6352f17bcc36da66a Author: Christoph Hellwig Date: Thu Dec 13 21:32:12 2018 +0100 block: remove the unused bio_set_pages_dirty and bio_check_pages_dirty exports Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 0374e1132217711bc2e920cde877dd7fc3dbd2d9 Author: Christoph Hellwig Date: Thu Dec 13 21:32:11 2018 +0100 block: remove the unused bio_iov_iter_get_pages export Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 637b60ade37ed5465c038c03f0fd1deabadac49c Author: Christoph Hellwig Date: Thu Dec 13 21:32:10 2018 +0100 block: remove the blk_recount_segments export Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 6c210aa596d0ecf6f3eea65c02ac807877385a18 Author: Christoph Hellwig Date: Thu Dec 13 21:32:09 2018 +0100 block: remove the bio_phys_segments export Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 75edce8a45486fe5fa5becdb43a7c36354b2a379 Author: Sean Christopherson Date: Mon Dec 3 13:53:06 2018 -0800 KVM: VMX: Move eVMCS code to dedicated files The header, evmcs.h, already exists and contains a fair amount of code, but there are a few pieces in vmx.c that can be moved verbatim. In addition, move an array definition to evmcs.c to prepare for multiple consumers of evmcs.h. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 8373d25d25d14fe644feae007c15a5a10cf8e888 Author: Sean Christopherson Date: Mon Dec 3 13:53:08 2018 -0800 KVM: VMX: Add vmx.h to hold VMX definitions Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 0718f87b0df49570cdcb96179997bd372cac1742 Author: Rohit kumar Date: Fri Dec 14 17:59:29 2018 +0530 ASoC: qdsp6: q6routing: add display_port_rx port routing This patch add support to Display_port_rx mixers required to select path between ASM stream and AFE ports. Signed-off-by: Rohit kumar Acked-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 32d2c61ba05944aa1e61d186611310dd911e1703 Author: Rohit kumar Date: Fri Dec 14 17:59:28 2018 +0530 ASoC: qdsp6: q6afe-dai: add support to Display port RX dais This patch adds support of AFE DAI for Display_port_rx port. Signed-off-by: Rohit kumar Acked-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 3f6856a28f5eeb4fcaeb3ae25118171747354e51 Author: Rohit kumar Date: Fri Dec 14 17:59:27 2018 +0530 ASoC: qdsp6: qdafe: add support for display_port_rx This patch adds support for Display_Port_Rx port in AFE. Signed-off-by: Rohit kumar Acked-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 76119509d23cdd9fbc71585042b27b6511b44b4d Author: Rohit kumar Date: Fri Dec 14 17:59:26 2018 +0530 ASoC: qdsp6: dt-bindings: Add q6afe display_port dt binding This patch adds bindings required for DISPLAY_PORT_RX port on AFE. Signed-off-by: Rohit kumar Acked-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 22930c79ac5c243c95e46508f0989e153836adc7 Author: Srinivas Kandagatla Date: Thu Nov 15 18:13:24 2018 +0000 ASoC: qdsp6: q6asm-dai: Add support to compress offload This patch adds MP3 playback support in q6asm dais, adding other codec support should be pretty trivial. Signed-off-by: Srinivas Kandagatla Acked-by: Vinod Koul Signed-off-by: Mark Brown commit f2e6c6aa0cb5f39e48627850680b87ec688070f8 Author: Srinivas Kandagatla Date: Thu Nov 15 18:13:23 2018 +0000 ASoC: qdsp6: q6asm: add support to MP3 format This patch adds support to mp3 format in ASM module. Signed-off-by: Srinivas Kandagatla Acked-by: Vinod Koul Signed-off-by: Mark Brown commit ee23cf37fd586769febab95e2fbbbb50da5f9f2d Author: Srinivas Kandagatla Date: Thu Nov 15 18:13:22 2018 +0000 ASoC: q6asm-dai: dt-bindings: Add support to compress dais This patch adds board specific bindings required for dais, In particular for compressed dais and dai direction. Board specific setup involves setting up some of dais as compressed dais and also specify direction of any dai. Some of the dais might only support capture/playback depending on the board level wiring. These two new dt properties will allow such flexibilty at board level dts. Signed-off-by: Srinivas Kandagatla Reviewed-by: Vinod Koul Reviewed-by: Rob Herring Acked-by: Vinod Koul Signed-off-by: Mark Brown commit d00f749b00f7802bf944688ad2971455f84fdacb Author: Srinivas Kandagatla Date: Thu Nov 15 18:13:21 2018 +0000 ALSA: compress: make use of runtime buffer for copy Default copy function uses kmalloc to allocate buffers, lets check if the runtime buffers are setup before making this allocations. This can be useful if the buffers are dma buffers. Signed-off-by: Srinivas Kandagatla Acked-by: Vinod Koul Signed-off-by: Mark Brown commit ba02eed9f300b6512181d526311d4e11aaa9714f Author: Srinivas Kandagatla Date: Thu Nov 15 18:13:20 2018 +0000 ALSA: soc-compress: add support to snd_compr_set_runtime_buffer() Existing compress offload code allocates data buffers using simple kmalloc, however there are situations where these buffers have to be mapped in smmu. So provide a way to set the runtime buffer by the driver itself, simillar to what we do with pcm. This patch adds support to set runtime dma buffer on compressed stream. Signed-off-by: Srinivas Kandagatla Acked-by: Vinod Koul Signed-off-by: Mark Brown commit 079e7f8709bb41cd0dc13efaffb24a0f17841955 Author: Fabrizio Castro Date: Thu Dec 13 20:19:57 2018 +0000 spi: sh-msiof: Add r8a774c0 support Document RZ/G2E (R8A774C0) SoC bindings. Signed-off-by: Fabrizio Castro Reviewed-by: Geert Uytterhoeven Signed-off-by: Mark Brown commit 35bc99aaa1a3af23cf78b6b56f14230b5da3993b Author: Pierre-Louis Bossart Date: Thu Dec 13 13:03:00 2018 -0600 ASoC: Intel: Skylake: Add more platform granularity The current SKYLAKE kconfig is a all-you-can-eat selection that will support all known plaforms. This is however not necessarily a good thing: most platforms for SKL and KBL don't support the DSP, but a number of CNL/WHL ones do. Selecting this driver in all cases isn't really smart and will require users to muck with blacklists. Partition the configs to allow distributions to select on which platform this driver is used. Keep the existing SND_SOC_INTEL_SKYLAKE config to select everything for backwards compatibility. This patch does not provide new functionality, only finer-grained choices in supported platforms. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit ae38d267417291db40de7439f2b0b690ab615f0e Author: Fabrizio Castro Date: Thu Dec 13 20:20:06 2018 +0000 ASoC: rsnd: Add r8a774c0 support Document RZ/G2E (R8A774C0) SoC bindings. Signed-off-by: Fabrizio Castro Acked-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 3cee7a7d05b11038c8b5fa093e45c6f839ffc867 Author: Rob Herring Date: Wed Dec 5 13:50:44 2018 -0600 backlight: 88pm860x_bl: 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. For instances using of_node_cmp, this has the side effect of now using case sensitive comparisons. This should not matter for any FDT based system which this is. Signed-off-by: Rob Herring Acked-by: Daniel Thompson Signed-off-by: Lee Jones commit bcbeef5f001ca7f004147df0132a18e582bf3122 Merge: 83fd1e52496b7 ade0c9493e972 Author: Rafael J. Wysocki Date: Fri Dec 14 12:53:34 2018 +0100 Merge branch 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull more operating performance points (OPP) framework changes for v4.21 from Viresh Kumar: "- Fix missing OPP debugfs directory (Viresh Kumar). - Make genpd performance states orthogonal to idlestates (Ulf Hansson). - Propagate performance state changes from genpd to its master (Viresh Kumar). - Minor improvement of some OPP helpers (Viresh Kumar)." * 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: PM / Domains: Propagate performance state updates PM / Domains: Factorize dev_pm_genpd_set_performance_state() PM / Domains: Save OPP table pointer in genpd OPP: Don't return 0 on error from of_get_required_opp_performance_state() OPP: Add dev_pm_opp_xlate_performance_state() helper OPP: Improve _find_table_of_opp_np() PM / Domains: Make genpd performance states orthogonal to the idlestates OPP: Fix missing debugfs supply directory for OPPs OPP: Use opp_table->regulators to verify no regulator case commit cfc652a73331c3b465e3f8dd39a3d6b71e6b3a66 Author: Kuninori Morimoto Date: Fri Dec 14 11:35:24 2018 +0900 ASoC: simple-card: tidyup prefix for snd_soc_codec_conf Current simple-card is handling "prefix" by many ways. But, it is not useful and readable. We want to do is that allow having it everywere. This patch supports it. It will be overwrote if lower node has it. sound { simple-audio-card,prefix = "xxx"; // initial simple-audio-card,dai-link { prefix = "xxx"; // overwrite cpu { ... }; codec { prefix = "xxx"; // overwrite }; }; }; Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit dd82410f7e939f00591c415d62915a89ac2fb8f0 Author: Kuninori Morimoto Date: Fri Dec 14 11:35:20 2018 +0900 ASoC: simple-card: tidyup convert_rate/channel method Current simple-card is handling "convert_rate/channel" by many ways. But, it is not useful and readable. We want to do is that allow having it everywere. This patch support it. It will be overwrote if lower node has it. sound { simple-audio-card,convert_channels = ; // initial simple-audio-card,dai-link { convert_channels = ; // overwrite cpu { convert_channels = ; // overwrite }; codec { convert_channels = ; // overwrite }; }; }; Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 79e834914d1fa2d078c586094ad347cc05aa428c Author: Kuninori Morimoto Date: Fri Dec 14 11:35:15 2018 +0900 ASoC: simple-card: tidyup mclk-fs method Current simple-card is handling "mclk-fs" by many way. But, it is not useful and readable. We want to do is that allow having mclk-fs everywere. This patch support it. It will be overwrote if lower node has it. sound { simple-audio-card,mclk-fs = ; // for initial simple-audio-card,dai-link { mclk-fs = ; // overwrite cpu { mclk-fs = ; // overwrite }; codec { mclk-fs = ; // overwrite }; }; }; Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit da215354eb55c382d3d5c426ea0e9aa7ef7c10e1 Author: Kuninori Morimoto Date: Fri Dec 14 11:35:10 2018 +0900 ASoC: simple-card: merge simple-scu-card simple-card and simple-scu-card are very similar driver, but the former is supporting normal sound card, the latter is supporting DPCM sound card. We couldn't use normal sound and DPCM sound in same time by one sound card. This patch merges both sound card into simple-card. Now we can use both feature on same driver. simple-card is now supporting .compatible = "simple-scu-audio-card". Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit c4e8ebb9f2624da8302b6683ecb5ead7108ccb79 Author: Kuninori Morimoto Date: Fri Dec 14 11:35:05 2018 +0900 ASoC: simple-card: merge simple-scu-card on Doc simple-card and simple-scu-card are very similar driver, but the former is supporting normal sound card, the latter is supporting DPCM sound card. We couldn't use normal sound and DPCM sound in same time by one sound card. This patch merges both sound card into simple-card. Now we can use both feature on same driver. simple-card is now supporting .compatible = "simple-scu-audio-card". Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 66164a4da30dd295a1b60568c02bee37cfd9895a Author: Kuninori Morimoto Date: Fri Dec 14 11:32:43 2018 +0900 ASoC: audio-graph-card: tidyup prefix for snd_soc_codec_conf Current audio-graph-card is handling "prefix" by many ways. But, it is not useful and readable. We want to do is that allow having it everywere. This patch supports it. It will be overwrote if lower node has it. sound { prefix = "xxx"; // initial }; codec { audio-graph-card,prefix = "xxx"; // overwrite ports { prefix = "xxx"; // overwrite port { prefix = "xxx"; // overwrite }; }; }; Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 7ced65ffb82fa58c6e314c16770288fe9ce3dfc8 Author: Kuninori Morimoto Date: Fri Dec 14 11:32:36 2018 +0900 ASoC: audio-graph-card: tidyup convert_rate/channel method Current audio-graph-card is handling "convert_rate/channel" by many ways. But, it is not useful and readable. We want to do is that allow having it everywere. This patch support it. It will be overwrote if lower node has it. sound { convert-channels = ; // initial }; codec { audio-graph-card,convert-channels = ; // overwrite ports { convert_channels = ; // overwrite port { convert_channels = ; // overwrite endpoint { convert_channels = ; // overwrite }; }; }; }; Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 56eb818191fbe4b93bbe6e884f96061013c9a6ab Author: Kuninori Morimoto Date: Fri Dec 14 11:32:30 2018 +0900 ASoC: audio-graph-card: tidyup mclk-fs method Current audio-graph-card is handling "mclk-fs" by many way. But, it is not useful and readable. We want to do is that allow having mclk-fs everywere. This patch support it. It will be overwrote if lower node has it. sound { mclk-fs = ; // initial }; codec { ports { mclk-fs = ; // overwrite port { mclk-fs = ; // overwrite endpoint { mclk-fs = ; // overwrite }; }; }; }; Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit ae3cb5790906b5caf519f6f21792c30fb5ddf8db Author: Kuninori Morimoto Date: Fri Dec 14 11:32:25 2018 +0900 ASoC: audio-graph-card: merge audio-graph-scu-card audio-graph-card and audio-graph-scu-card are very similar driver, but the former is supporting normal sound card, the latter is supporting DPCM sound card. We couldn't use normal sound and DPCM sound in same sound card by audio-graph-card. This patch merges both sound card into it. Now we can use both feature on same driver. audio-grap-card is now supporting .compatible = "audio-graph-scu-card". Signed-off-by: Kuninori Morimoto Tested-by: Tony Lindgren Signed-off-by: Mark Brown commit 91a531e48b20677c1f820f3bbd4237abd8144919 Author: Kuninori Morimoto Date: Fri Dec 14 11:32:06 2018 +0900 ASoC: audio-graph-card: merge audio-graph-scu-card on Doc audio-graph-card and audio-graph-scu-card are very similar driver, but the former is supporting normal sound card, the latter is supporting DPCM sound card. We couldn't use normal sound and DPCM sound in same sound card by audio-graph-card. This patch merges both feature into it on Documentation. Now we can use both feature on same driver. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit b8b89f5ee0b2555fa5a9d778685d2d6fb5122bb9 Author: Kuninori Morimoto Date: Fri Dec 14 11:29:42 2018 +0900 ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() ID method commit b6f3fc005a2c8 ("ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting") fixuped getting DAI ID method. It will get DAI ID from OF graph "port", but, we want to consider about "endpoint", too. And, we also want to keep compatibility. This patch fixup it as if (driver has specified DAI ID) use it as DAI ID else if (OF graph endpoint has reg) use it as DAI ID else if (OF graph port has reg) use it as DAI ID else use endpoint count as DAI ID Fixes: commit b6f3fc005a2c8 ("ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting") Reported-by: Tony Lindgren Signed-off-by: Kuninori Morimoto Tested-by: Tony Lindgren Signed-off-by: Mark Brown commit fc401cb98a736fa010aeaf863618a904ca70ba2c Author: Andrei.Stefanescu@microchip.com Date: Fri Dec 14 08:09:31 2018 +0000 regulator: mcp16502: add support for suspend This patch adds support for entering/resuming suspend states. It does this by setting the LPM pin of the PMIC. When suspending the PMIC will enter the Low-power mode when the LPM pin will be set to high. If the suspend target state is suspend-to-mem, the PMIC will transition to Hibernate mode, otherwise, if it is standby, it will remain in Low-power mode. Signed-off-by: Andrei Stefanescu Signed-off-by: Mark Brown commit 609363cf81fcbd2c7fc93d1f920cef3a71154de8 Author: Sean Christopherson Date: Mon Dec 3 13:53:05 2018 -0800 KVM: nVMX: Move vmcs12 code to dedicated files vmcs12 is the KVM-defined struct used to track a nested VMCS, e.g. a VMCS created by L1 for L2. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit cb1d474b322550630841a58ea960a448fe8ddce3 Author: Sean Christopherson Date: Mon Dec 3 13:53:04 2018 -0800 KVM: VMX: Move VMCS definitions to dedicated file This isn't intended to be a pure reflection of hardware, e.g. struct loaded_vmcs and struct vmcs_host_state are KVM-defined constructs. Similar to capabilities.h, this is a standalone file to avoid circular dependencies between yet-to-be-created vmx.h and nested.h files. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 2c4fd91d26643504011b7c2b75563a437e19d6a1 Author: Sean Christopherson Date: Mon Dec 3 13:53:03 2018 -0800 KVM: VMX: Expose various module param vars via capabilities.h Expose the variables associated with various module params that are needed by the nested VMX code. There is no ulterior logic for what variables are/aren't exposed, this is purely "what's needed by the nested code". Note that @nested is intentionally not exposed. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 3077c191088255932c9e3780d8c6a59f147b75b8 Author: Sean Christopherson Date: Mon Dec 3 13:53:02 2018 -0800 KVM: VMX: Move capabilities structs and helpers to dedicated file Defining a separate capabilities.h as opposed to putting this code in e.g. vmx.h avoids circular dependencies between (the yet-to-be-added) vmx.h and nested.h. The aforementioned circular dependencies are why struct nested_vmx_msrs also resides in capabilities instead of e.g. nested.h. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 7caaa71108676944d60672b3446fadb6bcf29de4 Author: Sean Christopherson Date: Mon Dec 3 13:53:01 2018 -0800 KVM: VMX: Pass vmx_capability struct to setup_vmcs_config() ...instead of referencing the global struct. This will allow moving setup_vmcs_config() to a separate file that may not have access to the global variable. Modify nested_vmx_setup_ctls_msrs() appropriately since vmx_capability.ept may not be accurate when called by vmx_check_processor_compat(). No functional change intended. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit c73da3fcab43357feb68cac227194b13e998a8db Author: Sean Christopherson Date: Mon Dec 3 13:53:00 2018 -0800 KVM: VMX: Properly handle dynamic VM Entry/Exit controls EFER and PERF_GLOBAL_CTRL MSRs have dedicated VM Entry/Exit controls that KVM dynamically toggles based on whether or not the guest's value for each MSRs differs from the host. Handle the dynamic behavior by adding a helper that clears the dynamic bits so the bits aren't set when initializing the VMCS field outside of the dynamic toggling flow. This makes the handling consistent with similar behavior for other controls, e.g. pin, exec and sec_exec. More importantly, it eliminates two global bools that are stealthily modified by setup_vmcs_config. Opportunistically clean up a comment and print related to errata for IA32_PERF_GLOBAL_CTRL. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 71d9409e20934e16f2d2ea88f0d1fb9851a7da3b Author: Sean Christopherson Date: Mon Dec 3 13:52:59 2018 -0800 KVM: VMX: Move caching of MSR_IA32_XSS to hardware_setup() MSR_IA32_XSS has no relation to the VMCS whatsoever, it doesn't belong in setup_vmcs_config() and its reference to host_xss prevents moving setup_vmcs_config() to a dedicated file. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 4cebd747d78559d1e8666d3e68a75f08966abc0c Author: Sean Christopherson Date: Mon Dec 3 13:52:58 2018 -0800 KVM: VMX: Drop the "vmx" prefix from vmx_evmcs.h VMX specific files now reside in a dedicated subdirectory, i.e. the file name prefix is redundant. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit e0123119a564de1a9aff712e0b968b3e21296a22 Author: Sean Christopherson Date: Mon Dec 3 13:52:57 2018 -0800 KVM: VMX: rename vmx_shadow_fields.h to vmcs_shadow_fields.h VMX specific files now reside in a dedicated subdirectory. Drop the "vmx" prefix, which is redundant, and add a "vmcs" prefix to clarify that the file is referring to VMCS shadow fields. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit a821bab2d1ee869e04b218b198837bf07f2d27c1 Author: Sean Christopherson Date: Mon Dec 3 13:52:56 2018 -0800 KVM: VMX: Move VMX specific files to a "vmx" subdirectory ...to prepare for shattering vmx.c into multiple files without having to prepend "vmx_" to all new files. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 3592cda6bc27fd6e73f73a6e793cbd0c09a07a36 Author: Sean Christopherson Date: Mon Dec 3 13:52:55 2018 -0800 KVM: x86: Add requisite includes to hyperv.h Until this point vmx.c has been the only consumer and included the file after many others. Prepare for multiple consumers, i.e. the shattering of vmx.c Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 8ba2e525ecd7428e25d80f37c533612d62f2dc26 Author: Sean Christopherson Date: Mon Dec 3 13:52:54 2018 -0800 KVM: x86: Add requisite includes to kvm_cache_regs.h Until this point vmx.c has been the only consumer and included the file after many others. Prepare for multiple consumers, i.e. the shattering of vmx.c Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 199b118ab3d528371f6e3ac9f6001a0f3fd11d04 Author: Sean Christopherson Date: Mon Dec 3 13:52:53 2018 -0800 KVM: VMX: Alphabetize the includes in vmx.c ...to prepare for the creation of a "vmx" subdirectory that will contain a variety of headers. Clean things up now to avoid making a bigger mess in the future. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit dfae3c03b89fd5547b1adee857b10dc6f1c66132 Author: Sean Christopherson Date: Mon Dec 3 13:52:52 2018 -0800 KVM: nVMX: Allocate and configure VM{READ,WRITE} bitmaps iff enable_shadow_vmcs ...and make enable_shadow_vmcs depend on nested. Aside from the obvious memory savings, this will allow moving the relevant code out of vmx.c in the future, e.g. to a nested specific file. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 1b3ab5ad1b8ad99bae76ec583809c5f5a31c707c Author: Sean Christopherson Date: Mon Dec 3 13:52:51 2018 -0800 KVM: nVMX: Free the VMREAD/VMWRITE bitmaps if alloc_kvm_area() fails Fixes: 34a1cd60d17f ("kvm: x86: vmx: move some vmx setting from vmx_init() to hardware_setup()") Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 2a31b9db153530df4aa02dac8c32837bf5f47019 Author: Paolo Bonzini Date: Tue Oct 23 02:36:47 2018 +0200 kvm: introduce manual dirty log reprotect There are two problems with KVM_GET_DIRTY_LOG. First, and less important, it can take kvm->mmu_lock for an extended period of time. Second, its user can actually see many false positives in some cases. The latter is due to a benign race like this: 1. KVM_GET_DIRTY_LOG returns a set of dirty pages and write protects them. 2. The guest modifies the pages, causing them to be marked ditry. 3. Userspace actually copies the pages. 4. KVM_GET_DIRTY_LOG returns those pages as dirty again, even though they were not written to since (3). This is especially a problem for large guests, where the time between (1) and (3) can be substantial. This patch introduces a new capability which, when enabled, makes KVM_GET_DIRTY_LOG not write-protect the pages it returns. Instead, userspace has to explicitly clear the dirty log bits just before using the content of the page. The new KVM_CLEAR_DIRTY_LOG ioctl can also operate on a 64-page granularity rather than requiring to sync a full memslot; this way, the mmu_lock is taken for small amounts of time, and only a small amount of time will pass between write protection of pages and the sending of their content. Signed-off-by: Paolo Bonzini commit 8fe65a8299f9e1f40cb95308ab7b3c4ad80bf801 Author: Paolo Bonzini Date: Tue Oct 23 02:18:42 2018 +0200 kvm: rename last argument to kvm_get_dirty_log_protect When manual dirty log reprotect will be enabled, kvm_get_dirty_log_protect's pointer argument will always be false on exit, because no TLB flush is needed until the manual re-protection operation. Rename it from "is_dirty" to "flush", which more accurately tells the caller what they have to do with it. Signed-off-by: Paolo Bonzini commit e5d83c74a5800c2a1fa3ba982c1c4b2b39ae6db2 Author: Paolo Bonzini Date: Thu Feb 16 10:40:56 2017 +0100 kvm: make KVM_CAP_ENABLE_CAP_VM architecture agnostic The first such capability to be handled in virt/kvm/ will be manual dirty page reprotection. Signed-off-by: Paolo Bonzini commit bb22dc14a2c29f6efef40ee72344c5d283a92987 Merge: fca91f6d60b6e 211929fd3f7c8 Author: Paolo Bonzini Date: Fri Dec 14 12:33:31 2018 +0100 Merge branch 'khdr_fix' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest into HEAD Merge topic branch from Shuah. commit 55ed14cdaec503bfe6a94f0524d0d2c9b7226aed Author: Emmanuel Grumbach Date: Tue Aug 14 16:49:30 2018 +0300 iwlwifi: mvm: don't check if a pointer is set if it can't be unset We used to have many versions of statistics notification coming from the firmware. In one of the cleanup patches, we forgot to clean the code that checks if data->general is set. Since it is always set, remove the check. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho commit 956343a61226e1af3d146386f70a059feb567d0c Author: Sara Sharon Date: Mon Aug 20 10:07:32 2018 +0300 iwlwifi: pcie: set cmd_len in the correct place command len is set too early in the code, since when building AMSDU, the size changes. This causes the byte count table to have the wrong size. Fixes: a0ec0169b7a9 ("iwlwifi: support new tx api") Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho commit 7969454b37f25d38a48bdbd9932e8aa49ed2ed77 Author: Shaul Triebitz Date: Wed Jul 25 22:11:52 2018 +0300 iwlwifi: mvm: radiotap: remove UL_DL bit in HE TRIG_BASED UL_DL is irrelevant to HE TRIG_BASED PPDU. Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho commit 6721039d5b8adfd57291c54e96eaa9f54da23753 Author: Shaul Triebitz Date: Mon Jul 2 17:16:48 2018 +0200 iwlwifi: mvm: add L-SIG length to radiotap We may have the L-SIG length depending on the phy_data info type; add it to radiotap when we do. Move getting the phy_data out one layer up and the info type into it so we can use this data more generically. We need to call the iwl_mvm_rx_he() function for other reasons as well, so can't just combine all of that into something like iwl_mvm_parse_phy_data(). Signed-off-by: Johannes Berg Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho commit bdf180c8d375ee75493d79ae384dd1f9686fc974 Author: Shaul Triebitz Date: Mon Jul 2 14:35:26 2018 +0200 iwlwifi: mvm: change PHY data RX for HE radiotap The firmware changed the PHY data API, so follow suit. Some data is now available even for HT/VHT frames, so the info type in the metadata was changed. This change isn't backwards compatible, but 1) the firmware with the old API was never released; 2) the only overlap in the info type field is from the old type of TB to the new of HT, so this basically just means that with older FW and newer driver the data will be considered missing. While at it, remove the extra code to set the LTF syms corresponding to the streams and use the data from the device instead - we don't really need this in any case other than when we have it from the device. As the new API gives use the spatial reuse 1-4 fields for trigger-based PPDUs, also expose that to radiotap. Signed-off-by: Johannes Berg Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho commit 0916224eaa77bff0fbbc747961d550ff8db45457 Author: Sara Sharon Date: Thu Aug 16 13:01:09 2018 +0300 iwlwifi: pcie: fix erroneous print When removing the driver, the following flow can happen: 1. host command is in progress, for example at index 68. 2. RX interrupt is received with the response. 3. Before it is processed, the remove flow kicks in, and calls iwl_pcie_txq_unmap. The function cleans all DMA, and promotes the read pointer to 69. 4. RX thread proceeds with the processing, and is calling iwl_pcie_cmdq_reclaim, which will print this error: iwl_pcie_cmdq_reclaim: Read index for DMA queue txq id (0), index 4 is out of range [0-256] 69 69. Detect this situation, and avoid the print. Change it to warning while at it, to make such issues more noticeable in the future. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho commit 7bc2468277033e05401d5f8fd48a772f407338c2 Author: Avraham Stern Date: Wed Aug 15 12:23:39 2018 +0300 iwlwifi: mvm: force TCM re-evaluation on TCM resume When traffic load is not low or low latency is active, TCM schedules re-evaluation work so in case traffic stops TCM will detect that traffic load has become low or that low latency is no longer active. However, if TCM is paused when the re-evaluation work runs, it does not re-evaluate and the re-evaluation work is no longer scheduled. As a result, TCM will not indicate that low latency is no longer active or that traffic load is low when traffic stops. Fix this by forcing TCM re-evaluation when TCM is resumed in case low latency is active or traffic load is not low. Signed-off-by: Avraham Stern Signed-off-by: Luca Coelho commit cc2af963f5dac19e1f0a9725c52927be98a80193 Author: Luca Coelho Date: Thu Aug 16 10:01:00 2018 +0300 iwlwifi: remove all unnecessary occurrences of nvm_calib_ver Now that nvm_calib_ver is not checked in opmodes other than dvm, we can remove it from all irrelevant configurations. Signed-off-by: Luca Coelho commit 64866e5da1eabd0c52ff45029b245f5465920031 Author: Luca Coelho Date: Thu Aug 16 09:23:08 2018 +0300 iwlwifi: move iwl_nvm_check_version() into dvm This function is only half-used by mvm (i.e. only the nvm_version part matters, since the calibration version is irrelevant), so it's pointless to export it from iwlwifi. If mvm uses this function, it has the additional complexity of setting the calib version to a bogus value on all cfg structs. To avoid this, move the function to dvm and make a simple comparison of the nvm_version in mvm instead. Signed-off-by: Luca Coelho commit 4aeaccd6b5f05a20fd3154581f1ec2e6793cd998 Author: Luca Coelho Date: Thu Aug 16 09:01:31 2018 +0300 iwlwifi: remove useless NVM_HW_SECTION_NUM_FAMILY_* macros These macros are useless because each one of them is used only once and the element they are assigned to is already pretty clear about what they mean, "nvm_hw_section_num". Signed-off-by: Luca Coelho commit 3e2b49d66f2eef7f01eb8b2c74589015c72c006c Author: Luca Coelho Date: Thu Aug 16 08:53:10 2018 +0300 iwlwifi: don't define OTP_LOW_IMAGE_SIZE per family, but per size Using OTP_LOW_IMAGE_SIZE_FAMILY_8000/9000/22000 only obfuscates the actual values, since these 3 are the same. Redefine the values per size so it's easier to understand and compare the different configurations. Signed-off-by: Luca Coelho commit da2eb669c2c9cc8ece953d4d249791ce139dd05c Author: Sara Sharon Date: Wed Jun 13 15:22:48 2018 +0300 iwlwifi: mvm: activate apply points Call the previously introduced apply points entry point when reaching an apply point. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho commit fe1b7d6c28885642dc3dd59d3710ae2b283aa486 Author: Sara Sharon Date: Thu Jun 21 09:42:12 2018 +0300 iwlwifi: add support for triggering ini triggers Add support for ini triggers. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho commit 7a14c23dcdee68782acb90be29590ad683c3aeb4 Author: Sara Sharon Date: Wed Jun 13 15:24:13 2018 +0300 iwlwifi: dbg: dump data according to the new ini TLVs When ini TLVs are loaded, dump data according to the stored configuration. Signed-off-by: Sara Sharon Signed-off-by: Luca Coelho commit 09b0b99007ff4e250a479de731d897bea34f0b4e Author: Luca Coelho Date: Thu Aug 9 13:51:08 2018 +0300 iwlwifi: move common 9000 cfg parameters to common macro The ht_params, nvm_ver, nvm_calib_ver and max_ht_ampdu_exponent elements in 9000 devices are always the same. Move them to the common macro. Signed-off-by: Luca Coelho commit ade0c9493e972171103c7d804840248c32032954 Merge: 46f48aca2e5ae 18edf49c45544 Author: Viresh Kumar Date: Fri Dec 14 16:28:52 2018 +0530 Merge branch 'opp/genpd/propagation' into opp/linux-next commit 18edf49c45544cfb93002b3b31fe8fc7fc14d95c Author: Viresh Kumar Date: Fri Nov 2 14:40:19 2018 +0530 PM / Domains: Propagate performance state updates Currently a genpd only handles the performance state requirements from the devices under its control. This commit extends that to also handle the performance state requirement(s) put on the master genpd by its sub-domains. There is a separate value required for each master that the genpd has and so a new field is added to the struct gpd_link (link->performance_state), which represents the link between a genpd and its master. The struct gpd_link also got another field prev_performance_state, which is used by genpd core as a temporary variable during transitions. On a call to dev_pm_genpd_set_performance_state(), the genpd core first updates the performance state of the masters of the device's genpd and then updates the performance state of the genpd. The masters do the same and propagate performance state updates to their masters before updating their own. The performance state transition from genpd to its master is done with the help of dev_pm_opp_xlate_performance_state(), which looks at the OPP tables of both the domains to translate the state. Tested-by: Rajendra Nayak Reviewed-by: Ulf Hansson Signed-off-by: Viresh Kumar commit cd50c6d3eb91bdff9ac37ee645c49ae274385d35 Author: Viresh Kumar Date: Wed Oct 31 14:56:54 2018 +0530 PM / Domains: Factorize dev_pm_genpd_set_performance_state() Separate out _genpd_set_performance_state() and _genpd_reeval_performance_state() from dev_pm_genpd_set_performance_state() to handle performance state update related stuff. This will be used by a later commit. Tested-by: Rajendra Nayak Reviewed-by: Ulf Hansson Signed-off-by: Viresh Kumar commit 1067ae3e427fba60965fc519e20d54d0b210fd27 Author: Viresh Kumar Date: Fri Nov 2 11:18:08 2018 +0530 PM / Domains: Save OPP table pointer in genpd dev_pm_genpd_set_performance_state() will be required to call dev_pm_opp_xlate_performance_state() going forward to translate from performance state of a sub-domain to performance state of its master. And dev_pm_opp_xlate_performance_state() needs pointers to the OPP tables of both genpd and its master. Lets fetch and save them while the OPP tables are added. Fetching the OPP tables should never fail as we just added the OPP tables and so add a WARN_ON() for such a bug instead of full error paths. Tested-by: Rajendra Nayak Reviewed-by: Ulf Hansson Signed-off-by: Viresh Kumar commit 2feb5a896c42fb24f6d6f7028574dc59bfc9306f Author: Viresh Kumar Date: Fri Dec 14 15:20:56 2018 +0530 OPP: Don't return 0 on error from of_get_required_opp_performance_state() of_get_required_opp_performance_state() returns 0 on errors currently and a positive performance state otherwise. Since 0 is a valid performance state (representing off), it would be better if this routine returns negative values on error. That will also make it behave similar to dev_pm_opp_xlate_performance_state(), which also returns performance states and returns negative values on error. Change the return type of the function to "int" in order to return negative values. This doesn't have any users for now and so no other part of the kernel will be impacted with this change. Reviewed-by: Ulf Hansson Signed-off-by: Viresh Kumar commit c8a59103e22b191e363fc0a90e08515a915b278d Author: Viresh Kumar Date: Fri Nov 2 14:36:42 2018 +0530 OPP: Add dev_pm_opp_xlate_performance_state() helper dev_pm_genpd_set_performance_state() needs to handle performance state propagation going forward. Currently this routine only gets the required performance state of the device's genpd as an argument, but it doesn't know how to translate that to master genpd(s) of the device's genpd. Introduce a new helper dev_pm_opp_xlate_performance_state() which will be used to translate from performance state of a device (or genpd sub-domain) to another device (or master genpd). Normally the src_table (of genpd sub-domain) will have the "required_opps" property set to point to one of the OPPs in the dst_table (of master genpd), but in some cases the genpd and its master have one to one mapping of performance states and so none of them have the "required-opps" property set. Return the performance state of the src_table as it is in such cases. Tested-by: Rajendra Nayak Reviewed-by: Ulf Hansson Signed-off-by: Viresh Kumar commit 699e21e4170add1c4c954838d94feec2014ee83c Author: Viresh Kumar Date: Thu Nov 22 11:04:00 2018 +0530 OPP: Improve _find_table_of_opp_np() Make _find_table_of_opp_np() more efficient by using of_get_parent() to find the parent OPP table node. Tested-by: Rajendra Nayak Reviewed-by: Ulf Hansson Signed-off-by: Viresh Kumar commit 41158dabfd913c04058d54e9561a2a159a8e5082 Author: Yong Zhi Date: Thu Dec 6 20:03:38 2018 -0500 media: staging/intel-ipu3: Add Intel IPU3 meta data uAPI These meta formats are used on Intel IPU3 ImgU video queues to carry 3A statistics and ISP pipeline parameters. V4L2_META_FMT_IPU3_3A V4L2_META_FMT_IPU3_PARAMS Signed-off-by: Yong Zhi Signed-off-by: Chao C Li Signed-off-by: Rajmohan Mani Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 68de2fe57a8f2746db1064d39c697595cd76bb16 Author: Ulf Hansson Date: Tue Dec 11 11:04:55 2018 +0100 PM / Domains: Make genpd performance states orthogonal to the idlestates It's quite questionable whether genpd internally should care about if the corresponding PM domain for a device is powered on, as to allow setting a new performance state for it. The assumptions creates an unnecessary limitation at this point, for both consumers and providers, but more importantly it also makes the code more complicated. Therefore, let's simplify the code to allow setting a performance state, by invoking the ->set_performance_state() callback, no matter whether the PM domain is powered on or off. Do note, this change means genpd providers needs to restore the performance state themselves during power on, via the ->power_on() callback. Moreover, they may also need to check that the PM domain is powered on, from their ->set_performance_state() callback, before deciding to update the state. Tested-by: Rajendra Nayak Acked-by: Viresh Kumar Signed-off-by: Ulf Hansson Signed-off-by: Viresh Kumar commit 7fc7af649ca77fd6a184a0d74269206fd3836a9c Author: Yong Zhi Date: Thu Dec 6 20:03:37 2018 -0500 media: staging/intel-ipu3: Add imgu top level pci device driver This patch adds support for the Intel IPU v3 as found on Skylake and Kaby Lake SoCs. The driver glues v4l2, css(camera sub system) and other pieces together to perform its functions, it also loads the IPU3 firmware binary as part of its initialization. Signed-off-by: Yong Zhi Signed-off-by: Tomasz Figa Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit a0ca1627b4501d266c92ed84669309d33deca0df Author: Yong Zhi Date: Thu Dec 6 20:03:36 2018 -0500 media: staging/intel-ipu3: Add v4l2 driver based on media framework Implement video driver that utilizes v4l2, vb2 queue support and media controller APIs. The driver exposes single subdevice and six nodes. Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit f5f2e427351896fc55e6340567438e3e980d3012 Author: Yong Zhi Date: Thu Dec 6 20:03:35 2018 -0500 media: staging/intel-ipu3: Add css pipeline programming This provides helper library to be used by v4l2 level to program imaging pipelines and control the streaming. Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit edfe84526099548fbad85ad0a4820a8ca614f640 Author: Yong Zhi Date: Thu Dec 6 20:03:34 2018 -0500 media: staging/intel-ipu3: css: Initialize css hardware This patch implements the functions to initialize and configure IPU3 h/w such as clock, irq and power. Signed-off-by: Yong Zhi Signed-off-by: Tomasz Figa Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 272c1a9b493986a95219dce674c49877d98cf90f Merge: 2a3c83f5fe077 3b5129b3a7c62 Author: Daniel Vetter Date: Fri Dec 14 11:27:24 2018 +0100 Merge tag 'exynos-drm-next-for-v4.21-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next Add configurable plane alpha and pixel blend mode support - This patch series adds configurable plane alpha and pixel blend mode support for FIMD device driver. Signed-off-by: Daniel Vetter From: Inki Dae Link: https://patchwork.freedesktop.org/patch/msgid/1544772430-8295-1-git-send-email-inki.dae@samsung.com commit e11110a5b74487cfc99dad8a5744fe26782f5d9c Author: Yong Zhi Date: Thu Dec 6 20:03:33 2018 -0500 media: staging/intel-ipu3: css: Compute and program ccs A collection of routines that are mainly used to calculate the parameters for accelerator cluster. Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 15e2f1ba09ad7ea3f641f9dc335e8e0999ab5363 Author: Yong Zhi Date: Thu Dec 6 20:03:32 2018 -0500 media: staging/intel-ipu3: css: Add static settings for image pipeline This adds coeff, config parameters etc const definitions for IPU3 programming. Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 09d290f0ba2165666c583726836ab761e099cc2d Author: Yong Zhi Date: Thu Dec 6 20:03:31 2018 -0500 media: staging/intel-ipu3: css: Add support for firmware management Introduce functions to load and install ImgU FW blobs. Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit e9fad6f1d2307d42e6b8f40c78b51c1f59c61922 Author: Yong Zhi Date: Thu Dec 6 20:03:30 2018 -0500 media: staging/intel-ipu3: css: Add dma buff pool utility functions The pools are used to store previous parameters set by user with the parameter queue. Due to pipelining, there needs to be multiple sets (up to four) of parameters which are queued in a host-to-sp queue. [mchehab@kernel.org: fixed two minor issues on comments: a space before tab and a typo: "vaid" -> "valid"] Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 2a2c51d3287e2e2bdbfd5f08716cee141e3cefa2 Author: Tomasz Figa Date: Thu Dec 6 20:03:29 2018 -0500 media: staging/intel-ipu3: Implement DMA mapping functions This driver uses IOVA space for buffer mapping through IPU3 MMU to transfer data between imaging pipelines and system DDR. Signed-off-by: Tomasz Figa Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 26f5689592e2f9442a4e46c2d375c70b1e99b62e Author: Tomasz Figa Date: Thu Dec 6 20:03:28 2018 -0500 media: staging/intel-ipu3: mmu: Implement driver This driver translates IO virtual address to physical address based on two levels page tables. Signed-off-by: Tomasz Figa Signed-off-by: Yong Zhi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 2da6500d335ed6c86bf12d11158507b1719aea5f Author: Yong Zhi Date: Thu Dec 6 20:03:27 2018 -0500 media: staging/intel-ipu3: abi: Add structs This add all the structs of IPU3 firmware ABI. Signed-off-by: Yong Zhi Signed-off-by: Rajmohan Mani Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 88aa9d2045717a895c1548ada75e93b005a2cc43 Author: Yong Zhi Date: Thu Dec 6 20:03:26 2018 -0500 media: staging/intel-ipu3: abi: Add register definitions and enum Add macros and enums used for IPU3 firmware interface. Signed-off-by: Yong Zhi Signed-off-by: Rajmohan Mani Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 934a040be674f7420e4b8691b97519e5ac588d28 Author: Sakari Ailus Date: Fri Jun 16 09:49:29 2017 -0400 media: docs-rst: v4l: Document V4L2_BUF_TYPE_META_OUTPUT interface Document the interface for metadata output, including V4L2_BUF_TYPE_META_OUTPUT buffer type and V4L2_CAP_META_OUTPUT capability bits. Signed-off-by: Sakari Ailus Acked-by: Hans Verkuil Reviewed-by: Tomasz Figa Tested-by: Tian Shu Qiu Signed-off-by: Mauro Carvalho Chehab commit 72148d1a57e7c76745e68c94ad5d235240d26ac8 Author: Sakari Ailus Date: Fri Jun 16 08:38:31 2017 -0400 media: v4l: Add support for V4L2_BUF_TYPE_META_OUTPUT The V4L2_BUF_TYPE_META_OUTPUT mirrors the V4L2_BUF_TYPE_META_CAPTURE with the exception that it is an OUTPUT type. The use case for this is to pass buffers to the device that are not image data but metadata. The formats, just as the metadata capture formats, are typically device specific and highly structured. Signed-off-by: Sakari Ailus Acked-by: Hans Verkuil Reviewed-by: Tomasz Figa Tested-by: Tian Shu Qiu Signed-off-by: Mauro Carvalho Chehab commit 12f799c8c739518e12248bbd000eb0a246e8e5f8 Author: Miles Chen Date: Wed Dec 12 18:56:49 2018 +0800 arm64: kaslr: print PHYS_OFFSET in dump_kernel_offset() When debug with kaslr, it is sometimes necessary to have PHYS_OFFSET to perform linear virtual address to physical address translation. Sometimes we're debugging with only few information such as a kernel log and a symbol file, print PHYS_OFFSET in dump_kernel_offset() for that case. Tested by: echo c > /proc/sysrq-trigger [ 11.996161] SMP: stopping secondary CPUs [ 11.996732] Kernel Offset: 0x2522200000 from 0xffffff8008000000 [ 11.996881] PHYS_OFFSET: 0xffffffeb40000000 Cc: Ard Biesheuvel Signed-off-by: Miles Chen Signed-off-by: Will Deacon commit 5da94b50475acaa728560e8c1d3f7291e1062eb3 Author: Vignesh R Date: Sun Dec 9 15:52:22 2018 +0530 arm64: dts: ti: k3-am654: Enable main domain McSPI0 Enable McSPI0 of main domain and add DT node for the SPI NOR flash connected to CS0. Signed-off-by: Vignesh R Signed-off-by: Tero Kristo commit 2cd7d393f461b931bd6ba2f3971f20b087a1b952 Author: Vignesh R Date: Sun Dec 9 15:52:21 2018 +0530 arm64: dts: ti: k3-am654: Add McSPI DT nodes There are 3 instances of McSPI in MCU domain and 4 instances in Main domain. Add DT nodes for all McSPI instances present on AM654 SoC. Signed-off-by: Vignesh R Signed-off-by: Tero Kristo commit c484fc957219e95e023efe74bfc6cc189303e6f4 Author: Vignesh R Date: Wed Dec 12 10:48:06 2018 +0530 arm64: dts: ti: k3-am654: Populate power-domain property for UART nodes Populate power-domain property for UART nodes, this is required for Linux to enable UART clocks via PM calls. Without this UART instances not initialized by bootloader (like main_uart1) fails to work in Linux. Also, drop current-speed property from main_uart1 and main_uart2 nodes as these UARTs are not initialized before Linux boots up and current speed is unknown. Signed-off-by: Vignesh R Signed-off-by: Tero Kristo commit e577d79424c07af63d0f19817a425bf4ccf0ec81 Author: Vignesh R Date: Fri Dec 7 15:05:35 2018 +0530 arm64: dts: ti: k3-am654-base-board: Enable ECAP PWM Enable ECAP PWM which is used for LCD backlight. Signed-off-by: Vignesh R Signed-off-by: Tero Kristo commit 07c663b0ee576a33c29f211d2e23484a9aa5ff30 Author: Vignesh R Date: Fri Dec 7 15:05:34 2018 +0530 arm64: dts: ti: k3-am65-main: Add ECAP PWM node Add DT entry for ECAP0 PWM node present in main domain Signed-off-by: Vignesh R Signed-off-by: Tero Kristo commit 19a1768fc34acc57d3ce2d945a676dfa032e6ba4 Author: Vignesh R Date: Tue Nov 13 11:31:11 2018 +0530 arm64: dts: ti: k3-am654-base-board: Add I2C nodes Add DT entries for I2C instances present in AM654 SoC. Signed-off-by: Vignesh R Acked-by: Nishanth Menon Signed-off-by: Tero Kristo commit 3f94859fd7ba4f5efa84767dba569d82e060b295 Author: Vignesh R Date: Tue Nov 13 11:31:10 2018 +0530 arm64: dts: ti: am654-base-board: Add pinmux for main uart0 Add pinmux for main uart0 that is serves as console on AM654 EVM Signed-off-by: Vignesh R Acked-by: Nishanth Menon Signed-off-by: Tero Kristo commit 1d79b4375fbc9ba4a113529090dab6b98e7b572c Author: Tero Kristo Date: Tue Nov 13 11:31:09 2018 +0530 arm64: dts: ti: k3-am65: Add pinctrl regions Add pinctrl regions for the main and wkup mmr. The range for main pinctrl region contains a gap at offset 0x2e4, and because of this, the pinctrl range is split into two sections. Signed-off-by: Tero Kristo Signed-off-by: Vignesh R Acked-by: Nishanth Menon commit fc66393ab5d695533a5eb0bce8ceffa11d747933 Author: Vignesh R Date: Tue Nov 13 11:31:08 2018 +0530 dt-bindings: pinctrl: k3: Introduce pinmux definitions The dt-bindings header for TI K3 AM6 SoCs define a set of macros for defining pinmux configs in human readable form, instead of raw-coded hex values. Signed-off-by: Vignesh R Acked-by: Linus Walleij Reviewed-by: Rob Herring Acked-by: Nishanth Menon Acked-by: Tony Lindgren Signed-off-by: Tero Kristo commit 19d111ccce9f4c3e0820585d991bf5ae9172cbe3 Author: Masahiro Yamada Date: Fri Dec 7 20:33:57 2018 +0900 microblaze: remove the explicit removal of system.dtb I guess || (rm -f $@ && echo false) ... should be || (rm -f $@ && false) In fact, no Makefile needs to delete a target explicitly on error. It is automatically done since commit 9c2af1c7377a ("kbuild: add .DELETE_ON_ERROR special target"). I also reused equivalent cmd_shipped from scripts/Makefile.lib. Signed-off-by: Masahiro Yamada Signed-off-by: Michal Simek commit 52e79c4f0bfd972d7176a26d58d163cc18bf6d6a Author: Masahiro Yamada Date: Fri Dec 7 20:33:56 2018 +0900 microblaze: fix race condition in building boot images I fixed a race condition in the parallel building of ARM in commit 3939f3345050 ("ARM: 8418/1: add boot image dependencies to not generate invalid images"). I see the same problem for MicroBlaze too. "make -j ARCH=microblaze all linux.bin.ub" results in a broken build because two threads descend into arch/microblaze/boot simultaneously. Add proper dependencies to avoid it. Signed-off-by: Masahiro Yamada Signed-off-by: Michal Simek commit 3dda563b8349ccc27547883e6cf2be4391d19cb1 Author: Masahiro Yamada Date: Fri Dec 7 20:33:55 2018 +0900 microblaze: add linux.bin* and simpleImage.* to PHONY linux.bin, linux.bin.gz, and linux.bin.ub are phony targets to generate a corresponding image under arch/microblaze/boot/. simpleImage.% also works like a phony target, but a pattern that contains '%' cannot be a phony target. I replaced it with equivalent simpleImage.$(DTB). Signed-off-by: Masahiro Yamada Signed-off-by: Michal Simek commit 4722a3e6b716d9d4594c3cf3856b03bbd24a59a8 Author: Masahiro Yamada Date: Fri Dec 7 20:33:54 2018 +0900 microblaze: fix multiple bugs in arch/microblaze/boot/Makefile This commit fixes some build issues. The first issue is the breakage of linux.bin.ub target since commit ece97f3a5fb5 ("microblaze: Fix simpleImage format generation") because the addition of UIMAGE_{IN,OUT} affected it. make ARCH=microblaze CROSS_COMPILE=microblaze-linux- linux.bin.ub [ snip ] OBJCOPY arch/microblaze/boot/linux.bin UIMAGE arch/microblaze/boot/linux.bin.ub.ub /usr/bin/mkimage: Can't open arch/microblaze/boot/linux.bin.ub: No such file or directory make[1]: *** [arch/microblaze/boot/Makefile;14: arch/microblaze/boot/linux.bin.ub] Error 1 make: *** [arch/microblaze/Makefile;83: linux.bin.ub] Error 2 The second issue is the use of the "if_changed" multiple times for the same target. As commit 92a4728608a8 ("x86/boot: Fix if_changed build flip/flop bug") pointed out, this never works properly. Moreover, generating multiple images as a side-effect is confusing. Let's split the build recipe for each image. simpleImage.
*.unstrip is just a copy of vmlinux. simpleImage.
and simpleImage.
.ub are created in the same way as linux.bin and linux.bin.ub, respectively. I kept simpleImage.* recipes independent of linux.bin.* ones to not change the behavior. Lastly, this commit fixes "make ARCH=microblaze clean". Previously, it only cleaned up the unstrip image. Now, all the simpleImage files are cleaned. Signed-off-by: Masahiro Yamada Signed-off-by: Michal Simek commit 2e14f94cf4bc2f15ca5362e81ca3a987c79e3062 Author: Masahiro Yamada Date: Fri Dec 7 20:33:53 2018 +0900 microblaze: move "... is ready" messages to arch/microblaze/Makefile To prepare for more fixes, move this to arch/microblaze/Makefile. Otherwise, the same "... is ready" would be printed multiple times. Signed-off-by: Masahiro Yamada Signed-off-by: Michal Simek commit bafcc61d998c1ca18f556d92a0e95335ac68c7da Author: Masahiro Yamada Date: Fri Dec 7 20:33:52 2018 +0900 microblaze: adjust the help to the real behavior "make ARCH=microblaze help" mentions simpleImage.
.unstrip, but it is not a real Make target. It does not work because Makefile assumes "system.unstrip" is the name of DT. $ make ARCH=microblaze CROSS_COMPILE=microblaze-linux- simpleImage.system.unstrip [ snip ] make[1]: *** No rule to make target 'arch/microblaze/boot/dts/system.unstrip.dtb', needed by 'arch/microblaze/boot/dts/system.dtb'. Stop. make: *** [Makefile;1060: arch/microblaze/boot/dts] Error 2 make: *** Waiting for unfinished jobs.... simpleImage.
works like a phony target that generates multiple images. Reflect the real behavior. I removed the DT directory path information because it is already explained a few lines below. While I am here, I deleted the redundant *_defconfig explanation. The top-level Makefile caters to list available defconfig files: mmu_defconfig - Build for mmu nommu_defconfig - Build for nommu Signed-off-by: Masahiro Yamada Signed-off-by: Michal Simek commit 3b5129b3a7c62fdec9cc69b1b3f20917c36ab5d4 Author: Christoph Manszewski Date: Thu Oct 25 17:23:50 2018 +0200 drm/exynos: fimd: Make pixel blend mode configurable The fimd hardware supports different blend modes. Add pixel blend mode property and make it configurable, by modifying the blend equation. Tested on TRATS2 with Exynos 4412 CPU, on top of linux-next-20181019. Signed-off-by: Christoph Manszewski Signed-off-by: Inki Dae commit 6f8ee5c21722f93d486b2ff041c28580c9511349 Author: Christoph Manszewski Date: Thu Oct 25 17:23:49 2018 +0200 drm/exynos: fimd: Make plane alpha configurable The fimd hardware supports variable plane alpha. Currently planes are opaque, make this configurable. Tested on TRATS2 with Exynos 4412 CPU, on top of linux-next-20181019. Signed-off-by: Christoph Manszewski Signed-off-by: Inki Dae commit fe37b482041709753365bfca739cba24ada297ef Author: Aisheng Dong Date: Thu Dec 13 15:42:54 2018 +0000 clk: imx: add scu clock common part Add SCU clock common part which will be used by client clock drivers. SCU clocks are totally different from the legacy clocks (No much legacy things can be reused), it's using a firmware interface now based on SCU protocol. So a new configuration option CONFIG_MXC_CLK_SCU is added. Cc: Shawn Guo Cc: Sascha Hauer Cc: Fabio Estevam Cc: Stephen Boyd Cc: Michael Turquette Signed-off-by: Dong Aisheng [sboyd@kernel.org: Mark ccm_ipc_handle static] Signed-off-by: Stephen Boyd commit 3a48d918a4615f0287ac2e106981b3987bf75a3d Author: Aisheng Dong Date: Thu Dec 13 15:42:50 2018 +0000 clk: imx: add configuration option for mmio clks The patch introduces CONFIG_MXC_CLK option for legacy MMIO clocks, this is required to compile legacy MMIO clock conditionally when adding SCU based clocks for MX8 platforms later. Cc: Shawn Guo Cc: Sascha Hauer Cc: Fabio Estevam Cc: Stephen Boyd Cc: Michael Turquette Signed-off-by: Dong Aisheng Signed-off-by: Stephen Boyd commit 0f5ab411f5878274b41839bad8bdcc7af1fcaa27 Author: Aisheng Dong Date: Thu Dec 13 01:08:06 2018 +0000 dt-bindings: clock: add imx8qxp lpcg clock binding The Low-Power Clock Gate (LPCG) modules contain a local programming model to control the clock gates for the peripherals. An LPCG module is used to locally gate the clocks for the associated peripheral. Note: This level of clock gating is provided after the clocks are generated by the SCU resources and clock controls. Thus even if the clock is enabled by these control bits, it might still not be running based on the base resource. Cc: Stephen Boyd Cc: Shawn Guo Cc: Sascha Hauer Cc: devicetree@vger.kernel.org Reviewed-by: Rob Herring Signed-off-by: Dong Aisheng Signed-off-by: Stephen Boyd commit 8cecda9164d35f72768dcfd47ebe708537348bed Author: Aisheng Dong Date: Thu Dec 13 01:07:59 2018 +0000 dt-bindings: clock: imx8qxp: add SCU clock IDs Add IMX8QXP SCU clock IDs. Cc: Stephen Boyd Cc: Shawn Guo Cc: Sascha Hauer Cc: devicetree@vger.kernel.org Cc: linux-clk@vger.kernel.org Reviewed-by: Rob Herring Signed-off-by: Dong Aisheng Signed-off-by: Stephen Boyd commit 6142236cd9f761d6f696f477c2669f8b0820de03 Author: Suraj Jitindar Singh Date: Fri Dec 7 12:17:03 2018 +1100 KVM: PPC: Book3S PR: Set hflag to indicate that POWER9 supports 1T segments When booting a kvm-pr guest on a POWER9 machine the following message is observed: "qemu-system-ppc64: KVM does not support 1TiB segments which guest expects" This is because the guest is expecting to be able to use 1T segments however we don't indicate support for it. This is because we don't set the BOOK3S_HFLAG_MULTI_PGSIZE flag in the hflags in kvmppc_set_pvr_pr() on POWER9. POWER9 does indeed have support for 1T segments, so add a case for POWER9 to the switch statement to ensure it is set. Signed-off-by: Suraj Jitindar Singh Signed-off-by: Paul Mackerras commit 0f6ddf34be2a2076bfa7b049c2d270fdda19fa19 Author: Yangtao Li Date: Mon Nov 5 09:47:17 2018 -0500 KVM: PPC: Book3S HV: Change to use DEFINE_SHOW_ATTRIBUTE macro Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Paul Mackerras commit 234ff0b729ad882d20f7996591a964965647addf Author: Paul Mackerras Date: Fri Nov 16 21:28:18 2018 +1100 KVM: PPC: Book3S HV: Fix race between kvm_unmap_hva_range and MMU mode switch Testing has revealed an occasional crash which appears to be caused by a race between kvmppc_switch_mmu_to_hpt and kvm_unmap_hva_range_hv. The symptom is a NULL pointer dereference in __find_linux_pte() called from kvm_unmap_radix() with kvm->arch.pgtable == NULL. Looking at kvmppc_switch_mmu_to_hpt(), it does indeed clear kvm->arch.pgtable (via kvmppc_free_radix()) before setting kvm->arch.radix to NULL, and there is nothing to prevent kvm_unmap_hva_range_hv() or the other MMU callback functions from being called concurrently with kvmppc_switch_mmu_to_hpt() or kvmppc_switch_mmu_to_radix(). This patch therefore adds calls to spin_lock/unlock on the kvm->mmu_lock around the assignments to kvm->arch.radix, and makes sure that the partition-scoped radix tree or HPT is only freed after changing kvm->arch.radix. This also takes the kvm->mmu_lock in kvmppc_rmap_reset() to make sure that the clearing of each rmap array (one per memslot) doesn't happen concurrently with use of the array in the kvm_unmap_hva_range_hv() or the other MMU callbacks. Fixes: 18c3640cefc7 ("KVM: PPC: Book3S HV: Add infrastructure for running HPT guests on radix host") Cc: stable@vger.kernel.org # v4.15+ Signed-off-by: Paul Mackerras commit 20bb4cb4fb9fb994d757932abc4404cf0f0f56cc Merge: 1072bd678547f 55b078f031f55 Author: James Morris Date: Thu Dec 13 19:30:33 2018 -0800 Merge branch 'smack-for-4.21-a' of https://github.com/cschaufler/next-smack into next-smack From Casey. "I have two Smack patches for 4.21. One Jose's patch adds missing documentation and Zoran's fleshes out the access checks on keyrings." commit 522185d5cb40fafeab807c1ff5ec4ad3a4688b0d Merge: 95302c394c3de 9651ee10ce3bc Author: David S. Miller Date: Thu Dec 13 18:41:39 2018 -0800 Merge branch 'Introduce-NETDEV_PRE_CHANGEADDR' Petr Machata says: ==================== Introduce NETDEV_PRE_CHANGEADDR Spectrum devices have a limitation that all router interfaces need to have the same address prefix. In Spectrum-1, the requirement is for the initial 38 bits of all RIFs to be the same, in Spectrum-2 the limit is 36 bits. Currently violations of this requirement are not diagnosed. At the same time, if the condition is not upheld, the mismatched MAC address ends up overwriting the common prefix, and all RIF MAC addresses silently change to the new prefix. It is therefore desirable to be able at least to diagnose the issue, and better to reject attempts to change MAC addresses in ways that is incompatible with the device. Currently MAC address changes are notified through emission of NETDEV_CHANGEADDR, which is done after the change. Extending this message to allow vetoing is certainly possible, but several other notification types have instead adopted a simple two-stage approach: first a "pre" notification is sent to make sure all interested parties are OK with the change that's about to be done. Then the change is done, and afterwards a "post" notification is sent. This dual approach is easier to use: when the change is vetoed, nothing has changed yet, and it's therefore unnecessary to roll anything back. Therefore this patchset introduces it for NETDEV_CHANGEADDR as well. One prominent path to emitting NETDEV_CHANGEADDR is through dev_set_mac_address(). Therefore in patch #1, give this function an extack argument, so that a textual reason for rejection (or a warning) can be communicated back to the user. In patch #2, add the new notification type. In patch #3, have dev.c emit the notification for instances of dev_addr change, or addition of an address to dev_addrs list. In patches #4 and #5, extend the bridge driver to handle and emit the new notifier. In patch #6, change IPVLAN to emit the new notifier. Likewise for bonding driver in patches #7 and #8. Note that the team driver doesn't need this treatment, as it goes through dev_set_mac_address(). In patches #9, #10 and #11 adapt mlxsw to veto MAC addresses on router interfaces, if they violate the requirement that all RIF MAC addresses have the same prefix. Finally in patches #12 and #13, add a test for vetoing of a direct change of a port device MAC, and indirect change of a bridge MAC. ==================== Signed-off-by: David S. Miller commit 9651ee10ce3bc1e7a71242727711da93441602ac Author: Petr Machata Date: Thu Dec 13 11:54:56 2018 +0000 selftests: mlxsw: Test FID RIF MAC vetoing When a FID RIF is created for a bridge with IP address, its MAC address must obey the same requirements as other RIFs. Test that attempts to change the address incompatibly by attaching a device are vetoed with extack. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 555afaae121ada40d10e538e888c6ecf3cd731eb Author: Petr Machata Date: Thu Dec 13 11:54:54 2018 +0000 selftests: mlxsw: Test RIF MAC vetoing Test that attempts to change address in a way that violates Spectrum requirements are vetoed with extack. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 74bc99397438352bf063329bf22c7a7b4f7e8220 Author: Petr Machata Date: Thu Dec 13 11:54:52 2018 +0000 mlxsw: spectrum_router: Veto unsupported RIF MAC addresses On NETDEV_PRE_CHANGEADDR, if the change is related to a RIF interface, verify that it satisfies the criterion that all RIF interfaces have the same MAC address prefix, as indicated by mlxsw_sp.mac_mask. Additionally, besides explicit address changes, check that the address of an interface for which a RIF is about to be added matches the required pattern as well. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 9329b8162b95200d046b7ef5c9830af9dc74d2ca Author: Petr Machata Date: Thu Dec 13 11:54:50 2018 +0000 mlxsw: spectrum: Add mlxsw_sp.mac_mask The Spectrum hardware demands that all router interfaces in the system have the same first 38 resp. 36 bits of MAC address: the former limit holds on Spectrum, the latter on Spectrum-2. Add a field that refers to the required prefix mask and initialize in mlxsw_sp1_init() and mlxsw_sp2_init(). Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 9735f2d2fe2c0078684c1ed17e53b7640af1c21b Author: Petr Machata Date: Thu Dec 13 11:54:48 2018 +0000 mlxsw: spectrum_router: Generalize mlxsw_sp_netdevice_router_port_event() Prepare mlxsw_sp_netdevice_router_port_event() for handling of NETDEV_PRE_CHANGEADDR. Split out the part that deals with the actual changes and call it for the two events currently handled. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 1caf40dec1e2098d5f0bef3a627f0b08b2f65f9c Author: Petr Machata Date: Thu Dec 13 11:54:46 2018 +0000 net: bonding: Issue NETDEV_PRE_CHANGEADDR Give interested parties an opportunity to veto an impending HW address change. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit b9245914282c3ddf86e60ff5dbb3136c2298f842 Author: Petr Machata Date: Thu Dec 13 11:54:44 2018 +0000 net: bonding: Give bond_set_dev_addr() a return value Before NETDEV_CHANGEADDR, bond driver should emit NETDEV_PRE_CHANGEADDR, and allow consumers to veto the address change. To propagate further the return code from NETDEV_PRE_CHANGEADDR, give the function that implements address change a return value. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 61345fab484b97cca47149c90396c74ac76072f5 Author: Petr Machata Date: Thu Dec 13 11:54:41 2018 +0000 net: ipvlan: Issue NETDEV_PRE_CHANGEADDR A NETDEV_CHANGEADDR event implies a change of address of each of the IPVLANs of this IPVLAN device. Therefore propagate NETDEV_PRE_CHANGEADDR to all the IPVLANs. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit b89df65c5e2ab2ce674997e44e87452f4d2e9b05 Author: Petr Machata Date: Thu Dec 13 11:54:39 2018 +0000 net: bridge: Handle NETDEV_PRE_CHANGEADDR from ports When a port device seeks approval of a potential new MAC address, make sure that should the bridge device end up using this address, all interested parties would agree with it. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit ca935da7f41bb2186f2a007ae183b27f37c8f5a3 Author: Petr Machata Date: Thu Dec 13 11:54:37 2018 +0000 net: bridge: Issue NETDEV_PRE_CHANGEADDR When a port is attached to a bridge, the address of the bridge in question may change as well. Even if it would not change at this point (because the current bridge address is lower), it might end up changing later as a result of detach of another port, which can't be vetoed. Therefore issue NETDEV_PRE_CHANGEADDR regardless of whether the address will be used at this point or not, and make sure all involved parties would agree with the change. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit d59cdf9475ad84d1f57cab1d162cf289702cfb15 Author: Petr Machata Date: Thu Dec 13 11:54:35 2018 +0000 net: dev: Issue NETDEV_PRE_CHANGEADDR When a device address is about to be changed, or an address added to the list of device HW addresses, it is necessary to ensure that all interested parties can support the address. Therefore, send the NETDEV_PRE_CHANGEADDR notification, and if anyone bails on it, do not change the address. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 1570415f0810fce085066fb39827397452c3965a Author: Petr Machata Date: Thu Dec 13 11:54:33 2018 +0000 net: dev: Add NETDEV_PRE_CHANGEADDR The NETDEV_CHANGEADDR notification is emitted after a device address changes. Extending this message to allow vetoing is certainly possible, but several other notification types have instead adopted a simple two-stage approach: first a "pre" notification is sent to make sure all interested parties are OK with a change that's about to be done. Then the change is done, and afterwards a "post" notification is sent. This dual approach is easier to use: when the change is vetoed, nothing has changed yet, and it's therefore unnecessary to roll anything back. Therefore adopt it for NETDEV_CHANGEADDR as well. To that end, add NETDEV_PRE_CHANGEADDR and an info structure to go along with it. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 3a37a9636cf3a1af2621a33f7eef8a2a3da81030 Author: Petr Machata Date: Thu Dec 13 11:54:30 2018 +0000 net: dev: Add extack argument to dev_set_mac_address() A follow-up patch will add a notifier type NETDEV_PRE_CHANGEADDR, which allows vetoing of MAC address changes. One prominent path to that notification is through dev_set_mac_address(). Therefore give this function an extack argument, so that it can be packed together with the notification. Thus a textual reason for rejection (or a warning) can be communicated back to the user. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 4c6926a23b76ea23403976290cd45a7a143f6500 Author: Dave Jiang Date: Thu Dec 6 12:40:01 2018 -0800 acpi/nfit, libnvdimm: Add unlock of nvdimm support for Intel DIMMs Add support to unlock the dimm via the kernel key management APIs. The passphrase is expected to be pulled from userspace through keyutils. The key management and sysfs attributes are libnvdimm generic. Encrypted keys are used to protect the nvdimm passphrase at rest. The master key can be a trusted-key sealed in a TPM, preferred, or an encrypted-key, more flexible, but more exposure to a potential attacker. Signed-off-by: Dave Jiang Co-developed-by: Dan Williams Reported-by: Randy Dunlap Signed-off-by: Dan Williams commit 37833fb7989a9d3c3e26354e6878e682c340d718 Author: Dave Jiang Date: Thu Dec 6 09:14:08 2018 -0800 acpi/nfit, libnvdimm: Add freeze security support to Intel nvdimm Add support for freeze security on Intel nvdimm. This locks out any changes to security for the DIMM until a hard reset of the DIMM is performed. This is triggered by writing "freeze" to the generic nvdimm/nmemX "security" sysfs attribute. Signed-off-by: Dave Jiang Co-developed-by: Dan Williams Signed-off-by: Dan Williams commit f2989396553a0bd13f4b25f567a3dee3d722ce40 Author: Dave Jiang Date: Wed Dec 5 23:39:29 2018 -0800 acpi/nfit, libnvdimm: Introduce nvdimm_security_ops Some NVDIMMs, like the ones defined by the NVDIMM_FAMILY_INTEL command set, expose a security capability to lock the DIMMs at poweroff and require a passphrase to unlock them. The security model is derived from ATA security. In anticipation of other DIMMs implementing a similar scheme, and to abstract the core security implementation away from the device-specific details, introduce nvdimm_security_ops. Initially only a status retrieval operation, ->state(), is defined, along with the base infrastructure and definitions for future operations. Signed-off-by: Dave Jiang Co-developed-by: Dan Williams Signed-off-by: Dan Williams commit 9db67581b91d9e9e05c35570ac3f93872e6c84ca Author: Dave Jiang Date: Tue Dec 4 10:31:33 2018 -0800 keys-encrypted: add nvdimm key format type to encrypted keys Adding nvdimm key format type to encrypted keys in order to limit the size of the key to 32bytes. Signed-off-by: Dave Jiang Acked-by: Mimi Zohar Signed-off-by: Dan Williams commit 76ef5e17252789da79db78341851922af0c16181 Author: Dave Jiang Date: Tue Dec 4 10:31:27 2018 -0800 keys: Export lookup_user_key to external users Export lookup_user_key() symbol in order to allow nvdimm passphrase update to retrieve user injected keys. Signed-off-by: Dave Jiang Acked-by: David Howells Signed-off-by: Dan Williams commit d6548ae4d16dc231dec22860c9c472bcb991fb15 Author: Dave Jiang Date: Tue Dec 4 10:31:20 2018 -0800 acpi/nfit, libnvdimm: Store dimm id as a member to struct nvdimm The generated dimm id is needed for the sysfs attribute as well as being used as the identifier/description for the security key. Since it's constant and should never change, store it as a member of struct nvdimm. As nvdimm_create() continues to grow parameters relative to NFIT driver requirements, do not require other implementations to keep pace. Introduce __nvdimm_create() to carry the new parameters and keep nvdimm_create() with the long standing default api. Signed-off-by: Dave Jiang Signed-off-by: Dan Williams commit 4fc96ee9085d39ceeaa7b60cd475d0a474e7062f Author: Tycho Andersen Date: Thu Dec 13 13:10:30 2018 -0700 seccomp, s390: fix build for syscall type change A recent patch landed in the security tree [1] that changed the type of the seccomp syscall. Unfortunately, I didn't quite get every instance of the forward declarations, and thus there is a build failure. Here's the last one that I could find, for s390. It should go through the security tree, although hopefully some s390 people can check and make sure it looks reasonable? The only oddity is the trailing semicolon; some lines around this patch have it, and some lines don't. I've left this one as-is. [1]: https://lore.kernel.org/lkml/20181212231630.GA31584@beast/T/#u Signed-off-by: Tycho Andersen Fixes: 6a21cc50f0c7 ("seccomp: add a return code to trap to userspace") Signed-off-by: Kees Cook commit 319deec7db6c0aab276d2447f778e7cffed24c7c Author: Tycho Andersen Date: Wed Dec 12 19:46:54 2018 -0700 seccomp: fix poor type promotion sparse complains, kernel/seccomp.c:1172:13: warning: incorrect type in assignment (different base types) kernel/seccomp.c:1172:13: expected restricted __poll_t [usertype] ret kernel/seccomp.c:1172:13: got int kernel/seccomp.c:1173:13: warning: restricted __poll_t degrades to integer Instead of assigning this to ret, since we don't use this anywhere, let's just test it against 0 directly. Signed-off-by: Tycho Andersen Reported-by: 0day robot Fixes: 6a21cc50f0c7 ("seccomp: add a return code to trap to userspace") Signed-off-by: Kees Cook commit 211929fd3f7c8de4d541b1cc243b82830e5ea1e8 Author: Shuah Khan Date: Wed Dec 12 20:25:14 2018 -0700 selftests: Fix test errors related to lib.mk khdr target Commit b2d35fa5fc80 ("selftests: add headers_install to lib.mk") added khdr target to run headers_install target from the main Makefile. The logic uses KSFT_KHDR_INSTALL and top_srcdir as controls to initialize variables and include files to run headers_install from the top level Makefile. There are a few problems with this logic. 1. Exposes top_srcdir to all tests 2. Common logic impacts all tests 3. Uses KSFT_KHDR_INSTALL, top_srcdir, and khdr in an adhoc way. Tests add "khdr" dependency in their Makefiles to TEST_PROGS_EXTENDED in some cases, and STATIC_LIBS in other cases. This makes this framework confusing to use. The common logic that runs for all tests even when KSFT_KHDR_INSTALL isn't defined by the test. top_srcdir is initialized to a default value when test doesn't initialize it. It works for all tests without a sub-dir structure and tests with sub-dir structure fail to build. e.g: make -C sparc64/drivers/ or make -C drivers/dma-buf ../../lib.mk:20: ../../../../scripts/subarch.include: No such file or directory make: *** No rule to make target '../../../../scripts/subarch.include'. Stop. There is no reason to require all tests to define top_srcdir and there is no need to require tests to add khdr dependency using adhoc changes to TEST_* and other variables. Fix it with a consistent use of KSFT_KHDR_INSTALL and top_srcdir from tests that have the dependency on headers_install. Change common logic to include khdr target define and "all" target with dependency on khdr when KSFT_KHDR_INSTALL is defined. Only tests that have dependency on headers_install have to define just the KSFT_KHDR_INSTALL, and top_srcdir variables and there is no need to specify khdr dependency in the test Makefiles. Fixes: b2d35fa5fc80 ("selftests: add headers_install to lib.mk") Cc: stable@vger.kernel.org Signed-off-by: Shuah Khan commit 00ec3ab0601280d00978ac4245a62b470cfa81bb Author: Qian Cai Date: Mon Dec 10 14:39:38 2018 +0100 netfilter: ipset: replace a strncpy() with strscpy() To make overflows as obvious as possible and to prevent code from blithely proceeding with a truncated string. This also has a side-effect to fix a compilation warning when using GCC 8.2.1. net/netfilter/ipset/ip_set_core.c: In function 'ip_set_sockfn_get': net/netfilter/ipset/ip_set_core.c:2027:3: warning: 'strncpy' writing 32 bytes into a region of size 2 overflows the destination [-Wstringop-overflow=] Signed-off-by: Qian Cai Signed-off-by: Jozsef Kadlecsik Signed-off-by: Pablo Neira Ayuso commit 8e350ce1f78ef5a7d8250b9b4bdf733ce2fa5b1f Author: Florent Fourcot Date: Tue Nov 27 17:15:56 2018 +0100 netfilter: ipset: fix ip_set_byindex function New function added by "Introduction of new commands and protocol version 7" is not working, since we return skb2 to user Signed-off-by: Victorien Molle Signed-off-by: Florent Fourcot Signed-off-by: Pablo Neira Ayuso commit 28c1272914613b6c5a0129d6d502c790d4f23d6c Author: Andrey Ignatov Date: Thu Dec 13 13:19:01 2018 -0800 selftests/bpf: Fix sk lookup usage in test_sock_addr Semantic of netns_id argument of bpf_sk_lookup_tcp and bpf_sk_lookup_udp was changed (fixed) in f71c6143c203. Corresponding changes have to be applied to all call sites in selftests. The patch fixes corresponding call sites in test_sock_addr test: pass BPF_F_CURRENT_NETNS instead of 0 in netns_id argument. Fixes: f71c6143c203 ("bpf: Support sk lookup in netns with id 0") Reported-by: Yonghong Song Signed-off-by: Andrey Ignatov Acked-by: Joe Stringer Tested-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 82e4eb4e96539c76518425a5b5a6c56fa400bce3 Author: Wang Dongsheng Date: Tue Nov 13 18:46:23 2018 +0800 ACPI / tables: add DSDT AmlCode new declaration name support A new naming rule was added in ACPICA version 20180427 changing the DSDT AML code name from "AmlCode" to "dsdt_aml_code". That change was made by commit 83b2fa943ba8 "ACPICA: iASL: Enhance the -tc option (create AML hex file in C)". Tested: ACPICA release version 20180427+. ARM64: QCOM QDF2400 GCC: 4.8.5 20150623 Signed-off-by: Wang Dongsheng [ rjw: Changelog ] Signed-off-by: Rafael J. Wysocki commit 3b15e830ba59ae20a52b401e8f9e981bd21ab577 Author: Bob Moore Date: Thu Dec 13 12:30:35 2018 -0800 ACPICA: Update version to 20181213 Version 20181213. Signed-off-by: Bob Moore Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit 55e8054dbb35a97c39c270c8fd9478e2c938ebab Author: Erik Kaneda Date: Thu Dec 13 12:30:34 2018 -0800 ACPICA: change coding style to match ACPICA, no functional change This commit alters the coding style of the following commit to match ACPICA to keep divergences between Linux and ACPICA at a minimum. This is not intended to result in functional changes. ae6b3e54aa52cd29965b8e4e47000ed2c5d78eb8 Author: Hans de Goede Date: Sun Nov 18 20:25:35 2018 +0100 ACPICA: Fix handling of buffer-size in acpi_ex_write_data_to_field() Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit 4c1379d7bb42fa664e0784539208ed74108c53f1 Author: Bob Moore Date: Thu Dec 13 12:30:33 2018 -0800 ACPICA: Debug output: Add option to display method/object evaluation Adds entry/exit messages for all objects that are evaluated. Works for the kernel-level code as well as acpiexec. The "-eo" flag enables acpiexec to display these messages. The messages are very useful when debugging the flow of table initialization. Signed-off-by: Bob Moore Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit 73a049a90fb241afcd9e489e764dbcecd38a0161 Author: Erik Kaneda Date: Thu Dec 13 12:30:32 2018 -0800 ACPICA: disassembler: disassemble OEMx tables as AML Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit 0fcb9a31da91533c71184cf3a1b68cdd3002f58b Author: Jung-uk Kim Date: Thu Dec 13 12:30:31 2018 -0800 ACPICA: Add "Windows 2018.2" string in the _OSI support Signed-off-by: Jung-uk Kim Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit 6d3decda043f95632ae75cc9edaa9d703680c157 Author: Bob Moore Date: Thu Dec 13 12:30:30 2018 -0800 ACPICA: Expressions in package elements are not supported Return AE_SUPPORT if encountered, fixes a previous fault if encountered. Note: Other ACPI implementations do not support this type of construct. Signed-off-by: Bob Moore Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit c47511760ecdb93847e3aa7f23c2ae52f9ab0ab2 Author: Bob Moore Date: Thu Dec 13 12:30:29 2018 -0800 ACPICA: Update buffer-to-string conversions Add "0x" prefix for hex values. Provides compatibility with other ACPI implementations. Signed-off-by: Bob Moore Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit 9f4a297660afe172558cade31d24de99ff0bd189 Author: Bob Moore Date: Thu Dec 13 12:30:28 2018 -0800 ACPICA: add comments, no functional change Signed-off-by: Bob Moore Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit 178a0f6379698a4e23ad077c9a71dc84ee69d3a9 Author: Erik Kaneda Date: Thu Dec 13 12:30:27 2018 -0800 ACPICA: Remove defines that use deprecated flag This commit removes the use of ACPI_NO_METHOD_EXECUTE flag Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit 2db90876700030bcf18bf045b9f1ca70fc2aa7d1 Author: Bob Moore Date: Thu Dec 13 12:30:26 2018 -0800 ACPICA: Add "Windows 2018" string in the _OSI support Latest windows string. Signed-off-by: Bob Moore Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki commit 55b078f031f556ea18963bd808e79a1dfaa4be44 Author: José Bollo Date: Thu Dec 13 13:31:01 2018 -0800 Smack: Improve Documentation Add some words about the mount option "smackfstransmute=label". Signed-off-by: José Bollo Signed-off-by: Casey Schaufler commit 72d7e948febe2e9c06825d4d3bf81d4cbef7393a Author: Kamil Konieczny Date: Tue Dec 4 17:52:47 2018 +0100 arm64: dts: exynos: Add IMEM clock controller to Exynos5433 Add node for IMEM clock controller, necessary for Security SubSystem (SSS) on Exynos5433. Signed-off-by: Kamil Konieczny Signed-off-by: Krzysztof Kozlowski commit 092ff0520070fad8407b196f3bb6156ce77a6f98 Author: Sagi Grimberg Date: Thu Dec 13 12:34:07 2018 -0800 nvme: fix kernel paging oops free the controller discard_page correctly. Fixes: cb5b7262b011 ("nvme: provide fallback for discard alloc failure") Signed-off-by: Sagi Grimberg Signed-off-by: Jens Axboe commit 8ac686d7dfed721102860ff2571e6b9f529ae81a Author: Sylwester Nawrocki Date: Wed Dec 12 18:57:44 2018 +0100 ARM: dts: exynos: Specify I2S assigned clocks in proper node The assigned parent clocks should be normally specified in the consumer device's DT node, this ensures respective driver always sees correct clock settings when required. This patch fixes regression in audio subsystem on Odroid XU3/XU4 boards that appeared after commits: commit 647d04f8e07a ("ASoC: samsung: i2s: Ensure the RCLK rate is properly determined") commit 995e73e55f46 ("ASoC: samsung: i2s: Fix rclk_srcrate handling") commit 48279c53fd1d ("ASoC: samsung: i2s: Prevent external abort on exynos5433 I2S1 access") Without this patch the driver gets wrong clock as the I2S function clock (op_clk) in probe() and effectively the clock which is finally assigned from DT is not being enabled/disabled in the runtime resume/suspend ops. Without the above listed commits the EXYNOS_I2S_BUS clock was always set as parent of CLK_I2S_RCLK_SRC regardless of DT settings so there was no issue with not enabled EXYNOS_SCLK_I2S. Cc: # 4.17.x Signed-off-by: Sylwester Nawrocki Signed-off-by: Krzysztof Kozlowski commit 497f1bcb9009fbcf1376aaa19b0b23a7e6988832 Author: Markus Reichl Date: Sat Dec 8 21:56:56 2018 +0100 ARM: dts: exynos: Add missing CPUs in cooling maps for Odroid X2 While updating cooling maps, the exynos4412-prime.dtsi was left untouched. This is not a problem with Odroid U3 because it uses its own map with fan (which was updated). However the cooling maps of Odroid X2 rely only on exynos4412-prime.dtsi. Signed-off-by: Markus Reichl Signed-off-by: Krzysztof Kozlowski commit 9f8c1c5712954f9d8877ac55b18adbdf03e51e1f Author: Daniel Borkmann Date: Wed Dec 12 10:45:38 2018 +0100 bpf: remove obsolete prog->aux sanitation in bpf_insn_prepare_dump This logic is not needed anymore since we got rid of the verifier rewrite that was using prog->aux address in f6069b9aa993 ("bpf: fix redirect to map under tail calls"). Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov commit 356da6d0cde3323236977fce54c1f9612a742036 Author: Christoph Hellwig Date: Thu Dec 6 13:39:32 2018 -0800 dma-mapping: bypass indirect calls for dma-direct Avoid expensive indirect calls in the fast path DMA mapping operations by directly calling the dma_direct_* ops if we are using the directly mapped DMA operations. Signed-off-by: Christoph Hellwig Acked-by: Jesper Dangaard Brouer Tested-by: Jesper Dangaard Brouer Tested-by: Tony Luck commit 190d4e5916a2d70a11009022b968fca948fb5dc7 Author: Christoph Hellwig Date: Thu Dec 6 13:37:00 2018 -0800 vmd: use the proper dma_* APIs instead of direct methods calls With the bypass support for the direct mapping we might not always have methods to call, so use the proper APIs instead. The only downside is that we will create two dma-debug entries for each mapping if CONFIG_DMA_DEBUG is enabled. Signed-off-by: Christoph Hellwig Acked-by: Jesper Dangaard Brouer Tested-by: Jesper Dangaard Brouer Tested-by: Tony Luck commit 55897af63091ebc2c3f239c6a6666f748113ac50 Author: Christoph Hellwig Date: Mon Dec 3 11:43:54 2018 +0100 dma-direct: merge swiotlb_dma_ops into the dma_direct code While the dma-direct code is (relatively) clean and simple we actually have to use the swiotlb ops for the mapping on many architectures due to devices with addressing limits. Instead of keeping two implementations around this commit allows the dma-direct implementation to call the swiotlb bounce buffering functions and thus share the guts of the mapping implementation. This also simplified the dma-mapping setup on a few architectures where we don't have to differenciate which implementation to use. Signed-off-by: Christoph Hellwig Acked-by: Jesper Dangaard Brouer Tested-by: Jesper Dangaard Brouer Tested-by: Tony Luck commit 17ac524719f3fc88c1a90528f4789e4b4f618512 Author: Christoph Hellwig Date: Mon Dec 3 11:14:09 2018 +0100 dma-direct: use dma_direct_map_page to implement dma_direct_map_sg No need to duplicate the mapping logic. Signed-off-by: Christoph Hellwig Acked-by: Jesper Dangaard Brouer Tested-by: Jesper Dangaard Brouer Tested-by: Tony Luck commit 58dfd4ac022037c6a562e92fc6d2a778819b2162 Author: Christoph Hellwig Date: Mon Dec 3 07:43:05 2018 +0100 dma-direct: improve addressability error reporting Only report report a DMA addressability report once to avoid spewing the kernel log with repeated message. Also provide a stack trace to make it easy to find the actual caller that caused the problem. Last but not least move the actual check into the fast path and only leave the error reporting in a helper. Signed-off-by: Christoph Hellwig Acked-by: Jesper Dangaard Brouer Tested-by: Jesper Dangaard Brouer Tested-by: Tony Luck commit 68c608345cc569bcfa1c1b2add4c00c343ecf933 Author: Christoph Hellwig Date: Thu Dec 6 07:06:04 2018 -0800 swiotlb: remove dma_mark_clean Instead of providing a special dma_mark_clean hook just for ia64, switch ia64 to use the normal arch_sync_dma_for_cpu hooks instead. This means that we now also set the PG_arch_1 bit for pages in the swiotlb buffer, which isn't stricly needed as we will never execute code out of the swiotlb buffer, but otherwise harmless. Signed-off-by: Christoph Hellwig Acked-by: Jesper Dangaard Brouer Tested-by: Jesper Dangaard Brouer Tested-by: Tony Luck commit b907e20508d02462a50c2841da0a5e3883fdab39 Author: Christoph Hellwig Date: Mon Dec 3 11:42:52 2018 +0100 swiotlb: remove SWIOTLB_MAP_ERROR We can use DMA_MAPPING_ERROR instead, which already maps to the same value. Signed-off-by: Christoph Hellwig Acked-by: Jesper Dangaard Brouer Tested-by: Jesper Dangaard Brouer Tested-by: Tony Luck commit e5361ca29f2fea345c08d2b5cb5e3b1840cbafb8 Author: Robin Murphy Date: Thu Dec 6 13:20:49 2018 -0800 ACPI / scan: Refactor _CCA enforcement Rather than checking the DMA attribute at each callsite, just pass it through for acpi_dma_configure() to handle directly. That can then deal with the relatively exceptional DEV_DMA_NOT_SUPPORTED case by explicitly installing dummy DMA ops instead of just skipping setup entirely. This will then free up the dev->dma_ops == NULL case for some valuable fastpath optimisations. Signed-off-by: Robin Murphy Reviewed-by: Rafael J. Wysocki Acked-by: Jesper Dangaard Brouer Tested-by: Jesper Dangaard Brouer Signed-off-by: Christoph Hellwig Tested-by: Tony Luck commit 90ac706e98fcb24fb0b0a259558987f33cc2f0f6 Author: Robin Murphy Date: Thu Dec 6 13:14:44 2018 -0800 dma-mapping: factor out dummy DMA ops The dummy DMA ops are currently used by arm64 for any device which has an invalid ACPI description and is thus barred from using DMA due to not knowing whether is is cache-coherent or not. Factor these out into general dma-mapping code so that they can be referenced from other common code paths. In the process, we can prune all the optional callbacks which just do the same thing as the default behaviour, and fill in .map_resource for completeness. Signed-off-by: Robin Murphy [hch: moved to a separate source file] Reviewed-by: Rafael J. Wysocki Acked-by: Jesper Dangaard Brouer Tested-by: Jesper Dangaard Brouer Tested-by: Tony Luck Signed-off-by: Christoph Hellwig commit 3731c3d4774e38b9d91c01943e1e6a243c1776be Author: Christoph Hellwig Date: Thu Dec 6 12:50:26 2018 -0800 dma-mapping: always build the direct mapping code All architectures except for sparc64 use the dma-direct code in some form, and even for sparc64 we had the discussion of a direct mapping mode a while ago. In preparation for directly calling the direct mapping code don't bother having it optionally but always build the code in. This is a minor hardship for some powerpc and arm configs that don't pull it in yet (although they should in a relase ot two), and sparc64 which currently doesn't need it at all, but it will reduce the ifdef mess we'd otherwise need significantly. Signed-off-by: Christoph Hellwig Acked-by: Jesper Dangaard Brouer Tested-by: Jesper Dangaard Brouer Tested-by: Tony Luck commit 8ddbe5943c0b1259b5ddb6dc1729863433fc256c Author: Christoph Hellwig Date: Thu Dec 6 12:47:50 2018 -0800 dma-mapping: move dma_cache_sync out of line This isn't exactly a slow path routine, but it is not super critical either, and moving it out of line will help to keep the include chain clean for the following DMA indirection bypass work. Signed-off-by: Christoph Hellwig Acked-by: Jesper Dangaard Brouer Tested-by: Jesper Dangaard Brouer Tested-by: Tony Luck commit 7249c1a52df9967cd23550f3dc24fb6ca43cdc6a Author: Christoph Hellwig Date: Thu Dec 6 12:43:30 2018 -0800 dma-mapping: move various slow path functions out of line There is no need to have all setup and coherent allocation / freeing routines inline. Move them out of line to keep the implemeation nicely encapsulated and save some kernel text size. Signed-off-by: Christoph Hellwig Acked-by: Jesper Dangaard Brouer Tested-by: Jesper Dangaard Brouer Tested-by: Tony Luck commit 05887cb610a54bf568de7f0bc07c4a64e45ac6f9 Author: Christoph Hellwig Date: Thu Dec 6 12:25:54 2018 -0800 dma-mapping: move dma_get_required_mask to kernel/dma dma_get_required_mask should really be with the rest of the DMA mapping implementation instead of in drivers/base as a lone outlier. Signed-off-by: Christoph Hellwig Acked-by: Jesper Dangaard Brouer Tested-by: Jesper Dangaard Brouer Tested-by: Tony Luck commit 7f0fee242e899f2eb42fd9e72bcfc3cb59aad1ce Author: Christoph Hellwig Date: Thu Dec 6 12:24:27 2018 -0800 dma-mapping: merge dma_unmap_page_attrs and dma_unmap_single_attrs The two functions are exactly the same, so don't bother implementing them twice. Signed-off-by: Christoph Hellwig Acked-by: Jesper Dangaard Brouer Tested-by: Jesper Dangaard Brouer Tested-by: Tony Luck commit 8d59b5f2a44611d7327a2a14b36090d692186f60 Author: Christoph Hellwig Date: Mon Dec 3 14:58:59 2018 +0100 dma-mapping: simplify the dma_sync_single_range_for_{cpu,device} implementation We can just call the regular calls after adding offset the the address instead of reimplementing them. Signed-off-by: Christoph Hellwig Acked-by: Jesper Dangaard Brouer Tested-by: Jesper Dangaard Brouer Tested-by: Tony Luck commit 20b105feda8d42360bd690b8fdf6b2f00ba4a993 Author: Christoph Hellwig Date: Tue Dec 4 08:04:31 2018 -0800 dma-mapping: remove a pointless memset in dma_atomic_pool_init We already zero the memory after allocating it from the pool that this function fills, and having the memset here in this form means we can't support CMA highmem allocations. Signed-off-by: Christoph Hellwig Reported-by: Russell King - ARM Linux commit 6edf2e3710f4ef2555ad7a2681dbeb4a69092b2d Author: Tom Murphy Date: Tue Nov 27 10:33:08 2018 +0000 fix dma-buf/udmabuf selftest This patch fixes the udmabuf selftest. Currently the selftest is broken. I fixed the selftest by setting the F_SEAL_SHRINK seal on the memfd file descriptor which is required by udmabuf and added the test to the selftest Makefile. Signed-off-by: Tom Murphy Reviewed-by: Gerd Hoffmann Signed-off-by: Shuah Khan commit 64bafd2f1e484e27071e7584642005d56516cb77 Author: Darrick J. Wong Date: Wed Dec 12 15:18:52 2018 -0800 xfs: require both realtime inodes to mount Since mkfs always formats the filesystem with the realtime bitmap and summary inodes immediately after the root directory, we should expect that both of them are present and loadable, even if there isn't a realtime volume attached. There's no reason to skip this if rbmino == NULLFSINO; in fact, this causes an immediate crash if the there /is/ a realtime volume and someone writes to it. Signed-off-by: Darrick J. Wong Reviewed-by: Bill O'Donnell commit 0ca2923e2a1e1eb3376900e1e3fc74e9b6345ee9 Author: Colin Ian King Date: Thu Dec 13 09:40:15 2018 +0000 selftests: watchdog: fix spelling mistake "experies" -> "expires" There is a spelling mistake in the --gettimeleft help text, fix it. Signed-off-by: Colin Ian King Signed-off-by: Shuah Khan commit 2d9a058e3f83dca48b8056148089711c552e2475 Merge: e78bd0d26f739 b65bb777ef223 Author: Jens Axboe Date: Thu Dec 13 12:59:37 2018 -0700 Merge branch 'nvme-4.21' of git://git.infradead.org/nvme into for-4.21/block Pull NVMe updates from Christoph: "Here is the second large chunk of nvme updates for 4.21: - host and target support for NVMe over TCP (Sagi Grimberg, Roy Shterman, Solganik Alexander) - error log page support in target (Chaitanya Kulkarni) plus small fixes and improvements from Jens Axboe and Chengguang Xu." * 'nvme-4.21' of git://git.infradead.org/nvme: (33 commits) nvme-rdma: support separate queue maps for read and write nvme-tcp: support separate queue maps for read and write nvme-fabrics: allow user to set nr_write_queues for separate queue maps nvme-fabrics: add missing nvmf_ctrl_options documentation blk-mq-rdma: pass in queue map to blk_mq_rdma_map_queues nvmet: update smart log with num err log entries nvmet: add error log page cmd handler nvmet: add error log support for file backend nvmet: add error log support for bdev backend nvmet: add error log support for admin-cmd nvmet: add error log support for rdma backend nvmet: add error log support for fabrics-cmd nvmet: add error log support in the core nvmet: add interface to update error-log page nvmet: add error-log definitions nvme: add error log page slot definition nvme: remove nvme_common command cdw10 array nvmet: remove unused variable nvme: provide fallback for discard alloc failure nvme: add __exit annotation ... commit ef2512c826592d40918a7de0a4ee31c67775db17 Author: Firoz Khan Date: Thu Dec 13 14:37:33 2018 +0530 mips: add __NR_syscalls along with __NR_Linux_syscalls __NR_Linux_syscalls macro holds the number of system call exist in mips architecture. We have to change the value of __NR_Linux_syscalls, if we add or delete a system call. One of the patch in this patch series has a script which will generate a uapi header based on syscall.tbl file. The syscall.tbl file contains the total number of system calls information. So we have two option to update __NR- _Linux_syscalls value. 1. Update __NR_Linux_syscalls in asm/unistd.h manually by counting the no.of system calls. No need to update __NR_Linux_syscalls until we either add a new system call or delete existing system call. 2. We can keep this feature it above mentioned script, that will count the number of syscalls and keep it in a generated file. In this case we don't need to expli- citly update __NR_Linux_syscalls in asm/unistd.h file. The 2nd option will be the recommended one. For that, I added the __NR_syscalls macro in uapi/asm/unistd.h along with __NR_Linux_syscalls. The macro __NR_syscalls also added for making the name convention same across all architecture. While __NR_syscalls isn't strictly part of the uapi, having it as part of the generated header to simplifies the implementation. We also need to enclose this macro with #ifdef __KERNEL__ to avoid side effects. Signed-off-by: Firoz Khan Signed-off-by: Paul Burton Cc: linux-mips@vger.kernel.org Cc: Ralf Baechle Cc: James Hogan Cc: Greg Kroah-Hartman Cc: Philippe Ombredanne Cc: Thomas Gleixner Cc: Kate Stewart Cc: y2038@lists.linaro.org Cc: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: arnd@arndb.de Cc: deepa.kernel@gmail.com Cc: marcin.juszkiewicz@linaro.org commit 2a3c83f5fe0770d13bbb71b23674886ff4111f44 Merge: d675ba4b9e6cc 0660d8cd83938 Author: Dave Airlie Date: Fri Dec 14 04:57:39 2018 +1000 Merge tag 'vmwgfx-next-2018-12-13' of git://people.freedesktop.org/~thomash/linux into drm-next Pull request of 2018-12-13 Two minor fixes for next pull. Signed-off-by: Dave Airlie From: Thomas Hellstrom Link: https://patchwork.freedesktop.org/patch/msgid/20181213130848.3080-1-thellstrom@vmware.com commit 716ff017a39e552f47de7667ba934d0547ba7535 Author: Maran Wilson Date: Mon Dec 10 11:09:35 2018 -0800 KVM: x86: Allow Qemu/KVM to use PVH entry point For certain applications it is desirable to rapidly boot a KVM virtual machine. In cases where legacy hardware and software support within the guest is not needed, Qemu should be able to boot directly into the uncompressed Linux kernel binary without the need to run firmware. There already exists an ABI to allow this for Xen PVH guests and the ABI is supported by Linux and FreeBSD: https://xenbits.xen.org/docs/unstable/misc/pvh.html This patch enables Qemu to use that same entry point for booting KVM guests. Signed-off-by: Maran Wilson Suggested-by: Konrad Rzeszutek Wilk Suggested-by: Boris Ostrovsky Tested-by: Boris Ostrovsky Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit d907be2b5b042536d15687ac0a86f27c8c9aebd4 Author: Maran Wilson Date: Mon Dec 10 11:09:11 2018 -0800 xen/pvh: Add memory map pointer to hvm_start_info struct The start info structure that is defined as part of the x86/HVM direct boot ABI and used for starting Xen PVH guests would be more versatile if it also included a way to pass information about the memory map to the guest. This would allow KVM guests to share the same entry point. Signed-off-by: Maran Wilson Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit a43fb7da53007e67ad593e179f01a1925b04f586 Author: Maran Wilson Date: Mon Dec 10 11:08:46 2018 -0800 xen/pvh: Move Xen code for getting mem map via hcall out of common file We need to refactor PVH entry code so that support for other hypervisors like Qemu/KVM can be added more easily. The original design for PVH entry in Xen guests relies on being able to obtain the memory map from the hypervisor using a hypercall. When we extend the PVH entry ABI to support other hypervisors like Qemu/KVM, a new mechanism will be added that allows the guest to get the memory map without needing to use hypercalls. For Xen guests, the hypercall approach will still be supported. In preparation for adding support for other hypervisors, we can move the code that uses hypercalls into the Xen specific file. This will allow us to compile kernels in the future without CONFIG_XEN that are still capable of being booted as a Qemu/KVM guest via the PVH entry point. Signed-off-by: Maran Wilson Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit 8cee3974b35bfb235d4637e10de5c5b364a9057e Author: Maran Wilson Date: Mon Dec 10 11:08:45 2018 -0800 xen/pvh: Move Xen specific PVH VM initialization out of common file We need to refactor PVH entry code so that support for other hypervisors like Qemu/KVM can be added more easily. This patch moves the small block of code used for initializing Xen PVH virtual machines into the Xen specific file. This initialization is not going to be needed for Qemu/KVM guests. Moving it out of the common file is going to allow us to compile kernels in the future without CONFIG_XEN that are still capable of being booted as a Qemu/KVM guest via the PVH entry point. Signed-off-by: Maran Wilson Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit 4df7363e52105bf7a8589efb2959c907872644fb Author: Maran Wilson Date: Mon Dec 10 11:08:44 2018 -0800 xen/pvh: Create a new file for Xen specific PVH code We need to refactor PVH entry code so that support for other hypervisors like Qemu/KVM can be added more easily. The first step in that direction is to create a new file that will eventually hold the Xen specific routines. Signed-off-by: Maran Wilson Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit fcd4747698150bc3a9596481d3eb2b3ae71d82f1 Author: Maran Wilson Date: Mon Dec 10 11:07:55 2018 -0800 xen/pvh: Move PVH entry code out of Xen specific tree Once hypervisors other than Xen start using the PVH entry point for starting VMs, we would like the option of being able to compile PVH entry capable kernels without enabling CONFIG_XEN and all the code that comes along with that. To allow that, we are moving the PVH code out of Xen and into files sitting at a higher level in the tree. This patch is not introducing any code or functional changes, just moving files from one location to another. Signed-off-by: Maran Wilson Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Juergen Gross Signed-off-by: Boris Ostrovsky commit 7733607fb3aa72e3df47e6165156feb92ced8f5f Author: Maran Wilson Date: Mon Dec 10 11:07:28 2018 -0800 xen/pvh: Split CONFIG_XEN_PVH into CONFIG_PVH and CONFIG_XEN_PVH In order to pave the way for hypervisors other than Xen to use the PVH entry point for VMs, we need to factor the PVH entry code into Xen specific and hypervisor agnostic components. The first step in doing that, is to create a new config option for PVH entry that can be enabled independently from CONFIG_XEN. Signed-off-by: Maran Wilson Reviewed-by: Juergen Gross Acked-by: Borislav Petkov Signed-off-by: Boris Ostrovsky commit de17f14ea576d8a0f2932404467fa916542da94d Author: Rohit kumar Date: Thu Nov 1 18:08:49 2018 +0530 ASoC: core: Invoke pcm_new() for all DAI-link Remove no_pcm check to invoke pcm_new() for backend dai-links too. This fixes crash in hdmi codec driver during hdmi_codec_startup() while accessing chmap_info struct. chmap_info struct memory is allocated in pcm_new() of hdmi codec driver which is not invoked in case of DPCM when hdmi codec driver is part of backend dai-link. Below is the crash stack: [ 61.635493] Unable to handle kernel NULL pointer dereference at virtual address 00000018 .. [ 61.666696] CM = 0, WnR = 1 [ 61.669778] user pgtable: 4k pages, 39-bit VAs, pgd = ffffffc0d6633000 [ 61.676526] [0000000000000018] *pgd=0000000153fc8003, *pud=0000000153fc8003, *pmd=0000000000000000 [ 61.685793] Internal error: Oops: 96000046 [#1] PREEMPT SMP [ 61.722955] CPU: 7 PID: 2238 Comm: aplay Not tainted 4.14.72 #21 .. [ 61.740269] PC is at hdmi_codec_startup+0x124/0x164 [ 61.745308] LR is at hdmi_codec_startup+0xe4/0x164 Signed-off-by: Rohit kumar Signed-off-by: Mark Brown commit 3500f1c589e92e0b6b1f8d31b4084fbde08d49cb Author: Dimitris Papavasiliou Date: Sat Nov 24 22:05:42 2018 +0200 ASoC: pcm512x: Implement the digital_mute interface Clicks and pops of various volumes can be produced while the device is opened, closed, put into and taken out of standby, or reconfigured. Fix this, by implementing the digital_mute interface, so that the output is muted during such operations. Signed-off-by: Dimitris Papavasiliou Signed-off-by: Mark Brown commit 9c8114c20d1876c8053d58dd92ea2a81c67dc198 Author: Srinivas Kandagatla Date: Mon Dec 10 13:56:32 2018 +0000 irqchip/gic-v3: Add quirk for msm8996 broken registers Access to GICR_WAKER is restricted on msm8996 SoC in Hypervisor. Its been more than 2+ years of wait for this to be fixed, which has no hopes to be fixed. This change was introduced for the "lead device" on msm8996 platform. It looks like all publicly available msm8996 and other Qualcomm SoCs have this implementation. So add a quirk to not access this register on msm8996. With this quirk MSM8996 can at least boot out of mainline, which can help community to work with boards based on MSM8996 and other SoCs with have this restrictions. This Quirk is based on device tree compatible string. Without this patch Qualcomm DB820c board reboots when GICR_WAKER is accessed. Signed-off-by: Srinivas Kandagatla Signed-off-by: Marc Zyngier commit f70fdb42a095d265813d6cc8bd10497d7c592ab6 Author: Srinivas Kandagatla Date: Mon Dec 10 13:56:31 2018 +0000 irqchip/gic: Add support to device tree based quirks This patch adds support to device tree based quirks based on device tree compatible string. Signed-off-by: Srinivas Kandagatla Signed-off-by: Marc Zyngier commit 7c813152cf9ba1901a4d621ebba1edbac910095e Author: Srinivas Kandagatla Date: Mon Dec 10 13:56:30 2018 +0000 dt-bindings/gic-v3: Add msm8996 compatible string Access to GICR_WAKER is restricted on msm8996 SoC in Hypervisor. There are many devices out there with this restriction in place and there has been no update to this firmware since last few years, making those devices totally unusable for upstream development. IIDR register value conflicts with other SoCs, using compatible seems to be the only way to apply quirks required for msm8996 based SoCs. Without this quirk many qcom SoCs (atleast 3 that I know) are unable to boot mainline. Reviewed-by: Rob Herring Signed-off-by: Srinivas Kandagatla Signed-off-by: Marc Zyngier commit acc2038738bd6f881e7a277ba14fa7c589fd3058 Merge: cd1cc0bef46fc 2c9b0b00af23c Author: Rob Herring Date: Thu Dec 13 11:20:36 2018 -0600 Merge branch 'yaml-bindings-for-v4.21' into dt/next commit 2c9b0b00af23cdc70d28d82e077dc1d280bcb84a Author: Rob Herring Date: Thu Apr 26 16:08:29 2018 -0500 dt-bindings: Convert trivial-devices.txt to json-schema Convert trivial-devices.txt to DT schema format using json-schema. Cc: Mark Rutland Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring commit cd1cc0bef46fc8d8f9ebe82d2064d4f4bd5ecf16 Author: Lubomir Rintel Date: Sun Dec 2 12:40:08 2018 +0100 dt-bindings: arm: mrvl: amend Browstone compatible string The Brownstone board is compatible with "mrvl,mmp2". The actual DTS already contains the string -- add it to the binding doc as well. Signed-off-by: Lubomir Rintel Signed-off-by: Rob Herring commit f4d1577e9bc66b3699c7c43b98735e1dcc0a83d0 Author: Rob Herring Date: Mon May 14 18:56:50 2018 -0500 dt-bindings: arm: Convert Tegra board/soc bindings to json-schema Convert Tegra SoC bindings to DT schema format using json-schema. Cc: Mark Rutland Cc: Jonathan Hunter Cc: devicetree@vger.kernel.org Cc: linux-tegra@vger.kernel.org Acked-by: Thierry Reding Signed-off-by: Rob Herring commit 738d57f23c2b3193aa187d7ecdaa1e83985af8e3 Author: Rob Herring Date: Mon May 14 18:57:35 2018 -0500 dt-bindings: arm: Convert ZTE board/soc bindings to json-schema Convert ZTE SoC bindings to DT schema format using json-schema. Cc: Jun Nie Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: devicetree@vger.kernel.org Acked-by: Shawn Guo Signed-off-by: Rob Herring commit 3da3d9be44954d5b0b5d0fdfc0aafaa2a905d206 Author: Michal Simek Date: Thu Nov 8 14:28:54 2018 +0100 dt-bindings: arm: Add missing Xilinx boards Add missing description for Ultra96, zcu104, zcu106 and zcu111. Signed-off-by: Michal Simek Signed-off-by: Rob Herring commit c808c7b950ce0e106e8d6eef8d54ec409483c319 Author: Rob Herring Date: Tue Mar 20 05:38:45 2018 -0500 dt-bindings: arm: Convert Xilinx board/soc bindings to json-schema Convert Xilinx SoC bindings to DT schema format using json-schema. Cc: Mark Rutland Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Acked-by: Michal Simek Signed-off-by: Rob Herring commit f3fb5732e3bde702f9ae0aef6c96ee60799459b5 Author: Rob Herring Date: Mon May 14 18:57:10 2018 -0500 dt-bindings: arm: Convert VIA board/soc bindings to json-schema Convert VIA SoC bindings to DT schema format using json-schema. Cc: Tony Prisk Cc: Mark Rutland Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring commit c74acbf039ca5b68363f804971cd63d0e78e8529 Author: Rob Herring Date: Mon May 14 18:56:27 2018 -0500 dt-bindings: arm: Convert ST STi board/soc bindings to json-schema Convert ST STi SoC bindings to DT schema format using json-schema. Acked-by: Patrice Chotard Cc: Mark Rutland Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring commit 26282485aedd93528b15bc3f7e1d03d3ca9a3d98 Author: Rob Herring Date: Mon May 14 18:56:08 2018 -0500 dt-bindings: arm: Convert SPEAr board/soc bindings to json-schema Convert SPEAr SoC bindings to DT schema format using json-schema. Cc: Shiraz Hashim Cc: Mark Rutland Cc: devicetree@vger.kernel.org Acked-by: Viresh Kumar Signed-off-by: Rob Herring commit cf7e48dad101d648e8d569d84247cd20163871ff Author: Rob Herring Date: Mon May 14 18:55:23 2018 -0500 dt-bindings: arm: Convert CSR SiRF board/soc bindings to json-schema Convert CSR SiRF SoC bindings to DT schema format using json-schema. Cc: Mark Rutland Cc: Barry Song Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Rob Herring commit 9d3ef77fe5688b761bdee91803af0c613717b52e Author: Rob Herring Date: Mon May 14 18:53:47 2018 -0500 dt-bindings: arm: Convert QCom board/soc bindings to json-schema Convert QCom SoC bindings to DT schema format using json-schema. Acked-by: Andy Gross Cc: David Brown Cc: Mark Rutland Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring commit da5faf32ad2d74144c14f1c8212e0063a3dc1d0b Author: Rob Herring Date: Mon May 14 18:52:51 2018 -0500 dt-bindings: arm: Convert TI nspire board/soc bindings to json-schema Convert TI NSpire SoC bindings to DT schema format using json-schema. Cc: Mark Rutland Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring commit 5afa43780f7c735ee83a015db69821b45a011ef6 Author: Rob Herring Date: Mon May 14 18:49:44 2018 -0500 dt-bindings: arm: Convert TI davinci board/soc bindings to json-schema Convert TI Davinci SoC bindings to DT schema format using json-schema. Reviewed-by: Sekhar Nori Cc: Kevin Hilman Cc: Mark Rutland Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring commit c7a851b7050e2b7b8ed6e96c1437e19ca5720851 Author: Tony Lindgren Date: Wed Dec 12 15:57:27 2018 -0800 ARM: dts: Cosmetic fix for omap5 USB node names These should be now using offset from the module base and not the full physical address. Cc: Peter Ujfalusi Signed-off-by: Tony Lindgren commit bc998a730367a69a1449320d321187d7414668fa Author: Bartosz Golaszewski Date: Fri Dec 7 14:04:52 2018 +0100 regmap: irq: handle HW using separate rising/falling edge interrupts Some interrupt controllers use separate bits for controlling rising and falling edge interrupts in the mask register i.e. they have one interrupt for rising edge and one for falling. We already handle the case where we have a single interrupt in the mask register and a separate type configuration register. Add a new switch to regmap_irq_chip which tells the framework to use the mask_base address for configuring the edge of the interrupts that define type_falling/rising_mask values. For such interrupts we never update the type_base bits. For interrupts that don't define type masks or their regmap irq chip doesn't set the type_in_mask to true everything stays the same. Signed-off-by: Bartosz Golaszewski Signed-off-by: Mark Brown commit 97bebc5facf7d495e72df0b7c50be3699c7bdd73 Author: Will Deacon Date: Tue Dec 11 16:42:31 2018 +0000 arm64: sysreg: Use _BITUL() when defining register bits Using shifts directly is error-prone and can cause inadvertent sign extensions or build problems with older versions of binutils. Consistent use of the _BITUL() macro makes these problems disappear. Signed-off-by: Will Deacon commit 1e013d06120cbf67e771848fc5d98174c33b078a Author: Will Deacon Date: Wed Dec 12 15:53:54 2018 +0000 arm64: cpufeature: Rework ptr auth hwcaps using multi_entry_cap_matches Open-coding the pointer-auth HWCAPs is a mess and can be avoided by reusing the multi-cap logic from the CPU errata framework. Move the multi_entry_cap_matches code to cpufeature.h and reuse it for the pointer auth HWCAPs. Reviewed-by: Suzuki Poulose Signed-off-by: Will Deacon commit a56005d3210500f8a166fcb83cbb5ac5d0f909e4 Author: Will Deacon Date: Wed Dec 12 15:52:02 2018 +0000 arm64: cpufeature: Reduce number of pointer auth CPU caps from 6 to 4 We can easily avoid defining the two meta-capabilities for the address and generic keys, so remove them and instead just check both of the architected and impdef capabilities when determining the level of system support. Reviewed-by: Suzuki Poulose Signed-off-by: Will Deacon commit fbedc599e9b891a6756b1c9bc2eead02b02cce77 Author: Mark Rutland Date: Fri Dec 7 18:39:31 2018 +0000 arm64: docs: document pointer authentication Now that we've added code to support pointer authentication, add some documentation so that people can figure out if/how to use it. Signed-off-by: Mark Rutland Signed-off-by: Kristina Martsenko Reviewed-by: Ramana Radhakrishnan Cc: Andrew Jones Cc: Catalin Marinas Cc: Ramana Radhakrishnan Cc: Will Deacon Signed-off-by: Will Deacon commit 84931327a807a4dd65d0d6b53a8ae47845c91f79 Author: Will Deacon Date: Thu Dec 13 13:14:06 2018 +0000 arm64: ptr auth: Move per-thread keys from thread_info to thread_struct We don't need to get at the per-thread keys from assembly at all, so they can live alongside the rest of the per-thread register state in thread_struct instead of thread_info. This will also allow straighforward whitelisting of the keys for hardened usercopy should we expose them via a ptrace request later on. Signed-off-by: Will Deacon commit 04ca3204fa09f5f55c8f113b0072004a7b364ff4 Author: Mark Rutland Date: Fri Dec 7 18:39:30 2018 +0000 arm64: enable pointer authentication Now that all the necessary bits are in place for userspace, add the necessary Kconfig logic to allow this to be enabled. Signed-off-by: Mark Rutland Signed-off-by: Kristina Martsenko Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit ba830885656414101b2f8ca88786524d4bb5e8c1 Author: Kristina Martsenko Date: Fri Dec 7 18:39:28 2018 +0000 arm64: add prctl control for resetting ptrauth keys Add an arm64-specific prctl to allow a thread to reinitialize its pointer authentication keys to random values. This can be useful when exec() is not used for starting new processes, to ensure that different processes still have different keys. Signed-off-by: Kristina Martsenko Signed-off-by: Will Deacon commit ccc43810827f9feb5e588e4b7098dc55b1d972f8 Author: Mark Rutland Date: Fri Dec 7 18:39:27 2018 +0000 arm64: perf: strip PAC when unwinding userspace When the kernel is unwinding userspace callchains, we can't expect that the userspace consumer of these callchains has the data necessary to strip the PAC from the stored LR. This patch has the kernel strip the PAC from user stackframes when the in-kernel unwinder is used. This only affects the LR value, and not the FP. This only affects the in-kernel unwinder. When userspace performs unwinding, it is up to userspace to strip PACs as necessary (which can be determined from DWARF information). Signed-off-by: Mark Rutland Signed-off-by: Kristina Martsenko Cc: Catalin Marinas Cc: Ramana Radhakrishnan Cc: Will Deacon Signed-off-by: Will Deacon commit ec6e822d1a22d0eef1d1fa260dff751dba9a4258 Author: Mark Rutland Date: Fri Dec 7 18:39:26 2018 +0000 arm64: expose user PAC bit positions via ptrace When pointer authentication is in use, data/instruction pointers have a number of PAC bits inserted into them. The number and position of these bits depends on the configured TCR_ELx.TxSZ and whether tagging is enabled. ARMv8.3 allows tagging to differ for instruction and data pointers. For userspace debuggers to unwind the stack and/or to follow pointer chains, they need to be able to remove the PAC bits before attempting to use a pointer. This patch adds a new structure with masks describing the location of the PAC bits in userspace instruction and data pointers (i.e. those addressable via TTBR0), which userspace can query via PTRACE_GETREGSET. By clearing these bits from pointers (and replacing them with the value of bit 55), userspace can acquire the PAC-less versions. This new regset is exposed when the kernel is built with (user) pointer authentication support, and the address authentication feature is enabled. Otherwise, the regset is hidden. Reviewed-by: Richard Henderson Signed-off-by: Mark Rutland Signed-off-by: Kristina Martsenko Cc: Catalin Marinas Cc: Ramana Radhakrishnan Cc: Will Deacon [will: Fix to use vabits_user instead of VA_BITS and rename macro] Signed-off-by: Will Deacon commit 7503197562567b57ec14feb3a9d5400ebc56812f Author: Mark Rutland Date: Fri Dec 7 18:39:25 2018 +0000 arm64: add basic pointer authentication support This patch adds basic support for pointer authentication, allowing userspace to make use of APIAKey, APIBKey, APDAKey, APDBKey, and APGAKey. The kernel maintains key values for each process (shared by all threads within), which are initialised to random values at exec() time. The ID_AA64ISAR1_EL1.{APA,API,GPA,GPI} fields are exposed to userspace, to describe that pointer authentication instructions are available and that the kernel is managing the keys. Two new hwcaps are added for the same reason: PACA (for address authentication) and PACG (for generic authentication). Reviewed-by: Richard Henderson Signed-off-by: Mark Rutland Signed-off-by: Kristina Martsenko Tested-by: Adam Wallis Cc: Catalin Marinas Cc: Ramana Radhakrishnan Cc: Suzuki K Poulose Cc: Will Deacon [will: Fix sizeof() usage and unroll address key initialisation] Signed-off-by: Will Deacon commit 6984eb47d5c1a74bb44467ee4eee22d680f10785 Author: Mark Rutland Date: Fri Dec 7 18:39:24 2018 +0000 arm64/cpufeature: detect pointer authentication So that we can dynamically handle the presence of pointer authentication functionality, wire up probing code in cpufeature.c. From ARMv8.3 onwards, ID_AA64ISAR1 is no longer entirely RES0, and now has four fields describing the presence of pointer authentication functionality: * APA - address authentication present, using an architected algorithm * API - address authentication present, using an IMP DEF algorithm * GPA - generic authentication present, using an architected algorithm * GPI - generic authentication present, using an IMP DEF algorithm This patch checks for both address and generic authentication, separately. It is assumed that if all CPUs support an IMP DEF algorithm, the same algorithm is used across all CPUs. Reviewed-by: Richard Henderson Signed-off-by: Mark Rutland Signed-off-by: Kristina Martsenko Cc: Catalin Marinas Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Will Deacon commit b3669b1e1c09890d61109a1a8ece2c5b66804714 Author: Mark Rutland Date: Fri Dec 7 18:39:23 2018 +0000 arm64: Don't trap host pointer auth use to EL2 To allow EL0 (and/or EL1) to use pointer authentication functionality, we must ensure that pointer authentication instructions and accesses to pointer authentication keys are not trapped to EL2. This patch ensures that HCR_EL2 is configured appropriately when the kernel is booted at EL2. For non-VHE kernels we set HCR_EL2.{API,APK}, ensuring that EL1 can access keys and permit EL0 use of instructions. For VHE kernels host EL0 (TGE && E2H) is unaffected by these settings, and it doesn't matter how we configure HCR_EL2.{API,APK}, so we don't bother setting them. This does not enable support for KVM guests, since KVM manages HCR_EL2 itself when running VMs. Reviewed-by: Richard Henderson Signed-off-by: Mark Rutland Signed-off-by: Kristina Martsenko Acked-by: Christoffer Dall Cc: Catalin Marinas Cc: Marc Zyngier Cc: Will Deacon Cc: kvmarm@lists.cs.columbia.edu Signed-off-by: Will Deacon commit a1ee8abb95c55948dc187d0cccc88814841c85d2 Author: Mark Rutland Date: Fri Dec 7 18:39:22 2018 +0000 arm64/kvm: hide ptrauth from guests In subsequent patches we're going to expose ptrauth to the host kernel and userspace, but things are a bit trickier for guest kernels. For the time being, let's hide ptrauth from KVM guests. Regardless of how well-behaved the guest kernel is, guest userspace could attempt to use ptrauth instructions, triggering a trap to EL2, resulting in noise from kvm_handle_unknown_ec(). So let's write up a handler for the PAC trap, which silently injects an UNDEF into the guest, as if the feature were really missing. Reviewed-by: Richard Henderson Signed-off-by: Mark Rutland Signed-off-by: Kristina Martsenko Reviewed-by: Andrew Jones Reviewed-by: Christoffer Dall Cc: Marc Zyngier Cc: kvmarm@lists.cs.columbia.edu Signed-off-by: Will Deacon commit 4eaed6aa2c628101246bcabc91b203bfac1193f8 Author: Mark Rutland Date: Fri Dec 7 18:39:21 2018 +0000 arm64/kvm: consistently handle host HCR_EL2 flags In KVM we define the configuration of HCR_EL2 for a VHE HOST in HCR_HOST_VHE_FLAGS, but we don't have a similar definition for the non-VHE host flags, and open-code HCR_RW. Further, in head.S we open-code the flags for VHE and non-VHE configurations. In future, we're going to want to configure more flags for the host, so lets add a HCR_HOST_NVHE_FLAGS defintion, and consistently use both HCR_HOST_VHE_FLAGS and HCR_HOST_NVHE_FLAGS in the kvm code and head.S. We now use mov_q to generate the HCR_EL2 value, as we use when configuring other registers in head.S. Reviewed-by: Marc Zyngier Reviewed-by: Richard Henderson Signed-off-by: Mark Rutland Signed-off-by: Kristina Martsenko Reviewed-by: Christoffer Dall Cc: Catalin Marinas Cc: Marc Zyngier Cc: Will Deacon Cc: kvmarm@lists.cs.columbia.edu Signed-off-by: Will Deacon commit aa6eece8ec5095e479a354365f5e5102bfab4f5a Author: Mark Rutland Date: Fri Dec 7 18:39:20 2018 +0000 arm64: add pointer authentication register bits The ARMv8.3 pointer authentication extension adds: * New fields in ID_AA64ISAR1 to report the presence of pointer authentication functionality. * New control bits in SCTLR_ELx to enable this functionality. * New system registers to hold the keys necessary for this functionality. * A new ESR_ELx.EC code used when the new instructions are affected by configurable traps This patch adds the relevant definitions to and for these, to be used by subsequent patches. Reviewed-by: Richard Henderson Signed-off-by: Mark Rutland Signed-off-by: Kristina Martsenko Cc: Catalin Marinas Cc: Marc Zyngier Cc: Suzuki K Poulose Cc: Will Deacon Signed-off-by: Will Deacon commit 15560657358539aafcac027445f1f34c29a889a6 Author: Kristina Martsenko Date: Fri Dec 7 18:39:19 2018 +0000 arm64: add comments about EC exception levels To make it clear which exceptions can't be taken to EL1 or EL2, add comments next to the ESR_ELx_EC_* macro definitions. Reviewed-by: Richard Henderson Signed-off-by: Kristina Martsenko Signed-off-by: Will Deacon commit 82b4d99725aedc3de731faa4e23f256fbe2821cf Author: Olliver Schinagl Date: Tue Dec 11 17:17:12 2018 +0200 mfd: axp20x: use explicit bit defines The AXP20X_OFF define is an actual specific bit, define it as such. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes Acked-by: Lee Jones Signed-off-by: Mark Brown commit dcea4d5c0a349034686ef9f8ba8a9910e0a1c14b Author: Olliver Schinagl Date: Tue Dec 11 17:17:11 2018 +0200 mfd: axp20x: Clean up included headers Add the bitops.h header as we need it, alphabetize header order. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes Acked-by: Lee Jones Signed-off-by: Mark Brown commit c1132b006785b14d01ccf40922493278984555d5 Author: Olliver Schinagl Date: Tue Dec 11 17:17:10 2018 +0200 regulator: dts: enable soft-start and ramp delay for the OLinuXino Lime2 The OLinuXino Lime2 has a big capacitor on its LDO3 output. It is actually too large, causing the PMIC to shutdown when toggling the LDO3. By enabling soft-start and ramp delay we increase the time for the capacitor to charge lowering the current drain on the power regulator. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes Signed-off-by: Mark Brown commit eb51c6eb9775d5e7ef810327dbc84bb0d15f72b5 Author: Olliver Schinagl Date: Tue Dec 11 17:17:09 2018 +0200 dt-bindings: mfd: axp20x: Add software based soft_start for AXP209 LDO3 In the past, there have been words on various lists that if LDO3 is disabled in u-boot, but enabled in the DTS, the axp209 driver would fail to continue/hang. Several enable/disable patches have been issues to devicetree's in both the kernel and u-boot to address this issue. What really happened however, was that the AXP209 shuts down without a notice and without setting an interrupt. This is caused when LDO3 gets overloaded, for example with large capacitors on the LDO3 output. Normally, we would expect that AXP209 would source 200 mA as per datasheet and set and trigger an interrupt when being overloaded. For some reason however, this does not happen. As a work-around, implement software-based 'regulator-soft-start' property for AXP209 LDO3 regulator, which is used to first bring up the LDO3 to the lowest possible voltage and then enable the LDO. After that, we can set the requested voltage as usual. Combining this setting with the regulator-ramp-delay allows LDO3 to come up slowly and staggered, potentially reducing overall inrush current. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes Signed-off-by: Mark Brown commit 77e3e3b165db94dc48c0de30498f51fa38f19d4d Author: Olliver Schinagl Date: Tue Dec 11 17:17:08 2018 +0200 regulator: axp20x: add software based soft_start for AXP209 LDO3 In the past, there have been words on various lists that if LDO3 is disabled in u-boot, but enabled in the DTS, the axp209 driver would fail to continue/hang. Several enable/disable patches have been issues to devicetree's in both the kernel and u-boot to address this issue. What really happened however, was that the AXP209 shuts down without a notice and without setting an interrupt. This is caused when LDO3 gets overloaded, for example with large capacitors on the LDO3 output. Normally, we would expect that AXP209 would source 200 mA as per datasheet and set and trigger an interrupt when being overloaded. For some reason however, this does not happen. As a work-around, we use the soft-start constraint of the regulator node to first bring up the LDO3 to the lowest possible voltage and then enable the LDO. After that, we can set the requested voltage as usual. Combining this setting with the regulator-ramp-delay allows LDO3 to enable voltage slowly and staggered, potentially reducing overall inrush current. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes Signed-off-by: Mark Brown commit fdb0436c35b86759da6d7fce27323e3cdced0e13 Author: Olliver Schinagl Date: Tue Dec 11 17:17:07 2018 +0200 dt-bindings: mfd: axp20x: add support for regulator-ramp-delay for AXP209 The AXP209 supports ramping up voltages on several regulators such as DCDC2 and LDO3, therefore we can use the standard 'regulator-ramp-delay' property for those 2 regulators. Note that the voltage ramp only works when the regulator is already enabled. E.g. when going from say 0.7 V to 3.6 V. When turning on the regulator, no voltage ramp is performed in hardware. What this means, is that if the bootloader brings up the voltage at 0.7 V, the ramp delay property is properly applied. If however, the bootloader leaves the power off, no ramp delay is applied when the power is enabled by the regulator framework. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes Acked-for-MFD-by: Lee Jones Signed-off-by: Mark Brown commit d29f54df8b167be6174881f265b12453a558e48a Author: Olliver Schinagl Date: Tue Dec 11 17:17:06 2018 +0200 regulator: axp20x: add support for set_ramp_delay for AXP209 The AXP209 supports ramping up voltages on several regulators such as DCDC2 and LDO3. This patch adds preliminary support for the regulator-ramp-delay property for these 2 regulators. Note that the voltage ramp only works when regulator is already enabled. E.g. when going from say 0.7 V to 3.6 V. When turning on the regulator, no voltage ramp is performed in hardware. What this means, is that if the bootloader brings up the voltage at 0.7 V, the ramp delay property is properly applied. If however, the bootloader leaves the power off, no ramp delay is applied when the power is enabled by the regulator framework. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes Signed-off-by: Mark Brown commit 16aa70e95947e0870ec9e5bf7c7db33fcbacb957 Author: Olliver Schinagl Date: Tue Dec 11 17:17:05 2018 +0200 mfd: axp20x: name voltage ramping define properly The current axp20x names the ramping register 'scal' which probably means scaling. Since the register really has nothing to do with scaling, but really is the voltage ramp we rename it appropriately. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes Acked-by: Lee Jones Signed-off-by: Mark Brown commit c33c83354c323e5c190fc0115b894394fcb81740 Merge: 919261c03e7ca db4a555f7c4cf Author: Mark Brown Date: Thu Dec 13 16:37:11 2018 +0000 Merge branch 'topic/axp20x' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-4.21 commit 165be3c260f88a5f8c55d89458ad1f1d9efd701f Author: Jerome Brunet Date: Thu Dec 13 16:44:28 2018 +0100 ASoC: meson: fix do_div warning in spdifin Even if this spdif input driver is only supposed to be used on 64bits platform, there is possible problem with 32bits and do_div, as reported by the kbuild robot. Just fix it. Fixes: 5ce5658375e6 ("ASoC: meson: add axg spdif input") Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit c2dacddc5f6772f38bf04c950967fe41bb5c9600 Author: Rob Herring Date: Mon May 14 18:47:39 2018 -0500 dt-bindings: arm: Convert Calxeda board/soc bindings to json-schema Convert Calxeda SoC bindings to DT schema format using json-schema. Cc: Mark Rutland Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring commit f8139316cab4f3e5cf31b65157b27e785e05965b Author: Rob Herring Date: Mon May 14 18:46:53 2018 -0500 dt-bindings: arm: Convert Altera board/soc bindings to json-schema Convert Altera SoC bindings to DT schema format using json-schema. Cc: Mark Rutland Acked-by: Dinh Nguyen Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring commit d3c207eeb9059cf055a887f15e5f41b096386448 Author: Rob Herring Date: Mon May 14 18:42:04 2018 -0500 dt-bindings: arm: Convert primecell binding to json-schema Convert ARM Primecell binding to DT schema format using json-schema. Cc: Mark Rutland Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring commit 672951cbd1b70a9ede6f9c6eba4ed6b726d32b03 Author: Rob Herring Date: Mon May 14 18:41:07 2018 -0500 dt-bindings: arm: Convert cpu binding to json-schema Convert ARM CPU binding to DT schema format using json-schema. Cc: Mark Rutland Cc: Matthias Brugger Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Signed-off-by: Rob Herring commit 4d2bb3e65035954dce7c666616906004f2c049f8 Author: Rob Herring Date: Mon May 14 18:42:37 2018 -0500 dt-bindings: timer: Convert ARM timer bindings to json-schema Convert ARM timers to DT schema format using json-schema. Cc: Daniel Lezcano Cc: Thomas Gleixner Cc: Mark Rutland Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring commit 0175ce4a58d6e42a707c413f21e1a1f354ea4988 Author: Rob Herring Date: Fri Nov 2 16:29:38 2018 -0500 dt-bindings: i2c: Convert i2c-gpio binding to json-schema Convert the i2c-gpio binding to DT schema format using json-schema. This serves as an example of how to include other schema (i2c-controller.yaml in this case). Signed-off-by: Rob Herring commit b31abceb0fec717948e4e8dae6705baf6914db96 Author: Rob Herring Date: Mon May 14 18:40:09 2018 -0500 dt-bindings: altera: Convert clkmgr binding to json-schema Convert Altera clkmgr to DT schema format using json-schema. Cc: Mark Rutland Acked-by: Dinh Nguyen Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring commit 00ce8a800060c80c6d0c895fad10cacb03277fcc Author: Rob Herring Date: Fri Jun 29 08:19:52 2018 -0600 dt-bindings: Add a writing DT schemas how-to and annotated example Add a how-to doc on writing DT schema documentation. This gives a description of each section and details on how to validate the DT schema file. The DT schema are written using json-schema vocabulary in a YAML encoded document. Using jsonschema gives us access to existing tooling. A YAML encoding gives us something easy to edit. The example is annotated to help explain what each section does. This example is just the tip of the iceberg, but is it the part most developers writing bindings will interact with. Backing all this up are meta-schema (to validate the binding schemas), some DT core schema, YAML encoded DT output with dtc, and a small number of python scripts to run validation. Cc: Mark Rutland Cc: devicetree@vger.kernel.org Signed-off-by: Rob Herring commit 4f0e3a57d6eb727c54249542c509e0b7aa122465 Author: Rob Herring Date: Thu Sep 6 13:26:07 2018 -0500 kbuild: Add support for DT binding schema checks This adds the build infrastructure for checking DT binding schema documents and validating dts files using the binding schema. Check DT binding schema documents: make dt_binding_check Build dts files and check using DT binding schema: make dtbs_check Optionally, DT_SCHEMA_FILES can be passed in with a schema file(s) to use for validation. This makes it easier to find and fix errors generated by a specific schema. Currently, the validation targets are separate from a normal build to avoid a hard dependency on the external DT schema project and because there are lots of warnings generated. Cc: Jonathan Corbet Cc: Mark Rutland Acked-by: Masahiro Yamada Cc: Michal Marek Cc: linux-doc@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kbuild@vger.kernel.org Signed-off-by: Rob Herring commit f231c34ca9772f0b0e2d1b781e9c415847aff522 Author: Pierre-Louis Bossart Date: Fri Dec 7 17:50:07 2018 -0600 ASoC: Intel: Skylake: add error logs on probe, remove dependency on NHLT Add error logs to make probe debug easier. Also remove hard-coded dependency on NHLT. NHLT literally stands for NonHdaudioLinkTable and is only required for SSP/DMIC interfaces. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 7f981bdcf55fda28a9a70c9e8151dd200771a0a8 Author: Pierre-Louis Bossart Date: Fri Dec 7 17:50:06 2018 -0600 ASoC: Intel: Skylake: remove useless tests on HDaudio capabilities bus->ppcap is now tested upfront, there is no need to re-check if the hardware is exposed as needed. Remove tests and remove indentation. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit fa11ab5688f744bc868356f3f14c3bb9f283a780 Author: Pierre-Louis Bossart Date: Fri Dec 7 17:50:05 2018 -0600 ASoC: Intel: Skylake: stop probe if HDaudio capabilities don't exist Check immediately if required HDaudio capabilities can't be found (no PPCAP or no streams exposed in GCAP), and move all DMA inits after the error tests. PPCAP and GCAP are not reliable indicators of DSP presence, but if they don't exist then the driver will not work. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit c746de8dbc7b0ae9df491f7a99a6dab34203b51b Author: Pierre-Louis Bossart Date: Fri Dec 7 17:50:04 2018 -0600 ASoC: Intel: Skylake: Harden DSP detection with PCI class/subclass info The existing PPCAP and GCAP fields cannot be used reliably to determine if the DSP is enabled by the BIOS. Instead rely on the class/subclass information to find out if this driver can run or not. The values in the code don't seem to be documented in publicly available documents but are part of recommendations made to BIOS writers and have been verified to be accurate on a number of platforms. Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit e6b98db945124987b1ecec3f5f030877627e01a9 Author: Takashi Iwai Date: Fri Dec 7 17:50:03 2018 -0600 ASoC: Intel: Skylake: Add CFL-S support It's with CNP, supposed to be equivalent with CNL entry. Keep the existing declaration style for now, at a later point we may transition and use PCI_DEVICE_DATA(). Signed-off-by: Takashi Iwai Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 26a25c841d9e6ba4ceba4b8d7ce3f3227f7510ce Author: Will Deacon Date: Thu Dec 13 15:34:44 2018 +0000 arm64: perf: Treat EXCLUDE_EL* bit definitions as unsigned Although the upper 32 bits of the PMEVTYPER_EL0 registers are RES0, we should treat the EXCLUDE_EL* bit definitions as unsigned so that we avoid accidentally sign-extending the privilege filtering bit (bit 31) into the upper half of the register. Signed-off-by: Will Deacon commit bb9963b850ea9e1ef39f4368eae83a9462f60166 Author: Kirill Marinushkin Date: Fri Dec 7 20:02:34 2018 +0100 ASoC: pcm3060: Add powersaving widgets for DAC and ADC Enable DAC/ADC only when playing/capturing Signed-off-by: Kirill Marinushkin Signed-off-by: Mark Brown commit 33f8db9a89200c18ff65d494a3dbd325d129e15e Author: Maruthi Srinivas Bayyavarapu Date: Sat Dec 8 00:02:38 2018 +0530 ASoC: xlnx: enable i2s driver build Enabled i2s driver build option. Signed-off-by: Maruthi Srinivas Bayyavarapu Signed-off-by: Mark Brown commit 112a8900d4b0399f45d6ea025d3e1a4a1d6fa3f3 Author: Maruthi Srinivas Bayyavarapu Date: Sat Dec 8 00:02:37 2018 +0530 ASoC: xlnx: Add i2s driver I2S IP instance can work in transmitter/playback or receiver/capture mode exclusively. The patch registers corresponding instance as ASoC component with audio framework. Signed-off-by: Maruthi Srinivas Bayyavarapu Signed-off-by: Mark Brown commit 644c2dcf2f2ea113602aa24170d3203942d3d140 Author: Maruthi Srinivas Bayyavarapu Date: Sat Dec 8 00:02:36 2018 +0530 dt-bindings: ASoC: xlnx, i2s: Document i2s bindings Added documentation for I2S IP core DT bindings. Signed-off-by: Maruthi Srinivas Bayyavarapu Signed-off-by: Mark Brown commit e78bd0d26f7396c7bd17be60d9686be8ef8e453a Author: Guoju Fang Date: Thu Dec 13 22:53:57 2018 +0800 bcache: print number of keys in trace_bcache_journal_write Sometimes flush journal may be very frequent, so it's useful to dump number of keys every time write journal. Signed-off-by: Guoju Fang Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit cc38ca7ed54a1df04ae9f23614b348ebfc918029 Author: Coly Li Date: Thu Dec 13 22:53:56 2018 +0800 bcache: set writeback_percent in a flexible range Because CUTOFF_WRITEBACK is defined as 40, so before the changes of dynamic cutoff writeback values, writeback_percent is limited to [0, CUTOFF_WRITEBACK]. Any value larger than CUTOFF_WRITEBACK will be fixed up to 40. Now cutof writeback limit is a dynamic value bch_cutoff_writeback, so the range of writeback_percent can be a more flexible range as [0, bch_cutoff_writeback]. The flexibility is, it can be expended to a larger or smaller range than [0, 40], depends on how value bch_cutoff_writeback is specified. The default value is still strongly recommended to most of users for most of workloads. But for people who want to do research on bcache writeback perforamnce tuning, they may have chance to specify more flexible writeback_percent in range [0, 70]. Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 9aaf51654672b16566c5fe787da3ca41ebf6d297 Author: Coly Li Date: Thu Dec 13 22:53:55 2018 +0800 bcache: make cutoff_writeback and cutoff_writeback_sync tunable Currently the cutoff writeback and cutoff writeback sync thresholds are defined by CUTOFF_WRITEBACK (40) and CUTOFF_WRITEBACK_SYNC (70) as static values. Most of time these they work fine, but when people want to do research on bcache writeback mode performance tuning, there is no chance to modify the soft and hard cutoff writeback values. This patch introduces two module parameters bch_cutoff_writeback_sync and bch_cutoff_writeback which permit people to tune the values when loading bcache.ko. If they are not specified by module loading, current values CUTOFF_WRITEBACK_SYNC and CUTOFF_WRITEBACK will be used as default and nothing changes. When people want to tune this two values, - cutoff_writeback can be set in range [1, 70] - cutoff_writeback_sync can be set in range [1, 90] - cutoff_writeback always <= cutoff_writeback_sync The default values are strongly recommended to most of users for most of workloads. Anyway, if people wants to take their own risk to do research on new writeback cutoff tuning for their own workload, now they can make it. Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 009673d02fa92acaa7ed0b1e1389610e4390ba49 Author: Coly Li Date: Thu Dec 13 22:53:54 2018 +0800 bcache: add MODULE_DESCRIPTION information This patch moves MODULE_AUTHOR and MODULE_LICENSE to end of super.c, and add MODULE_DESCRIPTION("Bcache: a Linux block layer cache"). This is preparation for adding module parameters. Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 7a671d8ef821bf5743fdff17fae0600648345b03 Author: Coly Li Date: Thu Dec 13 22:53:53 2018 +0800 bcache: option to automatically run gc thread after writeback The option gc_after_writeback is disabled by default, because garbage collection will discard SSD data which drops cached data. Echo 1 into /sys/fs/bcache//internal/gc_after_writeback will enable this option, which wakes up gc thread when writeback accomplished and all cached data is clean. This option is helpful for people who cares writing performance more. In heavy writing workload, all cached data can be clean only happens when writeback thread cleans all cached data in I/O idle time. In such situation a following gc running may help to shrink bcache B+ tree and discard more clean data, which may be helpful for future writing requests. If you are not sure whether this is helpful for your own workload, please leave it as disabled by default. Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit cb07ad63682ffcce10e9beaed7828a26780e3df9 Author: Coly Li Date: Thu Dec 13 22:53:52 2018 +0800 bcache: introduce force_wake_up_gc() Garbage collection thread starts to work when c->sectors_to_gc is negative value, otherwise nothing will happen even the gc thread is woken up by wake_up_gc(). force_wake_up_gc() sets c->sectors_to_gc to -1 before calling wake_up_gc(), then gc thread may have chance to run if no one else sets c->sectors_to_gc to a positive value before gc_should_run(). This routine can be called where the gc thread is woken up and required to run in force. Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit f383ae300c4b6466824fd5c8cbd0a6c4ed2b53d3 Author: Shenghui Wang Date: Thu Dec 13 22:53:51 2018 +0800 bcache: cannot set writeback_running via sysfs if no writeback kthread created "echo 1 > writeback_running" marks writeback_running even if no writeback kthread created as "d_strtoul(writeback_running)" will simply set dc-> writeback_running without checking the existence of dc->writeback_thread. Add check for setting writeback_running via sysfs: if no writeback kthread available, reject setting to 1. v2 -> v3: * Make message on wrong assignment more clear. * Print name of bcache device instead of name of backing device. Signed-off-by: Shenghui Wang Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 79b791466e525c98f6aeee9acf5726e7b27f4231 Author: Shenghui Wang Date: Thu Dec 13 22:53:50 2018 +0800 bcache: do not mark writeback_running too early A fresh backing device is not attached to any cache_set, and has no writeback kthread created until first attached to some cache_set. But bch_cached_dev_writeback_init run " dc->writeback_running = true; WARN_ON(test_and_clear_bit(BCACHE_DEV_WB_RUNNING, &dc->disk.flags)); " for any newly formatted backing devices. For a fresh standalone backing device, we can get something like following even if no writeback kthread created: ------------------------ /sys/block/bcache0/bcache# cat writeback_running 1 /sys/block/bcache0/bcache# cat writeback_rate_debug rate: 512.0k/sec dirty: 0.0k target: 0.0k proportional: 0.0k integral: 0.0k change: 0.0k/sec next io: -15427384ms The none ZERO fields are misleading as no alive writeback kthread yet. Set dc->writeback_running false as no writeback thread created in bch_cached_dev_writeback_init(). We have writeback thread created and woken up in bch_cached_dev_writeback _start(). Set dc->writeback_running true before bch_writeback_queue() called, as a writeback thread will check if dc->writeback_running is true before writing back dirty data, and hung if false detected. After the change, we can get the following output for a fresh standalone backing device: ----------------------- /sys/block/bcache0/bcache$ cat writeback_running 0 /sys/block/bcache0/bcache# cat writeback_rate_debug rate: 0.0k/sec dirty: 0.0k target: 0.0k proportional: 0.0k integral: 0.0k change: 0.0k/sec next io: 0ms v1 -> v2: Set dc->writeback_running before bch_writeback_queue() called, Signed-off-by: Shenghui Wang Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 4e361e020e7220fa8fc812acdca4d08814633f49 Author: Shenghui Wang Date: Thu Dec 13 22:53:49 2018 +0800 bcache: update comment in sysfs.c We have struct cached_dev allocated by kzalloc in register_bcache(), which initializes all the fields of cached_dev with 0s. And commit ce4c3e19e520 ("bcache: Replace bch_read_string_list() by __sysfs_match_string()") has remove the string "default". Update the comment. Signed-off-by: Shenghui Wang Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit 3db4d0783eaf2a2537f6b83679ad57cba0ad0481 Author: Shenghui Wang Date: Thu Dec 13 22:53:48 2018 +0800 bcache: update comment for bch_data_insert commit 220bb38c21b8 ("bcache: Break up struct search") introduced changes to struct search and s->iop. bypass/bio are fields of struct data_insert_op now. Update the comment. Signed-off-by: Shenghui Wang Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit ae17102316550b4b230a283febe31b2a9ff30084 Author: Shenghui Wang Date: Thu Dec 13 22:53:47 2018 +0800 bcache: do not check if debug dentry is ERR or NULL explicitly on remove debugfs_remove and debugfs_remove_recursive will check if the dentry pointer is NULL or ERR, and will do nothing in that case. Remove the check in cache_set_free and bch_debug_init. Signed-off-by: Shenghui Wang Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit d2f96f487f471b4c718324ecd1540c89d2be52ac Author: Shenghui Wang Date: Thu Dec 13 22:53:46 2018 +0800 bcache: add comment for cache_set->fill_iter We have the following define for btree iterator: struct btree_iter { size_t size, used; #ifdef CONFIG_BCACHE_DEBUG struct btree_keys *b; #endif struct btree_iter_set { struct bkey *k, *end; } data[MAX_BSETS]; }; We can see that the length of data[] field is static MAX_BSETS, which is defined as 4 currently. But a btree node on disk could have too many bsets for an iterator to fit on the stack - maybe far more that MAX_BSETS. Have to dynamically allocate space to host more btree_iter_sets. bch_cache_set_alloc() will make sure the pool cache_set->fill_iter can allocate an iterator equipped with enough room that can host (sb.bucket_size / sb.block_size) btree_iter_sets, which is more than static MAX_BSETS. bch_btree_node_read_done() will use that pool to allocate one iterator, to host many bsets in one btree node. Add more comment around cache_set->fill_iter to make code less confusing. Signed-off-by: Shenghui Wang Signed-off-by: Coly Li Signed-off-by: Jens Axboe commit fee10bd2267868f2a3e7ba008ef7665aac5e4412 Author: Naga Sureshkumar Relli Date: Thu Dec 6 18:17:34 2018 +0530 memory: pl353: Add driver for arm pl353 static memory controller Add driver for arm pl353 static memory controller. This controller is used in Xilinx Zynq SoC for interfacing the NAND and NOR/SRAM memory devices. Signed-off-by: Naga Sureshkumar Relli Reviewed-by: Linus Walleij Signed-off-by: Michal Simek commit e3e454b7047a8bb11c0311ab1708e040481a6044 Author: YueHaibing Date: Thu Dec 6 12:06:08 2018 +0000 rtlwifi: rtl8821ae: remove set but not used variable 'type' in translate_rx_signal_stuff Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c: In function 'translate_rx_signal_stuff': drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c:309:6: warning: variable 'type' set but not used [-Wunused-but-set-variable] It never used since commit 21e4b0726dc6 ("rtlwifi: rtl8821ae: Move driver from staging to regular tree") Signed-off-by: YueHaibing Signed-off-by: Kalle Valo commit b0b41af12a1bf21a45ccfe48da194ee688170d03 Author: Naga Sureshkumar Relli Date: Thu Dec 6 18:17:33 2018 +0530 dt-bindings: memory: Add pl353 smc controller devicetree binding information Add pl353 static memory controller devicetree binding information. Signed-off-by: Naga Sureshkumar Relli Reviewed-by: Linus Walleij Signed-off-by: Michal Simek commit f7eb7b8a4f72b0d9dea69b09f58185ffab97fd35 Author: Wesley Sheng Date: Mon Dec 10 17:12:24 2018 +0800 switchtec: Add MRPC DMA mode support MRPC normal mode requires the host to read the MRPC command status and output data from BAR. This results in high latency responses from the Memory Read TLP and potential Completion Timeout (CTO). Add support for MRPC DMA mode, including related macro definitions and data structures and code to: * Retrieve MRPC DMA mode version from adapter firmware * Allocate DMA buffer, register ISR, and enable DMA during init * Check MRPC execution status and get execution results from DMA buffer * Release DMA buffer and disable DMA function when unloading module MRPC DMA mode is a new feature of firmware, and the driver will fall back to MRPC normal mode if there is no support in the legacy firmware. Add a module parameter, "use_dma_mrpc", to select between MRPC DMA mode and MRPC normal mode. Since the driver automatically detects DMA support in the firmware, this parameter is just for debugging and testing. Include so that readq/writeq is replaced by two readl/writel on systems that do not support it. Signed-off-by: Wesley Sheng [bhelgaas: changelog, simplify dma_ver check] Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe commit 52d8db8e0cd7c28316514568fe5df0cfd4fa2075 Author: Kelvin Cao Date: Mon Dec 10 17:12:23 2018 +0800 switchtec: Improve MRPC efficiency by enabling write combining The MRPC Input buffer is mostly memory without any side effects, so we can improve the access time by enabling write combining on this region of the BAR. In a few places, we still need to flush the WC buffer. To do this, we simply read from the Outbound Doorbell register because reads to this register are processed by low latency hardware. Signed-off-by: Kelvin Cao Signed-off-by: Wesley Sheng Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe commit afbb1947db94eacc5a13302eee88a9772fb78935 Author: Pan Bian Date: Thu Nov 29 18:48:10 2018 +0800 rtl818x: fix potential use after free entry is released via usb_put_urb just after calling usb_submit_urb. However, entry is used if the submission fails, resulting in a use after free bug. The patch fixes this. Signed-off-by: Pan Bian ACKed-by: Larry Finger Signed-off-by: Kalle Valo commit 662a7b078cff6ab246d875775af7affedcf6e2d5 Author: YueHaibing Date: Wed Dec 5 07:26:06 2018 +0000 b43: remove set but not used variables 'tx_pwr_state,tmp2' Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/wireless/broadcom/b43/phy_n.c: In function 'b43_nphy_op_recalc_txpower': drivers/net/wireless/broadcom/b43/phy_n.c:5898:7: warning: variable 'tx_pwr_state' set but not used [-Wunused-but-set-variable] drivers/net/wireless/broadcom/b43/phy_n.c:6047:20: warning: variable 'tmp2' set but not used [-Wunused-but-set-variable] 'tx_pwr_state' never used since introduction in commit 8615eb2870f1 ("b43: N-PHY: support setting custom TX power") 'tmp2' not used any more since commit c002831a07dd ("b43: N-PHY: use helper for checking IPA") Signed-off-by: YueHaibing Signed-off-by: Kalle Valo commit 412dd15c8177d93abe0c8787b83b31c5eb061405 Author: Arnd Bergmann Date: Mon Dec 10 21:55:37 2018 +0100 brcmfmac: fix false-positive -Wmaybe-unintialized warning When CONFIG_NO_AUTO_INLINE is set, we get a false-postive warning for the brcmf_fw_request_nvram_done() function, after gcc figures out that brcmf_fw_nvram_from_efi() might not set the 'data_len' variable, but fails to notice that it always returns NULL: drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c: In function 'brcmf_fw_request_nvram_done': drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:560:11: error: 'data_len' may be used uninitialized in this function [-Werror=maybe-uninitialized] Mark it 'inline' to force gcc to understand this. Fixes: ce2e6db554fa ("brcmfmac: Add support for getting nvram contents from EFI variables") Signed-off-by: Arnd Bergmann Reviewed-by: Hans de Goede Signed-off-by: Kalle Valo commit 29f6589140a10ece8c1d73f58043ea5b3473ab3e Author: Wright Feng Date: Wed Nov 21 07:53:52 2018 +0000 brcmfmac: disable command decode in sdio_aos AOS is a part of the SDIOD core that becomes active when the rest of SDIOD is sleeping to keep SDIO bus alive responding to reduced set of commands. Transaction between AOS and SDIOD is not protected, and if cmd 52 is received in AOS and in the middle of response state changed from AOS to SDIOD, response is corrupted and it causes to SDIO Host controller to hang. Command decode for below chips are disabled in this commit: - 4339 - 4345 - 4354 - 4373 Reviewed-by: Arend van Spriel Signed-off-by: Wright Feng Signed-off-by: Double Lo Signed-off-by: Madhan Mohan R Signed-off-by: Chi-Hsien Lin Signed-off-by: Kalle Valo commit 2f2d389efda4caa4c1b69cb4fa2ab217f0fe6d6f Author: Chi-Hsien Lin Date: Wed Nov 21 07:53:50 2018 +0000 brcmfmac: 4373 save-restore support Use chipcommon sr_control0 register to check 4373 sr support. Reviewed-by: Arend van Spriel Signed-off-by: Chi-Hsien Lin Signed-off-by: Kalle Valo commit f95a8d9c6aca196f1ace5b2e53a3dd3bc491b1b3 Author: Naveen Gupta Date: Wed Nov 21 07:53:49 2018 +0000 brcmfmac: update 43012 F2 watermark setting to fix DMA Error during UDP RX Traffic The number of words that the read FIFO has to contain except the end of frame before sends data back to the host. Max watermark = (512B - 2* (BurstLength))/4 = (512 - 128)/4 = 384/4 = 0x60 so if burst length (i.e. BurstLength = 64) is increased, watermark has to be reduced. This is the optimal setting for this chip. Reviewed-by: Arend van Spriel Signed-off-by: Naveen Gupta Signed-off-by: Chi-Hsien Lin Signed-off-by: Kalle Valo commit b021a6bc1175442609af0b66d64f850883e155fb Author: Chi-Hsien Lin Date: Wed Nov 21 07:53:48 2018 +0000 brcmfmac: allow GCI core enumuration GCI core is needed for ULP operation. Allow GCI core enumuration with below changes: - Allow GCI to be added to core list even when it doesn't have a wrapper. - Allow 8K address space size. - Don't overwrite the address value when an additional size descriptor is in place. Reviewed-by: Arend van Spriel Signed-off-by: Chi-Hsien Lin Signed-off-by: Kalle Valo commit 35cb51b2162a1a7c5cd977f92595e60ab14d3b22 Author: Chi-Hsien Lin Date: Wed Nov 21 07:53:47 2018 +0000 brcmfmac: add support for CYW43012 SDIO chipset CYW43012 is a 1x1 802.11a/b/g/n Dual-Band HT20, 256-QAM/Turbo QAM. It is an Ultra Low Power WLAN+BT combo chip. Reviewed-by: Arend van Spriel Signed-off-by: Chi-Hsien Lin Signed-off-by: Praveen Babu C Signed-off-by: Kalle Valo commit 58e4bbea0c1d9b5ace11df968c5dc096ce052a73 Author: Madhan Mohan R Date: Wed Nov 21 07:53:45 2018 +0000 brcmfmac: set SDIO F1 MesBusyCtrl for CYW4373 Along with F2 watermark (existing) configuration, F1 MesBusyCtrl should be enabled & sdio device RX FIFO watermark should be configured to avoid overflow errors. Reviewed-by: Arend van Spriel Signed-off-by: Madhan Mohan R Signed-off-by: Chi-Hsien Lin Signed-off-by: Kalle Valo commit e1a08730eeb0bad4d82c3bc40e74854872de618d Author: Wright Feng Date: Wed Nov 21 07:53:44 2018 +0000 brcmfmac: set F2 watermark to 256 for 4373 We got SDIO_CRC_ERROR with 4373 on SDR104 when doing bi-directional throughput test. Enable watermark to 256 to guarantee the operation stability. Reviewed-by: Arend van Spriel Signed-off-by: Wright Feng Signed-off-by: Chi-Hsien Lin Signed-off-by: Kalle Valo commit eb6b33bfb8f56859df7264dccc2ca8ab7c57342a Author: Winnie Chang Date: Wed Nov 21 07:53:42 2018 +0000 brcmfmac: add 4354 raw pcie device id Add the raw 4354 PCIe device ID for unprogrammed Cypress boards. Reviewed-by: Arend Van Spriel Signed-off-by: Winnie Chang Signed-off-by: Chi-Hsien Lin Signed-off-by: Kalle Valo commit e4af3ffb43d50f070134aa1b40d5c3573f57deb1 Author: Chung-Hsien Hsu Date: Mon Nov 5 05:52:05 2018 +0000 brcmfmac: handle compressed tx status signal Firmware inform the driver about tx status by normal tx status signal or compressed tx status signal. This patch adds support to handle the compressed tx status signal. Signed-off-by: Chung-Hsien Hsu Signed-off-by: Chi-Hsien Lin Signed-off-by: Wright Feng Acked-by: Arend van Spriel Signed-off-by: Kalle Valo commit a3bdc6deb60bf6be4405058ca49a686c4db08c39 Author: Wright Feng Date: Mon Nov 5 05:51:59 2018 +0000 brcmfmac: enable frameburst mode in default firmware setting The frameburst feature can enable per-packet framebursting in firmware side and get higher TX throughput in High Throughput(HT) mode. To enhance TX throughput, we enable frameburst mode in default firmware setting. Signed-off-by: Wright Feng Acked-by: Arend van Spriel Signed-off-by: Kalle Valo commit 153e22c0ff1260035cd7fe72c8aeead1f5fac757 Author: Wright Feng Date: Mon Nov 5 05:51:54 2018 +0000 brcmfmac: add credit numbers updating support The credit numbers are static and tunable per chip in firmware side. However the credit number may be changed that is based on packet pool length and will send BRCMF_E_FIFO_CREDIT_MAP event to notify host driver updates the credit numbers during interface up. The purpose of this patch is making host driver has ability of updating the credit numbers when receiving the BRCMF_E_FIFO_CREDIT_MAP event. Signed-off-by: Wright Feng Acked-by: Arend van Spriel Signed-off-by: Kalle Valo commit ed0b2b067bad9d923842ac4c68c6b652b5885b84 Author: Brian Norris Date: Thu Dec 6 16:12:49 2018 -0800 mwifiex: add NL80211_STA_INFO_RX_BITRATE support Comparing the existing TX_BITRATE parsing code (in mwifiex_parse_htinfo()) with the RX bitrate histograms in debugfs.c, it appears that the rxpd_rate and rxpd_htinfo fields have the same format. At least, they give reasonable results when I parse them this way. So this patch adds support for RX_BITRATE to our station info dump. Along the way, I add legacy bitrate parsing into the same function, using the debugfs code (mwifiex_histogram_read() and mwifiex_adjust_data_rate()) as reference. Additionally, to satisfy the requirements of NL80211_STA_INFO_RX_BITRATE, I skip logging the bitrate of multicast packets. This shouldn't add a lot of overhead to the RX path, as there are already several similar 802.3 header checks in this same codepath. We can also bias the branch behavior to favor unicast, as that's the common performance-sensitive case. I'd consider this support somewhat experimental, as I have zero documentation from Marvell. But the existing driver code gives me good reason to think this is correct. I've tested this on a few different 802.11{a,b,g,n,ac} networks, and the reported bitrates look good to me. Signed-off-by: Brian Norris Signed-off-by: Kalle Valo commit a256707fbd4b1d153d0152c502aa5b87837aeb6c Author: Brian Norris Date: Thu Dec 6 16:12:48 2018 -0800 mwifiex: refactor mwifiex_parse_htinfo() for reuse This function converts some firmware-specific parameters into cfg80211 'rate_info' structures. It currently assumes it's dealing only with TX bitrate, but the RX bitrate looks to be the same, so refactor this function to be reusable. Signed-off-by: Brian Norris Signed-off-by: Kalle Valo commit 4cb777c64e030778c569f605398d7604d8aabc0f Author: Brian Norris Date: Mon Dec 3 14:26:55 2018 -0800 mwifiex: debugfs: correct histogram spacing, formatting Currently, snippets of this file look like: rx rates (in Mbps): 0=1M 1=2M2=5.5M 3=11M 4=6M 5=9M 6=12M 7=18M 8=24M 9=36M 10=48M 11=54M12-27=MCS0-15(BW20) 28-43=MCS0-15(BW40) 44-53=MCS0-9(VHT:BW20)54-63=MCS0-9(VHT:BW40)64-73=MCS0-9(VHT:BW80) ... noise_flr[--96dBm] = 22 noise_flr[--95dBm] = 149 noise_flr[--94dBm] = 9 noise_flr[--93dBm] = 2 We're missing some spaces, and we're adding a minus sign ('-') on values that are already negative signed integers. Signed-off-by: Brian Norris Signed-off-by: Kalle Valo commit 1dcd9429212b98bea87fc6ec92fb50bf5953eb47 Author: Pan Bian Date: Thu Nov 29 18:25:19 2018 +0800 mwifiex: fix potential NULL dereference and use after free There are two defects: (1) passing a NULL bss to mwifiex_save_hidden_ssid_channels will result in NULL dereference, (2) using bss after dropping the reference to it via cfg80211_put_bss. To fix them, the patch moves the buggy code to the branch that bss is not NULL and puts it before cfg80211_put_bss. Signed-off-by: Pan Bian Signed-off-by: Kalle Valo commit 8625db9416923b2941ef68776f55062555f7ce65 Author: Hui Wang Date: Thu Dec 13 21:02:16 2018 +0800 ASoC: Intel: kbl_rt5660: Add a new machine driver for kbl with rt5660 The new Dell IoT platform uses kabylake + alc3277 codec, and alc3277 shares the driver with the codec rt5660, here we generate a new machine driver based on kbl_da7219_max98357a. The audio design on this IoT platform is as below: - Intel kabylake platform - connect the codec ALC3277 via SSP0 - line-out and line-in with Micbias jacks - line-out mute control and jack detection of line-out and line-in - two HDMI ports with audio capability Signed-off-by: Hui Wang Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 8fe8915b6c0b5298fa547be21957b3860c39c46e Merge: 1b46ed96961db a01b8d1d24451 Author: Mark Brown Date: Thu Dec 13 14:36:46 2018 +0000 Merge branch 'for-4.20' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-4.21 intel dep commit 2a355ec25729053bb9a1a89b6c1d1cdd6c3b3fb1 Author: Will Deacon Date: Thu Dec 13 13:47:38 2018 +0000 arm64: kpti: Whitelist Cortex-A CPUs that don't implement the CSV3 field While the CSV3 field of the ID_AA64_PFR0 CPU ID register can be checked to see if a CPU is susceptible to Meltdown and therefore requires kpti to be enabled, existing CPUs do not implement this field. We therefore whitelist all unaffected Cortex-A CPUs that do not implement the CSV3 field. Signed-off-by: Will Deacon commit 074b145a05835e9f93a52323a4770b70b4b782fd Merge: d9bbd6a1a56ec e28487ea84a9c Author: Kalle Valo Date: Thu Dec 13 16:02:19 2018 +0200 Merge tag 'mt76-for-kvalo-2018-11-30' of https://github.com/nbd168/wireless first batch of mt76 patches for 4.21 * use the same firmware for mt76x2e and mt76x2u * mt76x2 fixes * mt76x0 fixes * mt76x0e survey support * more unification between mt76x2 and mt76x0 * mt76x0e AP mode support * mt76x0e DFS support * rework and fix tx status handling for mt76x0 and mt76x2 kvalo: fixed a conflict in drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c and a build problem in drivers/net/wireless/mediatek/mt76/mt76x02_util.c commit f836b94444d6b2e75f59dc7a161233ad99c08999 Merge: 0cef02031e74e 1adde32a2ede4 Author: Linus Walleij Date: Thu Dec 13 14:02:18 2018 +0100 Merge tag 'intel-pinctrl-v4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/intel into devel intel-pinctrl for v4.21-1 Switch to generic ->probe() callbacks. Simplify getting .driver_data. Code formatting fixes and headers clean up. Special case is the driver for Intel Cherryview SoC, where GPIO enabling bit was mistakenly cleared when pin gets freed. It's fixed now. The below commit went to v4.20-rc3, that's why duplication. - ad774315c3765ffb27abb6db987a2121d871a942 MAINTAINERS: Add tree link for Intel pin control driver The following is an automated git shortlog grouped by driver: baytrail: - Code formatting fixes - simplify getting .driver_data broxton: - Code formatting fixes - Get rid of unneeded ->probe() stub cannonlake: - Code formatting fixes - Get rid of unneeded ->probe() stub cedarfork: - Replace acpi.h with mod_devicetable.h - Get rid of unneeded ->probe() stub cherryview: - Stop clearing the GPIO_EN bit from chv_gpio_disable_free - Add chv_gpio_clear_triggering() helper function - simplify getting .driver_data denverton: - Replace acpi.h with mod_devicetable.h - Get rid of unneeded ->probe() stub geminilake: - Code formatting fixes icelake: - Code formatting fixes - Get rid of unneeded ->probe() stub intel: - Unexport intel_pinctrl_probe() - simplify getting .driver_data lewisburg: - Replace acpi.h with mod_devicetable.h - Get rid of unneeded ->probe() stub MAINTAINERS: - Add tree link for Intel pin control driver merrifield: - include bits.h instead of bitops.h sunrisepoint: - Get rid of unneeded ->probe() stub commit 6f61a2c8f1f6163c7e08c77c5f71df0427e4d2f6 Author: Laurent Pinchart Date: Mon Dec 10 11:43:55 2018 +0200 arm64: dts: renesas: draak: Fix CVBS input A typo in the adv7180 DT node prevents successful probing of the VIN. Fix it. Fixes: 6a0942c20f5c ("arm64: dts: renesas: draak: Describe CVBS input") Signed-off-by: Laurent Pinchart Acked-by: Jacopo Mondi Signed-off-by: Simon Horman commit c6cbcdea7ab94120b676a4865e9782ed3c06dc80 Merge: e894075934a44 db23d88756abd Author: Greg Kroah-Hartman Date: Thu Dec 13 13:37:24 2018 +0100 Merge tag 'iio-for-4.21b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Second set of IIO new device support, features and cleanups for the 4.21 cycle. Staging graduation * ad2s90 - Driver for this resolver to digital chip. New drivers and device support. * ad5686 - Add support for ad5310r DAC and associated fix in value read back. * exynos-adc - Support for S5PV210 which is slightly different from other parts. * mcp41010 - Driver supporting MCP41010, MCP41050, MCP41100, MCP42010, MCP42050 and MCP42100 microchip potentiometers. New ACPI ids. * ak8975 - AKM9911 ACPI HID. * kxcjk-1013 - KXJ2109 ACPI HID. - KIOX010A ACPI HID. New features * ad5933 - Explicit DT binding. * ad2s90 - Explicit DT binding including dropping spi setup that is done via dt in favour of verifying the settings form DT. * adt7316 - Explicit DT binding and support for gpio, irq_flags etc. * stm32-adc - Runtime power management. Minor fixes and cleanups * core - Protect against missing info structure. * ad2s90 - SPDX - Add documentation fo the mutex. * ad7280a - Check allocation failure. - Fix an accidental replacement of an error return. * adt7316 - Switch some variables to be local and rename for consistency with other drivers. - Revert a false handling of 0 as an error introduced earlier this cycle. * bmi160 - Use devm functions throughout probe() to avoid need for remove(). * hid-sensor-hub - White space cleanup. * hts221 - MAINTAINERS entry. * lis302 - Use generic name in the DT binding doc. * Messon-saradc - Check for allocation error. - Fix some presented clock names that break clk debugfs. * qcom-spmi-adc - A fix for initialization of the prescale property. Came late in the cycle, so merge window is probably the best route for this. * st_lsm6dsx - Allow for variable read length to support wider range of slave devices. * tag 'iio-for-4.21b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (37 commits) iio: adc: qcom-spmi-adc5: Initialize prescale properly dt-bindings: iio: adc: exynos-adc: Add S5PV210 variant iio: adc: Allow selection of Exynos ADC on S5PV210 iio: adc: exynos-adc: Add S5PV210 variant iio: bmi160: use all devm functions in probe iio: dac: ad5686: fix bit shift read register iio:dac:ad5686: Add AD5310R support Revert "Staging: iio: adt7316: Add an extra check for 'ret' equals to 0" dt-bindings: iio: accel: use a generic node name for lis302 iio: core: check 'info' value before registering the device staging: iio: adc: ad7280a: fix overwrite of the returned value staging: iio: adc: ad7280a: check for devm_kasprint() failure iio: humidity: hts221: add entry in MAINTAINERS file iio: magnetometer: ak8975: Add the "AKM9911" ACPI HID staging:iio:ad2s90: Move out of staging staging:iio:ad2s90: Add comment to device state mutex staging:iio:ad2s90: Replace license text w/ SPDX identifier dt-bindings:iio:resolver: Add docs for ad2s90 staging:iio:ad2s90: Add max frequency check at probe staging:iio:ad2s90: Remove spi setup that should be done via dt ... commit 919261c03e7cae9854f25812d4b529fbfbdb4c14 Author: Andrei.Stefanescu@microchip.com Date: Wed Dec 12 18:31:18 2018 +0000 regulator: mcp16502: add regulator driver for MCP16502 This patch adds a regulator driver for the MCP16502 PMIC. This drivers supports basic operations through the regulator interface such as: - setting/reading voltage - setting/reading operating mode - reading current status Signed-off-by: Andrei Stefanescu Signed-off-by: Mark Brown commit fef9f28a2ea4eff1b203e3ad6629778be20b4714 Author: Andrei.Stefanescu@microchip.com Date: Wed Dec 12 18:31:11 2018 +0000 MAINTAINERS: add maintainer for MCP16502 PMIC driver This patch adds a maintainer for the MCP16502 PMIC driver. Signed-off-by: Andrei Stefanescu Signed-off-by: Mark Brown commit 96f3fb86d70fe64ba88a7f567bafe9c504b87d25 Author: Andrei.Stefanescu@microchip.com Date: Wed Dec 12 18:31:08 2018 +0000 regulator: dt-bindings: add MCP16502 regulator bindings This patch describes the compatible and the device tree bindings necessary for the MCP16502 PMIC. Signed-off-by: Andrei Stefanescu Reviewed-by: Rob Herring Signed-off-by: Mark Brown commit 1b46ed96961db1a826b3e5cadac18c7c4857f054 Author: Jerome Brunet Date: Tue Dec 11 14:47:13 2018 +0100 MAINTAINERS: Add Amlogic sound drivers entry Add sound/soc/meson drivers entry for Amlogic audio drivers. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 5ce5658375e6de2468c4884f7ae474c4ed40a13f Author: Jerome Brunet Date: Tue Dec 11 14:47:12 2018 +0100 ASoC: meson: add axg spdif input Add support for the spdif input decoder of the axg SoC family Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 18dc4665fb6f3bb617c2e6d7da3f19586d06ab17 Author: Jerome Brunet Date: Tue Dec 11 14:47:11 2018 +0100 ASoC: meson: add axg spdif input DT binding documentation Add the DT binding documentation for axg's SPDIF input. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 984463a94d5cb23120bfe7d689077b940c25128b Author: Jerome Brunet Date: Tue Dec 11 14:47:10 2018 +0100 ASoC: meson: axg-toddr: add support for spdifin backend add IEC958_SUBFRAME_LE to the list of format accepted by the fifo frontend. As opposed to what was initially noted in the toddr dai driver, the spdifin does not place the msb at bit 28, it just output a whole spdif subframe. Placing the msb at bit 28 in the toddr driver just filters out the parity, user, channel status and validity bits. It is better to just provide the whole spdif subframe to the userspace and let the iec958 plugin deal with it. Signed-off-by: Jerome Brunet Signed-off-by: Mark Brown commit 62f82df488ce16f7068c7285820b2b7f7dcd7597 Author: Clark Wang Date: Fri Dec 7 02:50:41 2018 +0000 doc: lpspi: Document DT bindings for LPSPI slave mode Add introductions of interrupt-parent and spi-slave. Signed-off-by: Clark Wang Signed-off-by: Mark Brown commit cf86874bb9bdb99ba3620428b59b0408fbc703d0 Author: Clark Wang Date: Fri Dec 7 02:50:38 2018 +0000 spi: lpspi: Let watermark change with send data length Configure watermark to change with the length of the sent data. Support LPSPI sending message shorter than tx/rxfifosize. Signed-off-by: Clark Wang Signed-off-by: Mark Brown commit bcd87317aae26b9ac497cbc1232783aaea1aeed4 Author: Clark Wang Date: Fri Dec 7 02:50:36 2018 +0000 spi: lpspi: Add slave mode support Add slave mode support to the fsl-lpspi driver, only in PIO mode. For now, there are some limitations for slave mode transmission: 1. The stale data in RXFIFO will be dropped when the Slave does any new transfer. 2. One transfer can be finished only after all transfer->len data been transferred to master device 3. Slave device only accepts transfer->len data. Any data longer than this from master device will be dropped. Any data shorter than this from master will cause LPSPI to stuck due to mentioned limitation 2. 4. Only PIO transfer is supported in Slave Mode. Wire connection: GND, SCK, MISO(to MISO of slave), MOSI(to MOSI of slave), SCS Signed-off-by: Clark Wang Signed-off-by: Mark Brown commit 07d71557494c05b0651def1651bf6d7e7f47bbbb Author: Clark Wang Date: Fri Dec 7 02:50:34 2018 +0000 spi: lpspi: Replace all "master" with "controller" In order to enable the slave mode and make the code more readable, replace all related structure names and object names which is named "master" with "controller". Signed-off-by: Clark Wang Signed-off-by: Mark Brown commit eb896a69a0cf3afa69f0983470cc41f9cb04c017 Author: Song Liu Date: Wed Dec 12 09:37:47 2018 -0800 bpf: sync tools/include/uapi/linux/bpf.h Sync bpf.h for nr_prog_tags and prog_tags. Signed-off-by: Song Liu Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit c872bdb38febb4c31ece3599c52cf1f833b89f4e Author: Song Liu Date: Wed Dec 12 09:37:46 2018 -0800 bpf: include sub program tags in bpf_prog_info Changes v2 -> v3: 1. remove check for bpf_dump_raw_ok(). Changes v1 -> v2: 1. Fix error path as Martin suggested. This patch adds nr_prog_tags and prog_tags to bpf_prog_info. This is a reliable way for user space to get tags of all sub programs. Before this patch, user space need to find sub program tags via kallsyms. This feature will be used in BPF introspection, where user space queries information about BPF programs via sys_bpf. Signed-off-by: Song Liu Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit 869858f84a65b646052eff1ec75c1f49e638b62b Author: Nathan Chancellor Date: Thu Dec 13 14:15:20 2018 +0900 ASoC: simple-card: Dereference pointer for memcpy sizeof in asoc_simple_card_probe Commit 4fb7f4df49d3 ("ASoC: simple-card: use cpu/codec pointer on simple_dai_props") updated {cpu,codec}_dai to be pointers in struct simple_dai_props but didn't update these locations to dereference the pointers. This patch fixup it for non DT simple-card use case. Signed-off-by: Nathan Chancellor Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 0ad379ffd654aa4348fdffa33aada4c9de76a22e Merge: 00842be52f201 177e77169b0b7 Author: Daniel Borkmann Date: Thu Dec 13 12:16:31 2018 +0100 Merge branch 'bpf-fix-kptr-checks' Martin KaFai Lau says: ==================== This patch set removes the bpf_dump_raw_ok() guard for the func_info and line_info during bpf_prog_get_info_by_fd(). ==================== Acked-by: Yonghong Song Signed-off-by: Daniel Borkmann commit 177e77169b0b71587c74382d5f2207a16da34790 Author: Martin KaFai Lau Date: Wed Dec 12 10:18:22 2018 -0800 bpf: Remove !func_info and !line_info check from test_btf and bpftool kernel can provide the func_info and line_info even it fails the btf_dump_raw_ok() test because they don't contain kernel address. This patch removes the corresponding '== 0' test. Signed-off-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit 9e794163a69c103633fefb10a3879408d4e4e2c8 Author: Martin KaFai Lau Date: Wed Dec 12 10:18:21 2018 -0800 bpf: Remove bpf_dump_raw_ok() check for func_info and line_info The func_info and line_info have the bpf insn offset but they do not contain kernel address. They will still be useful for the userspace tool to annotate the xlated insn. This patch removes the bpf_dump_raw_ok() guard for the func_info and line_info during bpf_prog_get_info_by_fd(). The guard stays for jited_line_info which contains the kernel address. Although this bpf_dump_raw_ok() guard behavior has started since the earlier func_info patch series, I marked the Fixes tag to the latest line_info patch series which contains both func_info and line_info and this patch is fixing for both of them. Fixes: c454a46b5efd ("bpf: Add bpf_line_info support") Signed-off-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit f0b3f8418711d2e482bd57d6c0b5790947ca6863 Author: Fabio Estevam Date: Thu Dec 13 08:36:38 2018 -0200 ASoC: fsl-sai: Fix typo in "transmitter" Fix the spelling of "transmitter". Signed-off-by: Fabio Estevam Signed-off-by: Mark Brown commit 00842be52f2015c3c1028e16b565f325f4ca20fc Merge: 8f9a8a6193119 907b22365115f Author: Daniel Borkmann Date: Thu Dec 13 12:08:45 2018 +0100 Merge branch 'bpf-bpftool-license-update' Jakub Kicinski says: ==================== We are changing/clarifying the license on bpftool to GPLv2-only + BSD-2-Clause for all files. Current license mix is incompatible with libbfd (which is GPLv3-only) and therefore Debian maintainers are apprehensive about packaging bpftool. Acks include authors of code which has been copied into bpftool (e.g. JSON writer from iproute2, code from tools/bpf, code from BPF samples and selftests, etc.) Thanks again to all the authors who acked the change! ==================== Acked-by: Roman Gushchin Acked-by: YueHaibing Acked-by: Yonghong Song Acked-by: Stanislav Fomichev Acked-by: Sean Young Acked-by: Jiri Benc Acked-by: David Calavera Acked-by: Andrey Ignatov Acked-by: Joe Stringer Acked-by: David Ahern Acked-by: Alexei Starovoitov Acked-by: Petar Penkov Acked-by: Sandipan Das Acked-by: Prashant Bhole Acked-by: Stephen Hemminger Acked-by: John Fastabend Acked-by: Taeung Song Acked-by: Jiri Olsa Acked-by: Daniel Borkmann CC: okash.khawaja@gmail.com Signed-off-by: Daniel Borkmann commit 907b22365115fb86196152909915108d7c8243d1 Author: Jakub Kicinski Date: Wed Dec 12 19:59:26 2018 -0800 tools: bpftool: dual license all files Currently bpftool contains a mix of GPL-only and GPL or BSD2 licensed files. Make sure all files are dual licensed under GPLv2 and BSD-2-Clause. Signed-off-by: Jakub Kicinski Acked-by: Roman Gushchin Acked-by: YueHaibing Acked-by: Yonghong Song Acked-by: Stanislav Fomichev Acked-by: Sean Young Acked-by: Jiri Benc Acked-by: David Calavera Acked-by: Andrey Ignatov Acked-by: Joe Stringer Acked-by: David Ahern Acked-by: Alexei Starovoitov Acked-by: Petar Penkov Acked-by: Sandipan Das Acked-by: Prashant Bhole Acked-by: Stephen Hemminger Acked-by: John Fastabend Acked-by: Taeung Song Acked-by: Jiri Olsa Acked-by: Daniel Borkmann CC: okash.khawaja@gmail.com Signed-off-by: Daniel Borkmann commit 02ff58dcf70ad7d11b01523dc404166ed11021da Author: Jakub Kicinski Date: Wed Dec 12 19:59:25 2018 -0800 tools: bpftool: replace Netronome boilerplate with SPDX license headers Replace the repeated license text with SDPX identifiers. Signed-off-by: Jakub Kicinski Acked-by: Roman Gushchin Acked-by: YueHaibing Acked-by: Yonghong Song Acked-by: Stanislav Fomichev Acked-by: Sean Young Acked-by: Jiri Benc Acked-by: David Calavera Acked-by: Andrey Ignatov Acked-by: Joe Stringer Acked-by: David Ahern Acked-by: Alexei Starovoitov Acked-by: Petar Penkov Acked-by: Sandipan Das Acked-by: Prashant Bhole Acked-by: Stephen Hemminger Acked-by: John Fastabend Acked-by: Taeung Song Acked-by: Jiri Olsa Acked-by: Daniel Borkmann CC: okash.khawaja@gmail.com Signed-off-by: Daniel Borkmann commit afc7c944ef828b431c564818f8cbc80f3e16f0d6 Author: Jakub Kicinski Date: Wed Dec 12 19:59:24 2018 -0800 tools: bpftool: fix SPDX format in headers Documentation/process/license-rules.rst sayeth: 2. Style: The SPDX license identifier is added in form of a comment. The comment style depends on the file type:: C source: // SPDX-License-Identifier: C header: /* SPDX-License-Identifier: */ Headers should use C comment style. Signed-off-by: Jakub Kicinski Acked-by: Roman Gushchin Acked-by: YueHaibing Acked-by: Yonghong Song Acked-by: Stanislav Fomichev Acked-by: Sean Young Acked-by: Jiri Benc Acked-by: David Calavera Acked-by: Andrey Ignatov Acked-by: Joe Stringer Acked-by: David Ahern Acked-by: Alexei Starovoitov Acked-by: Petar Penkov Acked-by: Sandipan Das Acked-by: Prashant Bhole Acked-by: Stephen Hemminger Acked-by: John Fastabend Acked-by: Taeung Song Acked-by: Jiri Olsa Acked-by: Daniel Borkmann CC: okash.khawaja@gmail.com Signed-off-by: Daniel Borkmann commit add6883619a9e3bf9658eaff1a547354131bbcd9 Author: Fabio Estevam Date: Thu Dec 13 00:08:38 2018 -0200 ASoC: fsl: Fix SND_SOC_EUKREA_TLV320 build error on i.MX8M eukrea-tlv320.c machine driver runs on non-DT platforms and include header file in order to be able to use some machine_is_eukrea_xxx() macros. Building it for ARM64 causes the following build error: sound/soc/fsl/eukrea-tlv320.c:28:10: fatal error: asm/mach-types.h: No such file or directory Avoid this error by not allowing to build the SND_SOC_EUKREA_TLV320 driver when ARM64 is selected. This is needed in preparation for the i.MX8M support. Reported-by: kbuild test robot Signed-off-by: Fabio Estevam Acked-by: Shawn Guo Signed-off-by: Mark Brown commit 00c9fe37a7f27a306bcaa5737f0787fe139f8aba Author: Eric Biggers Date: Mon Dec 10 11:45:58 2018 -0800 crypto: adiantum - fix leaking reference to hash algorithm crypto_alg_mod_lookup() takes a reference to the hash algorithm but crypto_init_shash_spawn() doesn't take ownership of it, hence the reference needs to be dropped in adiantum_create(). Fixes: 059c2a4d8e16 ("crypto: adiantum - add Adiantum support") Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 0ac6b8fb23c724b015d9ca70a89126e8d1563166 Author: Eric Biggers Date: Thu Dec 6 15:55:41 2018 -0800 crypto: user - support incremental algorithm dumps CRYPTO_MSG_GETALG in NLM_F_DUMP mode sometimes doesn't return all registered crypto algorithms, because it doesn't support incremental dumps. crypto_dump_report() only permits itself to be called once, yet the netlink subsystem allocates at most ~64 KiB for the skb being dumped to. Thus only the first recvmsg() returns data, and it may only include a subset of the crypto algorithms even if the user buffer passed to recvmsg() is large enough to hold all of them. Fix this by using one of the arguments in the netlink_callback structure to keep track of the current position in the algorithm list. Then userspace can do multiple recvmsg() on the socket after sending the dump request. This is the way netlink dumps work elsewhere in the kernel; it's unclear why this was different (probably just an oversight). Also fix an integer overflow when calculating the dump buffer size hint. Fixes: a38f7907b926 ("crypto: Add userspace configuration API") Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit c6018e1a00b5c70610cdfb3650cc5622c917ed17 Author: Eric Biggers Date: Thu Dec 6 14:21:59 2018 -0800 crypto: adiantum - adjust some comments to match latest paper The 2018-11-28 revision of the Adiantum paper has revised some notation: - 'M' was replaced with 'L' (meaning "Left", for the left-hand part of the message) in the definition of Adiantum hashing, to avoid confusion with the full message - ε-almost-∆-universal is now abbreviated as ε-∆U instead of εA∆U - "block" is now used only to mean block cipher and Poly1305 blocks Also, Adiantum hashing was moved from the appendix to the main paper. To avoid confusion, update relevant comments in the code to match. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 282c14852d00d6d1b8fadf3e01e4180f02ddda84 Author: Eric Biggers Date: Thu Dec 6 13:00:08 2018 -0800 crypto: xchacha20 - fix comments for test vectors The kernel's ChaCha20 uses the RFC7539 convention of the nonce being 12 bytes rather than 8, so actually I only appended 12 random bytes (not 16) to its test vectors to form 24-byte nonces for the XChaCha20 test vectors. The other 4 bytes were just from zero-padding the stream position to 8 bytes. Fix the comments above the test vectors. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 5569e8c07447344cdc3771378ba4e0da0b94c2a4 Author: Eric Biggers Date: Thu Dec 6 12:31:54 2018 -0800 crypto: xchacha - add test vector from XChaCha20 draft RFC There is a draft specification for XChaCha20 being worked on. Add the XChaCha20 test vector from the appendix so that we can be extra sure the kernel's implementation is compatible. I also recomputed the ciphertext with XChaCha12 and added it there too, to keep the tests for XChaCha20 and XChaCha12 in sync. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit a033aed5a84eb93a32929b6862602cb283d39e82 Author: Eric Biggers Date: Tue Dec 4 22:20:05 2018 -0800 crypto: x86/chacha - yield the FPU occasionally To improve responsiveness, yield the FPU (temporarily re-enabling preemption) every 4 KiB encrypted/decrypted, rather than keeping preemption disabled during the entire encryption/decryption operation. Alternatively we could do this for every skcipher_walk step, but steps may be small in some cases, and yielding the FPU is expensive on x86. Suggested-by: Martin Willi Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 7a507d62258afd514583fadf1482451079fa0e4d Author: Eric Biggers Date: Tue Dec 4 22:20:04 2018 -0800 crypto: x86/chacha - add XChaCha12 support Now that the x86_64 SIMD implementations of ChaCha20 and XChaCha20 have been refactored to support varying the number of rounds, add support for XChaCha12. This is identical to XChaCha20 except for the number of rounds, which is 12 instead of 20. This can be used by Adiantum. Reviewed-by: Martin Willi Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 8b65f34c5821e7361488dc668d21195ea4c9f14d Author: Eric Biggers Date: Tue Dec 4 22:20:03 2018 -0800 crypto: x86/chacha20 - refactor to allow varying number of rounds In preparation for adding XChaCha12 support, rename/refactor the x86_64 SIMD implementations of ChaCha20 to support different numbers of rounds. Reviewed-by: Martin Willi Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 4af78261870a7d36dd222af8dad9688b705e365e Author: Eric Biggers Date: Tue Dec 4 22:20:02 2018 -0800 crypto: x86/chacha20 - add XChaCha20 support Add an XChaCha20 implementation that is hooked up to the x86_64 SIMD implementations of ChaCha20. This can be used by Adiantum. An SSSE3 implementation of single-block HChaCha20 is also added so that XChaCha20 can use it rather than the generic implementation. This required refactoring the ChaCha permutation into its own function. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 0f961f9f670e7c07690bfde2f533b93c653569cc Author: Eric Biggers Date: Tue Dec 4 22:20:01 2018 -0800 crypto: x86/nhpoly1305 - add AVX2 accelerated NHPoly1305 Add a 64-bit AVX2 implementation of NHPoly1305, an ε-almost-∆-universal hash function used in the Adiantum encryption mode. For now, only the NH portion is actually AVX2-accelerated; the Poly1305 part is less performance-critical so is just implemented in C. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 012c82388c032cd4a9821e11bae336cf4a014822 Author: Eric Biggers Date: Tue Dec 4 22:20:00 2018 -0800 crypto: x86/nhpoly1305 - add SSE2 accelerated NHPoly1305 Add a 64-bit SSE2 implementation of NHPoly1305, an ε-almost-∆-universal hash function used in the Adiantum encryption mode. For now, only the NH portion is actually SSE2-accelerated; the Poly1305 part is less performance-critical so is just implemented in C. Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit b299362ee48db8eab34208302ee9730ff9d6091c Author: Eric Biggers Date: Tue Dec 4 16:46:54 2018 -0800 crypto: adiantum - propagate CRYPTO_ALG_ASYNC flag to instance If the stream cipher implementation is asynchronous, then the Adiantum instance must be flagged as asynchronous as well. Otherwise someone asking for a synchronous algorithm can get an asynchronous algorithm. There are no asynchronous xchacha12 or xchacha20 implementations yet which makes this largely a theoretical issue, but it should be fixed. Fixes: 059c2a4d8e16 ("crypto: adiantum - add Adiantum support") Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 2fe55987b2624a86a5c709a8df65d4de2608dc07 Author: Ard Biesheuvel Date: Tue Dec 4 14:13:33 2018 +0100 crypto: arm64/chacha - use combined SIMD/ALU routine for more speed To some degree, most known AArch64 micro-architectures appear to be able to issue ALU instructions in parellel to SIMD instructions without affecting the SIMD throughput. This means we can use the ALU to process a fifth ChaCha block while the SIMD is processing four blocks in parallel. Signed-off-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit f2ca1cbd0fb584b5b5e0dbd9bda819f49cf9cdb6 Author: Ard Biesheuvel Date: Tue Dec 4 14:13:32 2018 +0100 crypto: arm64/chacha - optimize for arbitrary length inputs Update the 4-way NEON ChaCha routine so it can handle input of any length >64 bytes in its entirety, rather than having to call into the 1-way routine and/or memcpy()s via temp buffers to handle the tail of a ChaCha invocation that is not a multiple of 256 bytes. On inputs that are a multiple of 256 bytes (and thus in tcrypt benchmarks), performance drops by around 1% on Cortex-A57, while performance for inputs drawn randomly from the range [64, 1024) increases by around 30%. Signed-off-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit ee5bbc9fd3a1fb81e9f6103d6c52ab88926a9603 Author: Ard Biesheuvel Date: Tue Dec 4 14:13:31 2018 +0100 crypto: tcrypt - add block size of 1472 to skcipher template In order to have better coverage of algorithms operating on block sizes that are in the ballpark of a VPN packet, add 1472 to the block_sizes array. Signed-off-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit cf718eaa8f9b2cb8a372dcfd5ef701188e233558 Author: Srikanth, Jampala Date: Tue Dec 4 12:55:54 2018 +0000 crypto: cavium/nitrox - Enabled Mailbox support Enabled the PF->VF Mailbox support. Mailbox message are interpreted as {type, opcode, data}. Supported message types are REQ, ACK and NACK. Signed-off-by: Srikanth Jampala Signed-off-by: Herbert Xu commit 19c11c97c39f5c6280b4d523ea170ef9a8f7ed12 Author: Eric Biggers Date: Mon Dec 3 19:52:52 2018 -0800 crypto: arm64/chacha - add XChaCha12 support Now that the ARM64 NEON implementation of ChaCha20 and XChaCha20 has been refactored to support varying the number of rounds, add support for XChaCha12. This is identical to XChaCha20 except for the number of rounds, which is 12 instead of 20. This can be used by Adiantum. Reviewed-by: Ard Biesheuvel Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit 95a34b779e2a45b14e73cee1e7eec11870efb2ea Author: Eric Biggers Date: Mon Dec 3 19:52:51 2018 -0800 crypto: arm64/chacha20 - refactor to allow varying number of rounds In preparation for adding XChaCha12 support, rename/refactor the ARM64 NEON implementation of ChaCha20 to support different numbers of rounds. Reviewed-by: Ard Biesheuvel Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit cc7cf991e9eb54cac7733dc7d8f3a8591ba6e1c3 Author: Eric Biggers Date: Mon Dec 3 19:52:50 2018 -0800 crypto: arm64/chacha20 - add XChaCha20 support Add an XChaCha20 implementation that is hooked up to the ARM64 NEON implementation of ChaCha20. This can be used by Adiantum. A NEON implementation of single-block HChaCha20 is also added so that XChaCha20 can use it rather than the generic implementation. This required refactoring the ChaCha20 permutation into its own function. Signed-off-by: Eric Biggers Reviewed-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit a00fa0c88774bea9a102fc616598d9ee52765451 Author: Eric Biggers Date: Mon Dec 3 19:52:49 2018 -0800 crypto: arm64/nhpoly1305 - add NEON-accelerated NHPoly1305 Add an ARM64 NEON implementation of NHPoly1305, an ε-almost-∆-universal hash function used in the Adiantum encryption mode. For now, only the NH portion is actually NEON-accelerated; the Poly1305 part is less performance-critical so is just implemented in C. Reviewed-by: Ard Biesheuvel Tested-by: Ard Biesheuvel # big-endian Signed-off-by: Eric Biggers Signed-off-by: Herbert Xu commit ec10574d00da0d8b6ec9d0099410aae8aad4695a Merge: a7b1868a5f473 4868d2b662f55 Author: Martin Schwidefsky Date: Thu Dec 13 10:44:18 2018 +0100 Merge tag 'vfio-ccw-20181213' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw into features Pull vfio-ccw from Cornelia Huck with the following changes: - remove unneeded BOXED state - maintainership changes commit a7b1868a5f473fb93d912a618883cef0d43653b9 Author: Harald Freudenberger Date: Thu Nov 29 11:50:16 2018 +0100 s390/zcrypt: rework ap scan bus code Rework of the AP bus scan code. The ap_scan_bus() function is large, so this patch splits the code by introducing a new new function _ap_scan_bus_adapter() which deals with just one adapter and thus reduces the scan function code complexity. Now the AP bus scan can handle a type change of an crypto adapter on the fly (e.g. from CEX5 to CEX6). This may be the case with newer versions of zVM where the card may be pure virtual and a type change is just one click. However a type or function change requires to unregister all queue devices and the card device and re-register them. Comments around the AP bus scan code have been added and/or improved to provide some hopefully useful hints about what the code is actually doing. Signed-off-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky commit 42a87d4103ae365e18c3be1333592ab583b8ad9d Author: Harald Freudenberger Date: Mon Nov 26 15:50:04 2018 +0100 s390/zcrypt: make sysfs reset attribute trigger queue reset Until now there is no way to reset a AP queue or card. Driving a card or queue offline and online again does only toggle the 'software' online state. The only way to trigger a (hardware) reset is by running hot-unplug/hot-plug for example on the HMC. This patch makes the queue reset attribute in sysfs writable. Writing into this attribute triggers a reset on the AP queue's state machine. So the AP queue is flushed and state machine runs through the initial states which cause a reset (PQAP(RAPQ)) and a re-registration to interrupts (PQAP(AQIC)) if available. The reset sysfs attribute is writable by root only. So only an administrator is allowed to initiate a reset of AP queues. Please note that the queue's counter values are left untouched by the reset. Signed-off-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky commit 98dfd32620e970eb576ebce5ea39d905cb005e72 Author: Sebastian Ott Date: Thu Oct 18 11:11:08 2018 +0200 s390/pci: fix sleeping in atomic during hotplug When triggered by pci hotplug (PEC 0x306) clp_get_state is called with spinlocks held resulting in the following warning: zpci: n/a: Event 0x306 reconfigured PCI function 0x0 BUG: sleeping function called from invalid context at mm/page_alloc.c:4324 in_atomic(): 1, irqs_disabled(): 0, pid: 98, name: kmcheck 2 locks held by kmcheck/98: Change the allocation to use GFP_ATOMIC. Cc: stable@vger.kernel.org # 4.13+ Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky commit 9594ca6b87d9f11e9f14ac31581e0e5d79a8e839 Author: Sebastian Ott Date: Tue Oct 30 14:04:46 2018 +0100 s390/pci: remove bit_lock usage in interrupt handler The interrupt handler uses bit_spin_lock around a call to retrieve per irq data (the irq number). However this per irq data is only set during irq setup time and never changed until the irq is freed. Thus it's safe to remove the lock usage. Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky commit 87ccdcfa9c706be835fea226eda0b1ae9c671413 Author: Sebastian Ott Date: Mon Dec 3 13:19:12 2018 +0100 s390/drivers: fix proc/debugfs file permissions Remove write permissions for fops without a write callback. Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky commit ca92b93d17f8c546d10ae175430fb22d6bd2d60b Author: Yangtao Li Date: Sat Dec 1 22:28:11 2018 -0500 s390: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky commit b0c4b9f35555f02d2d8a701cd336b432415b1a55 Author: Mesih Kilinc Date: Sun Dec 2 23:23:41 2018 +0300 irqchip/sun4i: Add support for Allwinner ARMv5 F1C100s This patch adds support for suniv Allwinner ARMv5 F1C100s SoC which has stripped version of interrupt controller that found in A10/A13. Signed-off-by: Mesih Kilinc Acked-by: Maxime Ripard Signed-off-by: Marc Zyngier commit d4fc2ea0f0f883539d91e5e38263e143bc249774 Author: Mesih Kilinc Date: Sun Dec 2 23:23:40 2018 +0300 irqchip/sun4i: Move IC specific register offsets to struct This patch moves IC specific register offsets to sun4i_irq_chip_data struct in order to support different chips. Signed-off-by: Mesih Kilinc Acked-by: Maxime Ripard Signed-off-by: Marc Zyngier commit 177304cf9286355a6f383f8340bf81fbe37ccd6c Author: Mesih Kilinc Date: Sun Dec 2 23:23:39 2018 +0300 irqchip/sun4i: Add a struct to hold global variables In order to support different chips, IC specific data should be hold in a struct. This patch moves irq_base and irq_domain global variables to struct. Signed-off-by: Mesih Kilinc Acked-by: Maxime Ripard Signed-off-by: Marc Zyngier commit a15b7439083c30030f6269c4c0ec70af57949109 Author: Mesih Kilinc Date: Sun Dec 2 23:23:38 2018 +0300 dt-bindings: interrupt-controller: Add suniv interrupt-controller Add compatible string for Alwinner suniv F1C100s SoC interrupt controller which is stripped version of sun4i Signed-off-by: Mesih Kilinc Acked-by: Maxime Ripard Reviewed-by: Rob Herring Signed-off-by: Marc Zyngier commit d852e62ad689a4be2e48c4a9c8926f53a7894942 Author: Manivannan Sadhasivam Date: Mon Dec 10 23:05:43 2018 +0530 irqchip: Add RDA8810PL interrupt driver Add interrupt driver for RDA Micro RDA8810PL SoC. Signed-off-by: Andreas Färber Signed-off-by: Manivannan Sadhasivam Reviewed-by: Marc Zyngier Signed-off-by: Marc Zyngier commit cdf6179630a5aa877fba986e1c5dc91f2285eb08 Author: Manivannan Sadhasivam Date: Mon Dec 10 23:05:39 2018 +0530 dt-bindings: interrupt-controller: Document RDA8810PL intc Document interrupt controller in RDA Micro RDA8810PL SoC. Signed-off-by: Manivannan Sadhasivam Reviewed-by: Rob Herring Signed-off-by: Marc Zyngier commit f9c75bca44d4754456cba7d3b4f0e15518177b0e Author: Yangtao Li Date: Fri Nov 23 11:54:18 2018 -0500 irqchhip: Convert to using %pOFn instead of device_node.name In preparation to remove the node name pointer from struct device_node, convert printf users to use the %pOFn format specifier. Signed-off-by: Yangtao Li Signed-off-by: Marc Zyngier commit ed01edc0ab6fec0ff675a6b16ccf7069bde98769 Author: Andrey Smirnov Date: Wed Dec 5 23:31:25 2018 -0800 irqchip/irq-imx-gpcv2: Add support for i.MX8MQ Add code needed to support i.MX8MQ. Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Zyngier Cc: cphealy@gmail.com Cc: l.stach@pengutronix.de Cc: Leonard Crestez Cc: "A.s. Dong" Cc: Richard Zhu Cc: linux-imx@nxp.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrey Smirnov Signed-off-by: Marc Zyngier commit fb7348abb119e9ac497c95bec6615c6e56619c2e Author: Andrey Smirnov Date: Wed Dec 5 23:31:24 2018 -0800 irqchip/irq-imx-gpcv2: Make error messages more consistent Make error messages more consistent by making sure each starts with "%pOF:". Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Zyngier Cc: cphealy@gmail.com Cc: l.stach@pengutronix.de Cc: Leonard Crestez Cc: "A.s. Dong" Cc: Richard Zhu Cc: linux-imx@nxp.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrey Smirnov Signed-off-by: Marc Zyngier commit f2dace5f972576040477cc8a559254facebd3e10 Author: Andrey Smirnov Date: Wed Dec 5 23:31:23 2018 -0800 irqchip/irq-imx-gpcv2: Make use of BIT() macro Convert all instances of 1 << x to BIT(x) for consistency with other kernel code. Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Zyngier Cc: cphealy@gmail.com Cc: l.stach@pengutronix.de Cc: Leonard Crestez Cc: "A.s. Dong" Cc: Richard Zhu Cc: linux-imx@nxp.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrey Smirnov Signed-off-by: Marc Zyngier commit bd654fb67acf737952e97822c8681dbcf4b6d462 Author: Andrey Smirnov Date: Wed Dec 5 23:31:22 2018 -0800 irqchip/irq-imx-gpcv2: Share reg offset calculation code Move identical offset calculation code into a small helper function and make use of it in the rest of the code. Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Zyngier Cc: cphealy@gmail.com Cc: l.stach@pengutronix.de Cc: Leonard Crestez Cc: "A.s. Dong" Cc: Richard Zhu Cc: linux-imx@nxp.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrey Smirnov Signed-off-by: Marc Zyngier commit b87442b0745e9d54889caa8c9f28528cb8abac9d Author: Andrey Smirnov Date: Wed Dec 5 23:31:21 2018 -0800 irqchip/irq-imx-gpcv2: Remove unused code Varaible 'reg' in imx_gpcv2_irq_set_wake() has no users. Remove it. Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Zyngier Cc: cphealy@gmail.com Cc: l.stach@pengutronix.de Cc: Leonard Crestez Cc: "A.s. Dong" Cc: Richard Zhu Cc: linux-imx@nxp.com Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Andrey Smirnov Signed-off-by: Marc Zyngier commit bf9732857ba58d4c3fdedcf793783030b4ad388f Author: Kuninori Morimoto Date: Wed Dec 5 08:25:00 2018 +0000 irqchip/irq-renesas-intc-irqpin: Convert to SPDX identifiers This patch updates license to use SPDX-License-Identifier instead of verbose license text. Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman Signed-off-by: Marc Zyngier commit e25a96d708fde7ab66e96eb53a41ffeffa02dd49 Author: Kuninori Morimoto Date: Wed Dec 5 08:24:48 2018 +0000 irqchip/irq-renesas-irqc: Convert to SPDX identifiers This patch updates license to use SPDX-License-Identifier instead of verbose license text. Signed-off-by: Kuninori Morimoto Reviewed-by: Simon Horman Signed-off-by: Marc Zyngier commit 7728819c2190decbb871e08362d92c2409f9faa5 Author: Stefan Wahren Date: Sat Nov 10 16:54:23 2018 +0100 irqchip: bcm283x: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Cc: Simon Arlott Cc: Eric Anholt Signed-off-by: Stefan Wahren Signed-off-by: Marc Zyngier commit 06459901d55ee2f690b8e1fe084fb03061d617cf Author: Bartosz Golaszewski Date: Fri Nov 9 18:21:32 2018 +0100 irq/irq_sim: Store multiple interrupt offsets in a bitmap Two threads can try to fire the irq_sim with different offsets and will end up fighting for the irq_work asignment. Thomas Gleixner suggested a solution based on a bitfield where we set a bit for every offset associated with an interrupt that should be fired and then iterate over all set bits in the interrupt handler. This is a slightly modified solution using a bitmap so that we don't impose a limit on the number of interrupts one can allocate with irq_sim. Suggested-by: Thomas Gleixner Signed-off-by: Bartosz Golaszewski Signed-off-by: Marc Zyngier commit 81b1e6e6a8590a19257e37a1633bec098d499c57 Author: Miquel Raynal Date: Thu Oct 11 11:12:34 2018 +0200 platform-msi: Free descriptors in platform_msi_domain_free() Since the addition of platform MSI support, there were two helpers supposed to allocate/free IRQs for a device: platform_msi_domain_alloc_irqs() platform_msi_domain_free_irqs() In these helpers, IRQ descriptors are allocated in the "alloc" routine while they are freed in the "free" one. Later, two other helpers have been added to handle IRQ domains on top of MSI domains: platform_msi_domain_alloc() platform_msi_domain_free() Seen from the outside, the logic is pretty close with the former helpers and people used it with the same logic as before: a platform_msi_domain_alloc() call should be balanced with a platform_msi_domain_free() call. While this is probably what was intended to do, the platform_msi_domain_free() does not remove/free the IRQ descriptor(s) created/inserted in platform_msi_domain_alloc(). One effect of such situation is that removing a module that requested an IRQ will let one orphaned IRQ descriptor (with an allocated MSI entry) in the device descriptors list. Next time the module will be inserted back, one will observe that the allocation will happen twice in the MSI domain, one time for the remaining descriptor, one time for the new one. It also has the side effect to quickly overshoot the maximum number of allocated MSI and then prevent any module requesting an interrupt in the same domain to be inserted anymore. This situation has been met with loops of insertion/removal of the mvpp2.ko module (requesting 15 MSIs each time). Fixes: 552c494a7666 ("platform-msi: Allow creation of a MSI-based stacked irq domain") Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Signed-off-by: Marc Zyngier commit 5b5bb7c77a87fd0f1b887dd3d44abf7d0fd579e7 Merge: 651022382c7f8 d0618247a80f0 Author: Stephen Boyd Date: Thu Dec 13 01:07:54 2018 -0800 Merge tag 'v4.21-rockchip-clk-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into clk-rockchip Pull rockchip clk driver updates from Heiko Stuebner: - register fixes for rk3188 and rk3328 - one new critical clock for rk3188 and a fixed clock id (double used number) - new clock id for rk3328 * tag 'v4.21-rockchip-clk-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: clk: rockchip: add clock-id to gate of ACODEC for rk3328 clk: rockchip: add clock ID of ACODEC for rk3328 clk: rockchip: fix ID of 8ch clock of I2S1 for rk3328 clk: rockchip: fix I2S1 clock gate register for rk3328 clk: rockchip: make rk3188 hclk_vio_bus critical clk: rockchip: fix rk3188 sclk_mac_lbtest parameter ordering clk: rockchip: fix rk3188 sclk_smc gate data clk: rockchip: fix typo in rk3188 spdif_frac parent commit 48cc8f7a1d5a4b1c5b32de5ad8a53b1c9194c6d5 Author: Christoph Hellwig Date: Wed Dec 12 17:09:58 2018 +0100 sparc: use DT node full_name in sparc_dma_alloc_resource The sparc tree already has this change for the pre-refactored code, but pulling it into the dma-mapping tree like this should ease the merge conflicts a bit. Signed-off-by: Christoph Hellwig Acked-by: Sam Ravnborg Acked-by: David Miller commit e74581b79ddd9b49b8c61e2791fc4dffc0245afb Merge: 8913e8a73d034 f03566d0aa79f Author: Stephen Boyd Date: Thu Dec 13 01:05:44 2018 -0800 Merge tag 'meson-clk-4.21-2' of https://github.com/BayLibre/clk-meson into clk-meson Pull more meson clk driver updates from Neil Armstrong: - Fix GXL HDMI Pll fractional bits (from first round) - Add the Meson8/Meson8b video clocks - Add clk-input helper and use it for axg-audio clock driver * tag 'meson-clk-4.21-2' of https://github.com/BayLibre/clk-meson: clk: meson: axg-audio: use the clk input helper function clk: meson: add clk-input helper function clk: meson: meson8b: add the read-only video clock trees clk: meson: meson8b: add the fractional divider for vid_pll_dco clk: meson: meson8b: fix the offset of vid_pll_dco's N value clk: meson: Fix GXL HDMI PLL fractional bits width commit b65bb777ef2237030f2802f2263ae9a0108f7acf Author: Sagi Grimberg Date: Tue Dec 11 23:38:58 2018 -0800 nvme-rdma: support separate queue maps for read and write llow NVMF_OPT_NR_WRITE_QUEUES to describe additional write queues. In addition, implement .map_queues that will apply 2 queue maps for read and write queue sets. Note that with the separate queue map, HCTX_TYPE_READ will always use nr_io_queues and HCTX_TYPE_DEFAULT will use nr_write_queues. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 873946f4b957bf6e6a0351dd5282c73e0c870be9 Author: Sagi Grimberg Date: Tue Dec 11 23:38:57 2018 -0800 nvme-tcp: support separate queue maps for read and write Allow NVMF_OPT_NR_WRITE_QUEUES to describe additional write queues. In addition, implement .map_queues that will apply 2 queue maps for read and write queue sets. Note that with the separate queue map, HCTX_TYPE_READ will always use nr_io_queues and HCTX_TYPE_DEFAULT will use nr_write_queues. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 330f6b8a70771f0b059b7bcbc9a28d8023235b55 Author: Sagi Grimberg Date: Tue Dec 11 23:38:56 2018 -0800 nvme-fabrics: allow user to set nr_write_queues for separate queue maps This argument will specify how many I/O queues will be connected in create_ctrl in addition to nr_io_queues. With this configuration, I/O that carries payload from the host to the target, will use the default hctx queue map, and I/O that involves target to host transfers will use the read hctx queue map. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit fa9a1811e094658e53b0c82b6ce0431c4c54fc1b Author: Sagi Grimberg Date: Tue Dec 11 23:38:55 2018 -0800 nvme-fabrics: add missing nvmf_ctrl_options documentation Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit e42b3867de4bd5ee3a1849afb68a1fa8627f7282 Author: Sagi Grimberg Date: Tue Dec 11 23:38:54 2018 -0800 blk-mq-rdma: pass in queue map to blk_mq_rdma_map_queues Will be used by nvme-rdma for queue map separation support. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 23454d59cc16ddddf4b2290bbe60d2d9581dfd9a Author: Chaitanya Kulkarni Date: Wed Dec 12 15:11:48 2018 -0800 nvmet: update smart log with num err log entries Now that we have error log page implementation update smart log command handler to provide number of error log entries in the lifetime of the controller field. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 11ad507784ed5113af97903af1b0c4aea6b90690 Author: Chaitanya Kulkarni Date: Wed Dec 12 15:11:47 2018 -0800 nvmet: add error log page cmd handler Now that we have support for all the major parts of the target we add a NVMe error log page handler so that host can read the log page. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit c6aa3542e01026a94d24713ee2c0dce517e9b6de Author: Chaitanya Kulkarni Date: Wed Dec 12 15:11:43 2018 -0800 nvmet: add error log support for file backend This patch adds support for the file backend to populate the error log entries. Here we map the errno to the NVMe status codes. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 3b031d15995f3e4c43e38159072f07efe3fa35d9 Author: Chaitanya Kulkarni Date: Wed Dec 12 15:11:42 2018 -0800 nvmet: add error log support for bdev backend This patch adds the support for the block device backend to populate the error log entries. Here we map the blk_status_t to the NVMe status. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 2da6e00580f5bc13ed0ba0acaa9d7ce0df226e7e Author: Chaitanya Kulkarni Date: Wed Dec 12 15:11:46 2018 -0800 nvmet: add error log support for admin-cmd This patch adds the support to maintain the error log page for admin commands. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 762a11dfee10783a2fe4c467a68bac601e5acf1c Author: Chaitanya Kulkarni Date: Wed Dec 12 15:11:45 2018 -0800 nvmet: add error log support for rdma backend This patch adds the support to maintain the error log page for rdma transport, we mainly focus here on the NVME_INVALID_FIELD errors. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 84faf42b8aff3be95d96249da4152c77d81e1469 Author: Chaitanya Kulkarni Date: Wed Dec 12 15:11:44 2018 -0800 nvmet: add error log support for fabrics-cmd This patch adds the support to maintain error log page for the fabrics prop get, prop set, and admin connect commands. Here we also update the discovery.c and add update set/get features and parse functions to support error log page. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit e81446afc7f5ee45fd90b1b5a22ffa247dca5b15 Author: Chaitanya Kulkarni Date: Wed Dec 12 15:11:41 2018 -0800 nvmet: add error log support in the core This patch adds the support to maintain error log page for the nvmet-core. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 76574f37bf4caa7150ea1559cd98e3017b9752d2 Author: Chaitanya Kulkarni Date: Wed Dec 12 15:11:40 2018 -0800 nvmet: add interface to update error-log page This patch adds nvmet_req based interface to the nvmet-core so that we can update the error log page. We update error log page in the request completion path when status is not set to NVME_SC_SUCCESS. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit e4a976254ec5ebdcdb3e1e1b40e795b3db6b6dab Author: Chaitanya Kulkarni Date: Wed Dec 12 15:11:39 2018 -0800 nvmet: add error-log definitions This patch adds necessary fields in the target data structures to support error log page. For a target controller, we add a new error log field to maintain the error log, at any given point we maintain error entries equal to NVMET_ERROR_LOG_SLOTS for each controller. In the following patch, we also update the error log page entry in the I/O completion path so we introduce a spinlock for synchronization of the log. For nvmet_req, we add a new field error_loc to hold the location of the error in the command when the actual error occurs for each request and a starting LBA if applicable. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit b34de7cee0a65f2557bb05447fbe2cc7a9c46750 Author: Chaitanya Kulkarni Date: Wed Dec 12 15:11:38 2018 -0800 nvme: add error log page slot definition This patch adds the NVMe error slot definition from the spec. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit b7c8f3663d0e0773aca3324c26bce3ca8343ec14 Author: Chaitanya Kulkarni Date: Wed Dec 12 15:11:37 2018 -0800 nvme: remove nvme_common command cdw10 array This is a preparation patch which removes the nvme common command cdw10 array and replace with individual fields. This is needed for the nvmet error log page implementation make is error log page entry offset assignment easier. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 16d3a280d4d73eae786ebf2576cd597a031bc9df Author: Sagi Grimberg Date: Wed Dec 12 23:01:54 2018 -0800 nvmet: remove unused variable Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit cb5b7262b011cfb793519bf97e54dff5282da23c Author: Jens Axboe Date: Wed Dec 12 09:18:11 2018 -0700 nvme: provide fallback for discard alloc failure When boxes are run near (or to) OOM, we have a problem with the discard page allocation in nvme. If we fail allocating the special page, we return busy, and it'll get retried. But since ordering is honored for dispatch requests, we can keep retrying this same IO and failing. Behind that IO could be requests that want to free memory, but they never get the chance. Allocate a fixed discard page per controller for a safe fallback, and use that if the initial allocation fails. Signed-off-by: Jens Axboe Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 8eb5d89f483141dd076529bf5f6aa235b425886e Author: Chengguang Xu Date: Tue Dec 11 07:24:34 2018 +0800 nvme: add __exit annotation Add __exit annotation to cleanup helper which is only called once in the module. Signed-off-by: Chengguang Xu Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 3f2304f8c6d6ed97849057bd16fee99e434ca796 Author: Sagi Grimberg Date: Mon Dec 3 17:52:17 2018 -0800 nvme-tcp: add NVMe over TCP host driver This patch implements the NVMe over TCP host driver. It can be used to connect to remote NVMe over Fabrics subsystems over good old TCP/IP. The driver implements the TP 8000 of how nvme over fabrics capsules and data are encapsulated in nvme-tcp pdus and exchaged on top of a TCP byte stream. nvme-tcp header and data digest are supported as well. To connect to all NVMe over Fabrics controllers reachable on a given taget port over TCP use the following command: nvme connect-all -t tcp -a $IPADDR This requires the latest version of nvme-cli with TCP support. Signed-off-by: Sagi Grimberg Signed-off-by: Roy Shterman Signed-off-by: Solganik Alexander Signed-off-by: Christoph Hellwig commit ad4f530e95a7b88a332035b9e0c5384441356576 Author: Sagi Grimberg Date: Mon Dec 3 17:52:16 2018 -0800 nvmet: allow configfs tcp trtype configuration Reviewed-by: Max Gurtovoy Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 872d26a391da92ed8f0c0f5cb5fef428067b7f30 Author: Sagi Grimberg Date: Mon Dec 3 17:52:15 2018 -0800 nvmet-tcp: add NVMe over TCP target driver This patch implements the TCP transport driver for the NVMe over Fabrics target stack. This allows exporting NVMe over Fabrics functionality over good old TCP/IP. The driver implements the TP 8000 of how nvme over fabrics capsules and data are encapsulated in nvme-tcp pdus and exchaged on top of a TCP byte stream. nvme-tcp header and data digest are supported as well. Signed-off-by: Sagi Grimberg Signed-off-by: Roy Shterman Signed-off-by: Solganik Alexander Signed-off-by: Christoph Hellwig commit fc221d05447aa6db686a6724dd08aa6cce0924d1 Author: Sagi Grimberg Date: Mon Dec 3 17:52:14 2018 -0800 nvme-tcp: Add protocol header Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 20d44e86321299f61bb782a39aaa30f579823f58 Author: Sagi Grimberg Date: Mon Dec 3 17:52:13 2018 -0800 nvme-fabrics: allow user passing data digest Data digest is a nvme-tcp specific feature, but nothing prevents other transports reusing the concept so do not associate with tcp transport solely. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 3b49fa807284ec30669a95fd5f3806e127d29f4d Author: Sagi Grimberg Date: Mon Dec 3 17:52:12 2018 -0800 nvme-fabrics: allow user passing header digest Header digest is a nvme-tcp specific feature, but nothing prevents other transports reusing the concept so do not associate with tcp transport solely. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 1672ddb8d691e4433806373ec4104f37a86efab0 Author: Sagi Grimberg Date: Mon Dec 3 17:52:11 2018 -0800 nvmet: Add install_queue callout nvmet-tcp will implement it to allocate queue commands which are only known at nvmf connect time (sq size). Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 65d69e2505bb64f6a8d7f417f6e46e2a351174c6 Author: Sagi Grimberg Date: Mon Dec 3 17:52:10 2018 -0800 datagram: introduce skb_copy_and_hash_datagram_iter helper Introduce a helper to copy datagram into an iovec iterator but also update a predefined hash. This is useful for consumers of skb_copy_datagram_iter to also support inflight data digest without having to finish to copy and only then traverse the iovec and calculate the digest hash. Acked-by: David S. Miller Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit d05f443554b3c7dc6d46e3ba9c3c4de468875d4f Author: Sagi Grimberg Date: Mon Dec 3 17:52:09 2018 -0800 iov_iter: introduce hash_and_copy_to_iter helper Allow consumers that want to use iov iterator helpers and also update a predefined hash calculation online when copying data. This is useful when copying incoming network buffers to a local iterator and calculate a digest on the incoming stream. nvme-tcp host driver that will be introduced in following patches is the first consumer via skb_copy_and_hash_datagram_iter. Acked-by: David S. Miller Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 950fcaecd5cc6c014bb96506fd0652a501c85276 Author: Sagi Grimberg Date: Mon Dec 3 17:52:08 2018 -0800 datagram: consolidate datagram copy to iter helpers skb_copy_datagram_iter and skb_copy_and_csum_datagram are essentialy the same but with a couple of differences: The first is the copy operation used which either a simple copy or a csum_and_copy, and the second are the behavior on the "short copy" path where simply copy needs to return the number of bytes successfully copied while csum_and_copy needs to fault immediately as the checksum is partial. Introduce __skb_datagram_iter that additionally accepts: 1. copy operation function pointer 2. private data that goes with the copy operation 3. fault_short flag to indicate the action on short copy Suggested-by: David S. Miller Acked-by: David S. Miller Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit cb002d074dabfaa2248507fd9478d16a542e4f1e Author: Sagi Grimberg Date: Mon Dec 3 17:52:07 2018 -0800 iov_iter: pass void csum pointer to csum_and_copy_to_iter The single caller to csum_and_copy_to_iter is skb_copy_and_csum_datagram and we are trying to unite its logic with skb_copy_datagram_iter by passing a callback to the copy function that we want to apply. Thus, we need to make the checksum pointer private to the function. Acked-by: David S. Miller Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 0fc07791bc775478d9450ca9c6c674b45f6c1998 Author: Sagi Grimberg Date: Mon Dec 3 17:52:06 2018 -0800 datagram: open-code copy_page_to_iter This will be useful to consolidate skb_copy_and_hash_datagram_iter and skb_copy_and_csum_datagram to a single code path. Acked-by: David S. Miller Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 3152a974678a1e80c3c16d4b86522ecc500be529 Author: Sagi Grimberg Date: Mon Dec 3 17:52:05 2018 -0800 ath6kl: add ath6kl_ prefix to crypto_type Prevent a namespace conflict as in following patches as skbuff.h will include the crypto API. Acked-by: David S. Miller Cc: Kalle Valo Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 576d28812d82e94e2836632ff7e2d093099a1139 Merge: 94ffb030b6d31 e2744fd7097dd Author: Takashi Iwai Date: Thu Dec 13 09:26:19 2018 +0100 Merge branch 'topic/huawei-leds' into for-next Pull Huawei LEDS and hotkey support. Signed-off-by: Takashi Iwai commit e2744fd7097dd06b751b15395256ec7b7bb62124 Author: Ayman Bagabas Date: Wed Dec 12 18:07:59 2018 -0500 ALSA: hda: add support for Huawei WMI micmute LED Some of Huawei laptops come with a LED in the micmute key. This patch enables the use of micmute LED for these devices: 1. Matebook X (19e5:3200), (19e5:3201) 2. Matebook X Pro (19e5:3204) Reviewed-by: Andy Shevchenko Reviewed-by: Takashi Iwai Signed-off-by: Ayman Bagabas Signed-off-by: Takashi Iwai commit bf4fb28c6e74495de9e1e4ad359cd2272ac12c53 Author: Ayman Bagabas Date: Wed Dec 12 18:07:58 2018 -0500 platform/x86: add support for Huawei WMI hotkeys This driver adds support for missing hotkeys on some Huawei laptops. Laptops such as the Matebook X have non functioning hotkeys. Whereas newer laptops such as the Matebook X Pro come with working hotkeys out of the box. Old laptops, such as the Matebook X, report hotkey events through ACPI device "\WMI0". However, new laptops, such as the Matebook X Pro, does not have this WMI device. All the hotkeys on the Matebook X Pro work fine without this patch except (micmute, wlan, and huawei key). These keys and the brightness keys report events to "\AMW0" ACPI device. One problem is that brightness keys on the Matebook X Pro work without this patch. This results in reporting two brightness key press events one is captured by ACPI and another by this driver. A solution would be to check if such event came from the "\AMW0" WMI driver then skip reporting event. Another solution would be to leave this to user-space to handle. Which can be achieved by using "hwdb" tables and remap those keys to "unknown". This solution seems more natural to me because it leaves the decision to user-space. Acked-by: Andy Shevchenko Reviewed-by: Takashi Iwai Signed-off-by: Ayman Bagabas Signed-off-by: Takashi Iwai commit 8ac51bbc4cfec4ef08b03bef24b31e2d50ef8b37 Author: Ayman Bagabas Date: Wed Dec 12 18:07:57 2018 -0500 ALSA: hda: fix front speakers on Huawei MBXP This patch solves bug 200501 'Only 2 of 4 speakers playing sound.' It enables the front speakers on Huawei Matebook X Pro laptops. These laptops come with Dolby Atmos sound system and these pins configuration enables the front speakers. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200501 Reviewed-by: Andy Shevchenko Reviewed-by: Takashi Iwai Signed-off-by: Ayman Bagabas Signed-off-by: Takashi Iwai commit 94ffb030b6d31ec840bb811be455dd2e26a4f43e Author: Gustavo A. R. Silva Date: Wed Dec 12 15:36:28 2018 -0600 ALSA: pcm: Fix potential Spectre v1 vulnerability stream is indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. This issue was detected with the help of Smatch: sound/core/pcm.c:140 snd_pcm_control_ioctl() warn: potential spectre issue 'pcm->streams' [r] (local cap) Fix this by sanitizing stream before using it to index pcm->streams Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Signed-off-by: Gustavo A. R. Silva Cc: stable@vger.kernel.org Signed-off-by: Takashi Iwai commit 4aea96f4237cea0c51a8bc87c0db31f0f932f1f0 Author: Gustavo A. R. Silva Date: Wed Dec 12 11:20:49 2018 -0600 ALSA: emux: Fix potential Spectre v1 vulnerabilities info.mode and info.port are indirectly controlled by user-space, hence leading to a potential exploitation of the Spectre variant 1 vulnerability. These issues were detected with the help of Smatch: sound/synth/emux/emux_hwdep.c:72 snd_emux_hwdep_misc_mode() warn: potential spectre issue 'emu->portptrs[i]->ctrls' [w] (local cap) sound/synth/emux/emux_hwdep.c:75 snd_emux_hwdep_misc_mode() warn: potential spectre issue 'emu->portptrs' [w] (local cap) sound/synth/emux/emux_hwdep.c:75 snd_emux_hwdep_misc_mode() warn: potential spectre issue 'emu->portptrs[info.port]->ctrls' [w] (local cap) Fix this by sanitizing both info.mode and info.port before using them to index emu->portptrs[i]->ctrls, emu->portptrs[info.port]->ctrls and emu->portptrs. Notice that given that speculation windows are large, the policy is to kill the speculation on the first load and not worry if it can be completed with a dependent load/store [1]. [1] https://marc.info/?l=linux-kernel&m=152449131114778&w=2 Signed-off-by: Gustavo A. R. Silva Cc: stable@vger.kernel.org Signed-off-by: Takashi Iwai commit c7072f5f2aa1124d57042d1d7f17521532657dc6 Merge: a91f676074c05 46594d3345f04 Author: Takashi Iwai Date: Thu Dec 13 09:10:09 2018 +0100 Merge branch 'topic/hda-pm-refactor' into for-next Pull refactoring / fixes of HD-audio PM and display power management Signed-off-by: Takashi Iwai commit 95302c394c3de19bdf24fff5e44a2bf935eadf74 Merge: 43d4b2971810e 5c7e8bbb02572 Author: David S. Miller Date: Wed Dec 12 22:22:53 2018 -0800 Merge tag 'mlx5e-updates-2018-12-11' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5e-updates-2018-12-11 From Eli Britstein, Patches 1-10 adds remote mirroring support. Patches 1-4 refactor encap related code as pre-steps for using per destination encapsulation properties. Patches 5-7 use extended destination feature for single/multi destination scenarios that have a single encap destination. Patches 8-10 enable multiple encap destinations for a TC flow. From, Daniel Jurgens, Patch 11, Use CQE padding for Ethernet CQs, PPC showed up to a 24% improvement in small packet throughput From Eyal Davidovich, patches 12-14, FW monitor counter support FW monitor counters feature came to solve the delayed reporting of FW stats in the atomic get_stats64 ndo, since we can't access the FW at that stage, this feature will enable immediate FW stats updates in the driver via fw events on specific stats updates. Patch 12, cleanup to avoid querying a FW counter when it is not supported Patch 13, Monitor counters FW commands support Patch 14, Use monitor counters in ethernet netdevice to update FW stats reported in the atomic get_stats64 ndo. ==================== Signed-off-by: David S. Miller commit 43d4b2971810edded68098b996e917ed768d3dbb Author: Biao Huang Date: Thu Dec 13 10:41:37 2018 +0800 net-next: stmmac: dwmac-mediatek: add module license info Add MODULE_LICENSE info to fix this: WARNING: modpost: missing MODULE_LICENSE() in drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.o Signed-off-by: Biao Huang Signed-off-by: David S. Miller commit c784a28b025a22f8c791e14096fb7079236739c0 Author: YueHaibing Date: Wed Dec 12 08:33:53 2018 +0000 net/mlx5e: Remove set but not used variable 'upriv' Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/ethernet/mellanox/mlx5/core/en_rep.c: In function 'mlx5e_vport_rep_load': drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:1490:21: warning: variable 'upriv' set but not used [-Wunused-but-set-variable] drivers/net/ethernet/mellanox/mlx5/core/en_rep.c: In function 'mlx5e_vport_rep_unload': drivers/net/ethernet/mellanox/mlx5/core/en_rep.c:1557:21: warning: variable 'upriv' set but not used [-Wunused-but-set-variable] It not used any more since commit ef381359e3a8 ("net/mlx5e: Replace egdev with indirect block notifications"). Also remove unused variable 'uplink_rpriv' after this change. Signed-off-by: YueHaibing Reviewed-by: Leon Romanovsky Acked-by: Saeed Mahameed Signed-off-by: David S. Miller commit eed9de3b4f47114f440980203ca27c5fab70f529 Author: Nikolay Borisov Date: Tue Dec 11 10:31:40 2018 +0200 ima: Use inode_is_open_for_write Use the aptly named function rather than open coding the check. No functional changes. Signed-off-by: Nikolay Borisov Signed-off-by: Mimi Zohar commit d7cecb676dd364b28a5a8f5e4a30ce2e9cfdfcc3 Author: Nayna Jain Date: Sun Dec 9 01:57:05 2018 +0530 ima: Support platform keyring for kernel appraisal On secure boot enabled systems, the bootloader verifies the kernel image and possibly the initramfs signatures based on a set of keys. A soft reboot(kexec) of the system, with the same kernel image and initramfs, requires access to the original keys to verify the signatures. This patch allows IMA-appraisal access to those original keys, now loaded on the platform keyring, needed for verifying the kernel image and initramfs signatures. [zohar@linux.ibm.com: only use platform keyring if it's enabled (Thiago)] Signed-off-by: Nayna Jain Reviewed-by: Mimi Zohar Acked-by: Serge Hallyn Reviewed-by: James Morris Reviewed-by: Thiago Jung Bauermann Signed-off-by: Mimi Zohar commit 386b49f51dc24d1f9139eb11f49aa075eeb35363 Author: Josh Boyer Date: Sun Dec 9 01:57:04 2018 +0530 efi: Allow the "db" UEFI variable to be suppressed If a user tells shim to not use the certs/hashes in the UEFI db variable for verification purposes, shim will set a UEFI variable called MokIgnoreDB. Have the uefi import code look for this and ignore the db variable if it is found. [zohar@linux.ibm.com: removed reference to "secondary" keyring comment] Signed-off-by: Josh Boyer Signed-off-by: David Howells Acked-by: Nayna Jain Acked-by: Serge Hallyn Reviewed-by: James Morris Signed-off-by: Mimi Zohar commit 15ea0e1e3e185040bed6119f815096f2e4326242 Author: Josh Boyer Date: Thu Dec 13 01:37:56 2018 +0530 efi: Import certificates from UEFI Secure Boot Secure Boot stores a list of allowed certificates in the 'db' variable. This patch imports those certificates into the platform keyring. The shim UEFI bootloader has a similar certificate list stored in the 'MokListRT' variable. We import those as well. Secure Boot also maintains a list of disallowed certificates in the 'dbx' variable. We load those certificates into the system blacklist keyring and forbid any kernel signed with those from loading. [zohar@linux.ibm.com: dropped Josh's original patch description] Signed-off-by: Josh Boyer Signed-off-by: David Howells Signed-off-by: Nayna Jain Acked-by: Serge Hallyn Signed-off-by: Mimi Zohar commit 0bc9ae395b3f3b6557f0c5f0a0b0cd2fd5c00a04 Author: Dave Howells Date: Sun Dec 9 01:57:02 2018 +0530 efi: Add an EFI signature blob parser Add a function to parse an EFI signature blob looking for elements of interest. A list is made up of a series of sublists, where all the elements in a sublist are of the same type, but sublists can be of different types. For each sublist encountered, the function pointed to by the get_handler_for_guid argument is called with the type specifier GUID and returns either a pointer to a function to handle elements of that type or NULL if the type is not of interest. If the sublist is of interest, each element is passed to the handler function in turn. Signed-off-by: David Howells Signed-off-by: Nayna Jain Acked-by: Serge Hallyn Signed-off-by: Mimi Zohar commit 5c126ba22f894427cc770240faa1bf6b02ce7aca Author: Dave Howells Date: Sun Dec 9 01:57:01 2018 +0530 efi: Add EFI signature data types Add the data types that are used for containing hashes, keys and certificates for cryptographic verification along with their corresponding type GUIDs. Signed-off-by: David Howells Acked-by: Nayna Jain Acked-by: Serge Hallyn Reviewed-by: James Morris Signed-off-by: Mimi Zohar commit 60740accf78494e166ec76bdc39b7d75fc2fe1c7 Author: Nayna Jain Date: Sun Dec 9 01:57:00 2018 +0530 integrity: Load certs to the platform keyring The patch refactors integrity_load_x509(), making it a wrapper for a new function named integrity_add_key(). This patch also defines a new function named integrity_load_cert() for loading the platform keys. Signed-off-by: Nayna Jain Reviewed-by: Mimi Zohar Acked-by: Serge Hallyn Reviewed-by: James Morris Reviewed-by: Thiago Jung Bauermann Signed-off-by: Mimi Zohar commit 9dc92c45177ab70e20ae94baa2f2e558da63a9c7 Author: Nayna Jain Date: Sun Dec 9 01:56:59 2018 +0530 integrity: Define a trusted platform keyring On secure boot enabled systems, a verified kernel may need to kexec additional kernels. For example, it may be used as a bootloader needing to kexec a target kernel or it may need to kexec a crashdump kernel. In such cases, it may want to verify the signature of the next kernel image. It is further possible that the kernel image is signed with third party keys which are stored as platform or firmware keys in the 'db' variable. The kernel, however, can not directly verify these platform keys, and an administrator may therefore not want to trust them for arbitrary usage. In order to differentiate platform keys from other keys and provide the necessary separation of trust, the kernel needs an additional keyring to store platform keys. This patch creates the new keyring called ".platform" to isolate keys provided by platform from keys by kernel. These keys are used to facilitate signature verification during kexec. Since the scope of this keyring is only the platform/firmware keys, it cannot be updated from userspace. This keyring can be enabled by setting CONFIG_INTEGRITY_PLATFORM_KEYRING. Signed-off-by: Nayna Jain Reviewed-by: Mimi Zohar Acked-by: Serge Hallyn Reviewed-by: James Morris Reviewed-by: Thiago Jung Bauermann Signed-off-by: Mimi Zohar commit 6c8d5f051251f64af9026a9a763bb96a0f4a8d6f Author: YueHaibing Date: Tue Nov 13 01:26:17 2018 +0000 scsi: ufs: Fix platform_no_drv_owner.cocci warnings Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: YueHaibing Signed-off-by: Martin K. Petersen commit ed4c1136ac2a0dd8ca3ec37de2658eadb9d83c43 Author: Suganath Prabu Date: Fri Dec 7 12:58:35 2018 +0530 scsi: mpt3sas: Update driver version to 27.101.00.00 Update driver version from 27.100.00.00 to 27.101.00.00. Signed-off-by: Suganath Prabu Signed-off-by: Martin K. Petersen commit 306eaf276b02aa0852b7efdff6552a3dbfdbb943 Author: Suganath Prabu Date: Fri Dec 7 12:58:34 2018 +0530 scsi: mpt3sas: Replace readl with ioc->base_readl Use ioc->base_readl to restrict the readl retries to only Aero controllers. Signed-off-by: Suganath Prabu Signed-off-by: Martin K. Petersen commit b899202901a8add28adc73a1ae077217fa341dfe Author: Suganath Prabu Date: Fri Dec 7 12:58:33 2018 +0530 scsi: mpt3sas: Add separate function for aero doorbell reads Sometimes Aero controllers appears to be returning bad data (0) for doorbell register read and if retries are performed immediately after the bad read, they return good data. Workaround is added to retry read from doorbell registers for maximum three times if driver get the zero. Added functions base_readl_aero for Aero IOC and base_readl for gen35 and other controllers. Signed-off-by: Suganath Prabu Signed-off-by: Martin K. Petersen commit cc68e6077bbf09de3e792716a1d38588bdb7a785 Author: Suganath Prabu Date: Fri Dec 7 12:58:32 2018 +0530 scsi: mpt3sas: Introduce flag for aero based controllers Adding flag "is_aero_ioc" to differentiate aero based controllers from other gen35 controllers. Signed-off-by: Suganath Prabu Signed-off-by: Martin K. Petersen commit 6db831f4ef764ca19d7300d56ab9455af3cb930d Author: Xiang Chen Date: Thu Dec 6 21:34:42 2018 +0800 scsi: hisi_sas: Make sg_tablesize consistent value Sht->sg_tablesize is set in the driver, and it will be assigned to shost->sg_tablesize in SCSI mid-layer. So it is not necessary to assign shost->sg_table one more time in the driver. In addition to the change, change each scsi_host_template.sg_tablesize to HISI_SAS_SGE_PAGE_CNT instead of SG_ALL. Signed-off-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 6e1b731b535231e199c7810451c851398afccd33 Author: Xiang Chen Date: Thu Dec 6 21:34:41 2018 +0800 scsi: hisi_sas: Relocate some code to reduce complexity Relocate the codes related to dma_map/unmap in hisi_sas_task_prep() to reduce complexity, with a view to add DIF/DIX support. Signed-off-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 735bcc77e6ba83e464665cea9041072190ede37e Author: John Garry Date: Thu Dec 6 21:34:40 2018 +0800 scsi: hisi_sas: Fix warnings detected by sparse This patchset fixes some warnings detected by the sparse tool, like these: drivers/scsi/hisi_sas/hisi_sas_main.c:1469:52: warning: incorrect type in assignment (different base types) drivers/scsi/hisi_sas/hisi_sas_main.c:1469:52: expected unsigned short [unsigned] [assigned] [usertype] tag_of_task_to_be_managed drivers/scsi/hisi_sas/hisi_sas_main.c:1469:52: got restricted __le16 [usertype] drivers/scsi/hisi_sas/hisi_sas_main.c:1723:52: warning: incorrect type in assignment (different base types) drivers/scsi/hisi_sas/hisi_sas_main.c:1723:52: expected unsigned short [unsigned] [assigned] [usertype] tag_of_task_to_be_managed drivers/scsi/hisi_sas/hisi_sas_main.c:1723:52: got restricted __le16 [usertype] Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit d9678adbe733a770428a98651beaa2817d503ed3 Author: Marc Gonzalez Date: Fri Nov 9 02:07:07 2018 +0100 arm64: defconfig: Enable FSL_MC_BUS and FSL_MC_DPIO Commit e8342cc7954e ("enable CAAM crypto engine on QorIQ DPAA2 SoCs") enabled CRYPTO_DEV_FSL_DPAA2_CAAM, which depends on FSL_MC_DPIO, which is not set. Enable FSL_MC_BUS, and build FSL_MC_DPIO and CRYPTO_DEV_FSL_DPAA2_CAAM as modules. Signed-off-by: Marc Gonzalez [olof: refreshed due to churn] Signed-off-by: Olof Johansson commit 3cf9e6d0095479dee5748c441da876995c97354f Author: Marc Gonzalez Date: Fri Nov 9 02:03:20 2018 +0100 arm64: defconfig: Replace PINCTRL_MT7622 with PINCTRL_MTK_MOORE Commit e78d57b2f87c ("pinctrl: mediatek: add pinctrl-moore that implements the generic pinctrl dt-bindings") made PINCTRL_MT7622 depend on PINCTRL_MTK_MOORE, so it fell off in the refresh. Add MTK_MOORE, which automatically enables MT7622. Signed-off-by: Marc Gonzalez [olof: refresh and minor commit message reword] Signed-off-by: Olof Johansson commit 1f4fa50dd48f8467188b48328164ac9ca7eae254 Author: Marc Gonzalez Date: Fri Nov 9 01:56:44 2018 +0100 arm64: defconfig: Regenerate for v4.20 Run the platform defconfig through kbuild, and handle the trivial case where options merely move around. Signed-off-by: Marc Gonzalez [olof: refreshed due to some recent churn] Signed-off-by: Olof Johansson Signed-off-by: Olof Johansson commit b125eb0bf4699e1645f71bed72674a2634874bc0 Merge: a323a513c7128 8b3e6f8999f8d Author: Olof Johansson Date: Wed Dec 12 17:50:39 2018 -0800 Merge tag 'amlogic-dt64-2-redo' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into next/dt arm64: dts: Amlogic updates for v4.21, round2 Highlights: - fix IRQ trigger type - AXG: enable GPIO IRQs, PHY IRQ, watchdog * tag 'amlogic-dt64-2-redo' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: arm64: dts: meson: Fix IRQ trigger type for macirq arm64: dts: meson-axg: Enable GPIO interrupt controller arm64: dts: meson-axg: s400: Enable PHY interrupt arm64: dts: meson: add clock controller clock inputs dt-bindings: clk: meson: add main controller clock input dt-bindings: clk: meson: add ao controller clock inputs arm64: dts: meson-axg: remove alternate xtal arm64: dts: meson-axg: Enable watchdog on Meson AXG SoCs Signed-off-by: Olof Johansson commit b8222335938a9c6425b9f14e61c3ca67c8189dfc Author: Tony Lindgren Date: Wed Dec 12 15:46:16 2018 -0800 ARM: dts: Fix wrong address for omap5 sata phy Looks like I missed converting the omap5 sata phy addresses to use offset from the module base instead of full physical address. While at it, we can also more it to be a direct child of the interconnect target module, it is not really a child of the ocp2scp control device. Cc: Peter Ujfalusi Signed-off-by: Tony Lindgren commit 86d540ff3319e3f60a48a83bd8a770fce7fe66b5 Author: Himanshu Madhani Date: Mon Dec 10 12:36:25 2018 -0800 scsi: qla2xxx: Update driver version to 10.00.00.12-k Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 835aa4f2691e4ed4ed16de81f3cabf17a87a164f Author: Giridhar Malavali Date: Mon Dec 10 12:36:24 2018 -0800 scsi: qla2xxx: Fix for FC-NVMe discovery for NPIV port This patch fixes NVMe discovery by setting SKIP_PRLI flag, so that PRLI is driven by driver and is retried when the NPIV port is detected to have NVMe capability. Signed-off-by: Giridhar Malavali Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 5e6803b409ba3c18434de6693062d98a470bcb1e Author: Himanshu Madhani Date: Mon Dec 10 12:36:23 2018 -0800 scsi: qla2xxx: Fix NPIV handling for FC-NVMe This patch fixes issues with NPIV port with FC-NVMe. Clean up code for remoteport delete and also call nvme_delete when deleting VPs. Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit 850f6acd343663ff988888184df6af5cb0bc61c4 Author: Anil Gurumurthy Date: Mon Dec 10 12:36:22 2018 -0800 scsi: qla2xxx: Enable FC-NVME on NPIV ports Signed-off-by: Anil Gurumurthy Signed-off-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit bc127d93e4eca0f45caf2e68e9aeb06284b15b86 Author: Arnd Bergmann Date: Mon Dec 10 22:32:41 2018 +0100 scsi: aacraid: change event_wait to a completion The event_wait semaphore has completion semantics, so we can change it over to the completion interface for clarity without changing the behavior. Signed-off-by: Arnd Bergmann Reviewed-by: Johannes Thumshirn Reviewed-by: Dave Carroll Signed-off-by: Martin K. Petersen commit dc71eccc175eae4959b06ae697ebef019719063d Author: Arnd Bergmann Date: Mon Dec 10 22:32:40 2018 +0100 scsi: aacraid: change wait_sem to a completion The wait_sem member is used like a completion, so we should use the respective API. The behavior is unchanged. Signed-off-by: Arnd Bergmann Reviewed-by: Johannes Thumshirn Reviewed-by: Dave Carroll Signed-off-by: Martin K. Petersen commit 719162bd5bb968203397b9b1d0dd30a9797bbd09 Author: James Smart Date: Mon Dec 10 19:37:01 2018 -0800 scsi: lpfc: Enable Management features for IF_TYPE=6 Addition of support for if_type=6 missed several checks for interface type, resulting in the failure of several key management features such as firmware dump and loopback testing. Correct the checks on the if_type so that both SLI4 IF_TYPE's 2 and 6 are supported. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Ewan D. Milne Signed-off-by: Martin K. Petersen commit 2d1036aea463e34d03b402e6a918ec89a742b2bb Author: Martin K. Petersen Date: Wed Dec 12 20:26:56 2018 -0500 Revert "scsi: lpfc: ls_rjt erroneus FLOGIs" This reverts commit 287aba2592870fa5b76134b28173b77f1f7a4492. We killed the bad firmware and this mod is no longer necessary. Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 186599f89ea57e9b444dcb0793723b9148770161 Author: YueHaibing Date: Wed Dec 12 08:03:38 2018 +0000 net/mlx5: Remove duplicated include from eswitch.c Remove duplicated include. Signed-off-by: YueHaibing Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 0273ac349f08f4ff9ef88aaaf9c9f2aa6e87d2be Author: Dennis Zhou Date: Tue Dec 11 18:03:08 2018 -0500 blkcg: handle dying request_queue when associating a blkg Between v3 [1] and v4 [2] of the blkg association series, the association point moved from generic_make_request_checks(), which is called after the request enters the queue, to bio_set_dev(), which is when the bio is formed before submit_bio(). When the request_queue goes away, the blkgs supporting the request_queue are destroyed and then the q->root_blkg is set to %NULL. This patch adds a %NULL check to blkg_tryget_closest() to prevent the NPE caused by the above. It also adds a guard to see if the request_queue is dying when creating a blkg to prevent creating a blkg for a dead request_queue. [1] https://lore.kernel.org/lkml/20180911184137.35897-1-dennisszhou@gmail.com/ [2] https://lore.kernel.org/lkml/20181126211946.77067-1-dennis@kernel.org/ Fixes: 5cdf2e3fea5e ("blkcg: associate blkg when associating a device") Reported-and-tested-by: Ming Lei Reviewed-by: Bart Van Assche Signed-off-by: Dennis Zhou Signed-off-by: Jens Axboe commit 02e1dbe402de8c41787da7b1ef9acd2457b0b84b Merge: 351cbde969230 06a2fc8f1498d Author: David S. Miller Date: Wed Dec 12 16:34:22 2018 -0800 Merge branch 'Pass-extack-to-SWITCHDEV_PORT_OBJ_ADD' Petr Machata says: ==================== Pass extack to SWITCHDEV_PORT_OBJ_ADD Drivers may need to do validation as a result of port object addition. An example is mlxsw, which needs to check the configuration of a VXLAN device attached to an offloaded bridge. Without a mapped VLAN, the invalidity of the device is not important, but as soon as a pvid, untagged VLAN is configured for the device, it has to be validated and offloaded. Should the validation fail, there's currently no way to communicate details of the failure to the user, beyond an error number. Because currently, extack is not available at all in that area of code, this patch starts down at the RTNL level and progresses up towards the driver(s). In patch #1, ndo_bridge_setlink is updated to include extack, and callbacks of all clients are updated as well (ignoring the argument). In patch #2, the bridge driver is updated to propagate the extack through to the switchdev border, br_switchdev_port_vlan_add(). Patches #3, #4 and #5 then gradually extend switchdev to pass the extack argument through to the switchdev blocking notifier chain. Patches #6 and #7 then update mlxsw to pass the extack argument from VXLAN events resp. port events on to mlxsw_sp_bridge_8021q_vxlan_join(). Finally in patches #8 and #9, the code paths from the previous two patches are verified to yield an error message. v2: - Patch #1: - In ndo_bridge_setlink(), keep the whole extack declaration on the same line. ==================== Signed-off-by: David S. Miller commit 06a2fc8f1498dc978e856ef5ded6667b476a3b5b Author: Petr Machata Date: Wed Dec 12 17:03:06 2018 +0000 selftests: mlxsw: extack: Test VLAN add on a port device Test mapping a VLAN at a port device such that on the same VLAN, there already is an unoffloadable VXLAN device. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit b498dc7d29bd6b4a108451671f81d712fba008ec Author: Petr Machata Date: Wed Dec 12 17:03:04 2018 +0000 selftests: mlxsw: extack: Test VLAN add on a VXLAN device Test mapping a VLAN at a VXLAN device that can't be offloaded. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 7357eb3d4b3e33e3a08fb5916d6ae0dbb389a96a Author: Petr Machata Date: Wed Dec 12 17:03:02 2018 +0000 mlxsw: spectrum_switchdev: Propagate extack on port VLAN events After switchdev_handle_port_obj_add() was extended in a preceding patch, mlxsw_sp_port_obj_add() now takes an extack argument. Propagate it further by extending a callee chain from mlxsw_sp_port_vlans_add(), via mlxsw_sp_bridge_port_vlan_add() via mlxsw_sp_port_vlan_bridge_join() via mlxsw_sp_port_vlan_fid_join() to mlxsw_sp_bridge_ops.fid_get, adding an extack argument for each of them. This code path is used when a VLAN is added to a port netdevice if there already is an unoffloadable VXLAN device with that VLAN mapped. mlxsw_sp_bridge_8021d_port_join() is updated to obey the new interfaces changed by the abovementioned code, propagating extack ultimately from NETDEV_CHANGEUPPER events. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 0a5a2aee6f38073b6ae5d946bc668e965f29f3b0 Author: Petr Machata Date: Wed Dec 12 17:03:00 2018 +0000 mlxsw: spectrum_switchdev: Propagate extack on VXLAN VLAN events Now that VLAN port object addition notifications carry an extack, propagate it from mlxsw_sp_switchdev_vxlan_vlans_add() through mlxsw_sp_switchdev_vxlan_vlan_add() to mlxsw_sp_bridge_8021q_vxlan_join(). This code path is used when a VLAN is added to a VXLAN netdevice that cannot be offloaded. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 6921351359395a6c6ac72cd275a8393f399cecc7 Author: Petr Machata Date: Wed Dec 12 17:02:56 2018 +0000 net: switchdev: Add extack to switchdev_handle_port_obj_add() callback Drivers use switchdev_handle_port_obj_add() to handle recursive descent through lower devices. Change this function prototype to take add_cb that itself takes an extack argument. Decode extack from switchdev_notifier_port_obj_info and pass it to add_cb. Update mlxsw and ocelot drivers which use this helper. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Acked-by: Ivan Vecera Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 479c86dc551c9720765ed19433990eae6a1f899f Author: Petr Machata Date: Wed Dec 12 17:02:54 2018 +0000 net: switchdev: Add extack to struct switchdev_notifier_info In order to pass extack to the drivers that need it, add an extack field to struct switchdev_notifier_info, and an extack argument to the function call_switchdev_blocking_notifiers(). Also add a helper function switchdev_notifier_info_to_extack(). Signed-off-by: Petr Machata Acked-by: Jiri Pirko Acked-by: Ivan Vecera Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 69b7320e14e6e8c7a77fa5803cecc86434a1162d Author: Petr Machata Date: Wed Dec 12 17:02:52 2018 +0000 net: switchdev: Add extack argument to switchdev_port_obj_add() After the previous patch, bridge driver has extack argument available to pass to switchdev. Therefore extend switchdev_port_obj_add() with this argument, updating all callers, and passing the argument through to switchdev_port_obj_notify(). Signed-off-by: Petr Machata Acked-by: Jiri Pirko Acked-by: Ivan Vecera Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 169327d5850cb80d98d095cfaf8dfbb63d576864 Author: Petr Machata Date: Wed Dec 12 17:02:50 2018 +0000 net: bridge: Propagate extack to switchdev ndo_bridge_setlink has been updated in the previous patch to have extack available, and changelink RTNL op has had this argument since the time extack was added. Propagate both through the bridge driver to eventually reach br_switchdev_port_vlan_add(), where it will be used by subsequent patches. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Acked-by: Nikolay Aleksandrov Acked-by: Ivan Vecera Acked-by: Roopa Prabhu Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 2fd527b72bb6f95dfe8a1902e998cb76390c431e Author: Petr Machata Date: Wed Dec 12 17:02:48 2018 +0000 net: ndo_bridge_setlink: Add extack Drivers may not be able to implement a VLAN addition or reconfiguration. In those cases it's desirable to explain to the user that it was rejected (and why). To that end, add extack argument to ndo_bridge_setlink. Adapt all users to that change. Following patches will use the new argument in the bridge driver. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 351cbde969230a072cabca9969c68ab04e58e6b3 Author: Jonathan Toppins Date: Wed Dec 12 11:58:51 2018 -0500 bnxt: remove printing of hwrm message bnxt_en 0000:19:00.0 (unregistered net_device) (uninitialized): hwrm req_type 0x190 seq id 0x6 error 0xffff The message above is commonly seen when a newer driver is used on hardware with older firmware. The issue is this message means nothing to anyone except Broadcom. Remove the message to not confuse users as this message is really not very informative. Signed-off-by: Jonathan Toppins Acked-by: Michael Chan Signed-off-by: David S. Miller commit d675ba4b9e6ccd782e4db9109cbab708a85b8ff8 Merge: 02c4fb0210dc2 ba0ede185ef4c Author: Dave Airlie Date: Thu Dec 13 10:29:14 2018 +1000 Merge tag 'drm-msm-next-2018-12-12' of git://people.freedesktop.org/~robclark/linux into drm-next This time around, seeing some love for some older hw: - a2xx gpu support for apq8060 (hp touchpad) and imx5 (headless gpu-only mode) - a2xx gpummu support (a2xx was pre-iommu) - mdp4 display support for apq8060/touchpad For display/dpu: - a big pile of continuing dpu fixes and cleanups On the gpu side of things: - per-submit statistics and traceevents for better profiling - a6xx crashdump support - decouple get_iova() and page pinning.. so we can unpin from physical memory inactive bo's while using softpin to lower cpu overhead - new interface to set debug names on GEM BOs and debugfs output improvements - additional submit flag to indicate buffers that are used to dump (so $debugfs/rd cmdstream dumping is useful with softpin + state-objects) Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGvVvLPD9_Z4kyfGe98Y--byj6HbxHivEYSgF7Rq7=bFnw@mail.gmail.com commit 02c4fb0210dc2773e0d7f0a5a1b866986f8edc40 Merge: 29a1da27c4e41 8ff01abcccbb5 Author: Dave Airlie Date: Thu Dec 13 10:21:31 2018 +1000 Merge branch 'linux-4.21' of git://github.com/skeggsb/linux into drm-next Mostly just initial support for Turing TU104/TU106 chipsets. Support for TU102 is missing as I don't yet have HW, but it should be trivial to add in later in the merge window (in theory). It's a bit of a rough first pass that'll get improved in future releases as a finish figuring out some of the other HW changes, but it's good enough as it stands for modesetting and suspend/resume etc. Acceleration bring-up is incomplete due to NVIDIA not yet having provided FW images for me to use, though command submission and copy engines are functional already. Signed-off-by: Dave Airlie From: Ben Skeggs Link: https://patchwork.freedesktop.org/patch/msgid/CACAvsv7KmfcQqZcx+wh_1UKjTovp4PH_5UVMfeyxUu-M9WLZfw@mail.gmail.com commit 29a1da27c4e41c2b4ad85f02bbf412926d4b38df Merge: e7df065a69778 180b46ecdc9f7 Author: Dave Airlie Date: Thu Dec 13 10:16:09 2018 +1000 Merge tag 'drm/tegra/for-4.21-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next drm/tegra: Changes for v4.21-rc1 These changes contain a couple of minor fixes for host1x and the Falcon library in Tegra DRM. There are also a couple of missing pieces that finally enable support for host1x, VIC and display on Tegra194. I've also added a patch that enables audio over HDMI using the SOR which has been tested, and works, on both Tegra186 and Tegra194. Signed-off-by: Dave Airlie From: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20181207134712.32683-1-thierry.reding@gmail.com commit e7df065a697783ecb5c6eaa5692d78dcfceb71dd Merge: e69aa5f9b97f7 674e78acae0df Author: Dave Airlie Date: Thu Dec 13 09:49:04 2018 +1000 Merge branch 'drm-next-4.21' of git://people.freedesktop.org/~agd5f/linux into drm-next [airlied: make etnaviv build again] amdgpu: - DC trace support - More DC documentation - XGMI hive reset support - Rework IH interaction with KFD - Misc fixes and cleanups - Powerplay updates for newer polaris variants - Add cursor plane update fast path - Enable gpu reset by default on CI parts - Fix config with KFD/HSA not enabled amdkfd: - Limit vram overcommit - dmabuf support - Support for doorbell BOs ttm: - Support for simultaneous submissions to multiple engines scheduler: - Add helpers for hw with preemption support Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20181207233119.16861-1-alexander.deucher@amd.com commit e6652f0ff037d3cad81b82afd4f75c964ef611ec Author: Yangtao Li Date: Wed Dec 12 11:40:07 2018 -0500 netdevsim: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Acked-by: Jakub Kicinski Signed-off-by: David S. Miller commit d63962e38cc0a94cce4f39b8b171cdb55b69a4a5 Merge: 1072bd678547f fec7b6690541b Author: James Morris Date: Wed Dec 12 15:44:29 2018 -0800 Merge tag 'seccomp-next' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux into next-seccomp Add SECCOMP_RET_USER_NOTIF From Kees. commit 8f9a8a61931197d32ae31960f4179ff60ccbe3db Author: Roman Gushchin Date: Mon Dec 10 15:43:02 2018 -0800 selftests/bpf: add btf annotations for cgroup_local_storage maps Add btf annotations to cgroup local storage maps (per-cpu and shared) in the network packet counting example. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov commit 9a1126b63190e2541dd5d643f4bfeb5a7f493729 Author: Roman Gushchin Date: Mon Dec 10 15:43:01 2018 -0800 bpf: add bpffs pretty print for cgroup local storage maps Implement bpffs pretty printing for cgroup local storage maps (both shared and per-cpu). Output example (captured for tools/testing/selftests/bpf/netcnt_prog.c): Shared: $ cat /sys/fs/bpf/map_2 # WARNING!! The output is for debug purpose only # WARNING!! The output format will change {4294968594,1}: {9999,1039896} Per-cpu: $ cat /sys/fs/bpf/map_1 # WARNING!! The output is for debug purpose only # WARNING!! The output format will change {4294968594,1}: { cpu0: {0,0,0,0,0} cpu1: {0,0,0,0,0} cpu2: {1,104,0,0,0} cpu3: {0,0,0,0,0} } Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov commit 1b2b234b1318afb3775d4c6624fd5a96558f19df Author: Roman Gushchin Date: Mon Dec 10 15:43:00 2018 -0800 bpf: pass struct btf pointer to the map_check_btf() callback If key_type or value_type are of non-trivial data types (e.g. structure or typedef), it's not possible to check them without the additional information, which can't be obtained without a pointer to the btf structure. So, let's pass btf pointer to the map_check_btf() callbacks. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov commit a0517a0f7ef23550b4484c37e2b9c2d32abebf64 Author: Stanislav Fomichev Date: Tue Dec 11 19:20:52 2018 -0800 selftests/bpf: use __bpf_constant_htons in test_prog.c For some reason, my older GCC (< 4.8) isn't smart enough to optimize the !__builtin_constant_p() branch in bpf_htons, I see: error: implicit declaration of function '__builtin_bswap16' Let's use __bpf_constant_htons as suggested by Daniel Borkmann. I tried to use simple htons, but it produces the following: test_progs.c:54:17: error: braced-group within expression allowed only inside a function .eth.h_proto = htons(ETH_P_IP), Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov commit 9a58ee2f00fb558297c44f69833e408fdadd26db Merge: 3f9b7eeea0268 58ee90284ffa4 Author: David S. Miller Date: Wed Dec 12 15:21:01 2018 -0800 Merge branch 'stmmac-mt2712-support' Biao Huang says: ==================== add Ethernet driver support for mt2712 Changes in v6: modifications according to comments from Rob/Andrew/Sean: 1. use delay_ps instead of delay stage. 2. add comments in driver to avoid confusion. 2. rewrite set_delay function. 3. modify binding document for properties: tx-delay-ps/rx-delay-ps/pericfg etc. ==================== Signed-off-by: David S. Miller commit 58ee90284ffa495b04d56d643001d6f64a13a580 Author: Biao Huang Date: Wed Dec 12 17:35:32 2018 +0800 dt-binding: mediatek-dwmac: add binding document for MediaTek MT2712 DWMAC The commit adds the device tree binding documentation for the MediaTek DWMAC found on MediaTek MT2712. Signed-off-by: Biao Huang Signed-off-by: David S. Miller commit 9992f37e346bb00369c261981f2839a5926bf2eb Author: Biao Huang Date: Wed Dec 12 17:35:31 2018 +0800 stmmac: dwmac-mediatek: add support for mt2712 Add Ethernet support for MediaTek SoCs from the mt2712 family Signed-off-by: Biao Huang Signed-off-by: David S. Miller commit fb4d49448026bf1aee917426f74dc1f5342ba908 Author: Sebastian Reichel Date: Sat Sep 29 10:03:27 2018 +0200 power: supply: gpio-charger: Do not use deprecated POWER_SUPPLY_TYPE_USB_* Signed-off-by: Sebastian Reichel commit fbd17e58d472d7ec49810c6cd87900d73e75bb2b Author: Sebastian Reichel Date: Sat Sep 29 08:47:43 2018 +0200 power: supply: ds2781: switch to devm_power_supply_register Simplify/Cleanup the driver by switching to devm_power_supply_register and dropping the driver's remove function. Signed-off-by: Sebastian Reichel commit 63fac6cb63b06eb1ee471d7d62a1c2e8cf72bdf0 Author: Sebastian Reichel Date: Sat Sep 29 08:01:12 2018 +0200 power: supply: ds2780: switch to devm_power_supply_register Simplify/Cleanup the driver by switching to devm_power_supply_register and dropping the driver's remove function. Signed-off-by: Sebastian Reichel commit 711aebcfe3ba6bfe70f9fe9041f568552affd8b7 Author: Sebastian Reichel Date: Sat Sep 29 08:46:02 2018 +0200 power: supply: ds2781: fix race-condition in bin attribute registration This is a follow-up patch to the previous one, which fixed a race-condition during registration of the attribute group. This fixes the same issue for the binary attributes by adding them to the properly registered group. As a side effect the code is further cleaned up. Signed-off-by: Sebastian Reichel commit 88635b6da891522e6099c0bfc97ce03788dd6888 Author: Sebastian Reichel Date: Sat Sep 29 07:57:30 2018 +0200 power: supply: ds2780: fix race-condition in bin attribute registration This is a follow-up patch to the previous one, which fixed a race-condition during registration of the attribute group. This fixes the same issue for the binary attributes by adding them to the properly registered group. As a side effect the code is further cleaned up. Signed-off-by: Sebastian Reichel commit 451ba0e4363c053201065f0f2ba9405fbdf0f731 Author: Sebastian Reichel Date: Sat Sep 29 07:44:28 2018 +0200 power: supply: pcf50633: fix race-condition in sysfs registration This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel commit 157ba1bb5fcb91366df3be5e63a04b799ff9cf64 Author: Sebastian Reichel Date: Fri Sep 28 17:35:37 2018 +0200 power: supply: charger-manager: fix race-condition in sysfs registration This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel commit efcca6bdfba1d579d86bd3f5ea65e5bf8e7deebe Author: Sebastian Reichel Date: Fri Sep 28 15:14:22 2018 +0200 power: supply: charger-manager: simplify generation of sysfs attribute group name This is a simple cleanup and there should be no functional changes. Signed-off-by: Sebastian Reichel commit 750688c7cdfd3ffd6189d96cbf0ff8f19bdebbdb Author: Sebastian Reichel Date: Fri Sep 28 11:46:04 2018 +0200 power: supply: bq24257: fix race-condition in sysfs registration This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel commit 348a3c079bfccbdf63767dfb5bb0521d2e889fa9 Author: Sebastian Reichel Date: Fri Sep 28 11:39:16 2018 +0200 power: supply: bq24190_charger: fix race-condition in sysfs registration This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel commit b1f7ee898bdcad18e5a5c008ff7bf30ae9941265 Author: Sebastian Reichel Date: Fri Sep 28 11:25:20 2018 +0200 power: supply: lp8788: fix race-condition in sysfs registration This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel commit a45cefb0ca1fdec07495117c1d325d99fa9f5bbc Author: Sebastian Reichel Date: Fri Sep 28 11:10:51 2018 +0200 power: supply: ds2781: fix race-condition in sysfs registration This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel commit b10474aafe80cf50afe7d299d3cc8a60efe3e69b Author: Sebastian Reichel Date: Fri Sep 28 11:00:32 2018 +0200 power: supply: ds2780: fix race-condition in sysfs registration This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel commit 06215ce99988b8ce1e44ea096c5ef1fd202efb15 Author: Sebastian Reichel Date: Fri Sep 28 10:38:09 2018 +0200 power: supply: bq2415x: fix race-condition in sysfs registration This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel commit cef8fe6a382cb556b590269e9d1dfc0241014903 Author: Sebastian Reichel Date: Thu Sep 27 15:46:03 2018 +0200 power: supply: core: add support for custom sysfs attributes Add functionality to setup device specific sysfs attributes in a race condition free manner Signed-off-by: Sebastian Reichel commit 1072bd678547f8663cfb81a22fdb50c589e4976e Author: Paul Gortmaker Date: Sun Dec 9 15:36:31 2018 -0500 security: fs: make inode explicitly non-modular The Makefile/Kconfig entry controlling compilation of this code is: security/Makefile:obj-$(CONFIG_SECURITYFS) += inode.o security/Kconfig:config SECURITYFS security/Kconfig: bool "Enable the securityfs filesystem" ...meaning that it currently is not being built as a module by anyone. Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. The removal of module.h uncovered a couple previously hidden implicit header requirements which are now included explicitly. Cc: James Morris Cc: "Serge E. Hallyn" Cc: linux-security-module@vger.kernel.org Signed-off-by: Paul Gortmaker Signed-off-by: James Morris commit 876979c9308b7228cdaf6785909c57eebc85d911 Author: Paul Gortmaker Date: Sun Dec 9 15:36:29 2018 -0500 security: audit and remove any unnecessary uses of module.h Historically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file. This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. The advantage in removing such instances is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using. Since module.h might have been the implicit source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each instance for the presence of either and replace as needed. Cc: James Morris Cc: "Serge E. Hallyn" Cc: John Johansen Cc: Mimi Zohar Cc: Dmitry Kasatkin Cc: David Howells Cc: linux-security-module@vger.kernel.org Cc: linux-integrity@vger.kernel.org Cc: keyrings@vger.kernel.org Signed-off-by: Paul Gortmaker Signed-off-by: James Morris commit 3aafb1fbe654fce86e79e10b3dc496b50cb04284 Author: Paul Gortmaker Date: Sun Dec 9 15:36:32 2018 -0500 security: integrity: make evm_main explicitly non-modular The Makefile/Kconfig entry controlling compilation of this code is: obj-$(CONFIG_EVM) += evm.o evm-y := evm_main.o evm_crypto.o evm_secfs.o security/integrity/evm/Kconfig:config EVM security/integrity/evm/Kconfig: bool "EVM support" ...meaning that it currently is not being built as a module by anyone. Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Mimi Zohar Cc: James Morris Cc: "Serge E. Hallyn" Cc: linux-ima-devel@lists.sourceforge.net Cc: linux-security-module@vger.kernel.org Signed-off-by: Paul Gortmaker Signed-off-by: James Morris commit a79860800e0b500902baf745c259625e48a403db Author: Paul Gortmaker Date: Sun Dec 9 15:36:30 2018 -0500 keys: remove needless modular infrastructure from ecryptfs_format Even though the support can be modular, only one file needs to use all the macros like MODULE_AUTHOR, MODULE_LICENSE etc. Only the one responsible for registering/removal with module_init/module_exit needs to declare these. In this case, that file is "encrypted.c" and it already has the MODULE_LICENSE that we are removing here. Since the file does EXPORT_SYMBOL, we add export.h - and build tests show that module.h (which includes everything) was hiding an implicit use of string.h - so that is added as well. Cc: Mimi Zohar Cc: David Howells Cc: James Morris Cc: "Serge E. Hallyn" Cc: linux-integrity@vger.kernel.org Cc: keyrings@vger.kernel.org Cc: linux-security-module@vger.kernel.org Signed-off-by: Paul Gortmaker Signed-off-by: James Morris commit 4f83d5ea643af8892459d9852c88f3892201b864 Author: Paul Gortmaker Date: Sun Dec 9 15:36:33 2018 -0500 security: integrity: make ima_main explicitly non-modular The Makefile/Kconfig entry controlling compilation of this code is: obj-$(CONFIG_IMA) += ima.o ima-y := ima_fs.o ima_queue.o ima_init.o ima_main.o ima_crypto.o ima_api.o \ ima_policy.o ima_template.o ima_template_lib.o security/integrity/ima/Kconfig:config IMA security/integrity/ima/Kconfig- bool "Integrity Measurement Architecture(IMA)" ...meaning that it currently is not being built as a module by anyone. Lets remove the couple traces of modular infrastructure use, so that when reading the driver there is no doubt it is builtin-only. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: Mimi Zohar Cc: Dmitry Kasatkin Cc: James Morris Cc: "Serge E. Hallyn" Cc: linux-ima-devel@lists.sourceforge.net Cc: linux-security-module@vger.kernel.org Signed-off-by: Paul Gortmaker Signed-off-by: James Morris commit e4a7dca5de625018b29417ecc39dc5037d9a5a36 Author: Joey Zhang Date: Mon Dec 10 17:12:22 2018 +0800 switchtec: Fix SWITCHTEC_IOCTL_EVENT_IDX_ALL flags overwrite In the ioctl_event_ctl() SWITCHTEC_IOCTL_EVENT_IDX_ALL case, we call event_ctl() several times with the same "ctl" struct. Each call clobbers ctl.flags, which leads to the problem that we may not actually enable or disable all events as the user requested. Preserve the event flag value with a temporary variable. Fixes: 52eabba5bcdb ("switchtec: Add IOCTLs to the Switchtec driver") Signed-off-by: Joey Zhang Signed-off-by: Wesley Sheng [bhelgaas: changelog] Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe commit aff614c6339c1ee2a74ea0afc491d6e30d0bad61 Author: Boris Glimcher Date: Mon Dec 10 17:12:21 2018 +0800 switchtec: Set DMA coherent mask Switchtec hardware supports 64-bit DMA, so set the correct DMA mask. This allows the CMA to allocate larger buffers for memory windows. Signed-off-by: Boris Glimcher Signed-off-by: Wesley Sheng Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe commit 526180408b815aa7b96fd48bd23cdd33ef04e38e Author: Kelvin Cao Date: Mon Dec 10 17:12:20 2018 +0800 switchtec: Remove immediate status check after submitting MRPC command After submitting a Firmware Download MRPC command, Switchtec firmware will delay Management EP BAR MemRd TLP responses by more than 10ms. This is a firmware limitation. Delayed MemRd completions are a problem for systems with a low Completion Timeout (CTO). The current driver checks the MRPC status immediately after submitting an MRPC command, which results in a delayed MemRd completion that may cause a Completion Timeout. Remove the immediate status check and rely on the check after receiving an interrupt or timing out. This is only a software workaround to the READ issue and a proper fix of this should be done in firmware. Fixes: 080b47def5e5 ("MicroSemi Switchtec management interface driver") Signed-off-by: Kelvin Cao Signed-off-by: Wesley Sheng Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe commit 1a2fa02f7489dc4d746f2a15fb77b3ce1affade8 Author: Hans de Goede Date: Sat Dec 8 13:59:24 2018 +0100 ACPI / LPSS: Ignore acpi_device_fix_up_power() return value Ignore acpi_device_fix_up_power() return value. If we return an error we end up with acpi_default_enumeration() still creating a platform- device for the device and we end up with the device still being used but without the special LPSS related handling which is not useful. Specicifically ignoring the error fixes the touchscreen no longer working after a suspend/resume on a Prowise PT301 tablet. This tablet has a broken _PS0 method on the touchscreen's I2C controller, causing acpi_device_fix_up_power() to fail, causing fallback to standard platform-dev handling and specifically causing acpi_lpss_save/restore_ctx to not run. The I2C controllers _PS0 method does actually turn on the device, but then does some more nonsense which fails when run during early boot trying to use I2C opregion handling on another not-yet registered I2C controller. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 943a10f85265d4c14753d445003b6f5d8e3d959a Author: Yangtao Li Date: Tue Dec 11 11:20:48 2018 -0500 PM / sleep: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Acked-by: Pavel Machek Signed-off-by: Rafael J. Wysocki commit 04dab58a39d402162a7effe7278df8cd41557252 Author: Rafael J. Wysocki Date: Mon Dec 10 12:30:23 2018 +0100 cpuidle: Add 'above' and 'below' idle state metrics Add two new metrics for CPU idle states, "above" and "below", to count the number of times the given state had been asked for (or entered from the kernel's perspective), but the observed idle duration turned out to be too short or too long for it (respectively). These metrics help to estimate the quality of the CPU idle governor in use. Signed-off-by: Rafael J. Wysocki commit 8e22bce990b5d502360e15ecb0d69f963666d7fc Merge: 24161e726f67c 690e16bada602 Author: Olof Johansson Date: Wed Dec 12 14:21:26 2018 -0800 Merge tag 'v4.20-rockchip-dts64fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into fixes rockpro64 regulator fixes that cause stability issues * tag 'v4.20-rockchip-dts64fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: dts: rockchip: fix rk3399-rockpro64 regulator gpios Signed-off-by: Olof Johansson commit a6f119a06960ef1dc30570401e43b71f9ebdd2c2 Merge: 389cf4e42e204 c2ade654dbf7d Author: Olof Johansson Date: Wed Dec 12 14:20:55 2018 -0800 Merge tag 'omap-for-v4.21/driver-part2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/drivers Few more omap driver fixes and improvments for v4.21 merge window This series of changes improves the TI module flag handling to allow booting with older dts files until the module flags have been moved to the interconnect target module level. And there's a of_node_name_eq() clean-up patch from Rob Herring for the GPMC driver. * tag 'omap-for-v4.21/driver-part2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: memory: omap-gpmc: Use of_node_name_eq for node name comparisons bus: ti-sysc: Check for no-reset and no-idle flags at the child level ARM: OMAP2+: Check also the first dts child for hwmod flags Signed-off-by: Olof Johansson commit 24161e726f67cf7047141893c18d3f1591a52159 Merge: 0603a9a84679e 84fb6c7feb149 Author: Olof Johansson Date: Wed Dec 12 14:20:02 2018 -0800 Merge tag 'omap-for-v4.20/fixes-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into fixes Few device fixes for omaps Here's a collection of minor fixes for annoying usability issues people have noticed using various devices. There are two regression fixes: - A regression fix for omap5 usb3 dual role mode - A regression fix to ams-delta audio being muted permanently And two one-liners: - Fix polarity for am335x-pdu001 SD card detection - Fix non-working omap4-sdp Ethernet startup for rebind It would be nice to get these merged during the -rc cycle if possible. Naturally these can all wait for the merge window too if we start running out of time. * tag 'omap-for-v4.20/fixes-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: Fix OMAP4430 SDP Ethernet startup ARM: dts: am335x-pdu001: Fix polarity of card detection input ARM: OMAP1: ams-delta: Fix audio permanently muted ARM: dts: omap5: Fix dual-role mode on Super-Speed port Signed-off-by: Olof Johansson commit a323a513c7128e1597e59f6d3db38c426d229cb9 Author: Rob Herring Date: Wed Dec 12 09:50:11 2018 +0100 dt-bindings: arm: Convert Rockchip board/soc bindings to json-schema Convert Rockchip SoC bindings to DT schema format using json-schema. Cc: Mark Rutland Cc: Heiko Stuebner Cc: devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Signed-off-by: Rob Herring [move to per-board entries after confirming with Rob and added recently added boards] Signed-off-by: Heiko Stuebner Signed-off-by: Olof Johansson commit bd3fde386decf09317ff4a07cd0d05380a22f525 Author: Arnd Bergmann Date: Mon Dec 10 22:58:36 2018 +0100 ARM: omap2: avoid section mismatch warning WARNING: vmlinux.o(.text+0x27530): Section mismatch in reference from the function am43xx_suspend_init() to the function .init.text:am43xx_map_scu() The function am43xx_suspend_init() references the function __init am43xx_map_scu(). This is often because am43xx_suspend_init lacks a __init annotation or the annotation of am43xx_map_scu is wrong. Signed-off-by: Arnd Bergmann Acked-by: Tony Lindgren Acked-by: Santosh Shilimkar Reviewed-by: Kevin Hilman Signed-off-by: Olof Johansson commit 6dc7e8764b0879157899aa9ca15f894e001f0c20 Merge: 4238973b2ecd8 e9e863dc1dc88 Author: Olof Johansson Date: Wed Dec 12 14:03:48 2018 -0800 Merge tag 'amlogic-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into next/soc soc: Amlogic updates for v4.21 - ARM: meson: Kconfig: select HAVE_ARM_TWD and ARM_GLOBAL_TIMER - misc MAINTAINERS updates * tag 'amlogic-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: ARM: meson: select HAVE_ARM_TWD and ARM_GLOBAL_TIMER MAINTAINERS: add drivers/soc/amlogic/ to amlogic list MAINTAINERS: Remove myself from the list Signed-off-by: Olof Johansson commit 4f474037cf0656f4a59bbd61006fa2fa60e74c3b Merge: 69c5f266d8808 f18fd0f560eb3 Author: Olof Johansson Date: Wed Dec 12 14:01:03 2018 -0800 Merge tag 'gemini-dts' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into next/dt Gemini DTS updates for v4.21: - Fix the erroneous partition table on D-Link DIR-685 - Multiplex flash usage with other usage using pin control handling (merged to the MTD tree) - Use the RedBoot partition parser on SQ201 - Add the USB blocks (DT bindings merged in the last merge window) - Bump the debounce times a bit to avoid bouncing * tag 'gemini-dts' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: ARM: dts: Bump Gemini platforms to use 100ms debounce ARM: dts: Add the FOTG210 USB host to Gemini boards ARM: dts: Fix up SQ201 flash access ARM: dts: Enable Gemini flash access ARM: dts: Fix up the D-Link DIR-685 MTD partition info Signed-off-by: Olof Johansson commit 69c5f266d8808cd507a12b2c7c9ed7fc678c6487 Merge: 5cc60b0497c38 8be5b161bb3d0 Author: Olof Johansson Date: Wed Dec 12 13:59:58 2018 -0800 Merge tag 'sunxi-h3-h5-for-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/dt Allwinner H3/H5 changes for 4.21 Our usual pull request with the changes shared between the H3 and H5 SoCs. The major changes for this release are: - Addition of the video engine for the H5 - H3 Camera support - New board: Emlid Neutis N5, Mapleboard MP130 * tag 'sunxi-h3-h5-for-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: arm64: dts: allwinner: h5: Add Video Engine node ARM/arm64: dts: allwinner: Move H3/H5 syscon label over to soc-specific nodes arm64: dts: allwinner: h5: Add system-control node with SRAM C1 ARM: dts: sun8i: h3: Fix the system-control register range ARM: dts: sun8i: Add the H3/H5 CSI controller ARM: dts: sun8i-h3: Add dts for the Mapleboard MP130 arm64: dts: allwinner: new board - Emlid Neutis N5 dt-bindings: vendor-prefix: new vendor - Emlid ARM: dts: sun8i-h3: add sy8106a to orange pi plus Signed-off-by: Olof Johansson commit 4238973b2ecd84412d78cc72c4ab3bdae064f2e8 Merge: 4dd201beec951 5a87809b89b64 Author: Olof Johansson Date: Wed Dec 12 13:58:34 2018 -0800 Merge tag 'omap-for-v4.21/omap1-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/soc Changes for omap1 variants for v4.21 merge window In this set of changes Aaro Koskinen revives Palm Tungsten E for the MMC and USB making it usable again. And Janusz Krzysztofik follows up on the clean-up of ams-delta GPIO handling. The other changes are clean-up for DEFINE_SHOW_ATTRIBUTE by Yangtao Li. * tag 'omap-for-v4.21/omap1-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP1: fix USB configuration for device-only setups ARM: OMAP1: add MMC configuration for Palm Tungsten E ARM: OMAP1: devices: configure omap1_spi100k only on OMAP7xx ARM: OMAP1/2: fix SoC name printing ARM: OMAP1: ams-delta: Move AMS_DELTA_LATCH2_NGPIO to the board file ARM: OMAP1: ams-delta: Drop unused symbols from the board header ARM: OMAP1: ams-delta: Drop board specific global GPIO numbers ARM: OMAP: PM: Change to use DEFINE_SHOW_ATTRIBUTE macro ARM: OMAP1: clock: Change to use DEFINE_SHOW_ATTRIBUTE macro ARM: OMAP1: ams-delta: Provide GPIO lookup table for LED device ARM: OMAP1: ams-delta: make board header file local to mach-omap1 Signed-off-by: Olof Johansson commit 4dd201beec9512c44d11ac97791a33f5c3536d7b Author: Arnd Bergmann Date: Mon Dec 10 22:58:37 2018 +0100 ARM: tegra: avoid section mismatch warning WARNING: vmlinux.o(.text+0x39ecc): Section mismatch in reference from the function tegra114_gic_cpu_pm_registration() to the (unknown reference) .init.rodata:(unknown) The function tegra114_gic_cpu_pm_registration() references the (unknown reference) __initconst (unknown). This is often because tegra114_gic_cpu_pm_registration lacks a __initconst annotation or the annotation of (unknown) is wrong. Signed-off-by: Arnd Bergmann Acked-by: Thierry Reding Signed-off-by: Olof Johansson commit 4aa64677330beeeed721b4b122884dabad845d66 Author: Arnd Bergmann Date: Mon Dec 10 22:58:38 2018 +0100 ARM: ks8695: fix section mismatch warning WARNING: vmlinux.o(.text+0x13250): Section mismatch in reference from the function acs5k_i2c_init() to the (unknown reference) .init.data:(unknown) The function acs5k_i2c_init() references the (unknown reference) __initdata (unknown). This is often because acs5k_i2c_init lacks a __initdata annotation or the annotation of (unknown) is wrong. Signed-off-by: Arnd Bergmann Signed-off-by: Olof Johansson commit 88af3209aa0881aa5ffd99664b6080a4be5f24e5 Author: Arnd Bergmann Date: Mon Dec 10 22:58:39 2018 +0100 ARM: pxa: avoid section mismatch warning WARNING: vmlinux.o(.text+0x19f90): Section mismatch in reference from the function littleton_init_lcd() to the function .init.text:pxa_set_fb_info() The function littleton_init_lcd() references the function __init pxa_set_fb_info(). This is often because littleton_init_lcd lacks a __init annotation or the annotation of pxa_set_fb_info is wrong. WARNING: vmlinux.o(.text+0xf824): Section mismatch in reference from the function zeus_register_ohci() to the function .init.text:pxa_set_ohci_info() The function zeus_register_ohci() references the function __init pxa_set_ohci_info(). This is often because zeus_register_ohci lacks a __init annotation or the annotation of pxa_set_ohci_info is wrong. WARNING: vmlinux.o(.text+0xf95c): Section mismatch in reference from the function cm_x300_init_u2d() to the function .init.text:pxa3xx_set_u2d_info() The function cm_x300_init_u2d() references the function __init pxa3xx_set_u2d_info(). This is often because cm_x300_init_u2d lacks a __init annotation or the annotation of pxa3xx_set_u2d_info is wrong. Signed-off-by: Arnd Bergmann Signed-off-by: Olof Johansson commit 5d3e11c4782156f529deac2afc066f28308d9a80 Author: Arnd Bergmann Date: Mon Dec 10 21:43:02 2018 +0100 ARM: mmp: fix pxa168_device_usb_phy use on aspenite This one ended up in the wrong header file, causing a build failure on at least one platform: arch/arm/mach-mmp/aspenite.c: In function 'common_init': arch/arm/mach-mmp/aspenite.c:260:28: error: 'pxa168_device_usb_phy' undeclared (first use in this function); did you mean 'pxa168_device_ssp5'? We can just include both the pxa168.h and pxa910.h headers to make that work, which gets us to the next failure: arch/arm/mach-mmp/aspenite.o: In function `common_init': aspenite.c:(.init.text+0x1c0): undefined reference to `pxa168_device_usb_phy' This is solved by using the matching ifdef check around the USB device registration, enabling them only when either USB host or gadget mode are enabled. Fixes: a225daf72ee7 ("ARM: mmp: add a pxa-usb-phy device") Signed-off-by: Arnd Bergmann Signed-off-by: Olof Johansson commit 12d3a30db4a3b3df5fbadf5974b9cf50544a9950 Author: Arnd Bergmann Date: Mon Dec 10 21:43:01 2018 +0100 ARM: mmp: fix timer_init calls The change to passing the timer frequency as a function argument was a good idea, but caused a build failure for one user that was missed in the update: arch/arm/mach-mmp/time.c: In function 'mmp_dt_init_timer': arch/arm/mach-mmp/time.c:242:2: error: implicit declaration of function 'timer_init'; did you mean 'hrtimer_init'? [-Werror=implicit-function-declaration] Change that as well to fix the build error, and rename the function to put it into a proper namespace and make it clearer what is actually going on. I saw that the high 6500000 HZ frequency was previously only set with CONFIG_MMP2, but is now also used with MMP (pxa910), so I'm changing that back here. Please make sure that the frequencies are all correct now. Fixes: f36797ee4380 ("ARM: mmp/mmp2: dt: enable the clock") Signed-off-by: Arnd Bergmann Signed-off-by: Olof Johansson commit c8730395ea515e9592c0cdc474e0aa61fa9a7902 Merge: 3aab54033a850 167e63702d090 Author: Olof Johansson Date: Wed Dec 12 13:52:48 2018 -0800 Merge tag 'imx-soc-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/soc i.MX SoC changes for 4.21: - An improvement on i.MX debugging options that only defines DEBUG_IMX_UART_PORT if needed, so that the option will not be present in the kernel config when DEBUG_LL is disabled. - Adds the necessary platform support for i.MX7ULP SoC and configures power mode to Partial Stop mode 3 with system/bus clock enabled. Otherwise the default STOP mode will gate off system/bus clock when WFI gets executed on i.MX7ULP. - A fix from Arnd on SOC_IMX7ULP option dependency. * tag 'imx-soc-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: imx: fix dependencies on imx7ulp ARM: imx: add initial support for imx7ulp ARM: debug-imx: only define DEBUG_IMX_UART_PORT if needed Signed-off-by: Olof Johansson commit 3aab54033a8506af70cabb7c7db81442ea63944e Merge: abd488c00194f cafbc79e327f4 Author: Olof Johansson Date: Wed Dec 12 13:52:15 2018 -0800 Merge tag 'samsung-soc-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/soc Samsung mach/soc changes for v4.21 Just cleanups of: legacy way of setting external wakeup interrupts, old power management debugging functions and duplicated secondary startup initialization. * tag 'samsung-soc-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: exynos: Remove secondary startup initialization from smp_prepare_cpus ARM: samsung: Limit SAMSUNG_PM_DEBUG config option to non-Exynos platforms ARM: exynos: Remove no longer needed s3c_pm_check_*() calls ARM: exynos: Remove legacy setting of external wakeup interrupts ARM: s5pv210: Remove legacy setting of external wakeup interrupts Signed-off-by: Olof Johansson commit abd488c00194fb43abde35aad44fa134794fd5b4 Merge: 767ae01748223 dabfc8364ca76 Author: Olof Johansson Date: Wed Dec 12 13:51:29 2018 -0800 Merge tag 'sunxi-core-for-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/soc Allwinner core changes for 4.21 A few patches to enable a new Allwinner SoC based on an armv5 CPU. * tag 'sunxi-core-for-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: dt-bindings: watchdog: Add Allwinner ARMv5 F1C100s wdt ARM: sunxi: add Allwinner ARMv5 SoCs dt-bindings: arm: Add new Allwinner ARMv5 F1C100s SoC ARM: Check ARCH_MULTI_V7 to differentiate ARMv5/v7 Allwinner SoCs Signed-off-by: Olof Johansson commit 767ae01748223c6c02aa10ff657a04b76c9c2bb9 Merge: 50ba37008f6ea a2ce9a67051bb Author: Olof Johansson Date: Wed Dec 12 13:51:05 2018 -0800 Merge tag 'davinci-for-v4.21/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/soc DaVinci SoC updates for v4.21 ----------------------------- This set of patches moves DaVinci one step closer to not relying on at24 platform data by relying on nvmem cell lookups instead. Once other dependencies are merged, for v4.22, plan is to merge another series of patches removing at24 platform data. * tag 'davinci-for-v4.21/soc' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci: ARM: davinci: da850-evm: remove unnecessary include ARM: davinci: dm850-evm: use cell nvmem lookup for mac address ARM: davinci: mityomapl138: use cell nvmem lookup for mac address ARM: davinci: da830-evm: use cell nvmem lookup for mac address ARM: davinci: dm646x-evm: use cell nvmem lookup for mac address ARM: davinci: dm644x-evm: use cell nvmem lookup for mac address ARM: davinci: dm365-evm: use cell nvmem lookup for mac address Signed-off-by: Olof Johansson commit 50ba37008f6ea249ff508c617ed57c589aa1d989 Merge: ac21e9af5a5cc 2ed29e15e4b25 Author: Olof Johansson Date: Wed Dec 12 13:49:58 2018 -0800 Merge tag 'renesas-soc-for-v4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/soc Renesas ARM Based SoC Updates for v4.21 * pm-rmobile driver - Move to drivers/soc/renesas/ - Clean up struct rmobile_pm_domain * Renesas SoC Kconfig Symbols - Move symbols for ARM and SoCs to drivers/soc/renesas/ - Hide ARCH_RZN1 to improve consistency * SH-Mobile AG5 (sh73a0) SoC: Remove obsolete inclusion of * Restrict TWD and SCU to Renesas ARM based SoCs where they are present * Enable GPIOLIB on Renesas arm64 based SoCs to allow GPIO driver selection * tag 'renesas-soc-for-v4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: ARM: shmobile: R-Mobile: Move pm-rmobile to drivers/soc/renesas/ ARM: shmobile: R-Mobile: Clean up struct rmobile_pm_domain ARM: shmobile: Move SoC Kconfig symbols to drivers/soc/renesas/ arm64: renesas: Move SoC Kconfig symbols to drivers/soc/renesas/ ARM: shmobile: Hide ARCH_RZN1 to improve consistency ARM: shmobile: sh73a0: Remove obsolete inclusion of ARM: shmobile: Restrict TWD support to SoCs that have it ARM: shmobile: Restrict SCU support to SoCs that have it arm64: renesas: Enable GPIOLIB to allow GPIO driver selection Signed-off-by: Olof Johansson commit 44593ea9f3bf34d92c4def133264bc43c29cd443 Merge: 42196048c6e92 bb9c90ab4eddf Author: Olof Johansson Date: Wed Dec 12 13:47:42 2018 -0800 Merge tag 'imx-defconfig-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/defconfig i.MX defconfig update for 4.21: - Enable build of i.MX7ULP SoC support. - Enable Goodix touchscreen driver which is needed by ConnectCore 6UL SBC Pro (ccimx6ulsbcpro) board support. - Enable USB_ANNOUNCE_NEW_DEVICES to help USB issue debugging and BT_BNEP to support network over bluetooth. - Remove explicit ARM_UNWIND disabling as it's selected by ARM EABI support. - Enable DA9063 PMIC for emtrion i.MX6 boards support. - Enable driver support for Pixel Pipeline (PXP) and DCP crypto block which are found on i.MX6 and i.MX7 SoCs. * tag 'imx-defconfig-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: imx_v6_v7_defconfig: add imx7ulp support ARM: imx_v6_v7_defconfig: Select TOUCHSCREEN_GOODIX ARM: imx_v6_v7_defconfig: Enable USB_ANNOUNCE_NEW_DEVICES ARM: imx_v6_v7_defconfig: Enable BT_BNEP ARM: imx_v6_v7_defconfig: Remove explicit ARM_UNWIND disable ARM: imx_v6_v7_defconfig: Enable DA9063 PMIC support ARM: imx_v6_v7_defconfig: Select the PXP driver ARM: imx_v6_v7_defconfig: Enable CRYPTO_DEV_MXS_DCP Signed-off-by: Olof Johansson commit 42196048c6e92ec7bbccf8fbab6358854c6f5b31 Merge: 7d1396177ca9b 24c8e4b85399b Author: Olof Johansson Date: Wed Dec 12 13:47:15 2018 -0800 Merge tag 'samsung-defconfig-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/defconfig Samsung defconfig changes for v4.21 Enable drivers in exynos and multi_v7 defconfigs for MAX8952, MAX8998 (Samsung UniversalC210 board) and TC358764 (Arndale board). * tag 'samsung-defconfig-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: multi_v7_defconfig: Add TOSHIBA TC358764 bridge driver ARM: multi_v7_defconfig: Add MAX8952 regulator driver ARM: exynos_defconfig: Add TOSHIBA TC358764 bridge driver ARM: exynos_defconfig: Add MAX8952 regulator driver ARM: exynos_defconfig: Add MAX8998 RTC and charger drivers Signed-off-by: Olof Johansson commit 7d1396177ca9bc8b9cae3ab401cc229212ddb44e Merge: d72c6acee4366 4f49b73442016 Author: Olof Johansson Date: Wed Dec 12 13:46:39 2018 -0800 Merge tag 'sunxi-config64-for-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/defconfig Allwinner arm64 defconfig for 4.21 A bunch of patches to improve the coverage of Allwinner drivers in the arm64 defconfig, mostly targeted at adding display drivers support. * tag 'sunxi-config64-for-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: arm64: defconfig: Enable PWM_SUN4I arm64: defconfig: Enable DRM_SUN8I_DW_HDMI arm64: defconfig: Enable DRM_SUN8I_MIXER arm64: defconfig: Enable MFD_AXP20X_I2C Signed-off-by: Olof Johansson commit 389cf4e42e204fd0117318054a4abf18ef8f80d4 Merge: efa00b24fc283 96e5da7c84242 Author: Olof Johansson Date: Wed Dec 12 13:43:54 2018 -0800 Merge tag 'tegra-for-4.21-memory' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/drivers memory: tegra: Changes for v4.21-rc1 This contains a single commit that adds support for the EMC driver on Tegra20. * tag 'tegra-for-4.21-memory' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: memory: tegra: Introduce Tegra20 EMC driver Signed-off-by: Olof Johansson commit d72c6acee4366e455c780d82b577dbde0ff82422 Merge: d4907292ab19e 65a8c17a39f62 Author: Olof Johansson Date: Wed Dec 12 13:43:01 2018 -0800 Merge tag 'renesas-arm-defconfig-for-v4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/defconfig Renesas ARM Based SoC Defconfig Updates for v4.21 * Enable SII902X in shmobile defconfig * tag 'renesas-arm-defconfig-for-v4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: ARM: shmobile: defconfig: Enable SII902X Signed-off-by: Olof Johansson commit efa00b24fc28393bc6fbc1c72ae192b92962e859 Merge: d1a1cc9a3fade 446e8986a2417 Author: Olof Johansson Date: Wed Dec 12 13:38:50 2018 -0800 Merge tag 'at91-4.21-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into next/drivers AT91 SoC for 4.21: - Add new SoC IDs * tag 'at91-4.21-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: at91: add support in soc driver for new SAM9X60 ARM: at91: add support in soc driver for LPDDR2 SiP Signed-off-by: Olof Johansson commit c5eb1190074cfb14c5d9cac692f1912eecf1a5e4 Author: Jarkko Nikula Date: Tue Oct 23 14:45:52 2018 +0300 PCI / PM: Allow runtime PM without callback functions a9c8088c7988 ("i2c: i801: Don't restore config registers on runtime PM") nullified the runtime PM suspend/resume callback pointers while keeping the runtime PM enabled. This caused the SMBus PCI device to stay in D0 with /sys/devices/.../power/runtime_status showing "error" when the runtime PM framework attempted to autosuspend the device. This is due to PCI bus runtime PM, which checks for driver runtime PM callbacks and returns -ENOSYS if they are not set. Since i2c-i801.c doesn't need to do anything device-specific for runtime PM, Jean Delvare proposed this be fixed in the PCI core rather than adding dummy runtime PM callback functions in the PCI drivers. Change pci_pm_runtime_suspend()/pci_pm_runtime_resume() so they allow changing the PCI device power state during runtime PM transitions even if the driver supplies no runtime PM callbacks. This fixes the runtime PM regression on i2c-i801.c. It is not obvious why the code previously required the runtime PM callbacks. The test has been there since the code was introduced by 6cbf82148ff2 ("PCI PM: Run-time callbacks for PCI bus type"). On the other hand, a similar change was done to generic runtime PM callbacks in 05aa55dddb9e ("PM / Runtime: Lenient generic runtime pm callbacks"). Fixes: a9c8088c7988 ("i2c: i801: Don't restore config registers on runtime PM") Reported-by: Mika Westerberg Signed-off-by: Jarkko Nikula Signed-off-by: Bjorn Helgaas Reviewed-by: Jean Delvare Reviewed-by: Rafael J. Wysocki Cc: stable@vger.kernel.org # v4.18+ commit d1a1cc9a3fadeb14ba71abd54de8b89a37113a56 Merge: e3154317a0630 f56c06271c1c3 Author: Olof Johansson Date: Wed Dec 12 13:34:14 2018 -0800 Merge tag 'amlogic-drivers-2' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into next/drivers soc: amlogic: updates for v4.21, round 2 - meson-clk-measure: Add missing REGMAP_MMIO dependency * tag 'amlogic-drivers-2' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: soc: amlogic: meson-clk-measure: Add missing REGMAP_MMIO dependency Signed-off-by: Olof Johansson commit e3154317a063051a66231d43736276b5e3402f83 Merge: 8986f4c2172f9 b6444cf5fa607 Author: Olof Johansson Date: Wed Dec 12 13:33:06 2018 -0800 Merge tag 'imx-drivers-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/drivers i.MX drivers change for 4.21: - A series from Aisheng that improves SCU power domain bindings by defining '#power-domain-cells' as 1, and adds i.MX8 SCU power domain driver support on top of it. - A series from Lucas that updates gpcv2 driver for scalability and adds i.MX8MQ support into the driver. - Increase gpc driver GPC_CLK_MAX definition to 7, as DISPLAY power domain on imx6sx has 7 clocks. * tag 'imx-drivers-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: soc: imx: gpc: Increase GPC_CLK_MAX to 7 soc: imx: gpcv2: add support for i.MX8MQ SoC soc: imx: gpcv2: move register access table to domain data soc: imx: gpcv2: prefix i.MX7 specific defines firmware: imx: add SCU power domain driver firmware: imx: add pm svc headfile dt-bindings: fsl: scu: update power domain binding firmware: imx: remove resource id enums dt-bindings: imx: add scu resource id headfile Signed-off-by: Olof Johansson commit 8986f4c2172f9d31f3eaa4e0e4a1efb2a7cbefb5 Merge: bb7ece5fc43fb 576f1b4bc8022 Author: Olof Johansson Date: Wed Dec 12 13:32:27 2018 -0800 Merge tag 'v4.20-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into next/drivers add helper functions to create and send commands to the global command engine (GCE) device using the command queue driver (cmdq). * tag 'v4.20-next-soc' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: soc: mediatek: Add Mediatek CMDQ helper Signed-off-by: Olof Johansson commit bb7ece5fc43fb597ff965c79ddd62c3806f3e319 Merge: 2d32d65741040 d44d37cb27df5 Author: Olof Johansson Date: Wed Dec 12 13:31:43 2018 -0800 Merge tag 'sunxi-drivers-for-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/drivers Allwinner drivers changes for 4.21 Those patches are all about our SRAM driver, to enable new SoCs: the F1c100s, the H5 and the A64 C1 SRAM, that is used by the video decoding engine. * tag 'sunxi-drivers-for-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: dt-bindings: sram: sunxi: Add compatible for the A64 SRAM C1 dt-bindings: sram: sunxi: Add bindings for the H5 with SRAM C1 dt-bindings: sram: Add Allwinner suniv F1C100s soc: sunxi: sram: Add support for the H5 SoC system control soc: sunxi: sram: Enable EMAC clock access for H3 variant soc: sunxi: Change to use DEFINE_SHOW_ATTRIBUTE macro Signed-off-by: Olof Johansson commit 2d32d65741040b2908b2d948d0925d13392caf33 Merge: 4a598c7b3f00e af51c25fb59d4 Author: Olof Johansson Date: Wed Dec 12 13:29:26 2018 -0800 Merge tag 'tegra-for-4.21-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/drivers firmware: tegra: Changes for v4.21-rc1 These changes update the BPMP ABI header and implement a new variant of the BPMP firmware version tag query if supported. * tag 'tegra-for-4.21-firmware' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: firmware: tegra: Use in-band messages for firmware version query soc/tegra: bpmp: Update ABI header firmware: tegra: Print version tag at full firmware: tegra: Switch to global mrq_is_supported() firmware: tegra: Add helper to check for supported MRQs Signed-off-by: Olof Johansson commit 4a598c7b3f00e30148a3cc2e314961328f8a277e Merge: 48ff08dd9aa93 e3e403c218cd0 Author: Olof Johansson Date: Wed Dec 12 13:28:24 2018 -0800 Merge tag 'tegra-for-4.21-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/drivers soc/tegra: Changes for v4.21-rc1 These changes are mostly cleanups to the PMC driver, but they also add support for wake events on Tegra186 and Tegra194, which can be used to wake the system from sleep. With this and the corresponding device tree additions suspend/resume is finally working on these SoCs. * tag 'tegra-for-4.21-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: soc/tegra: pmc: Add initial Tegra194 wake events soc/tegra: pmc: Add initial Tegra186 wake events soc/tegra: pmc: Add wake event support soc/tegra: pmc: Add Tegra194 support soc/tegra: pmc: Change to use DEFINE_SHOW_ATTRIBUTE macro soc/tegra: Don't leak device tree node reference soc/tegra: fuse: Remove duplicated function declaration soc/tegra: pmc: Drop locking from tegra_powergate_is_powered() soc/tegra: pmc: Add sysfs entries for reset info soc/tegra: pmc: Don't power-up XUSB power-domains Signed-off-by: Olof Johansson commit 48ff08dd9aa9353ece8f5bebd217e824f1c6098c Merge: 330a7809cf90f 7fc4650cc2417 Author: Olof Johansson Date: Wed Dec 12 13:27:40 2018 -0800 Merge tag 'renesas-drivers-for-v4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/drivers Renesas ARM Based SoC Drivers Updates for v4.21 SYSC Driver: * Common - Fix power domain control after system resume - Merge PM Domain registration and linking - Remove rcar_sysc_power_{down,up}() helpers * R-Car E3 (r8a77990) SoC - Fix initialization order of 3DG-{A,B} * R-Car V3H (r8a77980) SoC - Correct A3VIP[012] power domain hierarchy - Correct names of A2DP[01] power domains * R-Car V3M (r8a77970) SoC - Correct names of A2DP/A2CN power domains - emove non-existent CR7 power domain * R-Car M3-N (r8a77965) SoC - Remove non-existent A3IR power domain * tag 'renesas-drivers-for-v4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: soc: renesas: rcar-sysc: Fix power domain control after system resume soc: renesas: rcar-sysc: Merge PM Domain registration and linking soc: renesas: rcar-sysc: Remove rcar_sysc_power_{down,up}() helpers soc: renesas: r8a77990-sysc: Fix initialization order of 3DG-{A,B} soc: renesas: r8a77980-sysc: Correct A3VIP[012] power domain hierarchy soc: renesas: r8a77980-sysc: Correct names of A2DP[01] power domains soc: renesas: r8a77970-sysc: Correct names of A2DP/A2CN power domains soc: renesas: r8a77970-sysc: Remove non-existent CR7 power domain soc: renesas: r8a77965-sysc: Remove non-existent A3IR power domain Signed-off-by: Olof Johansson commit 330a7809cf90f8e6d29cb3c13e58bc7bb532b1ae Merge: 202f9977b012d c2a70a319afb9 Author: Olof Johansson Date: Wed Dec 12 13:26:49 2018 -0800 Merge tag 'pxa-for-4.21' of https://github.com/rjarzmik/linux into next/drivers This pxa update brings only a single patch, finishing the dmaengine conversion. * tag 'pxa-for-4.21' of https://github.com/rjarzmik/linux: dmaengine: pxa: make the filter function internal Signed-off-by: Olof Johansson commit 189af4657186da08a2e79fb8e906cfd82b2ccddc Author: Ard Biesheuvel Date: Thu Dec 6 09:32:57 2018 +0100 ARM: smp: add support for per-task stack canaries On ARM, we currently only change the value of the stack canary when switching tasks if the kernel was built for UP. On SMP kernels, this is impossible since the stack canary value is obtained via a global symbol reference, which means a) all running tasks on all CPUs must use the same value b) we can only modify the value when no kernel stack frames are live on any CPU, which is effectively never. So instead, use a GCC plugin to add a RTL pass that replaces each reference to the address of the __stack_chk_guard symbol with an expression that produces the address of the 'stack_canary' field that is added to struct thread_info. This way, each task will use its own randomized value. Cc: Russell King Cc: Kees Cook Cc: Emese Revfy Cc: Arnd Bergmann Cc: Laura Abbott Cc: kernel-hardening@lists.openwall.com Acked-by: Nicolas Pitre Signed-off-by: Ard Biesheuvel Signed-off-by: Kees Cook commit 5cc60b0497c38fc7357ce049f474e8bdee69e90d Merge: 33afb48f32e56 953d9f3903659 Author: Olof Johansson Date: Wed Dec 12 13:07:51 2018 -0800 Merge tag 'v4.21-rockchip-dts64-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into next/dt Support for the onboard LEDs of the 2 96boards (ficus, rock960), hdmi output for rockpro64, vpu node on rk3399 and adding the always on 32kHz clock on rk3399-Gru to get a more complete clock tree. * tag 'v4.21-rockchip-dts64-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: dts: rockchip: Add on-board LED support on rk3399-rock960 arm64: dts: rockchip: Add on-board LED support on rk3399-ficus arm64: dts: rockchip: enable hdmi output on rk3399-rockpro64 arm64: dts: rockchip: add VPU device node for RK3399 arm64: dts: rockchip: Add 32k clk on rk3399-gru Signed-off-by: Olof Johansson commit 33afb48f32e56700ca77d7d345555927d205d6af Merge: 0abf32a837ed6 7841b88a8fddd Author: Olof Johansson Date: Wed Dec 12 13:06:47 2018 -0800 Merge tag 'v4.21-rockchip-dts32-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into next/dt RV1108 improvements (uart-dma, clocks, interrupt numbers, gmac support timer and emmc pins) from its first real-world user. RK3188 improvements (OPPv2, cpu node updates) to prepare for a new devicetree, the BQ Edison 2 Quad-Core. VPU device node for rk3288, right now only the jpeg encoder part will be in the kernel but hopefully other codecs will follow. * tag 'v4.21-rockchip-dts32-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: dts: rockchip: Add internal timer support for rv1108 ARM: dts: rockchip: add BQ Edison 2 QC devicetree ARM: dts: rockchip: add VPU device node for RK3288 ARM: dts: rockchip: update cpu supplies on rk3188 ARM: dts: rockchip: add phandles to secondary cpu cores ARM: dts: rockchip: add cpu-core resets for rk3188 ARM: dts: rockchip: convert rk3188 to opp-v2 ARM: dts: rockchip: add #sound-dai-cells to Cortex-A9 i2s ARM: dts: rockchip: Add UART DMA support for rv1108 ARM: dts: rockchip: Assign the proper GPIO clocks for rv1108 ARM: dts: rockchip: Fix the PMU interrupt number for rv1108 ARM: dts: rockchip: Pass the 'arm,cpu-registers-not-fw-configured' property on rv1108 ARM: dts: rockchip: Pass the 'clock-latency' property on rv1108 ARM: dts: rockchip: Add rv1108 GMAC support ARM: dts: rockchip: add rv1108 eMMC pin settings Signed-off-by: Olof Johansson commit 0abf32a837ed68dae8991e91491dd610fb2cfda7 Merge: ac3e0be697e92 d8007306f6ad1 Author: Olof Johansson Date: Wed Dec 12 13:04:41 2018 -0800 Merge tag 'at91-4.21-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into next/dt AT91 DT for 4.21 - Switch most platforms to the new clock binding - Small improvement for Axentia nattis * tag 'at91-4.21-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: at91: nattis: initialize the BLON pin as output-low early ARM: dts: at91: at91sam9rl: switch to new clock bindings ARM: dts: at91: at91sam9x5: switch to new clock bindings ARM: dts: at91: at91sam9263: switch to new clock bindings ARM: dts: at91: at91sam9261: switch to new clock bindings ARM: dts: at91: at91sam9260: switch to new clock bindings ARM: dts: at91: sama5d2: switch to new clock binding ARM: dts: at91: sama5d4: switch to new clock bindings ARM: dts: at91: sama5d2: use the divided clock for SMC Signed-off-by: Olof Johansson commit ac3e0be697e92413a1cd045da5550ea4bb783b72 Merge: ba97d019fc1d1 c311552a8eadf Author: Olof Johansson Date: Wed Dec 12 13:02:51 2018 -0800 Merge tag 'amlogic-dt-2' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic into next/dt ARM: dts: Amlogic updates for v4.21, round 2 Highlights - add CPU OPP tables - timers: add global timer and TWD * tag 'amlogic-dt-2' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-amlogic: ARM: dts: meson: meson8b: add the CPU OPP tables ARM: dts: meson: meson8: add the CPU OPP table ARM: dts: meson8b: add the Cortex-A5 global timer ARM: dts: meson8b: add the ARM TWD timer ARM: dts: meson8: add the Cortex-A9 global timer ARM: dts: meson8: add the ARM TWD timer ARM: dts: meson: group the Cortex-A5 / Cortex-A9 peripherals dt-bindings: clock: meson8b: export the CPU post dividers Signed-off-by: Olof Johansson commit 6059c6b1d526d47c0b9f028e106f30ad539dc323 Author: Jerry Hoemann Date: Fri Nov 30 10:35:41 2018 -0700 selftests: watchdog: Add gettimeleft command line arg Add command line argument to call and display the results of ioctl WDIOC_GETTIMELEFT. Signed-off-by: Jerry Hoemann Signed-off-by: Shuah Khan commit ba97d019fc1d12d95ed27fa878f70bd94ad5bb9b Merge: dd980900e2fc5 5fd98eb7e8ce0 Author: Olof Johansson Date: Wed Dec 12 13:01:24 2018 -0800 Merge tag 'uniphier-dt-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier into next/dt UniPhier ARM SoC DT updates for v4.21 - Add bindings for all SoCs/boards of UniPhier platform - Move binding docs to socionext directory - Add all CPUs in cooling maps - Add MIO DMAC nodes * tag 'uniphier-dt-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-uniphier: ARM: dts: uniphier: add MIO DMAC nodes arm64: dts: uniphier: Add all CPUs in cooling maps ARM: dts: uniphier: Add all CPUs in cooling maps dt-bindings: uniphier: move cache-uniphier.txt to vendor directory dt-bindings: uniphier: add bindings for UniPhier SoC family Signed-off-by: Olof Johansson commit dd980900e2fc52951933082be97b38ff6fb6fe3e Merge: fafda335f81a6 58f5fa6837250 Author: Olof Johansson Date: Wed Dec 12 12:59:14 2018 -0800 Merge tag 'imx-dt64-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/dt Freescale arm64 device tree update for 4.21: - Add device tree for LS1028A SoC and NXP FRWY & QDS boards support based on this SoC. - Add device tree for LX2160A SoC and NXP QDS & RDB boards support based on this SoC. - Add qdma devices for LS1043A and LS1046A SoC. - Disable PCIe device by default in SoC device tree and let board level device tree to enable as needed. - Drop compatible string "snps,dw-pcie" from LayerScape PCIe devices to avoid incorrect matching. - Move fsl-mc device as a child node of soc node, and add missing dma-ranges property for LS1088A SoC. - Update LayerScape SoCs' cooling maps to include all devices affected by individual trip points. * tag 'imx-dt64-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: arm64: dts: ls1046a: add qdma device tree nodes arm64: dts: ls1043a: add qdma device tree nodes arm64: dts: ls1088a: Add missing dma-ranges property arm64: dts: ls1088a: Move fsl-mc node arm64: dts: fsl: Add all CPUs in cooling maps arm64: dts: Add support for NXP LS1028A SoC arm64: dts: layerscape: removed compatible string "snps,dw-pcie" arm64: dts: fsl: Add the status property disable PCIe arm64: dts: ls1012a: Add FRWY-LS1012A board support arm64: dts: add LX2160AQDS board support arm64: dts: add LX2160ARDB board support arm64: dts: add QorIQ LX2160A SoC support Signed-off-by: Olof Johansson commit fafda335f81a6e5af64a3452185299c86ec32b5e Merge: 2b6464560852f a73900b826ce6 Author: Olof Johansson Date: Wed Dec 12 12:56:36 2018 -0800 Merge tag 'imx7ulp-dt-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/dt i.MX7ULP device tree for 4.21: - It includes the initial device tree for i.MX7ULP SoC and EVK board support. * tag 'imx7ulp-dt-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: dts: imx: add imx7ulp evk support ARM: dts: imx: add common imx7ulp dtsi support dt-bindings: fsl: add imx7ulp pm related components bindings dt-bindings: fsl: add compatible for imx7ulp evk clk: imx: add imx7ulp clk driver clk: imx: implement new clk_hw based APIs clk: imx: make mux parent strings const dt-bindings: clock: add imx7ulp clock binding doc clk: imx: add imx7ulp composite clk support clk: imx: add pfdv2 support clk: imx: add pllv4 support clk: fractional-divider: add CLK_FRAC_DIVIDER_ZERO_BASED flag support clk: imx: add gatable clock divider support Signed-off-by: Olof Johansson commit 2b6464560852f6c2ee2a37230cf29a23f324737c Merge: 80b451cd68b49 7f68ffe0617b4 Author: Olof Johansson Date: Wed Dec 12 12:55:34 2018 -0800 Merge tag 'imx7d-pico-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/dt i.MX7D PICO boards update for 4.21: - It contains a series from Otavio Salvador that improves i.MX7D PICO SoM, and then adds Hobbit baseboard support on top of the improvement. * tag 'imx7d-pico-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: dts: imx7d-pico: Add the imx7d-pico-hobbit variant ARM: dts: imx7d-pico-pi: Extend peripherals support ARM: dts: imx7d-pico: Extend peripherals support ARM: dts: imx7d-pico: Improve WiFi regulator name ARM: dts: imx7d-pico: Pass the Ethernet PHY reset GPIO ARM: dts: imx7d-pico: Pass the USBOTG1_PWR pinctrl ARM: dts: imx7d-pico-pi: Move SoM related part to imx7d-pico.dtsi ARM: dts: imx7d-pico: Switch to SPDX identifier ARM: dts: imx7d-pico: Do not harcode the memory size ARM: dts: imx7d-nitrogen7: Fix the description of the Wifi clock ARM: imx: update the cpu power up timing setting on i.mx6sx ARM: dts: imx7d-pico: Describe the Wifi clock ARM: dts: imx51-zii-rdu1: Remove EEPROM node Signed-off-by: Olof Johansson commit 80b451cd68b490ee612c7f5ca04854d488b4a20d Merge: 457a728d800a9 79da07dec740a Author: Olof Johansson Date: Wed Dec 12 12:54:48 2018 -0800 Merge tag 'imx-dt-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into next/dt i.MX device tree update for 4.21: - New boards support: emtrion emCON-MX6, imx6ul-pico-pi, imx7d-sdb-reva and vf610 based Liebherr's BK4 device, ZII SCU4 AIB board. - Add flexcan support for i.MX6UL SoC, turn on stop mode wakeup feature for flexcan, and enable devices on a few i.MX6 NXP boards. - Enable AUO G101EVN010 lcd panel and Goodix touch support for imx6ul-ccimx6ulsbcpro board. - Enable sensors support for imx6qdl-sabresd board: egalax touch, light, magnetometer and accelerometer sensor. - Switch more boards to use SPDX identifier. - Fix memory node duplication in i.MX device tree sources. - Correct GIC PPI interrupts mask for i.MX6UL and i.MX7 SoCs. - Drop 'snps,dw-pcie' compatible from LS1021A PCIe device to avoid incorrect device matching. - Add the gpu nodes for the adreno 200 GPU on iMX51 and iMX53, which are now supported by the freedreno driver. - Add DCP device support for i.MX6ULL, which requires explicit clock enabling. - Add '#thermal-sensor-cells' for thermal device and '#cooling-cells' for cooling devices. - Add missing clock information for EPIT on i.MX25 SoC. - Add PWM and qdma devices for LS1021A SoC. - Update cooling maps of LS1021A SoC to include all devices affected by individual trip points. - Random device addition and cleanup on various boards. * tag 'imx-dt-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (82 commits) ARM: dts: imx51-zii-rdu1: Do not specify "power-gpio" for hpa1 ARM: dts: imx6ul: Remove extra space between node name and brace ARM: dts: imx6qdl-sabresd: Use GPIO_ACTIVE_HIGH for regulators ARM: dts: imx6ul: add flexcan support ARM: dts: imx5: add gpu nodes ARM: dts: imx6qdl-sabresd: add accelerometer sensor support ARM: dts: imx6qdl-sabresd: add magnetometer sensor support ARM: dts: imx6qdl-sabresd: add light sensor support ARM: dts: imx6qdl-sabresd: Move regulators outside of "simple-bus" ARM: dts: imx6qdl: Fix memory node duplication ARM: dts: imx6dl-mamoj: Add a memory node ARM: dts: imx53-voipac-dmm-668: Fix memory node duplication ARM: dts: vf610-zii-scu4-aib: Add HI8435 support ARM: dts: imx6qdl-sabresd: add egalax touch screen support on i2c2 bus ARM: dts: imx7s: Add flexcan stop mode wakeup support ARM: dts: imx6ul: Add flexcan stop mode wakeup support ARM: dts: imx6qdl: Add flexcan stop mode wakeup support ARM: dts: imx6sx: Add flexcan stop mode wakeup support ARM: dts: imx6ul-pico: Add the imx6ul-pico-pi variant ARM: dts: imx6ul-pico-hobbit: Extend peripherals support ... Signed-off-by: Olof Johansson commit 457a728d800a95ace9e4fa4a6fa8b9e00270b13c Merge: 333524bcd361c c2e66b8f7c375 Author: Olof Johansson Date: Wed Dec 12 12:53:47 2018 -0800 Merge tag 'v4.20-next-dts64' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into next/dt mt8173: add node for the command queue device * tag 'v4.20-next-dts64' of https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: arm64: dts: mt8173: Add GCE node Signed-off-by: Olof Johansson commit 333524bcd361cd13559eeda981195c35b397e0cf Merge: df6aeaef1c408 9deffb5ee78e4 Author: Olof Johansson Date: Wed Dec 12 12:53:05 2018 -0800 Merge tag 'samsung-dt64-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/dt Samsung DTS ARM64 changes for v4.21 1. Update DWC3 hardware modules to Exynos5433 specific variant. 2. Update cooling maps to include all CPU devices in multiple DTS files. * tag 'samsung-dt64-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: arm64: dts: exynos: Add all CPUs in cooling maps arm64: dts: exynos: Update DWC3 modules on Exynos5433 SoCs Signed-off-by: Olof Johansson commit df6aeaef1c4083a77f13dd1437460e7565ca01a9 Merge: d4dcfc7c93436 57b13b8b34002 Author: Olof Johansson Date: Wed Dec 12 12:52:20 2018 -0800 Merge tag 'samsung-dt-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into next/dt Samsung DTS ARM changes for v4.21 1. Add missing properties and nodes for PMIC clocks in multiple DTS files. 2. Add UHS-I bus speed support to Odroid XU3/XU4/HC SD card and bump the maximum clock frequency to 200 MHz for SD and eMMC. 3. Update cooling maps to include all CPU devices in multiple DTS files. 4. Enable quirks for Exynos3250 DWC. 5. Add JPEG CODEC node to S5Pv210. 6. Add opp-suspend to devfreq OPPs on Exynos4 boards to fix resuming from suspend to RAM. 7. Remove eDP from Arndale board as it does not work and breaks also DSI. * tag 'samsung-dt-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: dts: exynos: remove display-port node from Arndale ARM: dts: exynos: Add opp-suspend to DMC and leftbus devfreq OPPs on Exynos4 ARM: dts: s5pv210: Add s5p-jpeg codec node. ARM: dts: exynos: Use Samsung SoC specific compatible for DWC2 module ARM: dts: exynos: Add all CPUs in cooling maps ARM: dts: exynos: Clarify comment explaining purpose of Odroid XU3 DTSI ARM: dts: exynos: Add pin configuration for SD write protect on Odroid XU3/XU4/HC1 ARM: dts: exynos: Update maximum frequency for eMMC to 200MHz on Odroid XU3/XU4 ARM: dts: exynos: Update maximum frequency for SD card to 200MHz on Odroid XU3/XU4/HC1 ARM: dts: exynos: Fix LDO13 min values on Odroid XU3/XU4/HC1 ARM: dts: exynos: Add UHS-I bus speed support to Odroid XU3/XU4/HC1 ARM: dts: exynos: Add missing clocks to RTC node for Arndale board ARM: dts: exynos: Add compatible for s5m8767 clocks node on Itop Core ARM: dts: exynos: Add compatible for s2mps11 clocks node on Exynos542x Signed-off-by: Olof Johansson commit d4dcfc7c93436d84421415286bc6aa95d1c96558 Merge: e7828317a479e dfc1259a3f7a1 Author: Olof Johansson Date: Wed Dec 12 12:51:46 2018 -0800 Merge tag 'mvebu-dt64-4.21-1' of git://git.infradead.org/linux-mvebu into next/dt mvebu dt64 for 4.21 (part 1) - complete the description of the clearfog-gt-8k board (Armada 8040 based board) - declare eMMC on espressobin (Armada 3720 based board) which still need to be enable by the bootloader as it is not present on all the board. - add a new version of the Macchiatobin (Armada 8040 based board): the Single Shot (without the 10G 3310 PHYs). * tag 'mvebu-dt64-4.21-1' of git://git.infradead.org/linux-mvebu: arm64: dts: clearfog-gt-8k: describe mini-PCIe CON2 USB arm64: dts: add support for Macchiatobin Single Shot board arm64: dts: marvell: armada-37xx: Enable emmc on espressobin arm64: dts: marvell: armada37xx: Add emmc/sdio pinctrl definition arm64: dts: clearfog-gt-8k: enable mini-PCIe CON2 USB arm64: dts: clearfog-gt-8k: 1G eth PHY reset signal arm64: dts: clearfog-gt-8k: fix USB regulator gpio polarity Signed-off-by: Olof Johansson commit e7828317a479eb6fd06bbf5010ed80a9b8a5506b Merge: ee261c7e822a5 1504b91c81935 Author: Olof Johansson Date: Wed Dec 12 12:50:46 2018 -0800 Merge tag 'qcom-arm64-for-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux into next/dt Qualcomm ARM64 Updates for v4.21 Part 2 * Switch to use dwc3-qcom glue driver on MSM8996 * Fix issue with xo clk name on MSM8998 * Add cooling maps on MSM8916 * Add UART nodes on SDM845 * Add camera subsystem support on MSM8996 and MSM8916 * tag 'qcom-arm64-for-4.21-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agross/linux: arm64: dts: msm8996: Use dwc3-qcom glue driver for USB arm64: dts: qcom: msm8998: Fixup clock to use xo_board arm64: dts: qcom: sdm845: Add UART nodes arm64: dts: qcom: msm8996: Add CAMSS support arm64: dts: qcom: msm8996: Add VFE SMMU node arm64: dts: qcom: Add pinctrls for camera sensors arm64: dts: qcom: Add Camera Control Interface pinctrls arm64: dts: qcom: msm8916: Add CAMSS support arm64: dts: qcom: msm8916: Add IOMMU sub-node for VFE context bank arm64: dts: msm8916: Add all CPUs in cooling maps Signed-off-by: Olof Johansson commit ee261c7e822a53a257b4c03997398a3f8a76ec8d Merge: 2c94db389bbae 44ff3cafcd7f4 Author: Olof Johansson Date: Wed Dec 12 12:50:00 2018 -0800 Merge tag 'sunxi-dt64-for-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/dt Allwinner arm64 DT changes for 4.21 Our usual set of arm64 DT changes, with the biggest additions being: - Support for the video decoding engine in the A64 - Support for the audio codec in the A64 - USB Support in the H6 - HDMI Support in the H6 - EMAC Support in the H6 - New board: Orange Pi Lite2 * tag 'sunxi-dt64-for-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: (27 commits) arm64: dts: allwinner: a64: Fix up RTC device node and clock references arm64: dts: allwinner: a64: Add Video Engine node arm64: dts: allwinner: a64: Add support for the SRAM C1 section arm64: dts: allwinner: a64: pinebook: enable power supplies arm64: dts: allwinner: a64: sopine-baseboard: enable power supplies arm64: dts: allwinner: axp803: add AC and battery power supplies arm64: dts: allwinner: a64: bananapi-m64: Enable audio codec arm64: dts: allwinner: a64: enable sound on Pinebook arm64: dts: allwinner: a64: enable sound on Pine64 and SoPine arm64: dts: allwinner: a64: add nodes necessary for analog sound support arm64: dts: allwinner: h6: orangepi: Add device nodes for LEDs arm64: dts: allwinner: h6: orangepi: Enable USB 2.0 host and OTG ports arm64: dts: allwinner: h6: orangepi: Add board-wide 5V regulator arm64: dts: allwinner: h6: fix EMAC compatible string sequence arm64: dts: allwinner: a64: Add device node for Mali-400 GPU dt-bindings: gpu: mali-utgard: Add compatible for A64 Mali arm64: dts: allwinner: h6: enable USB2 on Pine H64 arm64: dts: allwinner: h6: add USB Vbus regulator for Pine H64 arm64: dts: allwinner: h6: add USB2-related device nodes arm64: dts: allwinner: h6: Enable HDMI output on Pine H64 board ... Signed-off-by: Olof Johansson commit 2c94db389bbae850a6f353d9b93ee22c170d8497 Merge: 91eac9139ed44 5719ac19fc32d Author: Olof Johansson Date: Wed Dec 12 12:48:57 2018 -0800 Merge tag 'sunxi-dt-for-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into next/dt Allwinner DT changes for 4.21 This is a quite big pull request this time, with a huge number of changes (and patches) due to us fixing the vast majority of the DTC warnings our DT had. We also have a bunch of other good, more meaningful, changes: - Support for the new Allwinner T3 (rebranded R40) and f1c100s (armv5) SoCs - AXP803 PMIC AC Power supply support - Rework of the oscillators tree - Two new boards: the t3-cqa3t-bv3 and Lichee Pi Nano Plus a few enhancements here and there. * tag 'sunxi-dt-for-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: (84 commits) ARM: dts: sunxi: Fix PMU compatible strings ARM: dts: sun8i: r40: Add RTC device node ARM: dts: sunxi: h3/h5: Fix up RTC device node and clock references ARM: dts: sun8i: a23/a33: Fix up RTC device node ARM: dts: sun8i: r40: Add clock accuracy for external oscillators ARM: dts: sunxi: h3/h5: Add clock accuracy for external oscillators ARM: dts: sun8i: a33: Drop audio codec oversampling rate to 128 fs ARM: dts: sun8i: h3: Remove unnecessary reserved memory node ARM: dts: sun8i: a33: Remove unnecessary reserved memory node ARM: dts: suniv: Add device tree for Lichee Pi Nano ARM: dts: suniv: add initial DTSI file for F1C100s ARM: dts: axp81x: add AC power supply subnode ARM: dts: sun8i: v3s: Remove skeleton and memory to avoid warnings ARM: dts: sun8i: v3s: Provide default muxing for relevant controllers ARM: dts: sun8i: v3s: Change pinctrl nodes to avoid warning ARM: dts: sun8i: v3s: Change LRADC node names to avoid warnings ARM: dts: sun8i: h3: Remove leading zeros from unit-addresses ARM: dts: sun8i: BPI-M2M: Remove i2c nodes ARM: dts: sun8i: a23/a33: Provide default muxing for relevant controllers ARM: dts: sunxi: reference: Move the muxing back to the common DTSI ... Signed-off-by: Olof Johansson commit 674e78acae0dfb4beb56132e41cbae5b60f7d662 Author: Nicholas Kazlauskas Date: Wed Dec 5 14:59:07 2018 -0500 drm/amd/display: Add fast path for cursor plane updates [Why] Legacy cursor plane updates from drm helpers go through the full atomic codepath. A high volume of cursor updates through this slow code path can cause subsequent page-flips to skip vblank intervals since each individual update is slow. This problem is particularly noticeable for the compton compositor. [How] A fast path for cursor plane updates is added by using DRM asynchronous commit support provided by async_check and async_update. These don't do a full state/flip_done dependency stall and they don't block other commit work. However, DC still expects itself to be single-threaded for anything that can issue register writes. Screen corruption or hangs can occur if write sequences overlap. Every call that potentially perform register writes needs to be guarded for asynchronous updates to work. The dc_lock mutex was added for this. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106175 Signed-off-by: Nicholas Kazlauskas Acked-by: Andrey Grodzovsky Reviewed-by Leo Li Signed-off-by: Alex Deucher commit 9422f5871d5d9ad9e168e1329a43cf9169b04712 Author: Paolo Cretaro Date: Tue Nov 13 09:45:43 2018 +0100 vfio/mdev: add static modifier to add_mdev_supported_type Set add_mdev_supported_type as static since it is only used within mdev_sysfs.c. This fixes -Wmissing-prototypes gcc warning. Signed-off-by: Paolo Cretaro Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson commit e309df5b0c9e67cc929eedd3e32f4907fa49543e Author: Alex Williamson Date: Wed Dec 12 12:51:07 2018 -0700 vfio/pci: Parallelize device open and release In commit 61d792562b53 ("vfio-pci: Use mutex around open, release, and remove") a mutex was added to freeze the refcnt for a device so that we can handle errors and perform bus resets on final close. However, bus resets can be rather slow and a global mutex here is undesirable. Evaluating the potential locking granularity, a per-device mutex provides the best resolution but with multiple devices on a bus all released concurrently, they'll race to acquire each other's mutex, likely resulting in no reset at all if we use trylock. We therefore lock at the granularity of the bus/slot reset as we're only attempting a single reset for this group of devices anyway. This allows much greater scaling as we're bounded in the number of devices protected by a single reflck object. Reported-by: Christian Ehrhardt Tested-by: Christian Ehrhardt Reviewed-by: Eric Auger Reviewed-by: Cornelia Huck Signed-off-by: Alex Williamson commit fc42d47ce0118e2f59a67ac0b0da56f9dc454bd9 Author: Andrey Grodzovsky Date: Tue Dec 11 15:31:35 2018 -0500 drm/amdgpu: Enable GPU recovery by default for CI I retested Bonaire (gfx7 dGPU) and it works fine. Signed-off-by: Andrey Grodzovsky Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit b47f515bdcd4e22b0b87141157c9ee8bc7c9bb98 Merge: 0a1213fa74327 69c32972d5938 Author: Will Deacon Date: Wed Dec 12 18:59:39 2018 +0000 Merge branch 'for-next/perf' into aarch64/for-next/core Merge in arm64 perf and PMU driver updates, including support for the system/uncore PMU in the ThunderX2 platform. commit 0a1213fa7432778b71a1c0166bf56660a3aab030 Author: Ard Biesheuvel Date: Wed Dec 12 13:08:44 2018 +0100 arm64: enable per-task stack canaries This enables the use of per-task stack canary values if GCC has support for emitting the stack canary reference relative to the value of sp_el0, which holds the task struct pointer in the arm64 kernel. The $(eval) extends KBUILD_CFLAGS at the moment the make rule is applied, which means asm-offsets.o (which we rely on for the offset value) is built without the arguments, and everything built afterwards has the options set. Reviewed-by: Kees Cook Signed-off-by: Ard Biesheuvel Signed-off-by: Will Deacon commit db23d88756abd38e0995ea8449d0025b3de4b26b Author: Evan Green Date: Tue Dec 4 11:14:19 2018 -0800 iio: adc: qcom-spmi-adc5: Initialize prescale properly adc5_get_dt_data uses a local, prop, feeds it to adc5_get_dt_channel_data, and then puts the result into adc->chan_props. The problem is adc5_get_dt_channel_data may not initialize that structure fully, so a garbage value is used for prescale if the optional "qcom,pre-scaling" is not defined in DT. adc5_read_raw then uses this as an array index, generating a crash that looks like this: [ 6.683186] Unable to handle kernel paging request at virtual address ffffff90e78c7964 Call trace: qcom_vadc_scale_code_voltage_factor+0x74/0x104 qcom_vadc_scale_hw_calib_die_temp+0x20/0x60 qcom_adc5_hw_scale+0x78/0xa4 adc5_read_raw+0x3d0/0x65c iio_channel_read+0x240/0x30c iio_read_channel_processed+0x10c/0x150 qpnp_tm_get_temp+0xc0/0x40c of_thermal_get_temp+0x7c/0x98 thermal_zone_get_temp+0xac/0xd8 thermal_zone_device_update+0xc0/0x38c qpnp_tm_probe+0x624/0x81c platform_drv_probe+0xe4/0x11c really_probe+0x188/0x3fc driver_probe_device+0xb8/0x188 __device_attach_driver+0x114/0x180 bus_for_each_drv+0xd8/0x118 __device_attach+0x180/0x27c device_initial_probe+0x20/0x2c bus_probe_device+0x78/0x124 deferred_probe_work_func+0xfc/0x138 process_one_work+0x3d8/0x8b0 process_scheduled_works+0x48/0x6c worker_thread+0x488/0x7cc kthread+0x24c/0x264 ret_from_fork+0x10/0x18 Unfortunately, when I went to add the initializer for this and tried to boot it, my machine shut down immediately, complaining that it was hotter than the sun. It appears that adc5_chans_pmic and adc5_chans_rev2 were initializing prescale_index as if it were directly a divisor, rather than the index into adc5_prescale_ratios that it is. Fix the uninitialized value, and change the static initialization to use indices into adc5_prescale_ratios. Signed-off-by: Evan Green Reviewed-by: Matthias Kaehlcke Cc: Signed-off-by: Jonathan Cameron commit a9b0a2a7c19316588421b94946c8e2e5a84ac14e Author: Jonathan Bakker Date: Fri Dec 7 20:11:36 2018 +0100 dt-bindings: iio: adc: exynos-adc: Add S5PV210 variant Add information about new compatible for S5PV210 Signed-off-by: Jonathan Bakker Signed-off-by: Paweł Chmiel Signed-off-by: Jonathan Cameron commit fa09d06522ceac428fdc5c2b57c572f6cfd0a8bb Author: Ondrej Jirman Date: Fri Dec 7 10:56:01 2018 -0500 media: v4l2-fwnode: Fix setting V4L2_MBUS_DATA_ACTIVE_HIGH/LOW flag When parallel bus is used and data-active is being parsed, incorrect flags are cleared. Clear the correct flag bits. Fixes: e9be1b863e2c2948deb003df8edd9635b4611a8a (media: v4l: fwnode: Use default parallel flags). Cc: stable@vger.kernel.org # for Kernel 4.20 Signed-off-by: Ondrej Jirman Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit d1655c7f4871eea894921fbff65d4a7e1d17f763 Author: Jonathan Bakker Date: Fri Dec 7 20:11:35 2018 +0100 iio: adc: Allow selection of Exynos ADC on S5PV210 Make it possible to use Exynos ADC driver on S5PV210 based devices. Signed-off-by: Jonathan Bakker Signed-off-by: Paweł Chmiel Signed-off-by: Jonathan Cameron commit 882bf52fdeab47dbe991cc0e564b0b51c571d0a3 Author: Jonathan Bakker Date: Fri Dec 7 20:11:34 2018 +0100 iio: adc: exynos-adc: Add S5PV210 variant S5PV210's ADC variant is almost the same as v1 except that it has 10 channels and doesn't require the pmu register Signed-off-by: Jonathan Bakker Signed-off-by: Paweł Chmiel Signed-off-by: Jonathan Cameron commit d2b4387f3bdf016e266d23cf657465f557721488 Author: Eddie James Date: Tue Dec 11 11:57:01 2018 -0500 media: platform: Add Aspeed Video Engine driver The Video Engine (VE) embedded in the Aspeed AST2400 and AST2500 SOCs can capture and compress video data from digital or analog sources. With the Aspeed chip acting a service processor, the Video Engine can capture the host processor graphics output. Add a V4L2 driver to capture video data and compress it to JPEG images. Make the video frames available through the V4L2 streaming interface. Signed-off-by: Eddie James Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8a582fa9429108c247ff56dfbc4e3ead08a76956 Author: Claudiu Beznea Date: Tue Dec 11 15:56:59 2018 +0000 regulator: add documentation for regulator modes and suspend states Add documentation for regulator modes and suspend states. Signed-off-by: Claudiu Beznea Signed-off-by: Mark Brown commit b5ebba46e694a6e8e4322a80bb2a5a448f8f8b04 Author: Claudiu Beznea Date: Tue Dec 11 15:56:50 2018 +0000 regulator: act8945a-regulator: add shutdown function Implement shutdown method to make sure the PMIC will not enter the suspend state when the system is shutdown. This work is based on work done by Borris Brezillon on [1]. [1] https://www.spinics.net/lists/kernel/msg2942960.html Signed-off-by: Claudiu Beznea Signed-off-by: Mark Brown commit 03ffbf9c0891caf8723c81967ceea5faf5d099d5 Author: Claudiu Beznea Date: Tue Dec 11 15:56:45 2018 +0000 regulator: act8945a-regulator: fix line over 80 chars warning Fix line over 80 chars checkpatch.pl warning. Signed-off-by: Claudiu Beznea Signed-off-by: Mark Brown commit 7482d6ecc68e16a2b8272b0c9cbcc5c50edf013f Author: Boris Brezillon Date: Tue Dec 11 15:56:41 2018 +0000 regulator: act8945a-regulator: Implement PM functionalities The regulator supports a dedicated suspend mode. Implement the appropriate ->set_suspend_xx() hooks, add support for ->set_mode(), and provide basic PM ops functionalities to setup the regulator in a suspend state when the system is entering suspend. Signed-off-by: Boris Brezillon [claudiu.beznea@microchip.com: remove shutdown function, use dev_pm_ops, fix checkpatch warning, adapt commit message, add LDO modes support, move modes constants to active-semi,8945a-regulator.h, remove rdevs from struct act8945a_pmic, add op_mode to act8945a_pmic] Signed-off-by: Claudiu Beznea Signed-off-by: Mark Brown commit 90bc8ac220aab82df91322e67587d0418ec3b251 Author: Claudiu Beznea Date: Tue Dec 11 15:56:36 2018 +0000 regulator: act8945a-regulator: unlock expert registers Unlock expert registers for act8945a. This is based on orginal work of Boris Brezillon at [1]. [1] https://www.spinics.net/lists/kernel/msg2942960.html Signed-off-by: Claudiu Beznea Signed-off-by: Mark Brown commit f306d76082358fa9a3fb3e66674a5852bb48845f Author: Linus Walleij Date: Tue Dec 11 10:53:19 2018 +0100 regulator: arizona-ldo1: Rely on core to handle GPIO descriptor After making sure that the regulator core always take over handling of the GPIO descriptors, the gpiod_put() on the errorpath of the Arizona LDO1 driver becomes redundant. Reported-by: Charles Keepax Signed-off-by: Linus Walleij Acked-by: Charles Keepax Signed-off-by: Mark Brown commit 355e3532132b487ebf6a4900fad8f3525fa3e137 Author: Omar Sandoval Date: Wed Dec 12 08:46:32 2018 -0800 xfs: cache minimum realtime summary level The realtime summary is a two-dimensional array on disk, effectively: u32 rsum[log2(number of realtime extents) + 1][number of blocks in the bitmap] rsum[log][bbno] is the number of extents of size 2**log which start in bitmap block bbno. xfs_rtallocate_extent_near() uses xfs_rtany_summary() to check whether rsum[log][bbno] != 0 for any log level. However, the summary array is stored in row-major order (i.e., like an array in C), so all of these entries are not adjacent, but rather spread across the entire summary file. In the worst case (a full bitmap block), xfs_rtany_summary() has to check every level. This means that on a moderately-used realtime device, an allocation will waste a lot of time finding, reading, and releasing buffers for the realtime summary. In particular, one of our storage services (which runs on servers with 8 very slow CPUs and 15 8 TB XFS realtime filesystems) spends almost 5% of its CPU cycles in xfs_rtbuf_get() and xfs_trans_brelse() called from xfs_rtany_summary(). One solution would be to also store the summary with the dimensions swapped. However, this would require a disk format change to a very old component of XFS. Instead, we can cache the minimum size which contains any extents. We do so lazily; rather than guaranteeing that the cache contains the precise minimum, it always contains a loose lower bound which we tighten when we read or update a summary block. This only uses a few kilobytes of memory and is already serialized via the realtime bitmap and summary inode locks, so the cost is minimal. With this change, the same workload only spends 0.2% of its CPU cycles in the realtime allocator. Signed-off-by: Omar Sandoval Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 2c2d9d3a205afa93bf6105e4ab6f1ff536291dc6 Author: Darrick J. Wong Date: Wed Dec 12 08:46:26 2018 -0800 xfs: count inode blocks correctly in inobt scrub A big block filesystem might require more than one inobt record to cover all the inodes in the block. In these cases it is not correct to round the irec count up to the nearest block because this causes us to overestimate the number of inode blocks we expect to find. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit c1b4a321ede083521b91c314e1c4fa233ac33740 Author: Darrick J. Wong Date: Wed Dec 12 08:46:25 2018 -0800 xfs: precalculate cluster alignment in inodes and blocks Store the inode cluster alignment information in units of inodes and blocks in the mount data so that we don't have to keep recalculating them. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit 83dcdb4469e759f984db92616d7885fc14329841 Author: Darrick J. Wong Date: Wed Dec 12 08:46:25 2018 -0800 xfs: precalculate inodes and blocks per inode cluster Store the number of inodes and blocks per inode cluster in the mount data so that we don't have to keep recalculating them. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit 43004b2a8da2652b5ec526269a8acfba7d3d219c Author: Darrick J. Wong Date: Wed Dec 12 08:46:24 2018 -0800 xfs: add a block to inode count converter Add new helpers to convert units of fs blocks into inodes, and AG blocks into AG inodes, respectively. Convert all the open-coded conversions and XFS_OFFBNO_TO_AGINO(, , 0) calls to use them, as appropriate. The OFFBNO_TO_AGINO macro is retained for xfs_repair. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit 7280fedaf3a0f9097c0621c7d5b35849954d7f54 Author: Darrick J. Wong Date: Wed Dec 12 08:46:23 2018 -0800 xfs: remove xfs_rmap_ag_owner and friends Owner information for static fs metadata can be defined readonly at build time because it never changes across filesystems. This enables us to reduce stack usage (particularly in scrub) because we can use the statically defined oinfo structures. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit 66e3237e724c6650dca03627b40bb00a812d3f7a Author: Darrick J. Wong Date: Wed Dec 12 08:46:23 2018 -0800 xfs: const-ify xfs_owner_info arguments Only certain functions actually change the contents of an xfs_owner_info; the rest can accept a const struct pointer. This will enable us to save stack space by hoisting static owner info types to be const global variables. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit 02b100fb83f9b0f8719deef6c4ed973b4d9ce00c Author: Darrick J. Wong Date: Wed Dec 12 08:46:22 2018 -0800 xfs: streamline defer op type handling There's no need to bundle a pointer to the defer op type into the defer op control structure. Instead, store the defer op type enum, which enables us to shorten some of the lines. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Reviewed-by: Brian Foster commit bc9f2b7c8a732d896753709cc9d495780ba7e9f9 Author: Darrick J. Wong Date: Wed Dec 12 08:46:22 2018 -0800 xfs: idiotproof defer op type configuration Recently, we forgot to port a new defer op type to xfsprogs, which caused us some userspace pain. Reorganize the way we make libxfs clients supply defer op type information so that all type information has to be provided at build time instead of risky runtime dynamic configuration. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Reviewed-by: Brian Foster commit 43feeea88c9cb2955b9f7ba8152ec5abeea42810 Author: Dave Chinner Date: Wed Dec 12 08:46:21 2018 -0800 xfs: zero length symlinks are not valid A log recovery failure has been reproduced where a symlink inode has a zero length in extent form. It was caused by a shutdown during a combined fstress+fsmark workload. The underlying problem is the issue in xfs_inactive_symlink(): the inode is unlocked between the symlink inactivation/truncation and the inode being freed. This opens a window for the inode to be written to disk before it xfs_ifree() removes it from the unlinked list, marks it free in the inobt and zeros the mode. For shortform inodes, the fix is simple. xfs_ifree() clears the data fork state, so there's no need to do it in xfs_inactive_symlink(). This means the shortform fork verifier will not see a zero length data fork as it mirrors the inode size through to xfs_ifree()), and hence if the inode gets written back and the fork verifiers are run they will still see a fork that matches the on-disk inode size. For extent form (remote) symlinks, it is a little more tricky. Here we explicitly set the inode size to zero, so the above race can lead to zero length symlinks on disk. Because the inode is unlinked at this point (i.e. on the unlinked list) and unreferenced, it can never be seen again by a user. Hence when we set the inode size to zeor, also change the type to S_IFREG. xfs_ifree() expects S_IFREG inodes to be of zero length, and so this avoids all the problems of zero length symlinks ever hitting the disk. It also avoids the problem of needing to handle zero length symlink inodes in log recovery to replay the extent free intents and the remaining deferops to free the extents the symlink used. Also add a couple of asserts to warn us if zero length symlinks end up in either the symlink create or inactivation paths. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit daa531db8a09dc00084a6030c81f2555a8de70ac Author: Linus Walleij Date: Tue Dec 11 10:53:18 2018 +0100 regulator: wm8994: Rely on core to handle GPIO descriptor After making sure that the regulator core always take over handling of the GPIO descriptors, the gpiod_put() on the errorpath of the wm8994 driver becomes redundant. Reported-by: Charles Keepax Signed-off-by: Linus Walleij Acked-by: Charles Keepax Signed-off-by: Mark Brown commit 95f0455c549cb926804f71cadb9be8b0af792e00 Author: Eddie James Date: Tue Dec 11 11:57:00 2018 -0500 media: dt-bindings: media: Add Aspeed Video Engine binding documentation Document the bindings. Signed-off-by: Eddie James Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8c4ce794ee7aa31d7330ea3616f9d63444df1728 Author: Colin Ian King Date: Wed Dec 12 08:46:20 2018 -0800 xfs: clean up indentation issues, remove an unwanted space There is a statement that has an unwanted space in the indentation. Remove it. Signed-off-by: Colin Ian King Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit fe5ed6c22e94b131ed5608d66ebce1efc39a7edb Author: Pan Bian Date: Wed Dec 12 08:46:20 2018 -0800 xfs: libxfs: move xfs_perag_put late The function xfs_alloc_get_freelist calls xfs_perag_put to drop the reference. However, pag->pagf_btreeblks is read and written after the put operation. This patch moves the put operation later. Signed-off-by: Pan Bian Reviewed-by: Carlos Maiolino [darrick: minor changelog edits] Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit d6f215f359637db116f0a671cc445317ea82d01e Author: Darrick J. Wong Date: Wed Dec 12 08:46:19 2018 -0800 xfs: split up the xfs_reflink_end_cow work into smaller transactions In xfs_reflink_end_cow, we allocate a single transaction for the entire end_cow operation and then loop the CoW fork mappings to move them to the data fork. This design fails on a heavily fragmented filesystem where an inode's data fork has exactly one more extent than would fit in an extents-format fork, because the unmap can collapse the data fork into extents format (freeing the bmbt block) but the remap can expand the data fork back into a (newly allocated) bmbt block. If the number of extents we end up remapping is large, we can overflow the block reservation because we reserved blocks assuming that we were adding mappings into an already-cleared area of the data fork. Let's say we have 8 extents in the data fork, 8 extents in the CoW fork, and the data fork can hold at most 7 extents before needing to convert to btree format; and that blocks A-P are discontiguous single-block extents: 0......7 D: ABCDEFGH C: IJKLMNOP When a write to file blocks 0-7 completes, we must remap I-P into the data fork. We start by removing H from the btree-format data fork. Now we have 7 extents, so we convert the fork to extents format, freeing the bmbt block. We then move P into the data fork and it now has 8 extents again. We must convert the data fork back to btree format, requiring a block allocation. If we repeat this sequence for blocks 6-5-4-3-2-1-0, we'll need a total of 8 block allocations to remap all 8 blocks. We reserved only enough blocks to handle one btree split (5 blocks on a 4k block filesystem), which means we overflow the block reservation. To fix this issue, create a separate helper function to remap a single extent, and change _reflink_end_cow to call it in a tight loop over the entire range we're completing. As a side effect this also removes the size restrictions on how many extents we can end_cow at a time, though nobody ever hit that. It is not reasonable to reserve N blocks to remap N blocks. Note that this can be reproduced after ~320 million fsx ops while running generic/938 (long soak directio fsx exerciser): XFS: Assertion failed: tp->t_blk_res >= tp->t_blk_res_used, file: fs/xfs/xfs_trans.c, line: 116 Call Trace: xfs_trans_dup+0x211/0x250 [xfs] xfs_trans_roll+0x6d/0x180 [xfs] xfs_defer_trans_roll+0x10c/0x3b0 [xfs] xfs_defer_finish_noroll+0xdf/0x740 [xfs] xfs_defer_finish+0x13/0x70 [xfs] xfs_reflink_end_cow+0x2c6/0x680 [xfs] xfs_dio_write_end_io+0x115/0x220 [xfs] iomap_dio_complete+0x3f/0x130 iomap_dio_rw+0x3c3/0x420 xfs_file_dio_aio_write+0x132/0x3c0 [xfs] xfs_file_write_iter+0x8b/0xc0 [xfs] __vfs_write+0x193/0x1f0 vfs_write+0xba/0x1c0 ksys_write+0x52/0xc0 do_syscall_64+0x50/0x160 entry_SYSCALL_64_after_hwframe+0x49/0xbe Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster commit b7169ddea2f2a90538f606688adf4948f2da82ce Author: Kuninori Morimoto Date: Wed Dec 12 16:03:58 2018 +0900 ASoC: rsnd: remove RSND_REG_ from rsnd_reg Current rsnd is using RSND_REG_xxx for register naming, and using RSND_REG_##f style macro for read/write. The biggest reason why it uses this style is that we can avoid non-existing register access. But, its demerit is sequential register access code will be very ugly. Current rsnd driver is well tested, so, let's remove RSND_REG_ from rsnd_reg, and cleanup sequential register access code. Signed-off-by: Kuninori Morimoto Tested-by: Hiroyuki Yokoyama Signed-off-by: Mark Brown commit 25ac3da61ba144f8dbfe377eeec6b1da7ad0854a Author: Przemyslaw Gaj Date: Wed Dec 12 11:39:40 2018 +0000 i3c: master: cdns: fix I2C transfers in Cadence I3C master driver This patch fixes I2C transfers in Cadence I3C master driver. There was no way to queue more than one I2C transfer before. Fixes: 603f2bee2c54 ("i3c: master: Add driver for Cadence IP") Signed-off-by: Przemyslaw Gaj Signed-off-by: Boris Brezillon commit 4868d2b662f55ff2e27e92c44b14016531a022a0 Author: Christian Borntraeger Date: Wed Dec 12 15:59:29 2018 +0100 MAINTAINERS/vfio-ccw: add Farhan and Eric, make Halil Reviewer Eric and Farhan will help with maintaining vfio-ccw. Cc: Cornelia Huck Cc: Halil Pasic Cc: Farhan Ali Cc: Eric Farman Signed-off-by: Christian Borntraeger Message-Id: <20181212145929.136522-1-borntraeger@de.ibm.com> Acked-by: Halil Pasic Acked-by: Farhan Ali Acked-by: Eric Farman Signed-off-by: Cornelia Huck commit 0bcc547ec4b03a0b66615694561cce9c5a9a1014 Author: Masahiro Yamada Date: Tue Dec 11 20:00:50 2018 +0900 kconfig: clean up EOF handling in the lexer A new file should always start in the INITIAL state. When the lexer bumps into EOF, the lexer must get back to the INITIAL state anyway. Remove the redundant <> pattern in the PARAM state. Signed-off-by: Masahiro Yamada commit cc66bca775eeb81ef24456338bcd97e2e780c236 Author: Masahiro Yamada Date: Tue Dec 11 20:00:49 2018 +0900 kconfig: fix ambiguous grammar in terms of new lines This commit decreases 8 shift/reduce conflicts. A certain amount of grammatical ambiguity comes from how to reduce excessive T_EOL tokens. Let's take a look at the example code below: 1 config A 2 bool "a" 3 4 depends on B 5 6 config B 7 def_bool y The line 3 is melt into "config_option_list", but the line 5 can be either a part of "config_option_list" or "common_stmt" by itself. Currently, the lexer converts '\n' to T_EOL verbatim. In Kconfig, a new line works as a statement terminator, but new lines in empty lines are not critical since empty lines (or lines that contain only whitespaces/comments) are just no-op. If the lexer simply discards no-op lines, the parser will not be bothered by excessive T_EOL tokens. Of course, this means we are shifting the complexity from the parser to the lexer, but it is much easier than tackling on shift/reduce conflicts. I introduced the second stage lexer to tweak the behavior. Discard T_EOL if the previous token is T_EOL or T_HELPTEXT. Two T_EOL tokens in a row is meaningless. T_HELPTEXT is a special token that is reduced without T_EOL. Signed-off-by: Masahiro Yamada commit 21c5ecf60472be9f1b5bfe0b94870bef93db4202 Author: Masahiro Yamada Date: Tue Dec 11 20:00:48 2018 +0900 kconfig: refactor pattern matching in STRING state Here, similar matching patters are duplicated in order to look ahead the '\n' character. If the next character is '\n', the lexer returns T_WORD_QUOTE because it must be prepared to return T_EOL at the next match. Use unput('\n') trick to reduce the code duplication. Signed-off-by: Masahiro Yamada commit be3c8075978a420b6eae944250bf336aa11d4964 Author: Masahiro Yamada Date: Tue Dec 11 20:00:47 2018 +0900 kconfig: remove unneeded pattern matching to whitespaces Whitespaces are consumed in the COMMAND state anyway. Signed-off-by: Masahiro Yamada commit 413cd19d81fd675c6932abf91fe2b54d5ae72c7d Author: Masahiro Yamada Date: Tue Dec 11 20:00:46 2018 +0900 kconfig: require T_EOL to reduce visible statement All line-oriented statements should be reduced when seeing a T_EOL token. I guess missing T_EOL for the "visible" statement is just a mistake. This commit decreases one shift/reduce conflict. Signed-off-by: Masahiro Yamada commit fbac5977d81cb2b2b7e37b11c459055d9585273c Author: Masahiro Yamada Date: Tue Dec 11 20:00:45 2018 +0900 kconfig: fix memory leak when EOF is encountered in quotation An unterminated string literal followed by new line is passed to the parser (with "multi-line strings not supported" warning shown), then handled properly there. On the other hand, an unterminated string literal at end of file is never passed to the parser, then results in memory leak. [Test Code] ----------(Kconfig begin)---------- source "Kconfig.inc" config A bool "a" -----------(Kconfig end)----------- --------(Kconfig.inc begin)-------- config B bool "b\No new line at end of file ---------(Kconfig.inc end)--------- [Summary from Valgrind] Before the fix: LEAK SUMMARY: definitely lost: 16 bytes in 1 blocks ... After the fix: LEAK SUMMARY: definitely lost: 0 bytes in 0 blocks ... Eliminate the memory leak path by handling this case. Of course, such a Kconfig file is wrong already, so I will add an error message later. Signed-off-by: Masahiro Yamada commit 77c1c0fa8b1477c5799bdad65026ea5ff676da44 Author: Masahiro Yamada Date: Tue Dec 11 20:00:44 2018 +0900 kconfig: fix file name and line number of warn_ignored_character() Currently, warn_ignore_character() displays invalid file name and line number. The lexer should use current_file->name and yylineno, while the parser should use zconf_curname() and zconf_lineno(). This difference comes from that the lexer is always going ahead of the parser. The parser needs to look ahead one token to make a shift/reduce decision, so the lexer is requested to scan more text from the input file. This commit fixes the warning message from warn_ignored_character(). [Test Code] ----(Kconfig begin)---- / -----(Kconfig end)----- [Output] Before the fix: :0:warning: ignoring unsupported character '/' After the fix: Kconfig:1:warning: ignoring unsupported character '/' Signed-off-by: Masahiro Yamada commit d288d95842f1503414b7eebce3773bac3390457e Author: Jan Kara Date: Wed Dec 12 14:29:20 2018 +0100 udf: Fix BUG on corrupted inode When inode is corrupted so that extent type is invalid, some functions (such as udf_truncate_extents()) will just BUG. Check that extent type is valid when loading the inode to memory. Reported-by: Anatoly Trosinenko Signed-off-by: Jan Kara commit 4ab215061554ae2a4b78744a5dd3b3c6639f16a7 Author: Robin Murphy Date: Tue Dec 11 18:48:48 2018 +0000 arm64: Add memory hotplug support Wire up the basic support for hot-adding memory. Since memory hotplug is fairly tightly coupled to sparsemem, we tweak pfn_valid() to also cross-check the presence of a section in the manner of the generic implementation, before falling back to memblock to check for no-map regions within a present section as before. By having arch_add_memory(() create the linear mapping first, this then makes everything work in the way that __add_section() expects. We expect hotplug to be ACPI-driven, so the swapper_pg_dir updates should be safe from races by virtue of the global device hotplug lock. Signed-off-by: Robin Murphy Signed-off-by: Will Deacon commit 6e4ede698d1c17102e42c6f734f7d8cf60df28d5 Author: Will Deacon Date: Wed Dec 12 14:17:20 2018 +0000 arm64: percpu: Fix LSE implementation of value-returning pcpu atomics Commit 959bf2fd03b5 ("arm64: percpu: Rewrite per-cpu ops to allow use of LSE atomics") introduced alternative code sequences for the arm64 percpu atomics, so that the LSE instructions can be patched in at runtime if they are supported by the CPU. Unfortunately, when patching in the LSE sequence for a value-returning pcpu atomic, the argument registers are the wrong way round. The implementation of this_cpu_add_return() therefore ends up adding uninitialised stack to the percpu variable and returning garbage. As it turns out, there aren't very many users of the value-returning percpu atomics in mainline and we only spotted this due to a failure in the kprobes selftests. In this case, when attempting to single-step over the out-of-line instruction slot, the debug monitors would not be enabled because calling this_cpu_inc_return() on the kernel debug monitor refcount would fail to detect the transition from 0. We would consequently execute past the slot and take an undefined instruction exception from the kernel, resulting in a BUG: | kernel BUG at arch/arm64/kernel/traps.c:421! | PREEMPT SMP | pc : do_undefinstr+0x268/0x278 | lr : do_undefinstr+0x124/0x278 | Process swapper/0 (pid: 1, stack limit = 0x(____ptrval____)) | Call trace: | do_undefinstr+0x268/0x278 | el1_undef+0x10/0x78 | 0xffff00000803c004 | init_kprobes+0x150/0x180 | do_one_initcall+0x74/0x178 | kernel_init_freeable+0x188/0x224 | kernel_init+0x10/0x100 | ret_from_fork+0x10/0x1c Fix the argument order to get the value-returning pcpu atomics working correctly when implemented using the LSE instructions. Reported-by: Catalin Marinas Tested-by: Catalin Marinas Signed-off-by: Will Deacon commit 241414967fb92fdd6f4da27df74b9c9eb11d05f7 Author: Parvi Kaustubhi Date: Tue Dec 11 14:15:43 2018 -0800 MAINTAINERS: Update usnic driver maintainers Add Nelson Escobar and myself as maintainers for drivers/infiniband/hw/usnic Signed-off-by: Parvi Kaustubhi Signed-off-by: Jason Gunthorpe commit 3023a1e93656c02b8d6a3a46e712b815843fa514 Author: Kamal Heib Date: Mon Dec 10 21:09:48 2018 +0200 RDMA: Start use ib_device_ops Make all the required change to start use the ib_device_ops structure. Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 02a42f8e40caed53fd357c9c33912e1bfb6f0365 Author: Kamal Heib Date: Mon Dec 10 21:09:47 2018 +0200 RDMA/rdmavt: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops() and remove the use of check_driver_override(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 573efc4b3ce8f01b0ca6abbf22154f73c7ee1012 Author: Kamal Heib Date: Mon Dec 10 21:09:46 2018 +0200 RDMA/rxe: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 20a6b5886102bac96e7dc5f1c6ffb6543ad4b479 Author: Kamal Heib Date: Mon Dec 10 21:09:45 2018 +0200 RDMA/vmw_pvrdma: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit e761058190b49e1d672bc5fef8cfefdec3b7d555 Author: Kamal Heib Date: Mon Dec 10 21:09:44 2018 +0200 RDMA/usnic: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 16b0ba9571f99a3beb9e13e7340b04f34608c93a Author: Kamal Heib Date: Mon Dec 10 21:09:43 2018 +0200 RDMA/qib: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit bd59461e57b4163dbba8aaa131a6c2a61e1bdaab Author: Kamal Heib Date: Mon Dec 10 21:09:42 2018 +0200 RDMA/qedr: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit a263c1241a18975756fcdbb6ccdb6460c89b04a5 Author: Kamal Heib Date: Mon Dec 10 21:09:41 2018 +0200 RDMA/ocrdma: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 5a6c6e71acb069f0d7707fbc9b29a93cbe241d46 Author: Kamal Heib Date: Mon Dec 10 21:09:40 2018 +0200 RDMA/nes: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 56e2a43136b77205fc4a33f8915d6a289396668a Author: Kamal Heib Date: Mon Dec 10 21:09:39 2018 +0200 RDMA/mthca: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 96458233ee73b6082f75c1a55c9a4ad6ea7913d5 Author: Kamal Heib Date: Mon Dec 10 21:09:38 2018 +0200 RDMA/mlx5: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit c3296a1391cb0ffbea95ee2249af63cb45e4899b Author: Mark Rutland Date: Wed Dec 12 12:22:19 2018 +0000 arm64: add While we can export symbols from assembly files, CONFIG_MODVERIONS requires C declarations of anyhting that's exported. Let's account for this as other architectures do by placing these declarations in , which kbuild will automatically use to generate modversion information for assembly files. Since we already define most prototypes in existing headers, we simply need to include those headers in , and don't need to duplicate these. Reviewed-by: Robin Murphy Signed-off-by: Mark Rutland Signed-off-by: Will Deacon commit 1554509b0d007287ecd4be887ae94d3730cbf2b7 Author: Pierre Morel Date: Wed Oct 17 11:18:39 2018 +0200 vfio: ccw: Merge BUSY and BOXED states VFIO_CCW_STATE_BOXED and VFIO_CCW_STATE_BUSY have identical actions for the same events. Let's merge both into a single state to simplify the code. We choose to keep VFIO_CCW_STATE_BUSY. Signed-off-by: Pierre Morel Message-Id: <1539767923-10539-2-git-send-email-pmorel@linux.ibm.com> Reviewed-by: Eric Farman Signed-off-by: Cornelia Huck commit 544fbd16a461a318cd80537d1331c0df5c6cf930 Author: Ming Lei Date: Wed Dec 12 19:44:34 2018 +0800 block: deactivate blk_stat timer in wbt_disable_default() rwb_enabled() can't be changed when there is any inflight IO. wbt_disable_default() may set rwb->wb_normal as zero, however the blk_stat timer may still be pending, and the timer function will update wrb->wb_normal again. This patch introduces blk_stat_deactivate() and applies it in wbt_disable_default(), then the following IO hang triggered when running parted & switching io scheduler can be fixed: [ 369.937806] INFO: task parted:3645 blocked for more than 120 seconds. [ 369.938941] Not tainted 4.20.0-rc6-00284-g906c801e5248 #498 [ 369.939797] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 369.940768] parted D 0 3645 3239 0x00000000 [ 369.941500] Call Trace: [ 369.941874] ? __schedule+0x6d9/0x74c [ 369.942392] ? wbt_done+0x5e/0x5e [ 369.942864] ? wbt_cleanup_cb+0x16/0x16 [ 369.943404] ? wbt_done+0x5e/0x5e [ 369.943874] schedule+0x67/0x78 [ 369.944298] io_schedule+0x12/0x33 [ 369.944771] rq_qos_wait+0xb5/0x119 [ 369.945193] ? karma_partition+0x1c2/0x1c2 [ 369.945691] ? wbt_cleanup_cb+0x16/0x16 [ 369.946151] wbt_wait+0x85/0xb6 [ 369.946540] __rq_qos_throttle+0x23/0x2f [ 369.947014] blk_mq_make_request+0xe6/0x40a [ 369.947518] generic_make_request+0x192/0x2fe [ 369.948042] ? submit_bio+0x103/0x11f [ 369.948486] ? __radix_tree_lookup+0x35/0xb5 [ 369.949011] submit_bio+0x103/0x11f [ 369.949436] ? blkg_lookup_slowpath+0x25/0x44 [ 369.949962] submit_bio_wait+0x53/0x7f [ 369.950469] blkdev_issue_flush+0x8a/0xae [ 369.951032] blkdev_fsync+0x2f/0x3a [ 369.951502] do_fsync+0x2e/0x47 [ 369.951887] __x64_sys_fsync+0x10/0x13 [ 369.952374] do_syscall_64+0x89/0x149 [ 369.952819] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 369.953492] RIP: 0033:0x7f95a1e729d4 [ 369.953996] Code: Bad RIP value. [ 369.954456] RSP: 002b:00007ffdb570dd48 EFLAGS: 00000246 ORIG_RAX: 000000000000004a [ 369.955506] RAX: ffffffffffffffda RBX: 000055c2139c6be0 RCX: 00007f95a1e729d4 [ 369.956389] RDX: 0000000000000001 RSI: 0000000000001261 RDI: 0000000000000004 [ 369.957325] RBP: 0000000000000002 R08: 0000000000000000 R09: 000055c2139c6ce0 [ 369.958199] R10: 0000000000000000 R11: 0000000000000246 R12: 000055c2139c0380 [ 369.959143] R13: 0000000000000004 R14: 0000000000000100 R15: 0000000000000008 Cc: stable@vger.kernel.org Cc: Paolo Valente Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit f9dca0f0675e7249e10bba259392a582836e5e6e Author: Nishanth Menon Date: Sat Dec 8 10:00:42 2018 -0600 PM / AVS: SmartReflex: Switch to SPDX Licence ID Fix up licensing to be inline with Linux conventions. Signed-off-by: Nishanth Menon Acked-by: Kevin Hilman Signed-off-by: Rafael J. Wysocki commit 14d338a857f05f894ba3badd9e6d3039c68b8180 Author: Thomas Meyer Date: Sun Dec 2 21:52:11 2018 +0100 PM / AVS: SmartReflex: NULL check before some freeing functions is not needed NULL check before some freeing functions is not needed. Signed-off-by: Thomas Meyer Reviewed-by: Kevin Hilman Signed-off-by: Rafael J. Wysocki commit 9b31cf493ffa40914e02998381993116e574c651 Author: Will Deacon Date: Wed Dec 12 11:51:40 2018 +0000 arm64: mm: Introduce MAX_USER_VA_BITS definition With the introduction of 52-bit virtual addressing for userspace, we are now in a position where the virtual addressing capability of userspace may exceed that of the kernel. Consequently, the VA_BITS definition cannot be used blindly, since it reflects only the size of kernel virtual addresses. This patch introduces MAX_USER_VA_BITS which is either VA_BITS or 52 depending on whether 52-bit virtual addressing has been configured at build time, removing a few places where the 52 is open-coded based on explicit CONFIG_ guards. Signed-off-by: Will Deacon commit eaf3074e0a8c2a39c4c14aa8ef1c2ec09ace9c79 Author: Arnd Bergmann Date: Tue Dec 11 11:06:25 2018 +0100 usb: renesas_usbhs: mark PM functions as __maybe_unused Without CONFIG_PM, we get a new build warning here: drivers/usb/renesas_usbhs/common.c:860:12: error: 'usbhsc_resume' defined but not used [-Werror=unused-function] static int usbhsc_resume(struct device *dev) ^~~~~~~~~~~~~ drivers/usb/renesas_usbhs/common.c:844:12: error: 'usbhsc_suspend' defined but not used [-Werror=unused-function] static int usbhsc_suspend(struct device *dev) ^~~~~~~~~~~~~~ Fixes: d54d334e75b9 ("usb: renesas_usbhs: Use SIMPLE_DEV_PM_OPS macro") Signed-off-by: Arnd Bergmann Reviewed-by: Yoshihiro Shimoda Signed-off-by: Greg Kroah-Hartman commit c238ec3ef638f87d8d701600d13a185b011fa078 Author: Suwan Kim Date: Tue Dec 4 23:31:43 2018 +0900 usb: core: Remove unnecessary memset() register_root_hub() calls memset() setting usb_dev->bus->devmap. devicemap to 0 during hcd probe function (usb_hcd_pci_probe). But in previous function which is also the procedure of usb_hcd_pci_probe(), usb_bus_init() already initialized bus->devmap calling memset(). Furthermore, register_root_hub() is called only once in kernel. So, calling memset() which resets usb_bus->devmap.devicemap in register_root_hub() is redundant. Signed-off-by: Suwan Kim Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman commit 9e412c66a8a24fabad97b706132ee270db2e4c8e Author: Yangtao Li Date: Wed Dec 5 11:33:39 2018 -0500 usb: host: isp1362-hcd: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Greg Kroah-Hartman commit 27a2660f1ef944724956d92e8a312b6da0936fae Author: Bob Peterson Date: Wed Apr 18 12:05:01 2018 -0700 gfs2: Dump nrpages for inodes and their glocks This patch is based on an idea from Steve Whitehouse. The idea is to dump the number of pages for inodes in the glock dumps. The additional locking required me to drop const from quite a few places. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 2d29f6b96d8f80322ed2dd895bca590491c38d34 Author: Andreas Gruenbacher Date: Tue Dec 4 15:06:27 2018 +0100 gfs2: Fix loop in gfs2_rbm_find Fix the resource group wrap-around logic in gfs2_rbm_find that commit e579ed4f44 broke. The bug can lead to unnecessary repeated scanning of the same bitmaps; there is a risk that future changes will turn this into an endless loop. Fixes: e579ed4f44 ("GFS2: Introduce rbm field bii") Cc: stable@vger.kernel.org # v3.13+ Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson commit 5ac93d0c5d8cb12156933d1dc358e59f559e5b31 Merge: ed0a773bff5f2 4fe4f9fecc369 Author: Greg Kroah-Hartman Date: Wed Dec 12 12:29:23 2018 +0100 Merge tag 'usb-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: USB changes for v4.21 So it looks like folks are interested in dwc3 again. Almost 64% of the changes are in dwc3 this time around with some other bits in gadget functions and dwc2. There are two important parts here: a. removal of the waitqueue from dwc3's dequeue implementation, which will guarantee that gadget functions can dequeue from any context and; b. better method for starting isochronous transfers to avoid, as much as possible, missed isoc frames. Apart from these, we have the usual set of non-critical fixes and new features all over the place. * tag 'usb-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb: (56 commits) usb: dwc2: Fix disable all EP's on disconnect usb: dwc3: gadget: Disable CSP for stream OUT ep usb: dwc2: disable power_down on Amlogic devices Revert "usb: dwc3: pci: Use devm functions to get the phy GPIOs" USB: gadget: udc: s3c2410_udc: convert to DEFINE_SHOW_ATTRIBUTE usb: mtu3: fix dbginfo in qmu_tx_zlp_error_handler usb: dwc3: trace: add missing break statement to make compiler happy usb: dwc3: gadget: Report isoc transfer frame number usb: gadget: Introduce frame_number to usb_request usb: renesas_usbhs: Use SIMPLE_DEV_PM_OPS macro usb: renesas_usbhs: Remove dummy runtime PM callbacks usb: dwc2: host: use hrtimer for NAK retries usb: mtu3: clear SOFTCONN when clear USB3_EN if work as HS mode usb: mtu3: enable SETUPENDISR interrupt usb: mtu3: fix the issue about SetFeature(U1/U2_Enable) usb: mtu3: enable hardware remote wakeup from L1 automatically usb: mtu3: remove QMU checksum usb/mtu3: power down device ip at setup usb: dwc2: Disable power down feature on Samsung SoCs usb: dwc3: Correct the logic for checking TRB full in __dwc3_prepare_one_trb() ... commit e894075934a44ef66413fd1046808542011d8552 Author: Nishad Kamdar Date: Thu Dec 6 21:27:06 2018 +0530 staging: mt7621-mmc: Fix incompletely removed #if 0 block in sd.c Commit 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c") does not completely remove an #if 0 block in sd.c. This causes the function msdc_select_clksrc() which was eariler not compiled, to be compiled. That causes an error - MSDC_CLKSRC_REG is not defined. This patch completely removes the #if 0 block Reported-by: NeilBrown Fixes: 2a54e3259e2a ("staging: mt7621-mmc: Remove #if 0 blocks in sd.c") Signed-off-by: Nishad Kamdar Reviewed-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 4cc357c500d38d964e98bfa417af50063cf38c67 Author: Stefan Wahren Date: Thu Dec 6 19:29:00 2018 +0100 staging: bcm2835-camera: Add hint about possible faulty config As per default the GPU memory config of the Raspberry Pi isn't sufficient for the camera usage. Even worse the bcm2835 camera driver doesn't provide a helpful error message in this case. So let's add a hint to point the user to the likely cause. Signed-off-by: Stefan Wahren Reviewed-by: Nicolas Saenz Julienne Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 9c85a4d0aeab2c70c18ce4e3939c202d9c1c8235 Author: Stefan Wahren Date: Thu Dec 6 19:28:59 2018 +0100 staging: bcm2835-camera: Provide more specific probe error messages Currently there is only a catch-all info message which print the relevant error code without any context. So add more specific error messages in order to narrow down possible issues. Signed-off-by: Stefan Wahren Reviewed-by: Nicolas Saenz Julienne Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit b7491a9fca2dc2535b9dc922550a37c5baae9d3d Author: Stefan Wahren Date: Thu Dec 6 19:28:58 2018 +0100 staging: bcm2835-audio: Drop DT dependency Just like the bcm2835-video make this a platform driver which is probed by vchiq. In order to change the number of channels use a module parameter instead, but use the maximum as default. Signed-off-by: Stefan Wahren Reviewed-by: Nicolas Saenz Julienne Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit c04a8fe45845cc9e977de7fefd9d1871a3c905f2 Author: Stefan Wahren Date: Thu Dec 6 19:28:57 2018 +0100 staging: bcm2835-audio: use module_platform_driver() macro There is not much value behind this boilerplate, so use module_platform_driver() instead. Signed-off-by: Stefan Wahren Reviewed-by: Nicolas Saenz Julienne Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 736b0ec4865aeb426b71f3a14dc7b6cd18b611ab Author: Stefan Wahren Date: Thu Dec 6 19:28:56 2018 +0100 staging: bcm2835-audio: Enable compile test Enable the compilation test for bcm2835-audio to gain more build coverage. Signed-off-by: Stefan Wahren Reviewed-by: Nicolas Saenz Julienne Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 25c7597af20d2b1d042bafd9be84eaa69c1690b7 Author: Stefan Wahren Date: Thu Dec 6 19:28:55 2018 +0100 staging: vchiq_arm: Register a platform device for audio Following Eric's commit 37b7b3087a2f ("staging/vc04_services: Register a platform device for the camera driver.") this register the audio driver as a platform device, too. Signed-off-by: Stefan Wahren Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 405e2f98637d79b17434afc2596f5a49f418cc72 Author: Stefan Wahren Date: Thu Dec 6 19:28:54 2018 +0100 staging: vchiq_arm: Fix camera device registration Since the camera driver isn't probed via DT, we need to properly setup DMA. Fixes: 37b7b3087a2f ("staging/vc04_services: Register a platform device for the camera driver.") Signed-off-by: Stefan Wahren Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 1a321ea68b0f20dbd7654c09116a87b96b0cde3e Author: Stefan Wahren Date: Thu Dec 6 19:28:53 2018 +0100 staging: bcm2835-camera: Move module info to the end In order to have this more consistent between the vc04 services move the module information to the end of the file. Signed-off-by: Stefan Wahren Reviewed-by: Nicolas Saenz Julienne Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 3a2c20024a2b47adbf514e7f3ab79342739c3926 Author: Stefan Wahren Date: Thu Dec 6 19:28:52 2018 +0100 staging: bcm2835-camera: fix module autoloading In order to make the module bcm2835-camera load automatically, we need to add a module alias. Fixes: 4bebb0312ea9 ("staging/bcm2835-camera: Set ourselves up as a platform driver.") Signed-off-by: Stefan Wahren Reviewed-by: Nicolas Saenz Julienne Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit 7566f39dfdc11f8a97d5810c6e6295a88f97ef91 Author: Stefan Wahren Date: Thu Dec 6 19:28:51 2018 +0100 staging: bcm2835-camera: Abort probe if there is no camera Abort the probing of the camera driver in case there isn't a camera actually connected to the Raspberry Pi. This solution also avoids a NULL ptr dereference of mmal instance on driver unload. Fixes: 7b3ad5abf027 ("staging: Import the BCM2835 MMAL-based V4L2 camera driver.") Signed-off-by: Stefan Wahren Reviewed-by: Nicolas Saenz Julienne Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman commit a36b2606795800a15f6f33ee4c283ad66e1d7bfe Author: Uwe Kleine-König Date: Mon Oct 15 10:21:52 2018 +0200 pwm: Drop legacy wrapper for changing polarity The API to configure a PWM using pwm_enable(), pwm_disable(), pwm_config() and pwm_set_polarity() is superseeded by atomically setting the parameters using pwm_apply_state(). To get forward with deprecating the former set of functions use the opportunity that there is no current user of pwm_set_polarity() and remove it. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 99c22707ef647f692b6beb274fed2b6893955a3a Author: NeilBrown Date: Sun Dec 9 16:20:33 2018 +1100 staging: mt7621-dts: avoid warnings in pinctrl definitions The device-tree checking code sees node names "i2c" and "spi" in the pinctrl definition and thinks these are defining i2c or spi devices, and complains that they look wrong. So add a '0' to the end of each name (much like "uart" and "rgmii" have numbers at the end) to avoid the warning. Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit d17f5ff7713f9be7da820f4295e35d1862b3eb29 Author: NeilBrown Date: Sun Dec 9 16:20:33 2018 +1100 staging: mt7621-mmc: fix compile warnging: cmd_buf cmd_buf is only used when MT6575_SD_DEBUG is defined. So only declare it in that case. Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit a6bf8820224dc226bc3fd4aac27169f6fc38d26f Author: NeilBrown Date: Sun Dec 9 16:20:33 2018 +1100 staging: mt7621-mmc: add missing header. is sometimes included by other include files, and sometimes not, depending on config, particularly CONFIG_HIGHMEM. So include it explicitly rather than relying on implicit inclusion. Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 5b0d9cd7211d2f4bf4acc539c3ba4f346c43b0fe Author: NeilBrown Date: Sun Dec 9 16:20:32 2018 +1100 staging: mt7621-eth: fix compile warning. This code generates a waring as PHY_GBIT_FEATURES is "long" but ->supported in "int". It looks likely that "PHY_1000BT_FEATURES" is the correct define to use - it is intended to be used with the ->features field. Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 90dedc973b867afe514e13c4c3de3e03aa1ee951 Author: NeilBrown Date: Sun Dec 9 16:20:32 2018 +1100 staging: mt7621-dts: allow gnubee to reboot cleanly. Since commit bb276262e88d ("mtd: spi-nor: only apply reset hacks to broken hardware"), we need to mark the spi-nor as "broken" for reboot to work. Note that nothing is actually broken here. The hardware-watchdog in the SoC isn't wired in a way that works, but then the board doesn't claim to support a hardware watchdog - and the SPI certain isn't "broken". This causes an annoying warning on every boot, but that is better than failing on ever reboot. Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 84519a4b0fae9e20085cef0369aa6a5d144860e4 Author: NeilBrown Date: Sun Dec 9 16:20:32 2018 +1100 staging: mt7621-mmc: set correct dma mask. Since commit f8c55dc6e828 ("MIPS: use generic dma noncoherent ops for simple noncoherent platforms") changed MIPS dma handling, the mmc driver fails because it doesn't have a dma mask is set. So set the correct dma mask. Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 370e0a71012744383b4a3ea8882961b63e626d09 Author: NeilBrown Date: Sun Dec 9 16:20:32 2018 +1100 staging: mt7621-eth: set correct dma mask. Since commit f8c55dc6e828 ("MIPS: use generic dma noncoherent ops for simple noncoherent platforms") changed MIPS dma handling, the eth driver fails because the dma mask is set on the wrong 'struct device'. Move the setting to the correct struct device. Signed-off-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 446e8986a2417148aed14f362831bf2425d434cb Author: Sandeep Sheriker Mallikarjun Date: Wed Dec 12 11:41:10 2018 +0100 ARM: at91: add support in soc driver for new SAM9X60 Add detection of new SAM9X60 by this soc.c driver. Signed-off-by: Nicolas Ferre [nicolas.ferre@microchip.com: split patch] Signed-off-by: Sandeep Sheriker Mallikarjun Signed-off-by: Alexandre Belloni commit bf9b0b1b0b6cd51797ce79b6fa5fc2d1baa2719e Author: Michal Vokáč Date: Mon Oct 1 16:19:48 2018 +0200 pwm: imx: Implement get_state() function for hardware readout Implement the get_state() function and set the initial state to reflect real state of the hardware. This allows to keep the PWM running if it was enabled in bootloader. It is very similar to the GPIO behavior. GPIO pin set as output in bootloader keep the same setting in Linux unless it is reconfigured. If we find the PWM block enabled we need to prepare and enable its source clock otherwise the clock will be disabled late in the boot as unused. That will leave the PWM in enabled state but with disabled clock. That has a side effect that the PWM output is left at its current level at which the clock was disabled. It is totally non-deterministic and it may be LOW or HIGH. Signed-off-by: Michal Vokáč Signed-off-by: Thierry Reding commit 9f617ada9f823dff1944ebcf92ef4a05f5f322b7 Author: Michal Vokáč Date: Mon Oct 1 16:19:47 2018 +0200 pwm: imx: Use bitops and bitfield macros to define register values Use existing macros to define register fields instead of manually shifting the bit masks. Also define some more register bits. Signed-off-by: Michal Vokáč Signed-off-by: Thierry Reding commit e3adc7efe678ba907f99791f5adfee81faea10e6 Author: Michal Vokáč Date: Mon Oct 1 16:19:46 2018 +0200 pwm: imx: Sort include files Sort included header files alphabetically. Signed-off-by: Michal Vokáč Signed-off-by: Thierry Reding commit 852b2876a8a82f2c618da40b881bb07c2d42eb5c Author: Arnd Bergmann Date: Mon Dec 10 22:11:58 2018 +0100 staging: vchiq: rework remove_event handling I had started the removal of semaphores in this driver without knowing that Nicolas Saenz Julienne also worked on this. In case of the "remote event" infrastructure, my solution seemed significantly better, so I'm proposing this as a change on top. The problem with using either semaphores or completions here is that it's an overly complex way of waking up a thread, and it looks like the 'count' of the semaphore can easily get out of sync, even though I found it hard to come up with a specific example. Changing it to a 'wait_queue_head_t' instead of a completion simplifies this by letting us wait directly on the 'event->fired' variable that is set by the videocore. Another simplification is passing the wait queue directly into the helper functions instead of going through the fragile logic of recording the offset inside of a structure as part of a shared memory variable. This also avoids one uncached memory read and should be faster. Note that I'm changing it back to 'killable' after the previous patch changed 'killable' to 'interruptible', apparently based on a misunderstanding of the subtle down_interruptible() macro override in vchiq_killable.h. Fixes: f27e47bc6b8b ("staging: vchiq: use completions instead of semaphores") Signed-off-by: Arnd Bergmann Signed-off-by: Greg Kroah-Hartman commit 8bdf15fa67d8f24af31fb418bde9d02c563e8da8 Author: Arnd Bergmann Date: Mon Dec 10 22:40:32 2018 +0100 staging: rtl8723bs: remove semaphore remnants Nothing uses the semaphores any more in this driver, so remove all references to that type. Signed-off-by: Arnd Bergmann Reviewed-by: Hans de Goede Signed-off-by: Greg Kroah-Hartman commit 07e3a844ff05ad2587247987ac0e79d446e40682 Author: Arnd Bergmann Date: Mon Dec 10 22:40:31 2018 +0100 staging: rtl8723bs: change pwrctrl lock to a mutex This semaphore is used like a mutex, so it should use the regular mutex API, as we do in the other copies of this driver. Signed-off-by: Arnd Bergmann Reviewed-by: Hans de Goede Signed-off-by: Greg Kroah-Hartman commit 09a8ea34cf431bfb77159197e46753d101c528c5 Author: Arnd Bergmann Date: Mon Dec 10 22:40:30 2018 +0100 staging: rtl8723bs: change semaphores to completions This driver uses many semaphores, most of them are equivalent to completions. The other copies of this driver got moved over to completions a while ago, so do the same here. In this usage scenario, the two are equivalent, so the behavior should not change. Signed-off-by: Arnd Bergmann Reviewed-by: Hans de Goede Signed-off-by: Greg Kroah-Hartman commit 5e8f616103b8970aee1c1790306ccbc8cd3b6b16 Author: Michael Straube Date: Mon Dec 10 10:52:02 2018 +0100 staging: rtl8723bs: fix typo in the TODO file HGz -> GHz Signed-off-by: Michael Straube Acked-by: Hans de Goede Signed-off-by: Greg Kroah-Hartman commit c45140bce3f428865d8971a2fe6f0877506632e7 Author: Michael Straube Date: Mon Dec 10 10:52:01 2018 +0100 staging: rtl8723bs: remove dead code, rtw_port_switch_chk() The function rtw_port_switch_chk() returns always false. Remove the function and related dead code. Signed-off-by: Michael Straube Acked-by: Hans de Goede Signed-off-by: Greg Kroah-Hartman commit 15f11e0ffce0affbc256fcc1925c9e3cb2739b22 Author: Michael Straube Date: Fri Dec 7 21:55:15 2018 +0100 staging: rtl8188eu: reuse Hal_GetChnlGroup88E() Use Hal_GetChnlGroup88E() instead of duplicating it's code in get_rx_power_val_by_reg(). Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit a793dbe926014e6fee2c643fbfa966cb0cdf86ef Author: Michael Straube Date: Fri Dec 7 21:55:14 2018 +0100 staging: rtl8188eu: simplify loop in rtl88eu_phy_iq_calibrate() Zeroing the array result[m][n] and setting only the values at even 'n's simplifies the code and slightly reduces object file size. Signed-off-by: Michael Straube Signed-off-by: Greg Kroah-Hartman commit f8bc1b2efa05183f10451b7618243a4278bf6b16 Author: Spencer E. Olson Date: Tue Dec 4 12:07:50 2018 -0700 staging: comedi: change do_insn*_ioctl to allow more samples Changes do_insn*_ioctl functions to allow for data lengths for each comedi_insn of up to 2^16. This patch also changes these functions to only allocate as much memory as is necessary for each comedi_insn, rather than allocating a fixed-sized scratch space. In testing some user-space code for the new INSN_DEVICE_CONFIG_GET_ROUTES facility with some newer hardware, I discovered that do_insn_ioctl and do_insnlist_ioctl limited the amount of data that can be passed into the kernel for insn's to a length of 256. For some newer hardware, the number of routes can be greater than 1000. Working around the old limits (256) would complicate the user-space/kernel interaction. The new upper limit is reasonable with current memory available and does not otherwise impact the memory footprint for any current or otherwise typical configuration. Signed-off-by: Spencer E. Olson Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman commit 354ea2ee6d2bc08d2f73b67096e67760089887cb Author: Chuanhong Guo Date: Thu Dec 6 21:15:09 2018 +0800 staging: mt7621-spi: drop support for SPI mode 1/2/3 As explained in previous patch, this SPI controller seems to be tested on SPI flash only before mass production and some bits are swizzled under other SPI modes probably due to incorrect wiring inside the silicon. Drop implementation of SPI mode 1/2/3 since they are broken. Also drop RT2880_SPI_MODE_BITS macro because we now have only SPI_LSB_FIRST implemented and the mode_bits is so short that we don't need a macro there. Signed-off-by: Chuanhong Guo Reviewed-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit 108d9dd51363e52de92019aa2107885493ddb5f3 Author: Chuanhong Guo Date: Thu Dec 6 21:15:08 2018 +0800 staging: mt7621-spi: drop the broken full-duplex mode According to John Crispin (aka blogic) on IRC on Nov 26 2018: so basically i made cs1 work for MTK/labs when i built the linkit smart for them. the req-sheet said that cs1 should be proper duplex spi. however .... 1) the core will always send 1 byte before any transfer, this is the m25p80 command. 2) mode 3 is broken and bit reversed (?) 3) some bit are incorrectly wired in hw for mode2/3 we wrote a test script and test for [0-0xffff] on all modes and certain bits are swizzled under certain conditions and it was not possible to fix this even using a hack. we then decided to use spi-gpio and i never removed the errornous code basically the spi is fecked for anything but half duplex spi mode0 running a sflash on it The controller will always send some data from OPCODE register under half duplex mode before starting a full-duplex transfer, so the full-duplex mode is broken. This piece of code also make CS1 unavailable since it forces the broken full-duplex mode to be used on CS1. Signed-off-by: Chuanhong Guo Reviewed-by: NeilBrown Signed-off-by: Greg Kroah-Hartman commit d6a0de493374642ee8bb2f473d7b6e10cad82e85 Author: Arnd Bergmann Date: Mon Dec 10 22:41:50 2018 +0100 staging: speakup: change semaphore to completion In this driver, both function the same way, but we want to eventually kill off semaphores, so a completion is the better choice here. Signed-off-by: Arnd Bergmann Reviewed-by: Samuel Thibault Signed-off-by: Greg Kroah-Hartman commit 019ec6c14fbdfaeb361c84f68158fb9097f41004 Author: Aaron Strahlberger Date: Tue Dec 11 11:54:41 2018 +0100 staging: erofs: Fix spelling issue Changed "stoped" to "stopped". Signed-off-by: Aaron Strahlberger Signed-off-by: Julius Wiedmann Signed-off-by: Dominik Huber Reviewed-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit ccd9c19c7ae165c70221b0a4927c31a56e395658 Author: Gao Xiang Date: Wed Dec 12 01:57:30 2018 +0800 staging: erofs: remove __EROFS_BIT It's better to use pre-calculated values to make on-disk definition more straight-forward and human-readable. Since there is the only one user, let's remove __EROFS_BIT entirely. Suggested-by: Joe Perches Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 07c17732bd687567802aaa5fa5c101c2776565d1 Author: Tetsuo Handa Date: Tue Dec 11 18:49:05 2018 +0900 printk: Remove print_prefix() calls with NULL buffer. We can save lines/size by removing print_prefix() with buf == NULL. This patch makes no functional change. Link: http://lkml.kernel.org/r/1544521745-11925-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp To: Steven Rostedt Cc: linux-kernel@vger.kernel.org Signed-off-by: Tetsuo Handa Reviewed-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit 15653dc850e4bc64dffd9105faab063f81c4b3b2 Author: Nicolas Ferre Date: Wed Nov 28 12:00:35 2018 +0100 ARM: at91: add support in soc driver for LPDDR2 SiP Add some more SiP components to be detected by this soc.c driver. Signed-off-by: Nicolas Ferre Signed-off-by: Alexandre Belloni commit b8e076a6ef253e763bfdb81e5c72bcc828b0fbeb Author: Gao Xiang Date: Tue Dec 11 15:17:50 2018 +0800 staging: erofs: unzip_vle_lz4.c,utils.c: rectify BUG_ONs remove all redundant BUG_ONs, and turn the rest useful usages to DBG_BUGONs. Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Signed-off-by: Greg Kroah-Hartman commit 70b17991d89554cdd16f3e4fb0179bcc03c808d9 Author: Gao Xiang Date: Tue Dec 11 15:17:49 2018 +0800 staging: erofs: unzip_{pagevec.h,vle.c}: rectify BUG_ONs remove all redundant BUG_ONs, and turn the rest useful usages to DBG_BUGONs. Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Signed-off-by: Greg Kroah-Hartman commit ed0a773bff5f2966c1c8b85e471a4d7a61f9dd62 Merge: b53bde6686fb6 2e38c2e7026a9 Author: Greg Kroah-Hartman Date: Wed Dec 12 09:26:04 2018 +0100 Merge tag 'phy-for-4.21_v1' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-next Kishon writes: phy: for 4.21 *) Change phy set_mode ops to take both mode and setmode as arguments *) Add phy_configure() and phy_validate() API's mostly used for MIPI D-PHY *) Add helpers to get default values of parameters define in MIPI D-PHY spec *) Add driver for TI's CPSW Port PHY Interface Mode selection *) Add driver for Cadence Sierra PHY used with USB and PCIe *) Add driver for Freescale i.MX8MQ USB3 PHY *) Fixes QMP PHY bindings to allow the clocks provided by the PHY to be pointed at in device tree *) Fix for using fully specified regions (in device tree) for configuring the second lane in dual lane PHYs in QMP PHY *) Add support for Allwinner H6 USB2 PHY in phy-sun4i-usb driver *) Update phy-rcar-gen3-usb driver to follow the hardware manual *) Add support for fine grained power management in mapphone-mdm6600 driver Signed-off-by: Kishon Vijay Abraham I * tag 'phy-for-4.21_v1' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy: (30 commits) phy: qcom-qmp: Expose provided clocks to DT dt-bindings: phy-qcom-qmp: Move #clock-cells to child phy: qcom-qmp: Utilize fully-specified DT registers dt-bindings: phy-qcom-qmp: Fix register underspecification phy: ti: fix semicolon.cocci warnings phy: dphy: Add configuration helpers phy: Add MIPI D-PHY configuration options phy: Add configuration interface phy: Add MIPI D-PHY mode phy: add driver for Freescale i.MX8MQ USB3 PHY dt-bindings: phy: add binding for Freescale i.MX8MQ USB3 PHY phy: Use of_node_name_eq for node name comparisons net: ethernet: ti: cpsw: add support for port interface mode selection phy dt-bindings: net: ti: cpsw: switch to use phy-gmii-sel phy phy: ti: introduce phy-gmii-sel driver dt-bindings: phy: add cpsw port interface mode selection phy bindings phy: mvebu-cp110-comphy: fix spelling in structure name phy: mapphone-mdm6600: Improve phy related runtime PM calls phy: renesas: rcar-gen3-usb2: follow the hardware manual procedure phy: cadence: Add driver for Sierra PHY ... commit 3f9b7eeea0268eba57e2c18b48a9621f38c66101 Merge: e1a76515b0c20 6d4efada3b823 Author: David S. Miller Date: Tue Dec 11 23:01:34 2018 -0800 Merge branch 'mlxsw-Add-Spectrum-2-multicast-routing-support' Ido Schimmel says: ==================== mlxsw: Add Spectrum-2 multicast routing support Nir says: In Spectrum the firmware provided an abstraction for multicast routing on top of the policy engine. In Spectrum-2 this is no longer the case and the driver must interact directly with the policy engine in order to program multicast routes. Every route is written as an ACL rule, its priority set according to route type (*,G) or (S,G) and its action is an appropriate multicast routing action. Multicast routes are written to a specific ACL group which is bound to the appropriate IP protocol IPv4/IPv6. Patch #1 adds PEMRBT register needed to declare which ACL group is dedicated for each IP protocol multicast routing function. Patch #2 Changes initialization order and puts ACL before router as multicast router now uses ACL module. Patch #3 adds Spectrum-2 ACL keys needed for multicast route matching. Patch #4 adds another ACL profile - in addition to existing flower profile - which allows the multicast routing module to program rules directly into the ACL block. Patch #5 adds the ability to update ACL rules' action, since multicast routes actions may be updated after being configured. Patch #6 separates rule creation operation and rule action creation operation as in multicast router the action is created before the route is inserted. Patch #7 sharpens priority handling in Spectrum-2, to ensure incorrect values are not set to rule's priority. Patch #8 adds the implementation of multicast routing for IPv4 and IPv6 over existing ACL rule programming Finally, patch #9 adds a test for IPv4/IPv6 multicast routing. ==================== Signed-off-by: David S. Miller commit 6d4efada3b823b3e9019e50c40114abca43a677b Author: Nir Dotan Date: Mon Dec 10 07:11:46 2018 +0000 selftests: forwarding: Add multicast routing test Introduce basic testing for both IPv4 and IPv6 multicast. The test creates an (S,G) type route, sends traffic and verifies traffic arrives when the route is present and then verifies traffic does not arrive after deleting the route. This test requires smcroute - https://github.com/troglobit/smcroute which is a tool that allows creation of static multicast routes. Signed-off-by: Nir Dotan Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit cf7221a4f5a53f4975bdf55a9fa5de7a32acfc6d Author: Nir Dotan Date: Mon Dec 10 07:11:45 2018 +0000 mlxsw: spectrum_router: Add Multicast routing support for Spectrum-2 Add implementation of Spectrum-2 multicast routes for both IPv4 and IPv6 by using ACL module explicitly. In Spectrum-2, multicast routes are set as ACL rules, so initialization takes care of creating dedicated ACL groups and binding them to the appropriate multicast routing protocol IPv4/IPv6, and afterwards routes configuration translates to setting explicit ACL rules. Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit d7263ab35be25505ab57ebecd93cbc5dba8be717 Author: Nir Dotan Date: Mon Dec 10 07:11:44 2018 +0000 mlxsw: spectrum_acl: Limit priority value In Spectrum-2, higher priority value wins and priority valid values are in the range of {1,cap_kvd_size-1}. mlxsw_sp_acl_tcam_priority_get converts from lower-bound priorities alike tc flower to Spectrum-2 HW range. Up until now tc flower did not provide priority 0 or reached the maximal value, however multicast routing does provide priority 0. Therefore, Change mlxsw_sp_acl_tcam_priority_get to verify priority is in the correct range. Make sure priority is never set to zero and never exceeds the maximal allowed value. Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit c20580c21f80d676f6e128eea4dc482c4e51b265 Author: Nir Dotan Date: Mon Dec 10 07:11:43 2018 +0000 mlxsw: spectrum_acl: Support rule creation without action creation Up until now, when ACL rule was created its action was created with it. It suits well for tc flower where ACL rule always needs an action, however it does not suit multicast router, where the action is created prior to setting a route, which in Spectrum-2 is actually an ACL rule. Add support for rule creation without action creation. Do it by adding afa_block argument to mlxsw_sp_acl_rule_create, which if NULL then an action would be created, also add an indication within struct mlxsw_sp_acl_rule_info that tells if the action should be destroyed when the rule is destroyed. Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 2507a64c17e646800025dfeb508d5c406bf24ec4 Author: Nir Dotan Date: Mon Dec 10 07:11:41 2018 +0000 mlxsw: spectrum_acl: Add replace rule action operation Multicast routes actions may be updated after creation. An example for that is an addition of an egress interface to an existing route. So far, as tc flower API dictated, ACL rules were either created or deleted. Since multicast routes in Spectrum-2 are written to ACL as any rule, it is required to allow the update of a rule's action as it may change. Add methods and operations to support updating rule's action. This is supported only for Spectrum-2. Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 1a29d29394c79648928f4a2b82cf2fafc460dc55 Author: Nir Dotan Date: Mon Dec 10 07:11:40 2018 +0000 mlxsw: spectrum_acl: Add multicast router profile operations Add specific ACL operations needed for programming multicast routing ACL groups and routes. Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit add4550fca4018f74dd8a8e98fc49f6141f96177 Author: Nir Dotan Date: Mon Dec 10 07:11:39 2018 +0000 mlxsw: spectrum_acl: Add Spectrum-2 keys Add virtual router ID fields to Spectrum-2 key blocks set, as the field is required for multicast routing. Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 254cec14649ebdb891d75fc69be6c801762a9a09 Author: Nir Dotan Date: Mon Dec 10 07:11:37 2018 +0000 mlxsw: spectrum: Change stage of ACL initialization In Spectrum-2, MC routing is implemented using ACL block explicitly, so router initialization should take place after ACL initialization. Set the initialization of the ACL block before IP router initizalization takes place, so multicast router will be able to allocate ACL data structures and create its required chains. Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit a75e41d37a7ac5a8020f9fec54656c71209075fd Author: Nir Dotan Date: Mon Dec 10 07:11:33 2018 +0000 mlxsw: reg: Add Policy Engine Multicast Router Binding Table Register In Spectrum-2, multicast routing is implemented explicitly using policy engine (ACL) block. PEMRBT register is used to bind a dedicated ACL group to a specific IP protocol. Add the register to be later used in multicast router implementation. Signed-off-by: Nir Dotan Reviewed-by: Jiri Pirko Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit e1a76515b0c20c3477200c1345c477cc0e68c4ad Author: Xue Chaojing Date: Sun Dec 9 19:14:19 2018 +0000 hinic: optmize rx refill buffer mechanism There is no need to schedule a different tasklet for refill, This patch remove it. Suggested-by: Neil Horman Signed-off-by: Xue Chaojing Signed-off-by: David S. Miller commit 2e38c2e7026a9846b5bdadf0bf82808ec2c2f446 Author: Evan Green Date: Mon Dec 10 11:32:07 2018 -0800 phy: qcom-qmp: Expose provided clocks to DT Register a simple clock provider for the PHY pipe clock sources so that device tree users can point at these clocks via phandles to the lane nodes. Signed-off-by: Evan Green Reviewed-by: Stephen Boyd Tested-by: Vivek Gautam Signed-off-by: Kishon Vijay Abraham I commit d21aafe9a4a55ae5efcd640c0f3dc64ac047d38e Author: Evan Green Date: Mon Dec 10 11:32:04 2018 -0800 dt-bindings: phy-qcom-qmp: Move #clock-cells to child The phy-qcom-qmp bindings specified #clock-cells as 1. This was never used because of_clk_add_provider() was never called, so there was no way anybody could reference these clocks from DT. Furthermore, even if they could be accessed, the bindings never specified what should go in that additional cell. Fix these incomplete and broken bindings. Move the #clock-cells into the child node, since that is the actual clock provider, and not all instances of qcom-qmp-phy are clock providers. Also set #clock-cells to zero, since there's nothing to pass to it. Signed-off-by: Evan Green Reviewed-by: Stephen Boyd Signed-off-by: Kishon Vijay Abraham I commit 5e17b95d9893dbbe3366c4d66b0f1677cce99997 Author: Evan Green Date: Mon Dec 10 11:28:23 2018 -0800 phy: qcom-qmp: Utilize fully-specified DT registers Utilize the newly fixed up DT bindings to get the tx2 and rx2 register regions for the second lane of dual-lane PHYs. Before this change, the driver was simply using lane one's register region and adding 0x400, which reached well beyond the DT-specified register allocation. This would have been a crash were it not for the page size on ARM64. Fix the driver not to rely on the magic of virtual memory by using the newly specified DT register regions for tx2 and rx2. In order to support existing device trees, this change also contains a fallback mode for when those new register regions don't exist, which reverts to the original behavior of overreaching and prints a complaint. Signed-off-by: Evan Green Reviewed-by: Douglas Anderson Signed-off-by: Kishon Vijay Abraham I commit 2517d09b39f3bb811e7349efa8248147ccb2eaa1 Author: Evan Green Date: Mon Dec 10 11:28:22 2018 -0800 dt-bindings: phy-qcom-qmp: Fix register underspecification Add register regions for the second lane of dual-lane nodes. This additional specification is needed so that the driver can stop reaching beyond the tx and rx register allocations to get at the second lane registers in a dual-lane PHY. While in there, document #clock-cells as optional for PHYs that don't provide a pipe clock. Also, document the pcs_misc register region, which was being quietly supplied and used. Signed-off-by: Evan Green Reviewed-by: Douglas Anderson Reviewed-by: Rob Herring Signed-off-by: Kishon Vijay Abraham I commit 1a3a09270668d92755cc6efe8e0395bbb3de8629 Author: kbuild test robot Date: Sun Dec 9 22:20:03 2018 +0800 phy: ti: fix semicolon.cocci warnings drivers/phy/ti/phy-gmii-sel.c:91:2-3: Unneeded semicolon Remove unneeded semicolon. Generated by: scripts/coccinelle/misc/semicolon.cocci Fixes: 1811851f4e73 ("phy: ti: introduce phy-gmii-sel driver") CC: Grygorii Strashko Signed-off-by: kbuild test robot Signed-off-by: Kishon Vijay Abraham I commit dddc97e823033b705bbc06bc08b078200ad736a3 Author: Maxime Ripard Date: Fri Dec 7 14:55:31 2018 +0100 phy: dphy: Add configuration helpers The MIPI D-PHY spec defines default values and boundaries for most of the parameters it defines. Introduce helpers to help drivers get meaningful values based on their current parameters, and validate the boundaries of these parameters if needed. Signed-off-by: Maxime Ripard Signed-off-by: Kishon Vijay Abraham I commit 2ed869990e14bc5528aeb00c45e42793c5406637 Author: Maxime Ripard Date: Fri Dec 7 14:55:30 2018 +0100 phy: Add MIPI D-PHY configuration options Now that we have some infrastructure for it, allow the MIPI D-PHY phy's to be configured through the generic functions through a custom structure added to the generic union. The parameters added here are the ones defined in the MIPI D-PHY spec, plus the number of lanes in use. The current set of parameters should cover all the potential users. Signed-off-by: Maxime Ripard Signed-off-by: Kishon Vijay Abraham I commit aeaac93ddb28eeacc0dff9c12cb338eb1de7481d Author: Maxime Ripard Date: Fri Dec 7 14:55:29 2018 +0100 phy: Add configuration interface The phy framework is only allowing to configure the power state of the PHY using the init and power_on hooks, and their power_off and exit counterparts. While it works for most, simple, PHYs supported so far, some more advanced PHYs need some configuration depending on runtime parameters. These PHYs have been supported by a number of means already, often by using ad-hoc drivers in their consumer drivers. That doesn't work too well however, when a consumer device needs to deal with multiple PHYs, or when multiple consumers need to deal with the same PHY (a DSI driver and a CSI driver for example). So we'll add a new interface, through two funtions, phy_validate and phy_configure. The first one will allow to check that a current configuration, for a given mode, is applicable. It will also allow the PHY driver to tune the settings given as parameters as it sees fit. phy_configure will actually apply that configuration in the phy itself. Signed-off-by: Maxime Ripard Signed-off-by: Kishon Vijay Abraham I commit c8457828ff481411dca4cdea944c1a0980c862e1 Author: Maxime Ripard Date: Fri Dec 7 14:55:28 2018 +0100 phy: Add MIPI D-PHY mode MIPI D-PHY is a MIPI standard meant mostly for display and cameras in embedded systems. Add a mode for it. Reviewed-by: Laurent Pinchart Reviewed-by: Sakari Ailus Signed-off-by: Maxime Ripard Signed-off-by: Kishon Vijay Abraham I commit efe81bea891586680a928ea5dde40eb1fff34be2 Author: Li Jun Date: Thu Nov 15 15:12:47 2018 +0100 phy: add driver for Freescale i.MX8MQ USB3 PHY This is a cleaned up port of the downstream i.MX8MQ USB3 PHY driver. Signed-off-by: Li Jun Signed-off-by: Lucas Stach Signed-off-by: Kishon Vijay Abraham I commit 3c2ce40b2fbb52b5e861f8664f5422d39f11b39e Author: Lucas Stach Date: Thu Nov 15 15:12:46 2018 +0100 dt-bindings: phy: add binding for Freescale i.MX8MQ USB3 PHY This adds the binding for the USB3 PHY found on the i.MX8M SoC. Signed-off-by: Lucas Stach Reviewed-by: Rob Herring Signed-off-by: Kishon Vijay Abraham I commit 03e7d002526dc447902d15aba7d24919d9a13f92 Author: Rob Herring Date: Wed Dec 5 13:50:35 2018 -0600 phy: 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. For instances using of_node_cmp, this has the side effect of now using case sensitive comparisons. This should not matter for any FDT based system which all of these are. Cc: Kishon Vijay Abraham I Cc: Heiko Stuebner Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Signed-off-by: Rob Herring Signed-off-by: Kishon Vijay Abraham I commit 3ff18849eb658b16ff4a22da9360bba5dc68a2d2 Author: Grygorii Strashko Date: Sun Nov 25 18:15:25 2018 -0600 net: ethernet: ti: cpsw: add support for port interface mode selection phy Add support for port interface mode selection phy (phy-gmii-sel): - try to request interface mode selection phy from Port DT node and fail silently if not defined and old CONFIG_TI_CPSW_PHY_SEL driver enabled. - use new phy if requested successfully. Cc: Kishon Vijay Abraham I Cc: Tony Lindgren Signed-off-by: Grygorii Strashko Signed-off-by: Kishon Vijay Abraham I commit ad57b78579ab477d105b3349dad73af8633fe49a Author: Grygorii Strashko Date: Sun Nov 25 18:15:24 2018 -0600 dt-bindings: net: ti: cpsw: switch to use phy-gmii-sel phy The cpsw-phy-sel driver was replaced with new PHY driver phy-gmii-sel, so deprecate cpsw-phy-sel bindings and update CPSW binding to use phy-gmii-sel PHY bindings. Cc: Kishon Vijay Abraham I Cc: Tony Lindgren Signed-off-by: Grygorii Strashko Signed-off-by: Kishon Vijay Abraham I commit 92b58b34741ff5b9efa583add6e63ca4103f8e29 Author: Grygorii Strashko Date: Sun Nov 25 18:15:23 2018 -0600 phy: ti: introduce phy-gmii-sel driver TI am335x/am437x/dra7(am5)/dm814x CPSW3G Ethernet Subsystem supports two 10/100/1000 Ethernet ports with selectable G/MII, RMII, and RGMII interfaces. The interface mode is selected by configuring the MII mode selection register(s) (GMII_SEL) in the System Control Module chapter (SCM). GMII_SEL register(s) and bit fields placement in SCM are different between SoCs while fields meaning is the same. Historically CPSW external Port's interface mode selection configuration was introduced using custom API and driver cpsw-phy-sel.c. This leads to unnecessary driver, DT binding and custom API support effort. This patch introduces CPSW Port's PHY Interface Mode selection Driver (phy-gmii-sel) which implements standard Linux PHY interface and used as a replacement for TI's specific driver cpsw-phy-sel.c and corresponding custom API. Cc: Kishon Vijay Abraham I Cc: Tony Lindgren Signed-off-by: Grygorii Strashko Signed-off-by: Kishon Vijay Abraham I commit 5b9bf512ca93a46d370215966d21208ca2e7dc64 Author: Grygorii Strashko Date: Sun Nov 25 18:15:22 2018 -0600 dt-bindings: phy: add cpsw port interface mode selection phy bindings Add CPSW Port's Interface Mode Selection PHY (phy-gmii-sel) DT Bindings Cc: Kishon Vijay Abraham I Cc: Tony Lindgren Acked-by: Tony Lindgren Signed-off-by: Grygorii Strashko Signed-off-by: Kishon Vijay Abraham I commit c5e18b3413b56ac9a8eadb96c44fcda26d1b49ff Author: Miquel Raynal Date: Fri Nov 23 10:21:15 2018 +0100 phy: mvebu-cp110-comphy: fix spelling in structure name Rename the mvebu_comhy_conf structure to be mvebu_comphy_conf, which is probably what the original author meant. Signed-off-by: Miquel Raynal Acked-by: Antoine Tenart Signed-off-by: Kishon Vijay Abraham I commit 2ad2af0816221ac9ce9d5c8b979868b58a696c40 Author: Tony Lindgren Date: Sun Dec 2 15:51:35 2018 -0800 phy: mapphone-mdm6600: Improve phy related runtime PM calls I noticed that phy_pm_runtime_get_sync() and phy_pm_runtime_put() are not currently doing anything for phy-mapphone-mdm6600, only the sysfs interface for works for "auto" and "on". This is because of the shared GPIO pins between mdm6600 USB port and n_gsm port. We have not enabled runtime PM for the phy driver until after we've booted up mdm6600 properly to the USB mode. Otherwise phy_create() would have called pm_runtime_enable() and pm_runtime_no_callbacks() automatically on init. Let's fix this by registering the phy a bit later after we've powered up the mdm6600 USB port. And as the PM runtime support is only needed for the n_gsm mode and not for USB, we can allow the device to idle between phy_mdm6600_power_on() and phy_mdm6600_power_off(). Note that for suspend, runtime_pm is already disabled for the phy so we need to check for pm_runtime_enabled(). Cc: Johan Hovold Cc: Pavel Machek Cc: Sebastian Reichel Signed-off-by: Tony Lindgren Signed-off-by: Kishon Vijay Abraham I commit 72c0339c115b31b3c0b22b1809854136cadd49be Author: Yoshihiro Shimoda Date: Fri Nov 30 16:00:57 2018 +0900 phy: renesas: rcar-gen3-usb2: follow the hardware manual procedure This patch modifies rcar_gen3_init_otg() procedure to follow Figure 73.4 of "R-Car Series, 3rd Generation User's Manual: Hardware Rev.1.00". Signed-off-by: Yoshihiro Shimoda Signed-off-by: Kishon Vijay Abraham I commit 44d30d622821d3bf7fa74b62e2ea62bde314ec1b Author: Alan Douglas Date: Mon Nov 12 16:42:16 2018 +0000 phy: cadence: Add driver for Sierra PHY Add a Sierra PHY driver with PCIe and USB support. The PHY has multiple lanes, which can be configured into groups, and a generic PHY device is created for each group. There are two resets controlling the overall PHY block, one to enable the APB interface for programming registers, and another to enable the PHY itself. Additionally there are resets for each PHY lane. The PHY can be configured in hardware to read register settings from ROM, or they can be written by the driver. The sequence of operation on startup is to enable the APB bus, write the PHY registers (if required) for each lane group, and then enable the PHY. Each group of lanes can then be individually controlled using the power_on()/ power_off() function for that generic PHY Signed-off-by: Alan Douglas Signed-off-by: Kishon Vijay Abraham I commit cb96a690724e105f149b27a88d66669c53b01625 Author: Alan Douglas Date: Mon Nov 12 16:42:01 2018 +0000 dt-bindings: phy: Document cadence Sierra PHY bindings Add DT binding documentation for Sierra PHY. The PHY supports a number of different protocols, including PCIe and USB. The PHY lanes may be configured as single or multi-lane links. Each link is treated as a separate sub-node. For example, if there are 4 lanes in total the first 2 might be configured as a multi-lane PCIe link while the other two are single lane USB links, and in this case there would be 3 sub-nodes. There are two resets for the PHY block (one for APB register access, one for the PHY link) and separate resets for each link. For multi-lane links, the reset corresponds to the reset line on the master lane, the resets on other lanes have no effect. Signed-off-by: Alan Douglas Reviewed-by: Rob Herring Signed-off-by: Kishon Vijay Abraham I commit b3af06451bf859a45a306678e02b12bb676a9687 Author: Grygorii Strashko Date: Mon Nov 19 19:24:24 2018 -0600 phy: core: clean up unused ethernet specific phy modes After recent changes PHY_MODE_SGMII, PHY_MODE_2500SGMII, PHY_MODE_QSGMII, PHY_MODE_10GKR are not used any more and can be removed. Hence - remove them. Signed-off-by: Grygorii Strashko Signed-off-by: Kishon Vijay Abraham I commit cccc43b853df4d2663d3890e3365513d55612794 Author: Grygorii Strashko Date: Mon Nov 19 19:24:23 2018 -0600 phy: mvebu-cp110-comphy: convert to use eth phy mode and submode Convert mvebu-cp110-comphy PHY driver to use recently introduced PHY_MODE_ETHERNET and phy_set_mode_ext(). Cc: Russell King - ARM Linux Cc: Maxime Chevallier Cc: Antoine Tenart Signed-off-by: Grygorii Strashko Acked-by: Antoine Tenart Signed-off-by: Kishon Vijay Abraham I commit c8fe6d7f3f8345ba1d4b4f38d3163f6f94412f0a Author: Grygorii Strashko Date: Mon Nov 19 19:24:22 2018 -0600 phy: ocelot-serdes: convert to use eth phy mode and submode Convert ocelot-serdes PHY driver to use recently introduced PHY_MODE_ETHERNET and phy_set_mode_ext(). Cc: Quentin Schulz Signed-off-by: Grygorii Strashko Reviewed-by: Quentin Schulz Tested-by: Quentin Schulz Signed-off-by: Kishon Vijay Abraham I commit 2af8caeee47846a84bc96abc3a72f7c991153040 Author: Grygorii Strashko Date: Mon Nov 19 19:24:21 2018 -0600 phy: core: add PHY_MODE_ETHERNET Add new PHY's mode to be used by Ethernet PHY interface drivers or multipurpose PHYs like serdes. It will be reused in further changes. Signed-off-by: Grygorii Strashko Signed-off-by: Kishon Vijay Abraham I commit 79a5a18aa9d1062205cdcfa183d4cd5241d1b8da Author: Grygorii Strashko Date: Mon Nov 19 19:24:20 2018 -0600 phy: core: rework phy_set_mode to accept phy mode and submode Currently the attempt to add support for Ethernet interface mode PHY (MII/GMII/RGMII) will lead to the necessity of extending enum phy_mode and duplicate there values from phy_interface_t enum (or introduce more PHY callbacks) [1]. Both approaches are ineffective and would lead to fast bloating of enum phy_mode or struct phy_ops in the process of adding more PHYs for different subsystems which will make them unmaintainable. As discussed in [1] the solution could be to introduce dual level PHYs mode configuration - PHY mode and PHY submode. The PHY mode will define generic PHY type (subsystem - PCIE/ETHERNET/USB_) while the PHY submode - subsystem specific interface mode. The last is usually already defined in corresponding subsystem headers (phy_interface_t for Ethernet, enum usb_device_speed for USB). This patch is cumulative change which refactors PHY framework code to support dual level PHYs mode configuration - PHY mode and PHY submode. It extends .set_mode() callback to support additional parameter "int submode" and converts all corresponding PHY drivers to support new .set_mode() callback declaration. The new extended PHY API int phy_set_mode_ext(struct phy *phy, enum phy_mode mode, int submode) is introduced to support dual level PHYs mode configuration and existing phy_set_mode() API is converted to macros, so PHY framework consumers do not need to be changed (~21 matches). [1] http://lkml.kernel.org/r/d63588f6-9ab0-848a-5ad4-8073143bd95d@ti.com Signed-off-by: Grygorii Strashko Signed-off-by: Kishon Vijay Abraham I commit 640ac14744862b8b95652e7bc38b4ee987fa5eaf Author: Rob Herring Date: Thu Oct 18 08:31:05 2018 -0500 MAINTAINERS: Add Kishon as maintainer of PHY bindings DT bindings normally go in via subsystem maintainers, so add PHY bindings under generic PHY framework. Reported-by: Gustavo A. R. Silva Cc: Kishon Vijay Abraham I Signed-off-by: Rob Herring Signed-off-by: Kishon Vijay Abraham I commit ae409cc7c3cdb9ac4a1dba3eae70efec3d6b6c79 Author: Icenowy Zheng Date: Thu Oct 4 20:28:48 2018 +0800 phy: sun4i-usb: add support for H6 USB2 PHY The USB 2.0 PHY on Allwinner H6 SoC is similar to older Allwinner SoCs, with some USB0 quirk like A83T and PHY index 1/2 missing. Add support for it. Signed-off-by: Icenowy Zheng Reviewed-by: Chen-Yu Tsai Signed-off-by: Kishon Vijay Abraham I commit 2659392e5c08dff626e6db1d739adff58a94604d Author: Icenowy Zheng Date: Thu Oct 4 20:28:47 2018 +0800 phy: sun4i-usb: add support for missing USB PHY index The new Allwinner H6 SoC's USB2 PHY has two holes -- USB1 (which is a 3.0 port with dedicated PHY) and USB2 (which doesn't exist at all). Add support for this kind of missing USB PHY index. Signed-off-by: Icenowy Zheng Reviewed-by: Chen-Yu Tsai Signed-off-by: Kishon Vijay Abraham I commit 1726ea907a7f52d66560ccdb7d0c4da8a6094c14 Author: Icenowy Zheng Date: Thu Oct 4 20:28:46 2018 +0800 dt-bindings: phy: add binding for Allwinner H6 USB2 PHY The USB2.0 PHY on Allwinner H6 is similar to the ones on the ones on older SoCs, but with holes in PHY number (USB1 and USB2 are missing, in which USB1 is a USB3 PHY). Add binding for the PHY. Signed-off-by: Icenowy Zheng Reviewed-by: Rob Herring Signed-off-by: Kishon Vijay Abraham I commit e2affdbef2aca880f4b9e758779c72540db5f168 Author: Stefan Wahren Date: Sat Nov 10 16:59:15 2018 +0100 mailbox: bcm2835: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Cc: Lubomir Rintel Signed-off-by: Stefan Wahren Reviewed-by: Eric Anholt Acked-by: Lubomir Rintel Signed-off-by: Jassi Brar commit 78f3ff524fca63e7d2a57149a34ade23d2c12798 Author: Dan Carpenter Date: Mon Dec 3 17:50:11 2018 +0300 mailbox: ti-msgmgr: Off by one in ti_msgmgr_of_xlate() The > comparison should be >= or we access one element beyond the end of the array. (The inst->qinsts[] array is allocated in the ti_msgmgr_probe() function and it has ->num_valid_queues elements.) Fixes: a2b79838b891 ("mailbox: ti-msgmgr: Add support for Secure Proxy") Signed-off-by: Dan Carpenter Acked-by: Nishanth Menon Signed-off-by: Jassi Brar commit 2e4ac7cc493f36e45facb921a992a145351d280c Author: Kevin Wangtao Date: Mon Dec 3 11:55:09 2018 +0800 mailbox: Hi3660: Fixup mailbox state machine malfunction issue Current mailbox driver of Hi3660 release the mailbox directly before sending a new message which may cause last message lost and next message sending doesn't take effect actually. This patch fixs this issue by following the right progress below, each time before sending a message, mailbox driver will check whether the mailbox is in ready state, if last message has been acknowledged, the mailbox driver will clear the ack state to turn the mailbox to ready state again. Signed-off-by: Kevin Wangtao Reviewed-and-tested-by: Leo Yan Tested-by: Valentin Schneider Signed-off-by: Jassi Brar commit b5452838c661726880652f14e20ab58efed54fa5 Author: Julia Lawall Date: Fri Nov 2 16:11:55 2018 +0100 mailbox: hi3660: constify mbox_chan_ops structure The mbox_chan_ops structure can be const as it is only stored in the ops field of an mbox_controller structure and this field is const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall Signed-off-by: Jassi Brar commit 5b20c6fd6a60e182243da31c47f2ebff5b0e3d57 Author: Yangtao Li Date: Tue Dec 11 11:37:44 2018 -0500 timekeeping: Convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Thomas Gleixner Cc: john.stultz@linaro.org Cc: sboyd@kernel.org Link: https://lkml.kernel.org/r/20181211163744.22133-1-tiny.windzz@gmail.com commit b2dbff1bb893d5dfdf501231ff5505ca10cdede3 Author: Jens Axboe Date: Tue Dec 11 18:39:41 2018 -0700 sbitmap: flush deferred clears for resize and shallow gets We're missing a deferred clear off the shallow get, which can cause a hang. Additionally, when we resize the sbitmap, we should also flush deferred clears for good measure. Ensure we have full coverage on batch clears, even for paths where we would not be doing deferred clear. This makes it less error prone for future additions. Reported-by: Bart Van Assche Tested-by: Ming Lei Signed-off-by: Jens Axboe commit 37ab566c178d79807b2d20b4c999133780355c6c Author: Martin KaFai Lau Date: Tue Dec 11 16:02:05 2018 -0800 bpf: arm64: Enable arm64 jit to provide bpf_line_info This patch enables arm64's bpf_int_jit_compile() to provide bpf_line_info by calling bpf_prog_fill_jited_linfo(). Signed-off-by: Martin KaFai Lau Signed-off-by: Daniel Borkmann commit fec7b6690541b8128663a13c9586b1daf42b0a6c Author: Tycho Andersen Date: Sun Dec 9 11:24:14 2018 -0700 samples: add an example of seccomp user trap The idea here is just to give a demonstration of how one could safely use the SECCOMP_RET_USER_NOTIF feature to do mount policies. This particular policy is (as noted in the comment) not very interesting, but it serves to illustrate how one might apply a policy dodging the various TOCTOU issues. Signed-off-by: Tycho Andersen CC: Kees Cook CC: Andy Lutomirski CC: Oleg Nesterov CC: Eric W. Biederman CC: "Serge E. Hallyn" CC: Christian Brauner CC: Tyler Hicks CC: Akihiro Suda Signed-off-by: Kees Cook commit 6a21cc50f0c7f87dae5259f6cfefe024412313f6 Author: Tycho Andersen Date: Sun Dec 9 11:24:13 2018 -0700 seccomp: add a return code to trap to userspace This patch introduces a means for syscalls matched in seccomp to notify some other task that a particular filter has been triggered. The motivation for this is primarily for use with containers. For example, if a container does an init_module(), we obviously don't want to load this untrusted code, which may be compiled for the wrong version of the kernel anyway. Instead, we could parse the module image, figure out which module the container is trying to load and load it on the host. As another example, containers cannot mount() in general since various filesystems assume a trusted image. However, if an orchestrator knows that e.g. a particular block device has not been exposed to a container for writing, it want to allow the container to mount that block device (that is, handle the mount for it). This patch adds functionality that is already possible via at least two other means that I know about, both of which involve ptrace(): first, one could ptrace attach, and then iterate through syscalls via PTRACE_SYSCALL. Unfortunately this is slow, so a faster version would be to install a filter that does SECCOMP_RET_TRACE, which triggers a PTRACE_EVENT_SECCOMP. Since ptrace allows only one tracer, if the container runtime is that tracer, users inside the container (or outside) trying to debug it will not be able to use ptrace, which is annoying. It also means that older distributions based on Upstart cannot boot inside containers using ptrace, since upstart itself uses ptrace to monitor services while starting. The actual implementation of this is fairly small, although getting the synchronization right was/is slightly complex. Finally, it's worth noting that the classic seccomp TOCTOU of reading memory data from the task still applies here, but can be avoided with careful design of the userspace handler: if the userspace handler reads all of the task memory that is necessary before applying its security policy, the tracee's subsequent memory edits will not be read by the tracer. Signed-off-by: Tycho Andersen CC: Kees Cook CC: Andy Lutomirski CC: Oleg Nesterov CC: Eric W. Biederman CC: "Serge E. Hallyn" Acked-by: Serge Hallyn CC: Christian Brauner CC: Tyler Hicks CC: Akihiro Suda Signed-off-by: Kees Cook commit a5662e4d81c4d4b08140c625d0f3c50b15786252 Author: Tycho Andersen Date: Sun Dec 9 11:24:12 2018 -0700 seccomp: switch system call argument type to void * The const qualifier causes problems for any code that wants to write to the third argument of the seccomp syscall, as we will do in a future patch in this series. The third argument to the seccomp syscall is documented as void *, so rather than just dropping the const, let's switch everything to use void * as well. I believe this is safe because of 1. the documentation above, 2. there's no real type information exported about syscalls anywhere besides the man pages. Signed-off-by: Tycho Andersen CC: Kees Cook CC: Andy Lutomirski CC: Oleg Nesterov CC: Eric W. Biederman CC: "Serge E. Hallyn" Acked-by: Serge Hallyn CC: Christian Brauner CC: Tyler Hicks CC: Akihiro Suda Signed-off-by: Kees Cook commit db5113911abaa7eb20cf115d4339959c1aecea95 Author: Tycho Andersen Date: Sun Dec 9 11:24:11 2018 -0700 seccomp: hoist struct seccomp_data recalculation higher In the next patch, we're going to use the sd pointer passed to __seccomp_filter() as the data to pass to userspace. Except that in some cases (__seccomp_filter(SECCOMP_RET_TRACE), emulate_vsyscall(), every time seccomp is inovked on power, etc.) the sd pointer will be NULL in order to force seccomp to recompute the register data. Previously this recomputation happened one level lower, in seccomp_run_filters(); this patch just moves it up a level higher to __seccomp_filter(). Thanks Oleg for spotting this. Signed-off-by: Tycho Andersen CC: Kees Cook CC: Andy Lutomirski CC: Oleg Nesterov CC: Eric W. Biederman CC: "Serge E. Hallyn" Acked-by: Serge Hallyn CC: Christian Brauner CC: Tyler Hicks CC: Akihiro Suda Signed-off-by: Kees Cook commit 5c7e8bbb025726f9cb9b2bc050509a94262426f8 Author: Eyal Davidovich Date: Sat Oct 20 16:18:00 2018 +0300 net/mlx5e: Use monitor counters for update stats - Adding new notifier block (struct mlx5_nb) monitor_counters_nb for handeling MONITOR_COUNTER new event type. - Adding work queue element: monitor_counters_work for re-arm and update stats. - We re-queue the update stat work, only when working over firmware that doesn't support the monitored counters. Signed-off-by: Eyal Davidovich Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed commit 2f8bc4917a86f4504f85f0e24d67d17bd2a9bfc1 Author: Eyal Davidovich Date: Mon Oct 8 12:16:01 2018 +0300 net/mlx5e: Monitor counters commands support new file monitor_stats.c for the new API. add arm_monitor_counter new command support. add set_monitor_counter new command support. The device can monitor specific counters and provide an event to notify when these counters are changed. The monitoring is done in best effort manner where the minimum notification period is 200 ms, however when the device is loaded, the notification might be delayed. To configure the required counters to be monitored, the SET_MONITOR_COUNTER command shall be used with a list of counters to be monitored. The device firmware can monitor up to HCA_CAP.max_num_of_monitor_counters. The configuration is done based on counter type (such as ppcnt, q counter, etc) and additional param according to the type of counter selected. Upon monitor counter change, the device will generate Monitor_Counter_Change event. The device will not generate new events unless the driver re-arms the monitoring functionality, using the ARM_MONITOR_COUNTER command. Signed-off-by: Eyal Davidovich Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed commit 75370eb0d3b802f54600f2fc3ae5255fe9270112 Author: Eyal Davidovich Date: Sun Oct 7 15:18:37 2018 +0300 net/mlx5e: Avoid query PPCNT register if not supported by the device PPCNT is not supported if PCAM access reg is supported and ppcnt bit is clear. Signed-off-by: Eyal Davidovich Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit 939de57d30344ce728b0de61be87984e75af420e Author: Daniel Jurgens Date: Mon Nov 5 16:05:37 2018 -0600 net/mlx5e: Use CQE padding for Ethernet CQs Writing 64B CQEs to 128B cache lines results in a RMW operation. Padding the CQEs to 128B if possible improves performance on 128B cache line systems like PPC. Testing on PPC showed up to a 24% improvement in small packet throughput vs the default behavior, depending on the workload and system topology. Signed-off-by: Daniel Jurgens Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 8c4dc42bf6e4ffeda49cf5e26bfc991b548fc0aa Author: Eli Britstein Date: Sun Nov 18 14:21:46 2018 +0200 net/mlx5e: Support multiple encapsulations for a TC flow Currently a flow is associated with a single encap structure. The FW extended destination features enables the driver to associate a flow with multiple encap instances. Change the encap id field from a flow scope to a per destination value in the flow attributes struct. Use the encaps array to associate a flow table entry with multiple encap entries. Update the neigh logic to offload only if all encapsulations used in a flow are connected, and un-offload upon the first one disconnected. Note that the driver can now support up to two encap destinations. Signed-off-by: Eli Britstein Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 79baaec71989afa805a0f2dd532451a6103e11b4 Author: Eli Britstein Date: Sun Dec 2 09:44:13 2018 +0200 net/mlx5e: Allow association of a flow to multiple encaps Currently a flow can be associated with a single encap entry. The extended destination feature enables the driver to configure multiple encap entries per flow. Change the encap flow association field to array as a pre-step towards supporting multiple encap destinations. Use only the first array element, with no functional change. Signed-off-by: Eli Britstein Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 98b66cb1c9ff6ffbc6133ed649b2731638520992 Author: Eli Britstein Date: Sun Nov 18 13:16:52 2018 +0200 net/mlx5e: Change parse attr struct to accommodate multiple tunnel infos Currently the driver can support only a single TC tunnel_set action. Change the tunnel info fields to arrays, as a pre-step to support multiple encapsulations for a single flow, with no functional change. Signed-off-by: Eli Britstein Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 1cc26d74bb98bd9693f0e630ee1cac87d5ba9f20 Author: Eli Britstein Date: Mon Nov 26 07:24:08 2018 +0200 net/mlx5e: Support header rewrite actions with remote port mirroring A rule with the following actions is split to a two level FDB: 1. Forward to local mirror vport 2. Header rewrite 3. Forward to local vport In the first level flow table, forward the packet to the local port and forward the packet to the second level flow table for header rewrite and local port forwarding. This configuration fails when mirroring to a remote encapsulated destination because currently an FTE cannot support encap and table destinations. Use the extended destination capabilities to configure the first level flow table with a multi-destination FTE to the uplink and second level table and the second level flow table for the header rewrite and local port forwarding. Signed-off-by: Eli Britstein Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 38c9d2697b9c0d928875ea45b5e2fd706df7ad7e Author: Eli Britstein Date: Thu Nov 22 14:04:33 2018 +0200 net/mlx5e: Replace the split logic with extended destination Currently the FTE encap flag applies to all destinations. To support mirroring encapsulated traffic to a local port the driver split the two destinations to two flow table entries: Table#0: - FWD to the local vport - Goto table#1 Table#1: - Encap and FWD to wire The firmware extended destination capabilities enable the driver to set an encapsulation flag per destination. Remove the split logic and use the extended destination mechanism instead. Note that split technique is still required for pedit and VLAN push scenarios. Signed-off-by: Eli Britstein Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit a18e879d4e45b6aef73f42c765cd0da4b26f4260 Author: Eli Britstein Date: Tue Dec 4 08:06:41 2018 +0200 net/mlx5e: Annul encap action ordering requirement Currently a FW syndrome is emitted if the driver configures a multi-destination FTE where the first destination is a tunneled uplink port and the second destination is a local vPort. Support this scenario by creating a multi-destination FTE using the firmware's extended destination capabilities. Signed-off-by: Eli Britstein Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit f493f15534ecb5c2c295ba49a2add5822d05ae19 Author: Eli Britstein Date: Sat Dec 1 09:40:43 2018 +0200 net/mlx5e: Move flow attr reformat action bit to per dest flags Flow attr reformat action bit is moved from the global action bits to a per destination flags field, as a pre-step for adding additional flags to support encapsulation properties per destination, with no functionality change. Signed-off-by: Eli Britstein Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit df65a573eab28059e5dd1d5c32ad270dcf9cbf24 Author: Eli Britstein Date: Sat Dec 1 09:40:43 2018 +0200 net/mlx5e: Refactor eswitch flow attr for destination specific properties Currently the eswitch flow attr structure stores each destination specific property in its own specific array. Group them in an array of destination structures as a pre-step towards adding additional destination specific field properties. Signed-off-by: Eli Britstein Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit e85e02bad29e822c3ebde80e7c9e7428329c4a5b Author: Eli Britstein Date: Fri Nov 23 09:38:27 2018 +0200 net/mlx5: E-Switch, Rename esw attr mirror count field The mirror count esw attributes field is used to determine if splitting the rule to two FTEs is required while programming e-switch mirroring. Rename it to split count, making it clearer with no functional change. Signed-off-by: Eli Britstein Reviewed-by: Or Gerlitz Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 1228e912c9343d35b21663af82dea39dd8a575b8 Author: Eli Britstein Date: Sun Nov 18 08:25:17 2018 +0200 net/mlx5: Consider encapsulation properties when comparing destinations Currently the driver identifies identical vport destinations by comparing the vport ID. The FW extended destination feature enables the driver to forward the packet to the same vport with multiple encapsulation properties. Change the vport destination comparison logic to compare the encapsulation properties in addition to the vport ID. Signed-off-by: Eli Britstein Acked-by: Or Gerlitz Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 4725c4ba8d1c81c0b44a7a4f9b7f21bb0331e705 Author: Kamal Heib Date: Mon Dec 10 21:09:37 2018 +0200 RDMA/mlx4: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 15644f57cb6659349bc1ca7419fa89a28fbcfe61 Author: Kamal Heib Date: Mon Dec 10 21:09:36 2018 +0200 RDMA/i40iw: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 7f645a58d00155b93800fdd4e157c8f58fb3122f Author: Kamal Heib Date: Mon Dec 10 21:09:35 2018 +0200 RDMA/hns: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit e3c320caa10713e1276cd2b813a6cdac37810e51 Author: Kamal Heib Date: Mon Dec 10 21:09:34 2018 +0200 RDMA/hfi1: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit dad3b05d050a8ce5825b2bd7c680fc127b3c2c69 Author: Kamal Heib Date: Mon Dec 10 21:09:33 2018 +0200 RDMA/cxgb4: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 071b2ca40ae31bf1ce0c4a6edb5fc52988dafa54 Author: Kamal Heib Date: Mon Dec 10 21:09:32 2018 +0200 RDMA/cxgb3: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 9615f86be981a41a830ae088856da3e5ac362ab6 Author: Kamal Heib Date: Mon Dec 10 21:09:31 2018 +0200 RDMA/bnxt_re: Initialize ib_device_ops struct Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 521ed0d92ab0db3edd17a5f4716b7f698f4fce61 Author: Kamal Heib Date: Mon Dec 10 21:09:30 2018 +0200 RDMA/core: Introduce ib_device_ops This change introduces the ib_device_ops structure that defines all the InfiniBand device operations in one place, so the code will be more readable and clean, unlike today when the ops are mixed with ib_device data members. The providers will need to define the supported operations and assign them using ib_set_device_ops(), that will also make the providers code more readable and clean. Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 2dd8e44cb4f3893f26ca29e9593450f289a0b48a Author: Yuval Shaia Date: Tue Dec 11 12:26:35 2018 +0200 IB/mlx4: Remove unneeded NULL check NULL check for kfree is unnecessary, remove it. Fixes: b42dde478bca ("IB/mlx4: Rework special QP creation error path") Signed-off-by: Yuval Shaia Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 8cc0698f46ca9cb38e77323e1074f182aac4040a Author: Leon Romanovsky Date: Tue Dec 11 12:04:42 2018 +0200 RDMA/ocrdma: Use PCI-ID as an identification in debugfs In opposite to current implementation of identification based on device name, PCI-ID identification provides stable names suitable for device rename. Change ocrdma debugfs representation to use PCI-ID. Signed-off-by: Leon Romanovsky Reviewed-by: Yuval Shaia Acked-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit 9435ef4caeea0a1141e461f9ee6f91b173867c05 Author: Leon Romanovsky Date: Tue Dec 11 11:41:05 2018 +0200 RDMA/uverbs: Optimize clearing of extra bytes in response Clear extra bytes in response in batch manner instead of doing it per-byte. Signed-off-by: Leon Romanovsky Reviewed-by: Yuval Shaia Signed-off-by: Jason Gunthorpe commit a276a4d93bf1580d737f38d1810e5f4b166f3edd Author: Gal Pressman Date: Mon Dec 10 17:17:25 2018 +0200 RDMA/vmw_pvrdma: Use atomic memory allocation in create AH Create address handle callback should not sleep, use GFP_ATOMIC instead of GFP_KERNEL for memory allocation. Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver") Cc: Adit Ranadive Signed-off-by: Gal Pressman Reviewed-by: Yuval Shaia Signed-off-by: Jason Gunthorpe commit 59590b8ad2eea9543a639880fc0d2c139b66d164 Author: Yuval Shaia Date: Sun Dec 9 13:06:10 2018 +0200 IB/{mlx5,ocrdma,qedr,rxe}: Omit port validation from IB verbs RDMA core layer already make sure port is valid, no need to check it here again. For the pkey validation this depends on commit b3ac5742fead ("RDMA/core: Validate port number in query_pkey verb") Signed-off-by: Yuval Shaia Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit a1462351b590a4fa8eed6e5bf14245425635be0d Author: Leon Romanovsky Date: Mon Dec 10 11:19:49 2018 +0200 RDMA/mlx5: Fail early if user tries to create flows on IB representors IB representors don't support creation of RAW ethernet QP flows. Disable them by reusing existing RDMA/core support macros. We do it for both creation and matcher because latter is not usable if no flow creation is available. Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit f94e02ddfd88a511ed64fb68905e35d727635fea Author: YueHaibing Date: Mon Dec 10 15:27:59 2018 +0800 IB/mlx5: Remove duplicated include from mlx5_ib.h Remove duplicated include. Signed-off-by: YueHaibing Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit d764970bcea34b2d907ef1b9fe29d09b17099552 Author: Michael Guralnik Date: Sun Dec 9 11:49:54 2018 +0200 IB/mlx5: Add 2X width support to query_port Report to the user 2x width over MAD interface. Signed-off-by: Michael Guralnik Reviewed-by: Majd Dibbiny Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit a1697aba2721bebd5af2a041b9c251ce9bf7631e Author: Jeffrey Hugo Date: Tue Dec 11 13:00:04 2018 -0700 clk: qcom: Add missing msm8998 resets commit c0cb7c7e7164 ("clk: qcom: Enumerate remaining msm8998 resets") missed two USB2 resets. Add them. Fixes: c0cb7c7e7164 ("clk: qcom: Enumerate remaining msm8998 resets") Signed-off-by: Jeffrey Hugo Signed-off-by: Stephen Boyd commit 28ab1bb0e8f031dd7dd3462ff8f6b2e93fc77e7f Merge: b874155a5fa45 40e020c129cfc Author: Jason Gunthorpe Date: Tue Dec 11 14:24:57 2018 -0700 Merge tag 'v4.20-rc6' into rdma.git for-next For dependencies in following patches. commit 52eb74339a6233c69f4e3794b69ea7c98eeeae1b Author: Reinette Chatre Date: Mon Dec 10 14:31:13 2018 -0800 x86/resctrl: Fix rdt_find_domain() return value and checks rdt_find_domain() returns an ERR_PTR() that is generated from a provided domain id when the value is negative. Care needs to be taken when creating an ERR_PTR() from this value because a subsequent check using IS_ERR() expects the error to be within the MAX_ERRNO range. Using an invalid domain id as an ERR_PTR() does work at this time since this is currently always -1. Using this undocumented assumption is fragile since future users of rdt_find_domain() may not be aware of thus assumption. Two related issues are addressed: - Ensure that rdt_find_domain() always returns a valid error value by forcing the error to be -ENODEV when a negative domain id is provided. - In a few instances the return value of rdt_find_domain() is just checked for NULL - fix these to include a check of ERR_PTR. Fixes: d89b7379015f ("x86/intel_rdt/cqm: Add mon_data") Fixes: 521348b011d6 ("x86/intel_rdt: Introduce utility to obtain CDP peer") Signed-off-by: Reinette Chatre Signed-off-by: Borislav Petkov Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Tony Luck Cc: fenghua.yu@intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: x86-ml Link: https://lkml.kernel.org/r/b88cd4ff6a75995bf8db9b0ea546908fe50f69f3.1544479852.git.reinette.chatre@intel.com commit 922454c2e77c58062c81d33c564c5133343ab3e9 Author: Nicholas Kazlauskas Date: Fri Dec 7 10:07:09 2018 -0500 drm/amd/display: Fix duplicating scaling/underscan connector state [Why] These properties aren't being carried over when the atomic state. This tricks atomic check and commit tail into performing underscan and scaling operations when they aren't needed. With the patch that forced scaling/RMX_ASPECT on by default this results in many unnecessary surface updates and hangs under certain conditions. [How] Duplicate the properties. Fixes: 91b66c47ba34 ("drm/amd/display: Set RMX_ASPECT as default") Signed-off-by: Nicholas Kazlauskas Acked-by: Alex Deucher Reviewed-by: Leo Li Signed-off-by: Alex Deucher commit 65276f2bebea047338196a584291c6c8ccd7ea13 Author: Nicholas Kazlauskas Date: Wed Nov 28 16:17:50 2018 -0500 drm/amd/display: Fix unintialized max_bpc state values [Why] If the "max bpc" isn't explicitly set in the atomic state then it have a value of 0. This has the correct behavior of limiting a panel to 8bpc in the case where the panel supports 8bpc. In the case of eDP panels this isn't a true assumption - there are panels that can only do 6bpc. Banding occurs for these displays. [How] Initialize the max_bpc when the connector resets to 8bpc. Also carry over the value when the state is duplicated. Bugzilla: https://bugs.freedesktop.org/108825 Fixes: 307638884f72 ("drm/amd/display: Support amdgpu "max bpc" connector property") Signed-off-by: Nicholas Kazlauskas Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 05f224ca669398b567d09feb6e2ceefcb7d7f945 Author: Douglas Anderson Date: Thu Dec 6 14:23:18 2018 -0800 regulator: core: Clean enabling always-on regulators + their supplies At the end of regulator_resolve_supply() we have historically turned on our supply in some cases. This could be for one of two reasons: 1. If resolving supplies was happening before the call to set_machine_constraints() we needed to predict if set_machine_constraints() was going to turn the regulator on and we needed to preemptively turn the supply on. 2. Maybe set_machine_constraints() happened before we could resolve supplies (because we failed the first time to resolve) and thus we might need to propagate an enable that already happened up to our supply. Historically regulator_resolve_supply() used _regulator_is_enabled() to decide whether to turn on the supply. Let's change things a little bit. Specifically: 1. Let's try to enable the supply and the regulator in the same place, both in set_machine_constraints(). This means that we have exactly the same logic for enabling the supply and the regulator. 2. Let's properly set use_count when we enable always-on or boot-on regulators even for those that don't have supplies. The previous commit 1fc12b05895e ("regulator: core: Avoid propagating to supplies when possible") only did this right for regulators with supplies. 3. Let's make it clear that the only time we need to enable the supply in regulator_resolve_supply() is if the main regulator is currently in use. By using use_count (like the rest of the code) to decide if we're going to enable our supply we keep everything consistent. Overall the new scheme should be cleaner and easier to reason about. In addition to fixing regulator_summary to be more correct (because of the more correct use_count), this change also has the effect of no longer using _regulator_is_enabled() in this code path. _regulator_is_enabled() could return an error code for some regulators at bootup (like RPMh) that can't read their initial state. While one can argue that the design of those regulators is sub-optimal, the new logic sidesteps this brokenness. This fix in particular fixes observed problems on Qualcomm sdm845 boards which use the above-mentioned RPMh regulator. Those problems were made worse by commit 1fc12b05895e ("regulator: core: Avoid propagating to supplies when possible") because now we'd think at bootup that the SD regulators were already enabled and we'd never try them again. Fixes: 1fc12b05895e ("regulator: core: Avoid propagating to supplies when possible") Reported-by: Evan Green Signed-off-by: Douglas Anderson Signed-off-by: Mark Brown commit e6202e8249aa7115af65f2d80b43c132816224ef Merge: 2b96edb570709 d407c81adae57 Author: Mark Brown Date: Tue Dec 11 20:44:49 2018 +0000 Merge branch 'for-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-4.21 commit 6ff9b09e00a441599f3aacdf577254455a048bc9 Author: Andreas Gruenbacher Date: Mon Nov 26 18:45:35 2018 +0100 gfs2: Get rid of potential double-freeing in gfs2_create_inode In gfs2_create_inode, after setting and releasing the acl / default_acl, the acl / default_acl pointers are not set to NULL as they should be. In that state, when the function reaches label fail_free_acls, gfs2_create_inode will try to release the same acls again. Fix that by setting the pointers to NULL after releasing the acls. Slightly simplify the logic. Also, posix_acl_release checks for NULL already, so there is no need to duplicate those checks here. Fixes: e01580bf9e4d ("gfs2: use generic posix ACL infrastructure") Reported-by: Pan Bian Cc: Christoph Hellwig Cc: stable@vger.kernel.org # v4.9+ Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson commit cbbe76c8bb27c0bea4bfa6cac56b5d4073b90687 Author: Bob Peterson Date: Fri Nov 16 14:18:32 2018 -0600 gfs2: Remove vestigial bd_ops Field bd_ops was set but never used, so I removed it, and all code supporting it. Signed-off-by: Bob Peterson Acked-by: Steven Whitehouse Signed-off-by: Andreas Gruenbacher commit 28c59469302a39277029b19672db32b0a5e9c30b Author: Nicholas Kazlauskas Date: Fri Dec 7 12:15:01 2018 -0500 Revert "drm/amd/display: Set RMX_ASPECT as default" This reverts commit 91b66c47ba3468f7882ea4a84d5e0e0c186b638f. Forcing RMX_ASPECT as default uses the preferred/native mode's timings for any mode the user selects and scales the image. This provides a a consistently nicer result in the case where the selected mode's refresh rate matches the native mode's refresh but this isn't always the case. For example, if the monitor is 1080p@144Hz and the preferred mode is 60Hz then even if the user selects 1080p@144Hz as their selected mode they'll get 1080p@60Hz. Signed-off-by: Nicholas Kazlauskas Acked-by: Alex Deucher Reviewed-by: Leo Li Signed-off-by: Alex Deucher commit b874155a5fa450bf5e4b5303cbfff05958805bf8 Author: Michael Guralnik Date: Sun Dec 9 11:49:52 2018 +0200 IB/mlx5: Add HDR speed support to query port Report HDR speed when HDR is supported in CapabilityMask2 and the actual speed is HDR. Signed-off-by: Michael Guralnik Reviewed-by: Majd Dibbiny Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 4106a758f791de11502cc6be89c971735cab360f Author: Michael Guralnik Date: Sun Dec 9 11:49:51 2018 +0200 IB/mlx5: Report CapabilityMask2 in ib_query_port CapabilityMask2 exists when IB_PORT_CAP_MASK2_SUP is set in the original capability mask. In such cases, query its value and report it in query port. Signed-off-by: Michael Guralnik Reviewed-by: Majd Dibbiny Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit a5a5d1993696419e7d5357fc3128e53d219d382e Author: Michael Guralnik Date: Sun Dec 9 11:49:50 2018 +0200 IB/core: Add new IB rates Add the new rates that were added to Infiniband spec as part of HDR and 2x support. Signed-off-by: Michael Guralnik Reviewed-by: Majd Dibbiny Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 48f9c33c25bf9d2dcf8518b4c56ea50b7735a310 Author: Rob Herring Date: Wed Dec 5 13:50:24 2018 -0600 i2c: powermac: 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. Signed-off-by: Rob Herring Signed-off-by: Wolfram Sang commit 4d08d20f1c94b2da5847d3f9ba6c93ae5b1520c2 Author: Arnd Bergmann Date: Tue Dec 11 15:08:10 2018 +0100 arm64: fix ARM64_USER_VA_BITS_52 builds In some randconfig builds, the new CONFIG_ARM64_USER_VA_BITS_52 triggered a build failure: arch/arm64/mm/proc.S:287: Error: immediate out of range As it turns out, we were incorrectly setting PGTABLE_LEVELS here, lacking any other default value. This fixes the calculation of CONFIG_PGTABLE_LEVELS to consider all combinations again. Fixes: 68d23da4373a ("arm64: Kconfig: Re-jig CONFIG options for 52-bit VA") Signed-off-by: Arnd Bergmann Signed-off-by: Will Deacon commit 7faa313f05cad184e8b17750f0cbe5216ac6debb Author: Will Deacon Date: Tue Dec 11 13:41:32 2018 +0000 arm64: preempt: Fix big-endian when checking preempt count in assembly Commit 396244692232 ("arm64: preempt: Provide our own implementation of asm/preempt.h") extended the preempt count field in struct thread_info to 64 bits, so that it consists of a 32-bit count plus a 32-bit flag indicating whether or not the current task needs rescheduling. Whilst the asm-offsets definition of TSK_TI_PREEMPT was updated to point to this new field, the assembly usage was left untouched meaning that a 32-bit load from TSK_TI_PREEMPT on a big-endian machine actually returns the reschedule flag instead of the count. Whilst we could fix this by pointing TSK_TI_PREEMPT at the count field, we're actually better off reworking the two assembly users so that they operate on the whole 64-bit value in favour of inspecting the thread flags separately in order to determine whether a reschedule is needed. Acked-by: Ard Biesheuvel Reported-by: "kernelci.org bot" Tested-by: Kevin Hilman Signed-off-by: Will Deacon commit dbabf68574f96d49cfa4eb6e8e56178874477535 Author: Michael Guralnik Date: Sun Dec 9 11:49:49 2018 +0200 IB/core: Add 2X port width Add the new 2X port width that is part of IB spec 1.3 Signed-off-by: Michael Guralnik Reviewed-by: Majd Dibbiny Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 1e8f43b7fb25aa7a85db1e81b4689dd394e23b35 Author: Michael Guralnik Date: Sun Dec 9 11:49:48 2018 +0200 IB/core: Add CapabilityMask2 to port attributes CapabilityMask2 was added in IB Spec 1.3 under PortInfo attribute. The new Capapbility mask is needed in order to expose the new 2X width and HDR speed. Signed-off-by: Michael Guralnik Reviewed-by: Majd Dibbiny Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 4f5c85fe3a60ace555d09898166af372547f97fc Author: Adamski, Krzysztof (Nokia - PL/Wroclaw) Date: Mon Dec 10 15:01:27 2018 +0000 i2c-axxia: check for error conditions first It was observed that when using seqentional mode contrary to the documentation, the SS bit (which is supposed to only be set if automatic/sequence command completed normally), is sometimes set together with NA (NAK in address phase) causing transfer to falsely be considered successful. My assumption is that this does not happen during manual mode since the controller is stopping its work the moment it sets NA/ND bit in status register. This is not the case in Automatic/Sequentional mode where it is still working to send STOP condition and the actual status we get depends on the time when the ISR is run. This patch changes the order of checking status bits in ISR - error conditions are checked first and only if none of them occurred, the transfer may be considered successful. This is required to introduce using of sequentional mode in next patch. Signed-off-by: Krzysztof Adamski Reviewed-by: Alexander Sverdlin Signed-off-by: Wolfram Sang commit eb9907789ac373fc122c4b3a3c2d3f061d9ee922 Author: Adamski, Krzysztof (Nokia - PL/Wroclaw) Date: Mon Dec 10 15:00:52 2018 +0000 i2c-axxia: dedicated function to set client addr This patch moves configuration of hardware registers used for setting i2c client address to separate function. It is preparatory change for next commit. Signed-off-by: Krzysztof Adamski Reviewed-by: Alexander Sverdlin Signed-off-by: Wolfram Sang commit 66693960f574aa830986e1603657af36423b24eb Merge: 3ca3f86f7f485 40e020c129cfc Author: Wolfram Sang Date: Tue Dec 11 20:58:20 2018 +0100 Merge tag 'v4.20-rc6' into i2c/for-5.0 Linux 4.20-rc6 commit 3ca3f86f7f4856222a8b697d60d32717160a1a1b Author: Thierry Reding Date: Fri Nov 23 13:51:38 2018 +0100 dt-bindings: i2c: Use correct vendor prefix for Atmel The "at," prefix was never correct for Atmel, so fix the few occurrences that got it wrong. Use "atmel," instead. Signed-off-by: Thierry Reding Signed-off-by: Bartosz Golaszewski Acked-by: Peter Rosin [wsa: merged two patches into one, dropped 'trivial-devices' hunk which needs to go in seperately] Signed-off-by: Wolfram Sang commit 3782cc3725b31767101de6439f26ed8693d80c4c Author: jun qian Date: Tue Sep 11 07:54:46 2018 -0700 i2c: tegra: replace spin_lock_irqsave with spin_lock in ISR As you are already in ISR, it is unnecessary to call spin_lock_irqsave. Signed-off-by: jun qian Reviewed-by: Dmitry Osipenko Acked-by: Thierry Reding Signed-off-by: Wolfram Sang commit 7841b88a8fdddc0e7f3377fc42efe4cb3be1ed8b Author: Otavio Salvador Date: Mon Nov 26 15:35:06 2018 -0200 ARM: dts: rockchip: Add internal timer support for rv1108 Add support for the internal timer peripheral on RV1108. Signed-off-by: Otavio Salvador Signed-off-by: Heiko Stuebner commit 6db21d8986e14e2e86573a3b055b05296188bd2c Author: Yuval Shaia Date: Sun Dec 9 15:53:49 2018 +0200 IB/rxe: Fix incorrect cache cleanup in error flow Array iterator stays at the same slot, fix it. Fixes: 8700e3e7c485 ("Soft RoCE driver") Signed-off-by: Yuval Shaia Reviewed-by: Bart Van Assche Reviewed-by: Zhu Yanjun Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2c4d5356e64d7d538f24c23045478330fae4a065 Author: Igor Konopko Date: Tue Dec 11 20:16:27 2018 +0100 lightnvm: pblk: do not overwrite ppa list with meta list Ehen using pblk with 0 sized metadata both ppa list and meta list points to the same memory since pblk_dma_meta_size() returns 0 in that case. This patch fix that issue by ensuring that pblk_dma_meta_size() always returns space equal to sizeof(struct pblk_sec_meta) and thus ppa list and meta list points to different memory address. Even that in that case drive does not really care about meta_list pointer, this is the easiest way to fix that issue without introducing changes in many places in the code just for 0 sized metadata case. The same approach needs to be also done for pblk_get_sec_meta() since we also cannot point to the same memory address in meta buffer when we are using it for pblk recovery process Reported-by: Hans Holmberg Tested-by: Hans Holmberg Signed-off-by: Igor Konopko Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 55d8ec35398e7ab001989473cf6ed6f40b5ef4a6 Author: Igor Konopko Date: Tue Dec 11 20:16:26 2018 +0100 lightnvm: pblk: support packed metadata pblk performs recovery of open lines by storing the LBA in the per LBA metadata field. Recovery therefore only works for drives that has this field. This patch adds support for packed metadata, which store l2p mapping for open lines in last sector of every write unit and enables drives without per IO metadata to recover open lines. After this patch, drives with OOB size <16B will use packed metadata and metadata size larger than16B will continue to use the device per IO metadata. Reviewed-by: Javier González Signed-off-by: Igor Konopko Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit a16816b9e462e8ee86a908606bde54b53cfeca80 Author: Igor Konopko Date: Tue Dec 11 20:16:25 2018 +0100 lightnvm: disable interleaved metadata Currently pblk only check the size of I/O metadata and does not take into account if this metadata is in a separate buffer or interleaved in a single metadata buffer. In reality only the first scenario is supported, where second mode will break pblk functionality during any IO operation. This patch prevents pblk to be instantiated in case device only supports interleaved metadata. Reviewed-by: Javier González Signed-off-by: Igor Konopko Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 24828d0536bbedc9b265f2b01ffca99de3f6a7c7 Author: Igor Konopko Date: Tue Dec 11 20:16:24 2018 +0100 lightnvm: dynamic DMA pool entry size Currently lightnvm and pblk uses single DMA pool, for which the entry size always is equal to PAGE_SIZE. The contents of each entry allocated from the DMA pool consists of a PPA list (8bytes * 64), leaving 56bytes * 64 space for metadata. Since the metadata field can be bigger, such as 128 bytes, the static size does not cover this use-case. This patch adds support for I/O metadata above 56 bytes by changing DMA pool size based on device meta size and allows pblk to use OOB metadata >=16B. Reviewed-by: Javier González Signed-off-by: Igor Konopko Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit faa79f27f0a46cd6c3ac3de5e7f3e142598217fc Author: Igor Konopko Date: Tue Dec 11 20:16:23 2018 +0100 lightnvm: pblk: add helpers for OOB metadata pblk currently assumes that size of OOB metadata on drive is always equal to size of pblk_sec_meta struct. This commit add helpers which will allow to handle different sizes of OOB metadata on drive in the future. After this patch only OOB metadata equal to 16 bytes is supported. Reviewed-by: Javier González Signed-off-by: Igor Konopko Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit dd439496dfbcfee1eb1e0d14984f98acb2b84c16 Author: Igor Konopko Date: Tue Dec 11 20:16:22 2018 +0100 lightnvm: pblk: move lba list to partial read context Currently DMA allocated memory is reused on partial read for lba_list_mem and lba_list_media arrays. In preparation for dynamic DMA pool sizes we need to move this arrays into pblk_pr_ctx structures. Reviewed-by: Javier González Signed-off-by: Igor Konopko Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 42bd0384d77ef7552954056928018f5cfa91a013 Author: Javier González Date: Tue Dec 11 20:16:21 2018 +0100 lightnvm: pblk: avoid ref warning on cache creation The current kref implementation around pblk global caches triggers a false positive on refcount_inc_checked() (when called) as the kref is initialized to 0. Instead of usint kref_inc() on a 0 reference, which is in principle correct, use kref_init() to avoid the check. This is also more explicit about what actually happens on cache creation. In the process, do a small refactoring to use kref helpers. Fixes: 1864de94ec9d6 "lightnvm: pblk: stop recreating global caches" Signed-off-by: Javier González Reviewed-by: Hans Holmberg Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 85136c0102852fe505c0fbd3f1bf9d17038bb94d Author: Matias Bjørling Date: Tue Dec 11 20:16:20 2018 +0100 lightnvm: simplify geometry enumeration Currently the geometry of an OCSSD is enumerated using a two step approach: First, nvm_register is called, the OCSSD identify command is issued, and second the geometry sos and csecs values are read either from the OCSSD identify if it is a 1.2 drive, or from the NVMe namespace data structure if it is a 2.0 device. This patch recombines it into a single step, such that nvm_register can use the csecs and sos fields independent of which version is used. This enables one to dynamically size the lightnvm subsystem dma pool. Reviewed-by: Igor Konopko Reviewed-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 361d889f830ef61e4eae442c4c89fb14b626375f Author: Javier González Date: Tue Dec 11 20:16:19 2018 +0100 lightnvm: pblk: add comments wrt locking in recovery path pblk's recovery path is single threaded and therefore a number of assumptions regarding concurrency can be made. To avoid confusion, make this explicit with a couple of comments in the code. Signed-off-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit fde201a466c6ad5efd72cb54fdf2cefa8b6c6ad7 Author: Hua Su Date: Tue Dec 11 20:16:18 2018 +0100 lightnvm: pblk: add lock protection to list operations Protect the list_add on the pblk_line_init_bb() error path in case this code is used for some other purpose in the future. Signed-off-by: Hua Su Reviewed-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 6e82f0ba00b0addeec27b3a95eb41e6223fc8c4f Author: Hua Su Date: Tue Dec 11 20:16:17 2018 +0100 lightnvm: pblk: fix spelling in comment Signed-off-by: Hua Su Updated description. Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit e698d9f4e6254b838e4f1a3116ee069bbc378dc0 Author: Hans Holmberg Date: Tue Dec 11 20:16:16 2018 +0100 lightnvm: pblk: remove dead code in pblk_recov_l2p Remove the call to pblk_line_replace_data as it returns directly because we have not set l_mg->data_next yet. Signed-off-by: Hans Holmberg Reviewed-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 0934ce87b588a3da657b41804bf07518103875a4 Author: Hans Holmberg Date: Tue Dec 11 20:16:15 2018 +0100 lightnvm: pblk: fix pblk_lines_init error handling path The chunk metadata is allocated with vmalloc, so we need to use vfree to free it. Fixes: 090ee26fd512 ("lightnvm: use internal allocation for chunk log page") Signed-off-by: Hans Holmberg Reviewed-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit c9a1d640d519b40d00dac850d1f17a7df1954689 Author: Hans Holmberg Date: Tue Dec 11 20:16:14 2018 +0100 lightnvm: pblk: remove unused macro ADDR_POOL_SIZE is not used anymore, so remove the macro. Signed-off-by: Hans Holmberg Reviewed-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 3bcebc5bac0935d662f30d317e33ffa660bebf93 Author: Hans Holmberg Date: Tue Dec 11 20:16:13 2018 +0100 lightnvm: pblk: set conservative threshold for user writes In a worst-case scenario (random writes), OP% of sectors in each line will be invalid, and we will then need to move data out of 100/OP% lines to free a single line. So, to prevent the possibility of running out of lines, temporarily block user writes when there is less than 100/OP% free lines. Also ensure that pblk creation does not produce instances with insufficient over provisioning. Insufficient over-provising is not a problem on real hardware, but often an issue when running QEMU simulations (with few lines). 100 lines is enough to create a sane instance with the standard (11%) over provisioning. Signed-off-by: Hans Holmberg Reviewed-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 525f7bb2c9f9b2c6673854eade89e98fb3ba7802 Author: Hans Holmberg Date: Tue Dec 11 20:16:12 2018 +0100 lightnvm: pblk: stop writes gracefully when running out of lines If mapping fails (i.e. when running out of lines), handle the error and stop writing. Signed-off-by: Hans Holmberg Reviewed-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit ab3887be1e1a2594c9818a77b0f9dfabf0e4ab59 Author: Hans Holmberg Date: Tue Dec 11 20:16:11 2018 +0100 lightnvm: pblk: account for write error sectors in emeta Lines inflicted with write errors lines might be recovered if they have not been recycled after write error garbage collection. Ensure that the emeta accounting of valid lbas is correct for such lines to avoid recovery inconsistencies. Signed-off-by: Hans Holmberg Reviewed-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit c12fa401ac8c94a74aff68bb5736b3f1dc695fa8 Author: Hans Holmberg Date: Tue Dec 11 20:16:10 2018 +0100 lightnvm: pblk: fix resubmission of overwritten write err lbas Make sure we only look up valid lba addresses on the resubmission path. If an lba is invalidated in the write buffer, that sector will be submitted to disk (as it is already mapped to a ppa), and that write might fail, resulting in a crash when trying to look up the lba in the mapping table (as the lba is marked as invalid). Signed-off-by: Hans Holmberg Reviewed-by: Javier González Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 96076f7dde51f332bce5fc5644ddc1e221f64a5a Author: Hans Holmberg Date: Tue Dec 11 20:16:09 2018 +0100 lightnvm: pblk: fix chunk close trace event check The check for chunk closes suffers from an off-by-one issue, leading to chunk close events not being traced. Fixes: 4c44abf43d00 ("lightnvm: pblk: add trace events for chunk states") Signed-off-by: Hans Holmberg Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 55e58c5e78aad9d3246f57e7718cf5ee7adde9e3 Author: Geert Uytterhoeven Date: Tue Dec 11 20:16:08 2018 +0100 lightnvm: Fix uninitialized return value in nvm_get_chunk_meta() With gcc 4.1: drivers/lightnvm/core.c: In function ‘nvm_get_bb_meta’: drivers/lightnvm/core.c:977: warning: ‘ret’ may be used uninitialized in this function and drivers/nvme/host/lightnvm.c: In function ‘nvme_nvm_get_chk_meta’: drivers/nvme/host/lightnvm.c:580: warning: ‘ret’ may be used uninitialized in this function Indeed, if (for the former) the number of channels or LUNs is zero, or (for both) the passed number of chunks is zero, ret will be returned uninitialized. Fix this by preinitializing ret to zero. Fixes: aff3fb18f957de93 ("lightnvm: move bad block and chunk state logic to core") Fixes: a294c199455187d1 ("lightnvm: implement get log report chunk helpers") Signed-off-by: Geert Uytterhoeven Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit f40a62d2674b317a263512996f9a7abbfc8178ec Author: Zhoujie Wu Date: Tue Dec 11 20:16:07 2018 +0100 lightnvm: pblk: ignore the smeta oob area scan The smeta area l2p mapping is empty, and actually the recovery procedure only need to restore data sector's l2p mapping. So ignore the smeta oob scan. Signed-off-by: Zhoujie Wu Reviewed-by: Javier González Reviewed-by: Hans Holmberg Signed-off-by: Matias Bjørling Signed-off-by: Jens Axboe commit 953d9f3903659fb1e21f6453ef5221a7652ec908 Author: Manivannan Sadhasivam Date: Mon Oct 29 15:12:40 2018 +0530 arm64: dts: rockchip: Add on-board LED support on rk3399-rock960 Add on-board LED support for Rock960 board based on the following standard used by rest of the 96Boards: green:user1 default-trigger: heartbeat green:user2 default-trigger: mmc0/disk-activity(onboard-storage) green:user3 default-trigger: mmc1 (SD-card) green:user4 default-trigger: none, panic-indicator yellow:wlan default-trigger: phy0tx blue:bt default-trigger: hci0-power Signed-off-by: Manivannan Sadhasivam Reviewed-by: Linus Walleij Signed-off-by: Heiko Stuebner commit ba0abee70a9825b321f9b3499329b781d1d32f1c Author: Manivannan Sadhasivam Date: Mon Oct 29 15:12:39 2018 +0530 arm64: dts: rockchip: Add on-board LED support on rk3399-ficus Add on-board LED support for Ficus board based on the following standard used by other 96Boards: red:user1 default-trigger: heartbeat red:user2 default-trigger: mmc0/disk-activity (onboard-storage) red:user3 default-trigger: mmc1 (SD-card) red:user4 default-trigger: none, panic-indicator red:wlan default-trigger: phy0tx red:bt default-trigger: hci0-power Signed-off-by: Manivannan Sadhasivam Reviewed-by: Linus Walleij Signed-off-by: Heiko Stuebner commit 0bd72117fba2dd51a65eaa7b480adc0eea9a4409 Author: Daniel Borkmann Date: Tue Dec 11 10:26:33 2018 +0100 bpf: fix up uapi helper description and sync bpf header with tools Minor markup fixup from bpf-next into net-next merge in the BPF helper description of bpf_sk_lookup_tcp() and bpf_sk_lookup_udp(). Also sync up the copy of bpf.h from tooling infrastructure. Signed-off-by: Daniel Borkmann Reviewed-by: Quentin Monnet Signed-off-by: David S. Miller commit 0c1c3880442f07532780533457ba0784790d8de2 Author: Lijun Ou Date: Sat Dec 8 18:40:11 2018 +0800 RDMA/hns: Bugfix for RoCE loopback test This patch implements a cmdq to enable the loopback of ssu module according to the modified hardware desgin. The ssu consists of ingress unit, packet buffer and programmable packet process unit. if the loopback bit of ssu is not enabled, the roce packet with loopback bit will fail. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit f747b689451821fdf4bea53998feb38000595095 Author: Lijun Ou Date: Sat Dec 8 18:40:10 2018 +0800 RDMA/hns: Update posting & querying mailbox This patch updates the implementation of the mailbox command interface by using command queue instead of operating registers. With this update, the software can be well decoupled with the hardware. Signed-off-by: Lijun Ou Signed-off-by: Yixian Liu Signed-off-by: Wei Hu (Xavier) Signed-off-by: Jason Gunthorpe commit 4af07f01f7a787ba5158352b98c9e3cb74995a1c Author: Lijun Ou Date: Sat Dec 8 18:40:09 2018 +0800 RDMA/hns: Fix the bug while use multi-hop of pbl It will prevent multiply overflow when defines the pbl for u64 type. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit 233673e422de70d6ba32e7b41dd75e47f036d03b Author: Lijun Ou Date: Sat Dec 8 18:40:08 2018 +0800 RDMA/hns: Encapsulate and simplify qp state transition This patch move the codes of qp state transition into the new function as well as simplify the logic for other qp states transition. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit 9f5071010347b2134e1139dca2396a0cea8130dc Author: Lijun Ou Date: Sat Dec 8 18:40:07 2018 +0800 RDMA/hns: Init qp context when modify qp from reset to init It needs to clear qp context previous when init qp context. Otherwise, the newly created qp context residue has the contents of the qp context before the uninstall, and the qp context content is disordered, causing the task to fail. Signed-off-by: Lijun Ou Signed-off-by: Jason Gunthorpe commit 4f01b73e5adf5619d3e85a3c5845c89aad7a744d Author: Kuehling, Felix Date: Mon Dec 10 21:29:00 2018 +0000 drm/amdgpu: Fix stub function name This function was renamed in a previous commit. Update the stub function name for builds with CONFIG_HSA_AMD disabled. Fixes: 611736d8447c ("drm/amdgpu: Add KFD VRAM limit checking") Acked-by: Andrey Grodzovsky Acked-by: Christian König Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit ba0ede185ef4c74bfecfe1c992be5dbcc5c5ac04 Author: Jayant Shekhar Date: Wed Dec 5 21:51:47 2018 +0530 drm/msm/dpu: Fix clock issue after bind failure In case of msm drm bind failure, pm runtime put sync is called from dsi driver which issues an asynchronous put on mdss device. Subsequently when dpu_mdss_destroy is triggered the change will make sure to put the mdss device in suspend and clearing pending work if not scheduled. Signed-off-by: Jayant Shekhar Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 7adc4a343f94589f1954e93fcadee3f55e263a0d Author: Jordan Crouse Date: Mon Dec 3 15:47:23 2018 -0700 drm/msm/dpu: Clean up dpu_media_info.h static inline functions Do some cleanup in the static inline functions defined in dpu_media_info.h by cleaning up gotos and unneeded local variables. v3: Added spaces between operators per Seal Paul and Sam Ravnborg Reviewed-by: Sean Paul Signed-off-by: Jordan Crouse Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 3804a9824186af7c10f36fd4262b4e97326f1ef1 Author: Jordan Crouse Date: Mon Dec 3 15:47:22 2018 -0700 drm/msm/dpu: Further cleanups for static inline functions Remove more static inline functions that are lightly used and/or very simple and easy to build into the calling functions. v3: Fix a nit from Sean Paul v2: Removed another unused function from dpu_hw_lm.c and add back dpu_crtc_get_client_type() since there was a question regarding its usefulness. Reviewed-by: Sean Paul Signed-off-by: Jordan Crouse Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 3d688410e6419d3d9cffa160506fe954039e0cc7 Author: Jordan Crouse Date: Mon Dec 3 15:47:21 2018 -0700 drm/msm/dpu: Cleanup the debugfs functions Do some debugfs cleanups from across the DPU driver. The DRM destroy functions will do a recursive delete on the entire debugfs node so there is no need to store dentry pointers for the debugfs files that are persistent for the life of the driver. This also means that the destroy functions can go away too. Also, use standard API functions where applicable instead of using hand written code. v3: No changes v2: Add more code; most of the dpu debugfs files should be addressed now. Reviewed-by: Sean Paul Signed-off-by: Jordan Crouse Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 8fe62a63a867184ff94b02d618d88deddfda0cc0 Author: Jordan Crouse Date: Mon Dec 3 15:47:20 2018 -0700 drm/msm/dpu: Remove dpu_irq and unused functions dpu_irq.c does some unneeded checks and passes control to dpu_core_irq.c The simple functions can be defined in the same file where we use them and the files and their associated hangers on can be deleted. Additionally the postinstall hook isn't used even in dpu_core_irq.c so zap that entire path. v3: No changes Reviewed-by: Sean Paul Signed-off-by: Jordan Crouse Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit ab07e0c19fda03712c979626178cf9e23d610aaf Author: Jordan Crouse Date: Mon Dec 3 15:47:19 2018 -0700 drm/msm: Make irq_postinstall optional Allow the KMS operation 'irq_postinstall' to be optional so that the target display drivers don't need to define a dummy function if they don't need one. v3: No changes Reviewed-by: Sean Paul Signed-off-by: Jordan Crouse Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 53edf462596623f853deb70c190bf25e231fb6b5 Author: Jordan Crouse Date: Mon Dec 3 15:47:18 2018 -0700 drm/msm/dpu: Cleanup callers of dpu_hw_blk_init Outside of superfluous parameter checks the dpu_hw_blk_init() doesn't have any failure paths. Switch it over to be a void function and we can remove error handling paths in all the functions that call it. While we're in those functions remove unneeded initialization for a static variable. v3: No changes v2: Removed a cleanup intended for a different patch Reviewed-by: Sean Paul Signed-off-by: Jordan Crouse Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit fa79bcc3d18bf365a88134afc3211e6450feeaf0 Author: Jordan Crouse Date: Mon Dec 3 15:47:17 2018 -0700 drm/msm/dpu: Remove unused functions Remove some unused container_of() helper functions. v3: No changes v2: Retained still used helper functions in the name of readability Reviewed-by: Sean Paul Signed-off-by: Jordan Crouse Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 49dfe764797b1eb0fe9e7f392645b9161d6cfce6 Author: Jordan Crouse Date: Mon Dec 3 15:47:16 2018 -0700 drm/msm/dpu: Remove dpu_crtc_is_enabled() The static inline function dpu_crtc_enabled() is only called once and the function that calls it in turn is only called once and the return value can be easily checked in the calling functions so collapse everything down. v3: No changes Reviewed-by: Sean Paul Signed-off-by: Jordan Crouse Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 35d600dd92489bcec8e91279a9c708e0e11f4bd4 Author: Jordan Crouse Date: Mon Dec 3 15:47:15 2018 -0700 drm/msm/dpu: Remove dpu_crtc_get_mixer_height dpu_crtc_get_mixer_height() is only used once and the value it returns can be easily derived from the calling function. v3: No changes Reviewed-by: Sean Paul Signed-off-by: Jordan Crouse Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 27bc773aa69cf9aa03020a9d87abbcf06d4af1c2 Author: Jordan Crouse Date: Mon Dec 3 15:47:14 2018 -0700 drm/msm/dpu: Remove dpu_dbg The functions in dpu_dbg.c aren't used. The two main dump functions fail after a lookup from dpu_dbg_base.reg_base_list which turns out to never be populated and once those are removed the rest of the file doesn't make any sense. v3: No changes v2: Moved some unrelated changes to another patch Reviewed-by: Sean Paul Signed-off-by: Jordan Crouse Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit f9e81b8da34d79978ae4effa18b16cb71cc5cb4a Author: Sean Paul Date: Fri Nov 16 13:42:34 2018 -0500 drm/msm: dpu: Remove crtc_lock Each time it's called we're holding the crtc modeset lock, so it's redundant. Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 3e46c5df667b361627a57861877c5881a22ef071 Author: Sean Paul Date: Fri Nov 16 13:42:33 2018 -0500 drm/msm: dpu: Remove vblank_requested flag from dpu_crtc It's just for debugfs output, we don't need it Changes in v2: - None Cc: Jeykumar Sankaran Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit a796ba2cb3dde3d155401e91e8341879de1248ec Author: Sean Paul Date: Fri Nov 16 13:42:32 2018 -0500 drm/msm: dpu: Separate crtc assignment from vblank enable Instead of assigning/clearing the crtc on vblank enable/disable, we can just assign and clear the crtc on modeset. That allows us to just toggle the encoder's vblank interrupts on vblank_enable. So why is this important? Previously the driver was using the legacy pointers to assign/clear the crtc. Legacy pointers are cleared _after_ disabling the hardware, so the legacy pointer was valid during vblank_disable, but that's not something we should rely on. Instead of relying on the core ordering the legacy pointer assignments just so, we'll assign the crtc in dpu_crtc enable/disable. This is the only place that mapping can change, so we're covered there. We're also taking advantage of drm_crtc_vblank_on/off. By using this, we ensure that vblank_enable/disable can never be called while the crtc is off (which means the assigned crtc will always be valid). As such, we don't need to use modeset locks or the crtc_lock in the vblank_enable/disable routine to be sure state is consistent. ...I think. Changes in v2: - Changed crtc check in toggle_vblank to != (Jeykumar) Cc: Jeykumar Sankaran Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul [dpu_crtc.c change needed to be manually applied b/c of the dpu_crtc_reset change] Signed-off-by: Rob Clark commit 5c6277c1d25b5fbb1555f7962ce0d72f78fea266 Author: Sean Paul Date: Fri Nov 16 13:42:31 2018 -0500 drm/msm: dpu: Don't bother checking ->enabled in dpu_crtc_vblank The drm_crtc_vblank_on/off calls in enable/disable guarantee that we won't call this function when crtc is not enabled. Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit f7aafc8d53482be6c0e6faf6746bff21b772a1a5 Author: Sean Paul Date: Fri Nov 16 13:42:30 2018 -0500 drm/msm: dpu: Use atomic_disable for dpu_crtc_disable Matches dpu_crtc_enable and we'll need the old state in a future patch Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit e4914867ac99caee9a239c227a07791098ab5e53 Author: Sean Paul Date: Fri Nov 16 13:42:29 2018 -0500 drm/msm: dpu: Remove vblank_callback from encoder The indirection of registering a callback and opaque pointer isn't reall useful when there's only one callsite. So instead of having the vblank_cb registration, just give encoder a crtc and let it directly call the vblank handler. In a later patch, we'll make use of this further. Changes in v2: - None Cc: Jeykumar Sankaran Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit a9d629d71dc7f8d93538f783a7a9ee15e9f1a328 Author: Sean Paul Date: Fri Nov 16 13:42:28 2018 -0500 drm/msm: dpu: Remove crtc_lock from setup_mixers I think the intention here was to protect the enc->crtc access, but that's insufficient to avoid enc->crtc changing. Fortunately we're already holding the modeset lock when this is called (from atomic_check), so remove the crtc_lock and add a modeset lock check. While we're at it, use the encoder mask from crtc state instead of legacy pointer. Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit b77d0f0d4ee757e0a27a269a8b679108162f9bd2 Author: Sean Paul Date: Fri Nov 16 13:42:27 2018 -0500 drm/msm: dpu: Move pm_runtime_(get|put) from vblank_enable There are 4 times that _dpu_crtc_vblank_enable_no_lock() is called: 1- crtc enable 2- crtc disable 3- crtc vblank enable 4- crtc vblank disable When we enable or disable the crtc, we call drm_crtc_vblank_on and drm_crtc_vblank_off respectively. That will gate vblank enables and disables to only being called when the crtc is active. That means that we can just enable/disable pm runtime in crtc enable/disable. This will be beneficial in trying to eliminate blocking calls from the vblank call chain. Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 1dfdb0e107dbe6ebff3f6bbbe4aad0b5aa87bba4 Author: Sean Paul Date: Fri Nov 16 13:42:26 2018 -0500 drm/msm: dpu: Add modeset lock checks where applicable Add modeset lock checks to functions that could be called outside the core atomic stack. Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 4b8c6279593aa6b412d42bc77fbf73b497e1f4ec Author: Sean Paul Date: Fri Nov 16 13:42:25 2018 -0500 drm/msm: dpu: Stop using encoder->crtc pointer It's for legacy drivers, for atomic drivers crtc->state->encoder_mask should be used to map encoder to crtc. Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul [seanpaul resolved conflict with async param of dpu_encoder_kickoff] Signed-off-by: Rob Clark commit f449aa6e447c321585dbb97178fedac7183bc2f3 Author: Sean Paul Date: Fri Nov 30 17:00:02 2018 -0500 drm/msm: dpu: Grab the modeset locks in frame_event This patch wraps dpu_core_perf_crtc_release_bw() with modeset locks since it digs into the state objects. Changes in v2: - None Changes in v3: - Use those nifty new DRM_MODESET_LOCK_ALL_* helpers (Daniel) Cc: Daniel Vetter Cc: Jeykumar Sankaran Acked-by: Daniel Vetter Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit b01c2399226c294fe9b22d26ce0ebf1707acb8d9 Author: Sean Paul Date: Fri Nov 16 13:42:23 2018 -0500 drm/msm: dpu: Don't drop locks in crtc_vblank_enable Now that runtime resume is handled in encoder, we don't need to worry about crtc_lock recursion when calling pm_runtime_(get|put). So drop the lock drops in _dpu_crtc_vblank_enable_no_lock(). Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 18a63b3c6f0b6247f93f5eb05353b0486512017e Author: Sean Paul Date: Fri Nov 16 13:42:22 2018 -0500 drm/msm: dpu: Move crtc runtime resume to encoder The crtc runtime resume doesn't actually operate on the crtc, but rather its encoders. The problem with this is that we need to inspect the crtc state to get the currently connected encoders. Since runtime resume isn't guaranteed to be called while holding the modeset locks (although it sometimes is), this presents a race condition. Now that we have ->enabled on the virtual encoders, and a lock to protect it, just call resume on each encoder and only restore the ones that are enabled. Changes in v2: - None Cc: Jeykumar Sankaran Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit fba7427eb594964726ab92bde7b9c20c995b4685 Author: Sean Paul Date: Fri Nov 16 13:42:21 2018 -0500 drm/msm: dpu: Add ->enabled to dpu_encoder_virt Add a bool to dpu_encoder_virt to track whether the encoder is enabled or not. Repurpose the enc_lock mutex to ensure that it is consistent with the hw state. Changes in v2: - None Cc: Jeykumar Sankaran Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 585b3f9472eea88b82f9cde6a3129fd0c36e7e67 Author: Sean Paul Date: Fri Nov 16 13:42:20 2018 -0500 drm/msm: dpu: Fix typo in dpu_encoder enc_spinlock instead of enc_spin_lock. Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 09a2e645b0f7a5af061b0bf66dd1e04a7a78caf5 Author: Sean Paul Date: Fri Nov 16 13:42:19 2018 -0500 drm/msm: dpu: Remove dpu_power_handle Now that we don't have any event handlers, remove dpu_power_handle! Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit aeb7b49a1b0fc2c8d8de6bb890ccbf40015ecb2c Author: Sean Paul Date: Fri Nov 16 13:42:18 2018 -0500 drm/msm: dpu: Move DPU_POWER_HANDLE_DBUS_ID to core_perf It's only used in core_perf, so stick it there (and change the name to reflect that). Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit d53a61e1c055de1174cd227ecc07dbcdfe1f2530 Author: Sean Paul Date: Fri Nov 16 13:42:17 2018 -0500 drm/msm: dpu: Include dpu_io_util.h directly in dpu_kms.h It's needed for struct dss_module_power, and is currently being pulled in by dpu_power_handle.h Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit b2bb51e83539c9bebd58c3d809c862ea52410969 Author: Sean Paul Date: Fri Nov 16 13:42:16 2018 -0500 drm/msm: dpu: Remove power_handle from core_perf It's unused Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 3cf63cd5f880988fd0a223f36c08cdd1b628c78d Author: Sean Paul Date: Fri Nov 16 13:42:15 2018 -0500 drm/msm: dpu: Handle crtc pm_runtime_resume() directly Instead of registering through dpu_power_handle just to get a call on runtime_resume, call the crtc function directly. Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit c24b6330035acd992bc1bd682bbc955f21153294 Author: Sean Paul Date: Fri Nov 16 13:42:14 2018 -0500 drm/msm: dpu: Don't use power_event for vbif_init_memtypes power_events are only used for pm_runtime, and that's all handled in dpu_kms. So just call vbif_init_memtypes at the correct times. Changes in v2: - Removed obsolete comment (Jeykumar) Cc: Jeykumar Sankaran Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 88447b9b58fab9aedb9fdb090e17694dd4933639 Author: Sean Paul Date: Fri Nov 16 13:42:13 2018 -0500 drm/msm: dpu: Remove dpu_power_client There's only one client -- core, and it's only used for runtime pm which is already refcounted. Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit d05994dfa9509ccc88a4f687817410328902c5de Author: Sean Paul Date: Fri Nov 16 13:42:12 2018 -0500 drm/msm: dpu: Remove unused trace_dpu_perf_update_bus() Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 5e1228d7fdedfbb1227e53706264bc7631c8e49c Author: Sean Paul Date: Fri Nov 16 13:42:11 2018 -0500 drm/msm: dpu: Remove dpu_power_handle_get_dbus_name() It's only used for debugfs, so just output the enum value instead. Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit ff5952a72cb4d04c976eeffd8443e4eef22e1bfb Author: Sean Paul Date: Mon Dec 3 14:55:56 2018 -0500 drm/msm: dpu: Allocate proper amount for dpu_crtc_state Since dpu_crtc subclasses crtc_state, we need a custom .reset hook in order to allocate the right amount of memory to accommodate the additional struct members in dpu_crtc_state. So bring it [partially] back. Relevant KASAN splat: [ 10.333382] ================================================================== [ 10.344288] BUG: KASAN: slab-out-of-bounds in kmemdup+0x50/0x80 [ 10.350390] Read of size 736 at addr ffffffc0d9f06080 by task frecon/394 [ 10.358861] CPU: 6 PID: 394 Comm: frecon Tainted: G W 4.19.4 #121 [ 10.366476] Hardware name: Google Cheza (rev2) (DT) [ 10.371514] Call trace: [ 10.374087] dump_backtrace+0x0/0x194 [ 10.377878] show_stack+0x20/0x28 [ 10.381330] dump_stack+0xa0/0xc8 [ 10.384783] print_address_description+0x78/0x2e0 [ 10.389639] kasan_report+0x290/0x2d0 [ 10.393428] check_memory_region+0x20/0x14c [ 10.397740] __asan_loadN+0x14/0x1c [ 10.401345] kmemdup+0x50/0x80 [ 10.404524] dpu_crtc_duplicate_state+0x58/0xa0 [ 10.409228] drm_atomic_get_crtc_state+0xac/0x178 [ 10.414095] __drm_atomic_helper_set_config+0x54/0x4a4 [ 10.419393] drm_atomic_helper_set_config+0x60/0xb4 [ 10.424435] drm_mode_setcrtc+0x720/0x760 [ 10.428570] drm_ioctl_kernel+0xd8/0x13c [ 10.432617] drm_ioctl+0x380/0x4f4 [ 10.436150] drm_compat_ioctl+0x54/0x13c [ 10.440219] __arm64_compat_sys_ioctl+0x1d8/0xef4 [ 10.445086] el0_svc_common+0xd8/0x138 [ 10.448961] el0_svc_compat_handler+0x58/0x68 [ 10.453463] el0_svc_compat+0x8/0x18 [ 10.458712] Allocated by task 56: [ 10.462148] kasan_kmalloc.part.4+0x48/0xf4 [ 10.466465] kasan_kmalloc+0x8c/0xa0 [ 10.470165] kmem_cache_alloc_trace+0x25c/0x27c [ 10.474848] drm_atomic_helper_crtc_reset+0x68/0x98 [ 10.479877] drm_mode_config_reset+0xc4/0x19c [ 10.484383] msm_drm_bind+0x814/0x8dc [ 10.488169] try_to_bring_up_master.part.7+0x48/0xac [ 10.493282] component_master_add_with_match+0x158/0x198 [ 10.498758] msm_pdev_probe+0x328/0x348 [ 10.502736] platform_drv_probe+0x74/0xc8 [ 10.506877] really_probe+0x1ac/0x35c [ 10.510659] driver_probe_device+0xd4/0x118 [ 10.514975] __device_attach_driver+0xc8/0xf4 [ 10.519477] bus_for_each_drv+0xb4/0xe4 [ 10.523439] __device_attach+0xd0/0x158 [ 10.527394] device_initial_probe+0x24/0x30 [ 10.531715] bus_probe_device+0x50/0xe4 [ 10.535681] deferred_probe_work_func+0xac/0xdc [ 10.540376] process_one_work+0x3f0/0x6d4 [ 10.544521] worker_thread+0x3f4/0x520 [ 10.548399] kthread+0x1b4/0x1c8 [ 10.551740] ret_from_fork+0x10/0x18 [ 10.556986] Freed by task 0: [ 10.559967] (stack is not available) [ 10.565216] The buggy address belongs to the object at ffffffc0d9f06080 which belongs to the cache kmalloc-1024 of size 1024 [ 10.578268] The buggy address is located 0 bytes inside of 1024-byte region [ffffffc0d9f06080, ffffffc0d9f06480) [ 10.590248] The buggy address belongs to the page: [ 10.595195] page:ffffffbf0367c000 count:1 mapcount:0 mapping:ffffffc0de40f680 index:0x0 compound_mapcount: 0 [ 10.605321] flags: 0x4000000000008100(slab|head) [ 10.610100] raw: 4000000000008100 ffffffbf0369fa08 ffffffbf0367f008 ffffffc0de40f680 [ 10.618077] raw: 0000000000000000 0000000000150015 00000001ffffffff 0000000000000000 [ 10.626049] page dumped because: kasan: bad access detected [ 10.633341] Memory state around the buggy address: [ 10.638282] ffffffc0d9f06180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 10.645710] ffffffc0d9f06200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 10.653139] >ffffffc0d9f06280: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc [ 10.660571] ^ [ 10.665774] ffffffc0d9f06300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 10.673210] ffffffc0d9f06380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 10.680639] ================================================================== Fixes: a6ba45afda41 (drm/msm/dpu: Replace dpu_crtc_reset by atomic helper) Cc: Sean Paul Cc: Bruce Wang Cc: Rob Clark Reviewed-by: Bruce Wang Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit e6f6d63ed14c20528aa6df05a8f0707c183c6ba3 Author: Jonathan Marek Date: Tue Dec 4 10:16:58 2018 -0500 drm/msm: add headless gpu device for imx5 This patch allows using drm/msm without qcom display hardware. It adds a amd,imageon compatible, which is used instead of qcom,adreno, but does not require a top level msm node. Signed-off-by: Jonathan Marek Signed-off-by: Rob Clark commit fb42b5354d71b09d3dcfcf4e38b1e98b277a0fc8 Author: Matthias Kaehlcke Date: Tue Dec 4 14:42:27 2018 -0800 dt-bindings: msm/dsi: Add ref clock for PHYs Allow the PHY drivers to get the ref clock from the DT. Signed-off-by: Matthias Kaehlcke Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Reviewed-by: Rob Herring Signed-off-by: Rob Clark commit e888c279579e9c2409899eb3a5e9ad5b9f91260e Author: Jonathan Marek Date: Tue Dec 4 10:17:01 2018 -0500 dt-bindings: display: msm/gpu: document amd,imageon compatible Document the new amd,imageon compatible, used for non-qcom hardware that uses the drm/msm driver (iMX5). Signed-off-by: Jonathan Marek Reviewed-by: Rob Herring Signed-off-by: Rob Clark commit f72f4f1ae498a3c93c23c3d0e600df92977e86b1 Author: Jonathan Marek Date: Tue Dec 4 10:16:57 2018 -0500 drm/msm/mdp4: add lcdc-align-lsb flag to control lane alignment This allows controlling which of the 8 lanes are used for 6 bit color. Signed-off-by: Jonathan Marek Reviewed-by: Rob Herring Signed-off-by: Rob Clark commit c2052a4e5c99f7edcb0283e6e12b2fb6975b7353 Author: Jonathan Marek Date: Wed Nov 14 17:08:04 2018 -0500 drm/msm: implement a2xx mmu A2XX has its own very simple MMU. Added a msm_use_mmu() function because we can't rely on iommu_present to decide to use MMU or not. Signed-off-by: Jonathan Marek Signed-off-by: Rob Clark commit d1d9d0e1724d6a7123b4280fdf6630ae70f96c9c Author: Douglas Anderson Date: Tue Dec 4 10:04:41 2018 -0800 drm/msm: Only add available components When trying to get the display up on my sdm845 board I noticed that the display wouldn't probe if I had the dsi1 node marked as "disabled" even though my board doesn't use dsi1. It looks like the msm code adds all nodes to its list of components even if they are disabled. I believe this doesn't work because all registered components need to come up before we finish probing. Let's do like other DRM code and only add available components. Signed-off-by: Douglas Anderson Reviewed-by: Rob Clark Signed-off-by: Rob Clark commit e400b9edb078ba1c72a7017aab52c4a4a5c1fae8 Author: Jordan Crouse Date: Mon Dec 3 12:40:31 2018 -0700 drm/msm/a6xx: Add a name for the crashdumper buffer Add a buffer object name for the a6xx crashdumper so it can be seen with the changes introduced by 7799a98edd ("drm/msm: Add a name field for gem objects"). Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit d135c7ebb7bd13af8e09ff03fba73de113a6b501 Author: Jordan Crouse Date: Mon Dec 3 12:39:45 2018 -0700 drm/msm/a6xx: Use new kernel API free function for gpu state dadb36b7ec42 ("drm/msm: Add a common function to free kernel buffer objects") missed freeing the crashdumper state for a6xx. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 50bcc689b1f1c5eb00eda0db76e00783b97c02c2 Author: Sean Paul Date: Tue Oct 30 12:00:09 2018 -0400 drm/msm: dpu: Make legacy cursor updates asynchronous This patch sprinkles a few async/legacy_cursor_update checks through commit to ensure that cursor updates aren't blocked on vsync. There are 2 main components to this, the first is that we don't want to wait_for_commit_done in msm_atomic before returning from atomic_complete. The second is that in dpu we don't want to wait for frame_done events when updating the cursor. Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 5f79e03b1f7c1b2cf0019ce6365fe5d52629813d Author: Sean Paul Date: Tue Oct 30 12:00:08 2018 -0400 drm/msm: dpu: Only check flush register against pending flushes There exists a case where a flush of a plane/dma may have been triggered & started from an async commit. If that plane/dma is subsequently disabled by the next commit, the flush register will continue to hold the flush bit for the disabled plane. Since the bit remains active, pending_kickoff_cnt will never decrement and we'll miss frame_done events. This patch limits the check of flush_register to include only those bits which have been updated with the latest commit. Changes in v2: - None Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit d4e98855d170dc808e7f52c478f1beb18b700139 Author: Jayant Shekhar Date: Fri Nov 2 18:19:17 2018 +0530 drm/msm/dpu: Correct dpu destroy and disable order In case of msm drm bind failure, dpu_mdss_destroy is triggered. In this function, resources are freed and pm runtime disable is called, which triggers dpu_mdss_disable. Now in dpu_mdss_disable, driver tries to access a memory which is already freed. This results in kernel panic. Fix this by ensuring proper sequence of dpu destroy and disable calls. Changes in v2: - Removed double spacings [Jeykumar] Tested-by: Douglas Anderson Signed-off-by: Jayant Shekhar Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit c1866d44d149a1ea5c303632114fb6aa08cfd263 Author: Abhinav Kumar Date: Thu Oct 11 10:18:57 2018 -0700 drm/msm/dsi: fix dsi clock names in DSI 10nm PLL driver Fix the dsi clock names in the DSI 10nm PLL driver to match the names in the dispcc driver as those are according to the clock plan of the chipset. Changes in v2: - Update the clock diagram with the new clock name Reviewed-by: Sean Paul Signed-off-by: Abhinav Kumar Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit b2ccfdf1dde588d0e90d6d235b9ae557cbea5d4d Author: Jonathan Marek Date: Wed Nov 21 20:52:35 2018 -0500 drm/msm: set priv->kms to NULL before uninit otherwise, priv->kms is non-NULL and msm_drm_uninit will cause a panic. Signed-off-by: Jonathan Marek Signed-off-by: Rob Clark commit a5cd7b55dfac41a45432de0bf261f8b92c43c3fa Author: Jonathan Marek Date: Wed Nov 21 20:52:34 2018 -0500 drm/msm/mdp5: add config for msm8917 Add the mdp5_cfg_hw entry for MDP5 version v1.15 found on msm8917. Signed-off-by: Jonathan Marek Signed-off-by: Rob Clark commit 21af872cd8c695060dd1d045293bf21ea9156a51 Author: Jonathan Marek Date: Wed Nov 21 20:52:32 2018 -0500 drm/msm/adreno: add a2xx derived from the a3xx driver and tested on the following hardware: imx51-zii-rdu1 (a200 with 128kb gmem) imx53-qsrb (a200) msm8060-tenderloin (a220) Signed-off-by: Jonathan Marek Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark commit 86f46f25d8ff8dc32e1c8cd9b5ab0d285d5c3523 Author: Jonathan Marek Date: Wed Nov 21 20:52:30 2018 -0500 drm/msm: use contiguous vram for MSM_BO_SCANOUT when possible Makes it possible to have MMU for GPU but not display. Signed-off-by: Jonathan Marek Signed-off-by: Rob Clark commit 373931d2d7cd37d627c0713940c4c5abfdda043d Author: Jonathan Marek Date: Wed Nov 21 20:52:28 2018 -0500 drm/msm/mdp4: allocate blank_cursor_no with MSM_BO_SCANOUT flag For allocation in contiguous memory when the GPU has MMU but not mdp4. Signed-off-by: Jonathan Marek Signed-off-by: Rob Clark commit eb2b47bb9a03206a645af40a3128a00264b0207e Author: Jonathan Marek Date: Wed Nov 21 20:52:27 2018 -0500 drm/msm/mdp4: only use lut_clk on mdp4.2+ Signed-off-by: Jonathan Marek Signed-off-by: Rob Clark commit 1fed8df301336d904ba45b1bda0c7ce5bd7e6932 Author: Rob Clark Date: Thu Nov 29 10:30:04 2018 -0500 drm/msm: bump UAPI version Signed-off-by: Rob Clark commit f05c83e7746088e6ada6ce83fd7840b4b7b52ffe Author: Rob Clark Date: Thu Nov 29 10:27:22 2018 -0500 drm/msm: add uapi to get/set debug name Add UAPI to get/set GEM objects' debug name. Signed-off-by: Rob Clark commit 789d2e5a772ce312a7a2b81ffaf304946195beb5 Author: Rob Clark Date: Thu Nov 29 09:54:42 2018 -0500 drm/msm: rework GEM_INFO ioctl Prep work to add a way to get/set the GEM objects debug name. Signed-off-by: Rob Clark commit 7a93d5c38e5ee68376ca88d9e3f9841451b9efb1 Author: Rob Clark Date: Tue Oct 23 14:42:37 2018 -0400 drm/msm/gpu: add submit flag to hint which buffers should be dumped To lower CPU overhead, future userspace will be switching to pinning iova and avoiding the use of relocs, and only include cmds table entries for IB1 level cmdstream (but not IB2 or state-groups). This leaves the kernel unsure what to dump for rd/hangrd cmdstream dumping. So add a MSM_SUBMIT_BO_DUMP flag so userspace can indicate buffers that contain cmdstream (or are otherwise important to dump). Signed-off-by: Rob Clark commit 1df4289d5b23178a8a2c38ca766feb3d9c40d9fb Author: Sharat Masetty Date: Thu Nov 1 20:16:45 2018 +0530 drm/msm: Optimize adreno_show_object() When the userspace tries to read the crashstate dump, the read side implementation in the driver currently ascii85 encodes all the binary buffers and it does this each time the read system call is called. A userspace tool like cat typically does a page by page read and the number of read calls depends on the size of the data captured by the driver. This is certainly not desirable and does not scale well with large captures. This patch encodes the buffer only once in the read path. With this there is an immediate >10X speed improvement in crashstate save time. Signed-off-by: Sharat Masetty Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark commit 84c6127580c1cee58d57d5f97ce22f1131ecdfc9 Author: Jordan Crouse Date: Wed Nov 7 15:35:54 2018 -0700 drm/msm/gpu: Map the ringbuffer in the iova at create time For reasons that I'm sure made perfect sense at the time we were opting to defer the iova alloc / pin on the ringbuffer until HW init time so when we moved to iova reference counting we ended up adding a reference count every time the hardware started. Not that it mattered (because the ring is always around) but it did make the debug output look odd. Allocate and pin the iova at create time instead. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 0815d7749a68527adabe2ac40d49f6fc0800eae5 Author: Jordan Crouse Date: Wed Nov 7 15:35:52 2018 -0700 drm/msm: Add a name field for gem objects For debugging purposes it is useful to assign descriptions to buffers so that we know what they are used for. Add a field to the buffer object and use that to name the various kernel side allocations which ends up looking like like this in /d/dri/X/gem: flags id ref offset kaddr size madv name 00040000: I 0 ( 1) 00000000 0000000070b79eca 00004096 memptrs vmas: [gpu: 01000000,mapped,inuse=1] 00020000: I 0 ( 1) 00000000 0000000031ed4074 00032768 ring0 Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 7ad0e8cf6317825d2b7fc52a9000fb16461c2857 Author: Jordan Crouse Date: Wed Nov 7 15:35:51 2018 -0700 drm/msm: Count how many times iova memory is pinned Add a reference count to track how many times a particular chunk of iova memory is pinned (mapped) in the iomu and add msm_gem_unpin_iova to give up references. It is important to note that msm_gem_unpin_iova replaces msm_gem_put_iova because the new implicit behavior that an assigned iova in a given vma is now valid for the life of the buffer and what we are really focusing on is the use of that iova. For now the unmappings are lazy; once the reference counts go to zero they *COULD* be unmapped dynamically but that will require an outside force such as a shrinker or mm_notifiers. For now, we're just focusing on getting the counting right and setting ourselves up to be ready for the future. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 9fe041f6fdfedd92e15dd81d96475ff04bdf879e Author: Jordan Crouse Date: Wed Nov 7 15:35:50 2018 -0700 drm/msm: Add msm_gem_get_and_pin_iova() Add a new function to get and pin the iova memory in one step (basically renaming the old msm_gem_get_iova function) and switch msm_gem_get_iova() to only allocate an iova but not map it in the IOMMU. This is only currently used by msm_ioctl_gem_info() since all other users of of the iova expect that the memory be immediately available. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 575f0485508bb210914d8b45bdd8481d0ecd4a72 Author: Jordan Crouse Date: Wed Nov 7 15:35:49 2018 -0700 drm/msm: Clean up and enhance the output of the 'gem' debugfs node Add headers for the 'gem' debugfs file to make it easier to remember what all the values mean and move the list of virtual address regions to the next line and add the name and map status to make it clearer what we are looking at. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit c0ee9794693c1ff5bf540fc642fac954e39234a0 Author: Jordan Crouse Date: Wed Nov 7 15:35:48 2018 -0700 drm/msm: Split msm_gem_get_iova into two steps Split the operation of msm_gem_get_iova into two operations: 1) allocate an iova and 2) map (pin) the backing memory int the iommu. This is the first step toward allowing memory pinning to occur independently of the iova management. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 70dc51b447f570ba3881e289b8134d364977a6f0 Author: Jordan Crouse Date: Wed Nov 7 15:35:47 2018 -0700 drm/msm: Remove sgt from the mmu unmap function The scatter gather table doesn't need to be passed in for the MMU unmap function. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 1e29dff00400d40fdd3d52f2a76c188f5126f033 Author: Jordan Crouse Date: Wed Nov 7 15:35:46 2018 -0700 drm/msm: Add a common function to free kernel buffer objects Buffer objects allocated with msm_gem_kernel_new() are mostly freed the same way so we can save a few lines of code with a common function. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit d6852b4b2d0140b0fbfe112edf4fe66c1857b561 Author: Jordan Crouse Date: Fri Nov 2 09:25:26 2018 -0600 drm/msm/a6xx: Track and manage a6xx state memory The a6xx GPU state allocates a LOT of memory. Add a bit of infrastructure to track the memory allocations in the GPU structure and delete them when the state is destroyed much the same way that devm works with the device model as a whole. This protects against the developer accidentally forgetting to add a kfree() to an ever growing list. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 1707add815519da406c2d1444a1f10ef8bb4ad5b Author: Jordan Crouse Date: Fri Nov 2 09:25:25 2018 -0600 drm/msm/a6xx: Add a6xx gpu state Add support for gathering and dumping the a6xx GPU state including registers, GMU registers, indexed registers, shader blocks, context clusters and debugbus. v2: Fix bugs discovered by Sharat Masetty Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit b9fc230252e7d0cbf109292bead71e50476f14c9 Author: Jordan Crouse Date: Fri Nov 2 09:25:24 2018 -0600 drm/msm/adreno: Don't capture register values if target doesn't define them If the GPU target doesn't define a list of registers then gracefully skip capturing and/or printing them. This is used by more complex targets like 6xx that have other means of capturing register values. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 983674e24b4684045340b33dda1ecb81125d4cad Author: Jordan Crouse Date: Fri Nov 2 09:25:23 2018 -0600 drm/msm/gpu: Move gpu_poll_timeout() to adreno_gpu.h The gpu_poll_timeout() function can be useful to multiple targets so mvoe it into adreno_gpu.h from the a5xx code. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 896a248a9034bf2226ec2cc1d314d94ea4266274 Author: Jordan Crouse Date: Fri Nov 2 09:25:22 2018 -0600 drm/msm/gpu: Only store local command buffers in the GPU state Instead of trying to store all the tagged buffers from a hanging submit only store the command buffers that were not imported. This cuts down on the amount of data stored in the GPU state to the base minimum of useful information. The downside is that this will make it more difficult to successfully replay a hang with just the GPU state but there isn't any reason why that functionality can't be added back in later once we've figured out how to better communicate such massive amounts of data. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 4241db42e474ffc6d432e60eb5aaea98f12fda20 Author: Jordan Crouse Date: Fri Nov 2 09:25:21 2018 -0600 drm/msm/gpu: Add trace events for tracking GPU submissions Add trace events to track the progress of a GPU submission msm_gpu_submit occurs at the beginning of the submissions, msm_gpu_submit_flush happens when the submission is put on the ringbuffer and msm_submit_flush_retired is sent when the operation is retired. To make it easier to track the operations a unique sequence number is assigned to each submission and displayed in each event output so a human or a script can easily associate the events related to a specific submission. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 568692102b6ad52fae27bef66793bc2e5770e429 Author: Jordan Crouse Date: Fri Nov 2 09:25:20 2018 -0600 drm/msm/gpu: Add per-submission statistics Add infrastructure to track statistics for GPU submissions by sampling certain perfcounters before and after a submission. To store the statistics, the per-ring memptrs region is expanded to include room for up to 64 entries - this should cover a reasonable amount of inflight submissions without worrying about losing data. The target specific code inserts PM4 commands to sample the counters before and after submission and store them in the data region. The CPU can access the data after the submission retires to make sense of the statistics and communicate them to the user. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 93f7abf19dad2d0ad3c93597c87bbaff03218cb9 Author: Jordan Crouse Date: Fri Nov 2 09:25:19 2018 -0600 drm/msm: Gracefully handle failure in _msm_gem_kernel_new If any of the function calls in _msm_gem_kernel_new fail we need to make sure to dereference the GEM object with the appropriate function for the current locking state. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit 546ec7b471bcae78463426a218b8c7f35bbb71f4 Author: Jordan Crouse Date: Fri Nov 2 09:25:18 2018 -0600 drm/msm/gpu: Allocate the correct size for the GPU memptrs Allocate the correct buffer size for the GPU memptrs. The incorrect size hasn't affected us thus far since the incorrect size was larger than the intended size and we're still stuck on page sized granularity anyway but technically correct is the best kind of correct. Signed-off-by: Jordan Crouse Signed-off-by: Rob Clark commit ccdf7e28b4ab4bc8c08912e9466f1686b06f6394 Author: Rob Clark Date: Sun Dec 2 13:07:41 2018 -0500 drm/msm: update generated headers Signed-off-by: Rob Clark commit 01665c64b47597753a57efabfea36e9cb2443cff Author: Jeykumar Sankaran Date: Tue Nov 27 15:58:13 2018 -0800 drm/msm/dpu: set geometry for iommu domain Specify geometry for DPU iommu domain which sets the address space for gem allocations. Signed-off-by: Jeykumar Sankaran Suggested-by: Jordan Crouse Suggested-by: Vivek Gautam Acked-by: Jordan Crouse Signed-off-by: Rob Clark commit 6a41da17e87dee2936645d9a51fccf932fa42981 Author: Mamta Shukla Date: Sat Oct 20 23:19:26 2018 +0530 drm: msm: Use DRM_DEV_* instead of dev_* Use DRM_DEV_INFO/ERROR/WARN instead of dev_info/err/debug to generate drm-formatted specific log messages so that it will be easy to differentiate in case of multiple instances of driver. Signed-off-by: Mamta Shukla Signed-off-by: Rob Clark commit e1bd55e5a567a90c5b26238a46bbaf1c775e9661 Author: Stephen Boyd Date: Tue Dec 11 09:57:48 2018 -0800 clk: Tag basic clk types with SPDX These are all GPL-2.0 files per the existing license text. Replace the boiler plate with the tag. Signed-off-by: Stephen Boyd commit ebafb63dc7759c4cc54065b5aa675080b5f453ce Author: Stephen Boyd Date: Tue Dec 11 09:43:03 2018 -0800 clk: Tag clk core files with SPDX These are all GPL-2.0 files per the existing license text. Replace the boiler plate with the tag. Signed-off-by: Stephen Boyd commit 84511abc47bd79e1e4a550cb7a662c09bcddd92b Author: Sean Paul Date: Thu Oct 4 14:09:45 2018 -0400 drm/msm: dpu: Remove checks from dpu_plane_destroy_state() They're not needed. Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit aa4df9bf2862956b88d3f63b7c55911e93c15e45 Author: Sean Paul Date: Thu Sep 20 10:58:18 2018 -0400 drm/msm: dpu: Clean up _dpu_core_video_mode_intf_connected() Local variable is not needed and condition can't be hit. Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 0841851f3b22bc1da09683aa458efe9f9e2abf51 Author: Sean Paul Date: Thu Sep 20 10:58:17 2018 -0400 drm/msm: dpu: Remove empty/useless labels I noticed an empty label while driving by and decided to use coccinelle to see if there were any more. Here's the spatch and the invocation: --- @@ identifier lbl; expression E; @@ - goto lbl; + return E; ... - lbl: return E; @@ identifier lbl; @@ - goto lbl; + return; ... - lbl: - return; --- spatch --allow-inconsistent-paths --sp-file file.spatch --dir drivers/gpu/drm/msm/disp/dpu1 --in-place --- Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 58fba464eaeff6533236d334cf2a2df24241dc76 Author: Sean Paul Date: Thu Sep 20 10:58:16 2018 -0400 drm/msm: dpu: Remove 'inline' from several functions Per chapter 15 of coding-style, removing 'inline' keyword from functions that are larger than a typical macro. In a couple of cases I've simplified the function and kept the inline. Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit bf711751c882e5f406ad484111285b258fb012c4 Author: Sean Paul Date: Thu Sep 20 10:58:15 2018 -0400 drm/msm: dpu: Remove _dpu_encoder_power_enable() It's unused, remove it. Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 37686b5ec41a58ae136f91471d039f2418d8d192 Author: Sean Paul Date: Thu Sep 20 10:58:14 2018 -0400 drm/msm: dpu: Remove unused functions from msm_media_info.h These functions aren't used anywhere, remove them. Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 01b09d53ad5b7e183386887cbc536dfda9f6ce65 Author: Sean Paul Date: Thu Sep 20 10:58:13 2018 -0400 drm/msm: Remove dpu_encoder_phys_ops->hw_reset() We call out of the virt encoder into phys only to call back into the virt for hw reset. So remove the indirection and just call the virt function directly. Reviewed-by: Jeykumar Sankaran Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 9a5e3fce4b74035ef8d5d3c5b9795e8859c69c67 Author: Bruce Wang Date: Fri Oct 5 17:04:03 2018 -0400 drm/msm/dpu: Replace dpu_crtc_reset by atomic helper Since we removed all suspend logic from the crtc code (see patch 3/4), dpu_crtc_reset does the same things as drm_atomic_helper_crtc_reset, so let's just replace it with a call to the atomic helper. v3: added patch to patchset Reviewed-by: Sean Paul Signed-off-by: Bruce Wang Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 7a007a121d342f0948be1f06ad61cdc953f7dab6 Author: Bruce Wang Date: Fri Oct 5 17:04:02 2018 -0400 drm/msm/dpu: Remove suspend state tracking from crtc Since drm core's modeset locks serialize atomic commits, we don't need to track whether or not we're in a suspended state from inside the crtc for dpu_crtc_enable/disable. This patch removes the suspend logic from the crtc and removes the relevant tracing from dpu_trace. Since we removed all calls to dpu_kms_is_suspend_state, we can remove that function and the suspend_state field of dpu_kms as well. v2: added patch to patchset v3: reworded commit body and moved deletion of dpu_kms_is_suspend_state and suspend_state to this patch Reviewed-by: Sean Paul Signed-off-by: Bruce Wang Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 3750e78c72da3c35292dcf531ebe3062faaa33bc Author: Bruce Wang Date: Fri Oct 5 17:04:01 2018 -0400 drm/msm: Cut dpu_kms hooks from msm_pm_suspend/resume Removes the traces of the non-atomic helper calls in msm_pm_suspend/resume since we just deleted those functions (see patch 1). Also removes the drm_kms_helper_poll_disable/enable calls, since the DRM_CONNECTOR_POLL_CONNECT flag is never set so periodic polling doesn't happen anyways. v2: reorganized patch order v3: made error checks less severe Reviewed-by: Sean Paul Signed-off-by: Bruce Wang Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit b2b83523b1768828c3122a2862fa0dd88fb40489 Author: Bruce Wang Date: Fri Oct 5 17:04:00 2018 -0400 drm/msm/dpu: Remove dpu_kms_pm_suspend/resume PM resume was crashing during dpu_kms_pm_resume. This patch removes dpu_kms_pm_suspend/resume so that msm_pm_suspend/resume uses the atomic helpers instead (see next patch). This patch also removes dpu_kms_is_suspend_blocked since it is never called. v2: Reorganized patches in patchset Signed-off-by: Bruce Wang Reviewed-by: Sean Paul Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 812eeeb6b59e15e0f2dece81b4600d2206283cd3 Author: Sean Paul Date: Wed Oct 3 14:36:44 2018 -0400 drm/msm: dpu: Add tracing around CTL_FLUSH I found these tracepoints useful for debugging cursor/ctl, someone else might find them useful too Reviewed-by: Jeykumar Sankaran Reviewed-by: Abhinav Kumar Signed-off-by: Sean Paul Signed-off-by: Rob Clark commit 2a5f14f279f59143139bcd1606903f2f80a34241 Author: Abhi Das Date: Fri Nov 9 09:57:20 2018 -0600 gfs2: read journal in large chunks to locate the head Use bio(s) to read in the journal sequentially in large chunks and locate the head of the journal. This version addresses the issues Christoph pointed out w.r.t error handling and using deprecated API. Signed-off-by: Abhi Das Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson Cc: Christoph Hellwig commit 40e0e61e366bed56b71edb3b970245165090ec9a Author: Abhi Das Date: Fri Nov 9 09:54:18 2018 -0600 gfs2: add a helper function to get_log_header that can be used elsewhere Move and re-order the error checks and hash/crc computations into another function __get_log_header() so it can be used in scenarios where buffer_heads are not being used for the log header. Signed-off-by: Abhi Das Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 5b84609532d6e48a769a735d214e2cd705ed395e Author: Abhi Das Date: Fri Nov 9 09:49:01 2018 -0600 gfs2: changes to gfs2_log_XXX_bio Change gfs2_log_XXX_bio family of functions so they can be used with different bios, not just sdp->sd_log_bio. This patch also contains some clean up suggested by Andreas. Signed-off-by: Abhi Das Signed-off-by: Andreas Gruenbacher Signed-off-by: Bob Peterson commit 98583b3e87303e5941c30d4cf0c117cbfaa89116 Author: Abhi Das Date: Fri Nov 9 09:35:14 2018 -0600 gfs2: add more timing info to journal recovery process Tells you how many milliseconds map_journal_extents and find_jhead take. Signed-off-by: Abhi Das Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 0ebbe4f974a6035542f32f0ed16859c4e128477b Author: Andreas Gruenbacher Date: Tue Nov 6 10:31:33 2018 +0000 gfs2: Fix the gfs2_invalidatepage description The comment incorrectly states that the function always returns 0. Signed-off-by: Andreas Gruenbacher commit 977767a7e1ee32ae85377d88b5383da789d2a6b5 Author: Andreas Gruenbacher Date: Fri Oct 12 20:07:27 2018 +0200 gfs2: Clean up gfs2_is_{ordered,writeback} The gfs2_is_ordered and gfs2_is_writeback checks are weird in that they implicitly check for !gfs2_is_jdata. This makes understanding how to use those functions correctly a challenge. Clean this up by making gfs2_is_ordered and gfs2_is_writeback take a super block instead of an inode and by removing the implicit !gfs2_is_jdata checks. Update the callers accordingly. Signed-off-by: Andreas Gruenbacher commit c2ade654dbf7d02f09ad491f5621fc321d4af96b Author: Rob Herring Date: Wed Dec 5 13:50:30 2018 -0600 memory: omap-gpmc: 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. For instances using of_node_cmp, this has the side effect of now using case sensitive comparisons. This should not matter for any FDT based system which this is. Cc: Roger Quadros Cc: Tony Lindgren Cc: linux-omap@vger.kernel.org Signed-off-by: Rob Herring Signed-off-by: Tony Lindgren commit 04491ab0c4f03061f2b402e8b74f101abc8a8a15 Merge: 3be5e10daf1fc 4014c08ba3947 Author: Tony Lindgren Date: Tue Dec 11 08:30:23 2018 -0800 Merge branch 'omap-for-v4.21/ti-sysc' into omap-for-v4.21/driver commit 5a87809b89b64c0ccd82261de53c41f2fffb56da Merge: 1e6755f5e8f01 c7b7b5cbd0c85 Author: Tony Lindgren Date: Tue Dec 11 08:14:58 2018 -0800 Merge branch 'omap1-usb-fix' into omap-for-v4.21/omap1 commit c7b7b5cbd0c859b1546a5a3455d457708bdadf4c Author: Aaro Koskinen Date: Tue Dec 4 19:57:42 2018 +0200 ARM: OMAP1: fix USB configuration for device-only setups Currently we do USB configuration only if the host mode (CONFIG_USB) is enabled. But it should be done also in the case of device-only setups, so change the condition to CONFIG_USB_SUPPORT. This allows to use omap_udc on Palm Tungsten E. Signed-off-by: Aaro Koskinen Signed-off-by: Tony Lindgren commit 1e6755f5e8f01a92ab29b86aed9d9db3ec39a681 Author: Aaro Koskinen Date: Tue Dec 4 19:58:12 2018 +0200 ARM: OMAP1: add MMC configuration for Palm Tungsten E Add initial MMC configuration for Palm Tungsten E to allow using a proper rootfs on the device. This still assumes the bootloader enabling the MMC, and that the card is always present and writeable. Signed-off-by: Aaro Koskinen Signed-off-by: Tony Lindgren commit 91eac9139ed440ec1a911e005e21cf1df8418798 Merge: 622523c75ff84 611a1c69f8ca8 Author: Olof Johansson Date: Tue Dec 11 08:10:09 2018 -0800 Merge tag 'tegra-for-4.21-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/dt arm64: tegra: Device tree change for v4.21-rc1 These changes add a bunch of features for Tegra194 and Tegra186, such as wake events, on-die RTC, temperature sensors, HDA for audio over HDMI and fan support on Jetson Xavier to allow cooling of the device. * tag 'tegra-for-4.21-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: (29 commits) arm64: tegra: Set reg property for display-hub on Tegra194 arm64: tegra: Set reg property for display-hub on Tegra186 arm64: dts: tegra186: Enable IOMMU for SDHCI arm64: tegra: Enable HDA controller on Jetson TX1 arm64: tegra: Add CEC controller on Tegra194 arm64: tegra: Enable HDA on Jetson Xavier arm64: tegra: Add HDA controller on Tegra194 arm64: tegra: Add CEC controller on Tegra186 arm64: tegra: Enable HDA on Jetson TX2 arm64: tegra: Add HDA controller on Tegra186 arm64: tegra: Add temperature sensor on P2888 arm64: tegra: Add gpio-keys on Jetson Xavier arm64: tegra: Add AON GPIO controller on Tegra194 arm64: tegra: p2888: Enable on-die RTC arm64: tegra: Add RTC support on Tegra194 arm64: tegra: Enable PMC wake events on Tegra194 arm64: tegra: p3310: Enable on-die RTC arm64: tegra: Add RTC support on Tegra186 arm64: tegra: Enable PMC wake events on Tegra186 arm64: tegra: Fix power key interrupt type on Jetson TX2 ... Signed-off-by: Olof Johansson commit 622523c75ff8440dbd1047420f8e9b018bbcfca5 Merge: 44a26c894ba2b 3dde5a2342cd2 Author: Olof Johansson Date: Tue Dec 11 08:06:35 2018 -0800 Merge tag 'tegra-for-4.21-arm-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/dt ARM: tegra: Device tree changes for v4.21-rc1 These changes add the external memory controller on Tegra20 as well as the VIC on Tegra124. * tag 'tegra-for-4.21-arm-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: ARM: tegra: Add VIC on Tegra124 ARM: dts: tegra20: Add clock entry to External Memory Controller ARM: dts: tegra20: Add interrupt entry to External Memory Controller Signed-off-by: Olof Johansson commit 44a26c894ba2bcae449ffd37f02c104883c499ce Merge: c5a06e704abe2 b4c7bf003cb57 Author: Olof Johansson Date: Tue Dec 11 08:05:17 2018 -0800 Merge tag 'tegra-for-4.21-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/dt dt-bindings: Changes for v4.21-rc1 This contains a few cleanups of and additions to existing device tree bindings, such as XUSB, EMC, PMC and thermal. * tag 'tegra-for-4.21-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: dt-bindings: tegra186-pmc: Add interrupt controller properties dt-bindings: thermal: tegra-bpmp: Add Tegra194 support dt: bindings: Move tegra20-emc binding to memory-controllers directory dt: bindings: tegra20-emc: Document clock property dt: bindings: tegra20-emc: Document interrupt property dt-bindings: usb: xhci-tegra: Add power-domain details Signed-off-by: Olof Johansson commit c5a06e704abe21ba4c5461d860a9745f44a209a2 Merge: 857f00213315e 74791d15fd7c4 Author: Olof Johansson Date: Tue Dec 11 08:05:01 2018 -0800 Merge tag 'renesas-dt-bindings-for-v4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/dt Renesas ARM Based SoC DT Bindings Updates for v4.21 * Move 'renesas,prr' binding to its own document - Prepration for converting board-level bindings to json-schema * Document iW-RainboW-G20D-Qseven-RZG1N board and iWave RZ/G1N SOM * tag 'renesas-dt-bindings-for-v4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: dt-bindings: arm: renesas: Move 'renesas,prr' binding to its own doc dt-bindings: arm: renesas: Document iW-RainboW-G20D-Qseven-RZG1N board dt-bindings: arm: renesas: Document iWave RZ/G1N SOM Signed-off-by: Olof Johansson commit 857f00213315e4502e5bc1170baf740b639ae73d Merge: e2bc560635cdf e259e04748e27 Author: Olof Johansson Date: Tue Dec 11 08:03:48 2018 -0800 Merge tag 'renesas-arm-dt2-for-v4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/dt Second Round of Renesas ARM Based SoC DT Updates for v4.21 * RZ/G1N (r8a7744) SoC - Describe in DT: SYS-DMAC, GPIO, Ethernet AVB, SMP, [H]SCIF{A|B}, I2C, USB 2.0 and 3.0 hosts, USB-DMAC, HSUSB, RWDT, Audio, CAN, IRQC, thermal, CMT, VIN, VSP, IPMMU, PMU, TPU, QSPI MSIOF, and PCIE - iWave G20D-Q7 board - Initial support - Enable eMMC, SDHI and SPIO NOR support - Add camera daughterboard * RZ/G1M (r8a7743) SoC - Remove legacy "renesas,rcar-thermal" compatibility * tag 'renesas-arm-dt2-for-v4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: (34 commits) ARM: dts: r8a7744-iwg20m: Add SPI NOR support ARM: dts: iwg20d-q7-common: Move cmt/rwdt node out of RZ/G1M SOM ARM: dts: r8a7744: Add PCIe Controller device node ARM: dts: r8a7744: Add xhci support ARM: dts: r8a7744: Add MSIOF[012] support ARM: dts: r8a7744: Add QSPI support ARM: dts: r8a7744-iwg20d-q7-dbcm-ca: Add device tree for camera DB ARM: dts: r8a7744: Add TPU support ARM: dts: r8a7744: Add PWM SoC support ARM: dts: r8a7744: Add IPMMU DT nodes ARM: dts: r8a7744: Add VSP support ARM: dts: r8a7744: add VIN dt support ARM: dts: r8a7744: Add CMT SoC specific support ARM: dts: r8a7744: Add thermal device to DT ARM: dts: r8a7744: Add IRQC support ARM: dts: r8a7744: Add CAN support ARM: dts: r8a7744: Add audio support ARM: dts: r8a7744: Add RWDT node ARM: dts: r8a7744: Add USB-DMAC and HSUSB device nodes ARM: dts: r8a7744: USB 2.0 host support ... Signed-off-by: Olof Johansson commit e2bc560635cdf02413c95cb388871584c4060443 Merge: 2fd1a4091f392 4fbd4158fe896 Author: Olof Johansson Date: Tue Dec 11 08:01:55 2018 -0800 Merge tag 'renesas-arm64-dt2-for-v4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/dt Second Round of Renesas ARM64 Based SoC DT Updates for v4.21 * R-Car D3 (r8a77995) SoC based Draak board - Add the backlight device for the LVDS1 output * R-Car H3 (r8a7795) ES1.0 SoC - Add missing power domains to IPMMU nodes * R-Car M3-N (r8a77965) SoC - Remove non-existent IPMMU-IR * tag 'renesas-arm64-dt2-for-v4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: arm64: dts: renesas: r8a77995: draak: Add backlight arm64: dts: renesas: r8a7795-es1: Add missing power domains to IPMMU nodes arm64: dts: renesas: r8a77965: Remove non-existent IPMMU-IR Signed-off-by: Olof Johansson commit 2fd1a4091f392d6c20fa3dea72b70a58267481bd Merge: 287eedda7c064 76d0bbd8a4ef1 Author: Olof Johansson Date: Tue Dec 11 07:59:16 2018 -0800 Merge tag 'aspeed-4.21-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/aspeed into next/dt ASPEED device tree updates for 4.20 - New machine: Facebook Backpack-CMM BMC and flash layout - OpenPower reference systems (Palmetto P8, Romulus P9) move to the ColdFire based FSI driver - Misc device tree updates from the OpenBMC project * tag 'aspeed-4.21-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/aspeed: ARM: dts: aspeed: Add Facebook Backpack-CMM BMC ARM: dts: Add Facebook BMC flash layout ARM: dts: aspeed: wspoon: Enable iio-hwmon battery ARM: dts: aspeed: romulus: Enable iio-hwmon-battery ARM: dts: aspeed: Enable VHUB on Romulus ARM: dts: aspeed-palmetto: Add LPC control node ARM: dts: aspeed: Palmetto system can use coprocessor for FSI ARM: dts: aspeed: Romulus system can use coprocessor for FSI Signed-off-by: Olof Johansson commit 287eedda7c064fb2d2981e56564528c8d34ea5d4 Merge: 332da8486b58e ad8044f87c0b5 Author: Olof Johansson Date: Tue Dec 11 07:43:46 2018 -0800 Merge tag 'pxa-dt-4.21' of https://github.com/rjarzmik/linux into next/dt This device-tree pxa update brings : - various fixes from Daniel (W=12 issues mainly) - support for the first pxa3xx devicetree pxa board * tag 'pxa-dt-4.21' of https://github.com/rjarzmik/linux: ARM: dts: pxa3xx: Add Raumfeld DTS files ARM: dts: pxa: clean up USB controller nodes ARM: dts: pxa3xx: clean up pxa3xx clock controller node name ARM: dts: pxa3xx: order timer and gcu nodes under /pxabus ARM: dts: pxa2xx: fix hwuart memory range ARM: dts: pxa3xx: drop #address-cells and #size-cells from pinctrl node ARM: dts: pxa2xx: drop #address-cells and #size-cells from /cpus ARM: dts: pxa3xx: add gcu node Signed-off-by: Olof Johansson commit 5241ccbf2819426e0b55c784105eee7f1c57c9b2 Author: Tony Lindgren Date: Fri Dec 7 16:52:46 2018 -0800 ARM: dts: Add missing ranges for dra7 mcasp l3 ports We need to add mcasp l3 port ranges for mcasp to use a correct l3 data port address for dma. And we're also missing the optional clocks that we have tagged with HWMOD_OPT_CLKS_NEEDED in omap_hwmod_7xx_data.c. Note that for reading the module revision register HWMOD_OPT_CLKS_NEEDED do not seem to be needed. So they could be probably directly managed only by the mcasp driver, and then we could leave them out for the interconnect target module. Fixes: 4ed0dfe3cf39 ("ARM: dts: dra7: Move l4 child devices to probe them with ti-sysc") Reported-by: Peter Ujfalusi Cc: Peter Ujfalusi Signed-off-by: Tony Lindgren commit f4ef6fd0789da20b32d303859b8f9f8a11396c09 Author: Tony Lindgren Date: Mon Dec 10 13:43:11 2018 -0800 ARM: dts: Fix ranges for am335x epwmss Looks like I missed the ranges for am335x epwmss. Let's set it up the same way as for am437x and dra7. Fixes: 87fc89ced3a7 ("ARM: dts: am335x: Move l4 child devices to probe them with ti-sysc") Tested-by: Peter Ujfalusi Signed-off-by: Tony Lindgren commit f03566d0aa79f9e09a288936980741c479a22fdb Author: Jerome Brunet Date: Tue Dec 4 17:58:19 2018 +0100 clk: meson: axg-audio: use the clk input helper function Rework the axg audio clock controller to use the new clk-input helper function. Signed-off-by: Jerome Brunet Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong [narmstrong: fixed pclk input clock name to axg_audio_pclk] Link: http://lkml.kernel.org/r/20181204165819.21541-3-jbrunet@baylibre.com commit c4576aed8d85d808cd6443bda58393d525207d01 Author: Mike Snitzer Date: Tue Dec 11 09:10:26 2018 -0500 dm: fix request-based dm's use of dm_wait_for_completion The md->wait waitqueue is used by both bio-based and request-based DM. Commit dbd3bbd291 ("dm rq: leverage blk_mq_queue_busy() to check for outstanding IO") lost sight of the requirement that dm_wait_for_completion() must work with all types of DM devices. Fix md_in_flight() to call the blk-mq or bio-based method accordingly. Fixes: dbd3bbd291 ("dm rq: leverage blk_mq_queue_busy() to check for outstanding IO") Signed-off-by: Mike Snitzer Signed-off-by: Jens Axboe commit 0660d8cd83938ef5cc91582fe6f951e8935f2d0f Author: Deepak Rawat Date: Thu Dec 6 11:44:44 2018 -0800 drm: Fix docs warning in drm_damage_helper.c Modify description to match actual argument list. Signed-off-by: Deepak Rawat Signed-off-by: Thomas Hellstrom commit d74380ba0e6318d97907b675cef0a02c5a15771e Author: Colin Ian King Date: Mon Dec 10 09:26:19 2018 +0000 drm/selftest: fix spelling mistake "dimention" -> "dimension" There is a spelling mistake in a pr_err message, fix this. Signed-off-by: Colin Ian King Signed-off-by: Thomas Hellstrom commit 732cd75b8c920d3727e69957b14faa7c2d7c3b75 Author: Quentin Perret Date: Mon Dec 3 09:56:27 2018 +0000 sched/fair: Select an energy-efficient CPU on task wake-up If an Energy Model (EM) is available and if the system isn't overutilized, re-route waking tasks into an energy-aware placement algorithm. The selection of an energy-efficient CPU for a task is achieved by estimating the impact on system-level active energy resulting from the placement of the task on the CPU with the highest spare capacity in each performance domain. This strategy spreads tasks in a performance domain and avoids overly aggressive task packing. The best CPU energy-wise is then selected if it saves a large enough amount of energy with respect to prev_cpu. Although it has already shown significant benefits on some existing targets, this approach cannot scale to platforms with numerous CPUs. This is an attempt to do something useful as writing a fast heuristic that performs reasonably well on a broad spectrum of architectures isn't an easy task. As such, the scope of usability of the energy-aware wake-up path is restricted to systems with the SD_ASYM_CPUCAPACITY flag set, and where the EM isn't too complex. Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: adharmap@codeaurora.org Cc: chris.redpath@arm.com Cc: currojerez@riseup.net Cc: dietmar.eggemann@arm.com Cc: edubezval@gmail.com Cc: gregkh@linuxfoundation.org Cc: javi.merino@kernel.org Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: morten.rasmussen@arm.com Cc: patrick.bellasi@arm.com Cc: pkondeti@codeaurora.org Cc: rjw@rjwysocki.net Cc: skannan@codeaurora.org Cc: smuckle@google.com Cc: srinivas.pandruvada@linux.intel.com Cc: thara.gopinath@linaro.org Cc: tkjos@google.com Cc: valentin.schneider@arm.com Cc: vincent.guittot@linaro.org Cc: viresh.kumar@linaro.org Link: https://lkml.kernel.org/r/20181203095628.11858-15-quentin.perret@arm.com Signed-off-by: Ingo Molnar commit 390031e4c309c94ecc07a558187eb5185200df83 Author: Quentin Perret Date: Mon Dec 3 09:56:26 2018 +0000 sched/fair: Introduce an energy estimation helper function In preparation for the definition of an energy-aware wakeup path, introduce a helper function to estimate the consequence on system energy when a specific task wakes-up on a specific CPU. compute_energy() estimates the capacity state to be reached by all performance domains and estimates the consumption of each online CPU according to its Energy Model and its percentage of busy time. Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: adharmap@codeaurora.org Cc: chris.redpath@arm.com Cc: currojerez@riseup.net Cc: dietmar.eggemann@arm.com Cc: edubezval@gmail.com Cc: gregkh@linuxfoundation.org Cc: javi.merino@kernel.org Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: morten.rasmussen@arm.com Cc: patrick.bellasi@arm.com Cc: pkondeti@codeaurora.org Cc: rjw@rjwysocki.net Cc: skannan@codeaurora.org Cc: smuckle@google.com Cc: srinivas.pandruvada@linux.intel.com Cc: thara.gopinath@linaro.org Cc: tkjos@google.com Cc: valentin.schneider@arm.com Cc: vincent.guittot@linaro.org Cc: viresh.kumar@linaro.org Link: https://lkml.kernel.org/r/20181203095628.11858-14-quentin.perret@arm.com Signed-off-by: Ingo Molnar commit 2802bf3cd936fe2c8033a696d375a4d9d3974de4 Author: Morten Rasmussen Date: Mon Dec 3 09:56:25 2018 +0000 sched/fair: Add over-utilization/tipping point indicator Energy-aware scheduling is only meant to be active while the system is _not_ over-utilized. That is, there are spare cycles available to shift tasks around based on their actual utilization to get a more energy-efficient task distribution without depriving any tasks. When above the tipping point task placement is done the traditional way based on load_avg, spreading the tasks across as many cpus as possible based on priority scaled load to preserve smp_nice. Below the tipping point we want to use util_avg instead. We need to define a criteria for when we make the switch. The util_avg for each cpu converges towards 100% regardless of how many additional tasks we may put on it. If we define over-utilized as: sum_{cpus}(rq.cfs.avg.util_avg) + margin > sum_{cpus}(rq.capacity) some individual cpus may be over-utilized running multiple tasks even when the above condition is false. That should be okay as long as we try to spread the tasks out to avoid per-cpu over-utilization as much as possible and if all tasks have the _same_ priority. If the latter isn't true, we have to consider priority to preserve smp_nice. For example, we could have n_cpus nice=-10 util_avg=55% tasks and n_cpus/2 nice=0 util_avg=60% tasks. Balancing based on util_avg we are likely to end up with nice=-10 tasks sharing cpus and nice=0 tasks getting their own as we 1.5*n_cpus tasks in total and 55%+55% is less over-utilized than 55%+60% for those cpus that have to be shared. The system utilization is only 85% of the system capacity, but we are breaking smp_nice. To be sure not to break smp_nice, we have defined over-utilization conservatively as when any cpu in the system is fully utilized at its highest frequency instead: cpu_rq(any).cfs.avg.util_avg + margin > cpu_rq(any).capacity IOW, as soon as one cpu is (nearly) 100% utilized, we switch to load_avg to factor in priority to preserve smp_nice. With this definition, we can skip periodic load-balance as no cpu has an always-running task when the system is not over-utilized. All tasks will be periodic and we can balance them at wake-up. This conservative condition does however mean that some scenarios that could benefit from energy-aware decisions even if one cpu is fully utilized would not get those benefits. For systems where some cpus might have reduced capacity on some cpus (RT-pressure and/or big.LITTLE), we want periodic load-balance checks as soon a just a single cpu is fully utilized as it might one of those with reduced capacity and in that case we want to migrate it. [ peterz: Added a comment explaining why new tasks are not accounted during overutilization detection. ] Signed-off-by: Morten Rasmussen Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: adharmap@codeaurora.org Cc: chris.redpath@arm.com Cc: currojerez@riseup.net Cc: dietmar.eggemann@arm.com Cc: edubezval@gmail.com Cc: gregkh@linuxfoundation.org Cc: javi.merino@kernel.org Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: patrick.bellasi@arm.com Cc: pkondeti@codeaurora.org Cc: rjw@rjwysocki.net Cc: skannan@codeaurora.org Cc: smuckle@google.com Cc: srinivas.pandruvada@linux.intel.com Cc: thara.gopinath@linaro.org Cc: tkjos@google.com Cc: valentin.schneider@arm.com Cc: vincent.guittot@linaro.org Cc: viresh.kumar@linaro.org Link: https://lkml.kernel.org/r/20181203095628.11858-13-quentin.perret@arm.com Signed-off-by: Ingo Molnar commit 630246a06ae2a7a12d1fce85f1e5681032982791 Author: Quentin Perret Date: Mon Dec 3 09:56:24 2018 +0000 sched/fair: Clean-up update_sg_lb_stats parameters In preparation for the introduction of a new root domain flag which can be set during load balance (the 'overutilized' flag), clean-up the set of parameters passed to update_sg_lb_stats(). More specifically, the 'local_group' and 'local_idx' parameters can be removed since they can easily be reconstructed from within the function. While at it, transform the 'overload' parameter into a flag stored in the 'sg_status' parameter hence facilitating the definition of new flags when needed. Suggested-by: Peter Zijlstra Suggested-by: Valentin Schneider Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Thomas Gleixner Cc: adharmap@codeaurora.org Cc: chris.redpath@arm.com Cc: currojerez@riseup.net Cc: dietmar.eggemann@arm.com Cc: edubezval@gmail.com Cc: gregkh@linuxfoundation.org Cc: javi.merino@kernel.org Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: morten.rasmussen@arm.com Cc: patrick.bellasi@arm.com Cc: pkondeti@codeaurora.org Cc: rjw@rjwysocki.net Cc: skannan@codeaurora.org Cc: smuckle@google.com Cc: srinivas.pandruvada@linux.intel.com Cc: thara.gopinath@linaro.org Cc: tkjos@google.com Cc: vincent.guittot@linaro.org Cc: viresh.kumar@linaro.org Link: https://lkml.kernel.org/r/20181203095628.11858-12-quentin.perret@arm.com Signed-off-by: Ingo Molnar commit 1f74de8798c93ce14801cc4e772603e51c841c33 Author: Quentin Perret Date: Mon Dec 3 09:56:22 2018 +0000 sched/toplogy: Introduce the 'sched_energy_present' static key In order to make sure Energy Aware Scheduling (EAS) will not impact systems where no Energy Model is available, introduce a static key guarding the access to EAS code. Since EAS is enabled on a per-root-domain basis, the static key is enabled when at least one root domain meets all conditions for EAS. Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: adharmap@codeaurora.org Cc: chris.redpath@arm.com Cc: currojerez@riseup.net Cc: dietmar.eggemann@arm.com Cc: edubezval@gmail.com Cc: gregkh@linuxfoundation.org Cc: javi.merino@kernel.org Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: morten.rasmussen@arm.com Cc: patrick.bellasi@arm.com Cc: pkondeti@codeaurora.org Cc: rjw@rjwysocki.net Cc: skannan@codeaurora.org Cc: smuckle@google.com Cc: srinivas.pandruvada@linux.intel.com Cc: thara.gopinath@linaro.org Cc: tkjos@google.com Cc: valentin.schneider@arm.com Cc: vincent.guittot@linaro.org Cc: viresh.kumar@linaro.org Link: https://lkml.kernel.org/r/20181203095628.11858-10-quentin.perret@arm.com Signed-off-by: Ingo Molnar commit 531b5c9f5cd05ead53324f419b32685a22eebe8b Author: Quentin Perret Date: Mon Dec 3 09:56:21 2018 +0000 sched/topology: Make Energy Aware Scheduling depend on schedutil Energy Aware Scheduling (EAS) is designed with the assumption that frequencies of CPUs follow their utilization value. When using a CPUFreq governor other than schedutil, the chances of this assumption being true are small, if any. When schedutil is being used, EAS' predictions are at least consistent with the frequency requests. Although those requests have no guarantees to be honored by the hardware, they should at least guide DVFS in the right direction and provide some hope in regards to the EAS model being accurate. To make sure EAS is only used in a sane configuration, create a strong dependency on schedutil being used. Since having sugov compiled-in does not provide that guarantee, make CPUFreq call a scheduler function on governor changes hence letting it rebuild the scheduling domains, check the governors of the online CPUs, and enable/disable EAS accordingly. Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Thomas Gleixner Cc: adharmap@codeaurora.org Cc: chris.redpath@arm.com Cc: currojerez@riseup.net Cc: dietmar.eggemann@arm.com Cc: edubezval@gmail.com Cc: gregkh@linuxfoundation.org Cc: javi.merino@kernel.org Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: morten.rasmussen@arm.com Cc: patrick.bellasi@arm.com Cc: pkondeti@codeaurora.org Cc: skannan@codeaurora.org Cc: smuckle@google.com Cc: srinivas.pandruvada@linux.intel.com Cc: thara.gopinath@linaro.org Cc: tkjos@google.com Cc: valentin.schneider@arm.com Cc: vincent.guittot@linaro.org Cc: viresh.kumar@linaro.org Link: https://lkml.kernel.org/r/20181203095628.11858-9-quentin.perret@arm.com Signed-off-by: Ingo Molnar commit b68a4c0dba3b1e1dda1ede49f3c2fc72d3b54567 Author: Quentin Perret Date: Mon Dec 3 09:56:20 2018 +0000 sched/topology: Disable EAS on inappropriate platforms Energy Aware Scheduling (EAS) in its current form is most relevant on platforms with asymmetric CPU topologies (e.g. Arm big.LITTLE) since this is where there is a lot of potential for saving energy through scheduling. This is particularly true since the Energy Model only includes the active power costs of CPUs, hence not providing enough data to compare packing-vs-spreading strategies. As such, disable EAS on root domains where the SD_ASYM_CPUCAPACITY flag is not set. While at it, disable EAS on systems where the complexity of the Energy Model is too high since that could lead to unacceptable scheduling overhead. All in all, EAS can be used on a root domain if and only if: 1. an Energy Model is available; 2. the root domain has an asymmetric CPU capacity topology; 3. the complexity of the root domain's EM is low enough to keep scheduling overheads low. Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: adharmap@codeaurora.org Cc: chris.redpath@arm.com Cc: currojerez@riseup.net Cc: dietmar.eggemann@arm.com Cc: edubezval@gmail.com Cc: gregkh@linuxfoundation.org Cc: javi.merino@kernel.org Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: morten.rasmussen@arm.com Cc: patrick.bellasi@arm.com Cc: pkondeti@codeaurora.org Cc: rjw@rjwysocki.net Cc: skannan@codeaurora.org Cc: smuckle@google.com Cc: srinivas.pandruvada@linux.intel.com Cc: thara.gopinath@linaro.org Cc: tkjos@google.com Cc: valentin.schneider@arm.com Cc: vincent.guittot@linaro.org Cc: viresh.kumar@linaro.org Link: https://lkml.kernel.org/r/20181203095628.11858-8-quentin.perret@arm.com Signed-off-by: Ingo Molnar commit 011b27bb5d3139e8b5fe9ceff1fc7f6dc3145071 Author: Quentin Perret Date: Mon Dec 3 09:56:19 2018 +0000 sched/topology: Add lowest CPU asymmetry sched_domain level pointer Add another member to the family of per-cpu sched_domain shortcut pointers. This one, sd_asym_cpucapacity, points to the lowest level at which the SD_ASYM_CPUCAPACITY flag is set. While at it, rename the sd_asym shortcut to sd_asym_packing to avoid confusions. Generally speaking, the largest opportunity to save energy via scheduling comes from a smarter exploitation of heterogeneous platforms (i.e. big.LITTLE). Consequently, the sd_asym_cpucapacity shortcut will be used at first as the lowest domain where Energy-Aware Scheduling (EAS) should be applied. For example, it is possible to apply EAS within a socket on a multi-socket system, as long as each socket has an asymmetric topology. Energy-aware cross-sockets wake-up balancing will only happen when the system is over-utilized, or this_cpu and prev_cpu are in different sockets. Suggested-by: Morten Rasmussen Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: adharmap@codeaurora.org Cc: chris.redpath@arm.com Cc: currojerez@riseup.net Cc: dietmar.eggemann@arm.com Cc: edubezval@gmail.com Cc: gregkh@linuxfoundation.org Cc: javi.merino@kernel.org Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: patrick.bellasi@arm.com Cc: pkondeti@codeaurora.org Cc: rjw@rjwysocki.net Cc: skannan@codeaurora.org Cc: smuckle@google.com Cc: srinivas.pandruvada@linux.intel.com Cc: thara.gopinath@linaro.org Cc: tkjos@google.com Cc: valentin.schneider@arm.com Cc: vincent.guittot@linaro.org Cc: viresh.kumar@linaro.org Link: https://lkml.kernel.org/r/20181203095628.11858-7-quentin.perret@arm.com Signed-off-by: Ingo Molnar commit 6aa140fa4508933a6ac6717d65a403eb904d6c02 Author: Quentin Perret Date: Mon Dec 3 09:56:18 2018 +0000 sched/topology: Reference the Energy Model of CPUs when available The existing scheduling domain hierarchy is defined to map to the cache topology of the system. However, Energy Aware Scheduling (EAS) requires more knowledge about the platform, and specifically needs to know about the span of Performance Domains (PD), which do not always align with caches. To address this issue, use the Energy Model (EM) of the system to extend the scheduler topology code with a representation of the PDs, alongside the scheduling domains. More specifically, a linked list of PDs is attached to each root domain. When multiple root domains are in use, each list contains only the PDs covering the CPUs of its root domain. If a PD spans over CPUs of multiple different root domains, it will be duplicated in all lists. The lists are fully maintained by the scheduler from partition_sched_domains() in order to cope with hotplug and cpuset changes. As for scheduling domains, the list are protected by RCU to ensure safe concurrent updates. Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: adharmap@codeaurora.org Cc: chris.redpath@arm.com Cc: currojerez@riseup.net Cc: dietmar.eggemann@arm.com Cc: edubezval@gmail.com Cc: gregkh@linuxfoundation.org Cc: javi.merino@kernel.org Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: morten.rasmussen@arm.com Cc: patrick.bellasi@arm.com Cc: pkondeti@codeaurora.org Cc: rjw@rjwysocki.net Cc: skannan@codeaurora.org Cc: smuckle@google.com Cc: srinivas.pandruvada@linux.intel.com Cc: thara.gopinath@linaro.org Cc: tkjos@google.com Cc: valentin.schneider@arm.com Cc: vincent.guittot@linaro.org Cc: viresh.kumar@linaro.org Link: https://lkml.kernel.org/r/20181203095628.11858-6-quentin.perret@arm.com Signed-off-by: Ingo Molnar commit 27871f7a8a341ef5c636a337856369acf8013e4e Author: Quentin Perret Date: Mon Dec 3 09:56:16 2018 +0000 PM: Introduce an Energy Model management framework Several subsystems in the kernel (task scheduler and/or thermal at the time of writing) can benefit from knowing about the energy consumed by CPUs. Yet, this information can come from different sources (DT or firmware for example), in different formats, hence making it hard to exploit without a standard API. As an attempt to address this, introduce a centralized Energy Model (EM) management framework which aggregates the power values provided by drivers into a table for each performance domain in the system. The power cost tables are made available to interested clients (e.g. task scheduler or thermal) via platform-agnostic APIs. The overall design is represented by the diagram below (focused on Arm-related drivers as an example, but applicable to any architecture): +---------------+ +-----------------+ +-------------+ | Thermal (IPA) | | Scheduler (EAS) | | Other | +---------------+ +-----------------+ +-------------+ | | em_pd_energy() | | | em_cpu_get() | +-----------+ | +--------+ | | | v v v +---------------------+ | | | Energy Model | | | | Framework | | | +---------------------+ ^ ^ ^ | | | em_register_perf_domain() +----------+ | +---------+ | | | +---------------+ +---------------+ +--------------+ | cpufreq-dt | | arm_scmi | | Other | +---------------+ +---------------+ +--------------+ ^ ^ ^ | | | +--------------+ +---------------+ +--------------+ | Device Tree | | Firmware | | ? | +--------------+ +---------------+ +--------------+ Drivers (typically, but not limited to, CPUFreq drivers) can register data in the EM framework using the em_register_perf_domain() API. The calling driver must provide a callback function with a standardized signature that will be used by the EM framework to build the power cost tables of the performance domain. This design should offer a lot of flexibility to calling drivers which are free of reading information from any location and to use any technique to compute power costs. Moreover, the capacity states registered by drivers in the EM framework are not required to match real performance states of the target. This is particularly important on targets where the performance states are not known by the OS. The power cost coefficients managed by the EM framework are specified in milli-watts. Although the two potential users of those coefficients (IPA and EAS) only need relative correctness, IPA specifically needs to compare the power of CPUs with the power of other components (GPUs, for example), which are still expressed in absolute terms in their respective subsystems. Hence, specifying the power of CPUs in milli-watts should help transitioning IPA to using the EM framework without introducing new problems by keeping units comparable across sub-systems. On the longer term, the EM of other devices than CPUs could also be managed by the EM framework, which would enable to remove the absolute unit. However, this is not absolutely required as a first step, so this extension of the EM framework is left for later. On the client side, the EM framework offers APIs to access the power cost tables of a CPU (em_cpu_get()), and to estimate the energy consumed by the CPUs of a performance domain (em_pd_energy()). Clients such as the task scheduler can then use these APIs to access the shared data structures holding the Energy Model of CPUs. Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Rafael J. Wysocki Cc: Thomas Gleixner Cc: adharmap@codeaurora.org Cc: chris.redpath@arm.com Cc: currojerez@riseup.net Cc: dietmar.eggemann@arm.com Cc: edubezval@gmail.com Cc: gregkh@linuxfoundation.org Cc: javi.merino@kernel.org Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: morten.rasmussen@arm.com Cc: patrick.bellasi@arm.com Cc: pkondeti@codeaurora.org Cc: skannan@codeaurora.org Cc: smuckle@google.com Cc: srinivas.pandruvada@linux.intel.com Cc: thara.gopinath@linaro.org Cc: tkjos@google.com Cc: valentin.schneider@arm.com Cc: vincent.guittot@linaro.org Cc: viresh.kumar@linaro.org Link: https://lkml.kernel.org/r/20181203095628.11858-4-quentin.perret@arm.com Signed-off-by: Ingo Molnar commit 938e5e4b0d1502a93e787985cb95b136b40717b7 Author: Quentin Perret Date: Mon Dec 3 09:56:15 2018 +0000 sched/cpufreq: Prepare schedutil for Energy Aware Scheduling Schedutil requests frequency by aggregating utilization signals from the scheduler (CFS, RT, DL, IRQ) and applying a 25% margin on top of them. Since Energy Aware Scheduling (EAS) needs to be able to predict the frequency requests, it needs to forecast the decisions made by the governor. In order to prepare the introduction of EAS, introduce schedutil_freq_util() to centralize the aforementioned signal aggregation and make it available to both schedutil and EAS. Since frequency selection and energy estimation still need to deal with RT and DL signals slightly differently, schedutil_freq_util() is called with a different 'type' parameter in those two contexts, and returns an aggregated utilization signal accordingly. While at it, introduce the map_util_freq() function which is designed to make schedutil's 25% margin usable easily for both sugov and EAS. As EAS will be able to predict schedutil's frequency requests more accurately than any other governor by design, it'd be sensible to make sure EAS cannot be used without schedutil. This will be done later, once EAS has actually been introduced. Suggested-by: Peter Zijlstra Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Thomas Gleixner Cc: adharmap@codeaurora.org Cc: chris.redpath@arm.com Cc: currojerez@riseup.net Cc: dietmar.eggemann@arm.com Cc: edubezval@gmail.com Cc: gregkh@linuxfoundation.org Cc: javi.merino@kernel.org Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: morten.rasmussen@arm.com Cc: patrick.bellasi@arm.com Cc: pkondeti@codeaurora.org Cc: rjw@rjwysocki.net Cc: skannan@codeaurora.org Cc: smuckle@google.com Cc: srinivas.pandruvada@linux.intel.com Cc: thara.gopinath@linaro.org Cc: tkjos@google.com Cc: valentin.schneider@arm.com Cc: vincent.guittot@linaro.org Cc: viresh.kumar@linaro.org Link: https://lkml.kernel.org/r/20181203095628.11858-3-quentin.perret@arm.com Signed-off-by: Ingo Molnar commit 5bd0988be12733a42a1a3d50e3e2ddfd79e57518 Author: Quentin Perret Date: Mon Dec 3 09:56:14 2018 +0000 sched/topology: Relocate arch_scale_cpu_capacity() to the internal header By default, arch_scale_cpu_capacity() is only visible from within the kernel/sched folder. Relocate it to include/linux/sched/topology.h to make it visible to other clients needing to know about the capacity of CPUs, such as the Energy Model framework. This also shrinks the public header. Signed-off-by: Quentin Perret Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: adharmap@codeaurora.org Cc: chris.redpath@arm.com Cc: currojerez@riseup.net Cc: dietmar.eggemann@arm.com Cc: edubezval@gmail.com Cc: gregkh@linuxfoundation.org Cc: javi.merino@kernel.org Cc: joel@joelfernandes.org Cc: juri.lelli@redhat.com Cc: morten.rasmussen@arm.com Cc: patrick.bellasi@arm.com Cc: pkondeti@codeaurora.org Cc: rjw@rjwysocki.net Cc: skannan@codeaurora.org Cc: smuckle@google.com Cc: srinivas.pandruvada@linux.intel.com Cc: thara.gopinath@linaro.org Cc: tkjos@google.com Cc: valentin.schneider@arm.com Cc: vincent.guittot@linaro.org Cc: viresh.kumar@linaro.org Link: https://lkml.kernel.org/r/20181203095628.11858-2-quentin.perret@arm.com Signed-off-by: Ingo Molnar commit 9ebc6053814d37b9de8cc291fba28f30a729c929 Author: Yangtao Li Date: Sat Nov 3 13:26:02 2018 -0400 sched/core: Remove unnecessary unlikely() in push_*_task() WARN_ON() already contains an unlikely(), so it's not necessary to use WARN_ON(1). Signed-off-by: Yangtao Li Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20181103172602.1917-1-tiny.windzz@gmail.com Signed-off-by: Ingo Molnar commit 765d0af19f5f388a34bf4533378f8398b72ded46 Author: Vincent Guittot Date: Wed Aug 29 15:19:11 2018 +0200 sched/topology: Remove the ::smt_gain field from 'struct sched_domain' ::smt_gain is used to compute the capacity of CPUs of a SMT core with the constraint 1 < ::smt_gain < 2 in order to be able to compute number of CPUs per core. The field has_free_capacity of struct numa_stat, which was the last user of this computation of number of CPUs per core, has been removed by: 2d4056fafa19 ("sched/numa: Remove numa_has_capacity()") We can now remove this constraint on core capacity and use the defautl value SCHED_CAPACITY_SCALE for SMT CPUs. With this remove, SCHED_CAPACITY_SCALE becomes the maximum compute capacity of CPUs on every systems. This should help to simplify some code and remove fields like rd->max_cpu_capacity Furthermore, arch_scale_cpu_capacity() is used with a NULL sd in several other places in the code when it wants the capacity of a CPUs to scale some metrics like in pelt, deadline or schedutil. In case on SMT, the value returned is not the capacity of SMT CPUs but default SCHED_CAPACITY_SCALE. So remove it. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Mike Galbraith Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1535548752-4434-4-git-send-email-vincent.guittot@linaro.org Signed-off-by: Ingo Molnar commit 43b9e4febc66b98d83cc1560196d56ac7fef3c32 Author: Mukesh Ojha Date: Tue Nov 27 14:43:32 2018 +0530 perf/core: Declare the __percpu attribute on non-deref types Sparse reports the current declaration of two perf percpu variables with this warning: warning: incorrect type in initializer (different address spaces) expected void const [noderef] *__vpp_verify got struct perf_cpu_context * While it's normally perfectly fine to place GCC attributes anywhere in the definition, this particular attribute is for a checking compiler's such as Sparse's benefit, which doesn't want __percpu on pointers. So reorder the attribute to come after the structure type, not after the pointer type. [ mingo: Rewrote the changelog. ] Signed-off-by: Mukesh Ojha Signed-off-by: Peter Zijlstra (Intel) Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/1543310012-7967-1-git-send-email-mojha@codeaurora.org Signed-off-by: Ingo Molnar commit a91f676074c05b3c455700b90849adcfda50079e Author: Takashi Sakamoto Date: Tue Dec 11 19:17:35 2018 +0900 ALSA: fireface: add support for Fireface 800 with MIDI functionality only Fireface 800 is a flagship model of RME GmbH for audio and music units on IEEE 1394 bus, shipped 2004. This model consists of four chips: - TI TSB81BA3D for physical layer on cable environment of EEE 1394 bus - TI TSB82AA2 for link layer for 1394 OHCI bus bridge to PCI bus - Xilinx Spartan-3 FPGA XC3S400 - Xilinx High-Performance CPLD XC9572XL This commit adds support Fireface 800. In this time, the support is restricted to its MIDI functionality, thus this commit adds some condition statements to avoid touching streaming functionality. Unlike Fireface 400, Fireface 800 has no functionality to suppress asynchronous transactions for MIDI messages except for unregister of listen address in controller side, thus the feature is available as is. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit aef4ad2f5aa27ec05f0306547bcf7cf86a9e9873 Author: Takashi Sakamoto Date: Tue Dec 11 19:17:34 2018 +0900 ALSA: fireface: localize a handler for MIDI messages on tx transaction Content of asynchronous transaction for MIDI messages differs between Fireface 400 and 800. This commit adds a model-specific handler for the transaction and adds arrangement. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 3eb8a24459491acc40440b655ca640c87125c5a3 Author: Takashi Sakamoto Date: Tue Dec 11 19:17:33 2018 +0900 ALSA: fireface: add driver data for register for MIDI high address Fireface 400 and 800 have the same mechanism to decide address to which asynchronous transactions are sent for MIDI messages, however they use different registers for controllers to notify higher 4 byte of the address. This commit adds a model-specific parameter to represent the address. Additionally, it corrects some comments. I note that these two models have a difference to enable/disable the transaction. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 0085c6edabe85fd39d6ad4340dba2587511e2b3e Author: Takashi Sakamoto Date: Tue Dec 11 19:17:32 2018 +0900 ALSA: fireface: share register for async transaction of MIDI messages As long as investigating packet dumps from Fireface 400/800, a register to receive asynchronous transactions for MIDI messages is the same. For Fireface 800, minor register is used. This commit declares macros for the transactions and obsoletes model-specific parameters. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 5bfb841e2f5952f5a6d8540dfda196769b358f8c Author: Takashi Sakamoto Date: Tue Dec 11 19:17:31 2018 +0900 ALSA: fireface: add support for second optical interface for ADAT stream Unlike Fireface 400, Fireface 800 have two pair of optical interface for ADAT signal and S/PDIF signal. ADAT signals for the interface are handled for sampling clock source separately. This commit modifies a parser for clock configuration to distinguish these two ADAT signals. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 3c3b892b3735edcc9e0be0aa129c72613e3f156e Author: Takashi Sakamoto Date: Tue Dec 11 19:17:30 2018 +0900 ALSA: fireface: share helper function to get current sampling rate and clock source As long as investigating packet dumps from Fireface 400/800, bits on status registers for clock synchronization are the same. This commit moves a parser for a register of clock configuration to obsolete model-specific operations. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 72f10f08b6e95cfeb7cad9ebd165d5cca771e0e7 Author: Takashi Sakamoto Date: Tue Dec 11 19:17:29 2018 +0900 ALSA: fireface: share status and configuration dump As long as investigating packet dumps from Fireface 400/800, bits on status registers for clock synchronization are the same. This commit moves a parser for the registers to obsolete model-specific operations. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 3ae49ed923028b93c790910d362e3af7f0b87d09 Author: Takashi Sakamoto Date: Tue Dec 11 19:17:28 2018 +0900 ALSA: fireface: share some registers for status of clock synchronization As long as investigating packet dumps from Fireface 400/800, status registers for clock synchronization is common. This commit moves some macros for them to header file. Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai commit 80eb865768703c0f85a0603762742ae1dedf21f0 Author: Andrea Parri Date: Tue Nov 27 12:01:10 2018 +0100 sched/fair: Clean up comment in nohz_idle_balance() Concerning the comment associated to the atomic_fetch_andnot() in nohz_idle_balance(), Vincent explains [1]: "[...] the comment is useless and can be removed [...] it was referring to a line code above the comment that was present in a previous iteration of the patchset. This line disappeared in final version but the comment has stayed." So remove the comment. Vincent also points out that the full ordering associated to the atomic_fetch_andnot() primitive could be relaxed, but this patch insists on the current more conservative/fully ordered solution: "Performance" isn't a concern, stay away from "correctness"/subtle relaxed (re)ordering if possible..., just make sure not to confuse the next reader with misleading/out-of-date comments. [1] http://lkml.kernel.org/r/CAKfTPtBjA-oCBRkO6__npQwL3+HLjzk7riCcPU1R7YdO-EpuZg@mail.gmail.com Suggested-by: Vincent Guittot Signed-off-by: Andrea Parri Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/20181127110110.5533-1-andrea.parri@amarulasolutions.com Signed-off-by: Ingo Molnar commit fe27b0de8dfcdf8482558ce5d25e697fe74d851e Author: Bart Van Assche Date: Thu Dec 6 17:11:37 2018 -0800 locking/lockdep: Stop using RCU primitives to access 'all_lock_classes' Due to the previous patch all code that accesses the 'all_lock_classes' list holds the graph lock. Hence use regular list primitives instead of their RCU variants to access this list. Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Cc: Johannes Berg Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Thomas Gleixner Cc: Waiman Long Cc: johannes.berg@intel.com Cc: tj@kernel.org Link: https://lkml.kernel.org/r/20181207011148.251812-14-bvanassche@acm.org Signed-off-by: Ingo Molnar commit 786fa29e9cb6810e21ab0d9c41a81d81d54d1d1b Author: Bart Van Assche Date: Thu Dec 6 17:11:36 2018 -0800 locking/lockdep: Make concurrent lockdep_reset_lock() calls safe Since zap_class() removes items from the all_lock_classes list and the classhash_table, protect all zap_class() calls against concurrent data structure modifications with the graph lock. Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Cc: Johannes Berg Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Thomas Gleixner Cc: Waiman Long Cc: johannes.berg@intel.com Cc: tj@kernel.org Link: https://lkml.kernel.org/r/20181207011148.251812-13-bvanassche@acm.org Signed-off-by: Ingo Molnar commit a66b6922dc6a5ece60ea9326153da3b062977a4d Author: Bart Van Assche Date: Thu Dec 6 17:11:35 2018 -0800 locking/lockdep: Remove a superfluous INIT_LIST_HEAD() statement Initializing a list entry just before it is passed to list_add_tail_rcu() is not necessary because list_add_tail_rcu() overwrites the next and prev pointers anyway. Hence remove the INIT_LIST_HEAD() statement. Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Cc: Johannes Berg Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Thomas Gleixner Cc: Waiman Long Cc: johannes.berg@intel.com Cc: tj@kernel.org Link: https://lkml.kernel.org/r/20181207011148.251812-12-bvanassche@acm.org Signed-off-by: Ingo Molnar commit 2904d9fa45d3ce7153f1e10d78c570ecf7f19c35 Author: Bart Van Assche Date: Thu Dec 6 17:11:34 2018 -0800 locking/lockdep: Introduce lock_class_cache_is_registered() This patch does not change any functionality but makes the lockdep_reset_lock() function easier to read. Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Cc: Johannes Berg Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Thomas Gleixner Cc: Waiman Long Cc: johannes.berg@intel.com Cc: tj@kernel.org Link: https://lkml.kernel.org/r/20181207011148.251812-11-bvanassche@acm.org Signed-off-by: Ingo Molnar commit d35568bdb6ce4be3f885f8f189bbde5adc7e0160 Author: Bart Van Assche Date: Thu Dec 6 17:11:33 2018 -0800 locking/lockdep: Inline __lockdep_init_map() Since the function __lockdep_init_map() only has one caller, inline it into its caller. This patch does not change any functionality. Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Cc: Johannes Berg Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Thomas Gleixner Cc: Waiman Long Cc: johannes.berg@intel.com Cc: tj@kernel.org Link: https://lkml.kernel.org/r/20181207011148.251812-10-bvanassche@acm.org Signed-off-by: Ingo Molnar commit 1431a5d2cfa18d7006d9b0e7ab4548d9bb19ce55 Author: Bart Van Assche Date: Thu Dec 6 17:11:32 2018 -0800 locking/lockdep: Declare local symbols static This patch avoids that sparse complains about a missing declaration for the lock_classes array when building with CONFIG_DEBUG_LOCKDEP=n. Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Cc: Johannes Berg Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Thomas Gleixner Cc: Waiman Long Cc: johannes.berg@intel.com Cc: tj@kernel.org Link: https://lkml.kernel.org/r/20181207011148.251812-9-bvanassche@acm.org Signed-off-by: Ingo Molnar commit 886adbed7ac19352315e9f1dd880360c7544d25c Author: Bart Van Assche Date: Thu Dec 6 17:11:31 2018 -0800 tools/lib/lockdep/tests: Test the lockdep_reset_lock() implementation This patch makes sure that the lockdep_reset_lock() function gets tested. Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Cc: Johannes Berg Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Thomas Gleixner Cc: Waiman Long Cc: johannes.berg@intel.com Cc: tj@kernel.org Link: https://lkml.kernel.org/r/20181207011148.251812-8-bvanassche@acm.org Signed-off-by: Ingo Molnar commit ac862d9b2fd084b50ee7a332a35d8d8d3228ce09 Author: Bart Van Assche Date: Thu Dec 6 17:11:30 2018 -0800 tools/lib/lockdep: Add dummy print_irqtrace_events() implementation This patch avoids that linking against liblockdep fails due to no print_irqtrace_events() definition being available. Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Cc: Johannes Berg Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Thomas Gleixner Cc: Waiman Long Cc: johannes.berg@intel.com Cc: tj@kernel.org Link: https://lkml.kernel.org/r/20181207011148.251812-7-bvanassche@acm.org Signed-off-by: Ingo Molnar commit 7f3c7952d111ac93573fb86f4d5aeff527a07fcc Author: Bart Van Assche Date: Thu Dec 6 17:11:29 2018 -0800 tools/lib/lockdep: Rename "trywlock" into "trywrlock" This patch avoids that the following compiler warning is reported while compiling the lockdep unit tests: include/liblockdep/rwlock.h: In function 'liblockdep_pthread_rwlock_trywlock': include/liblockdep/rwlock.h:66:9: warning: implicit declaration of function 'pthread_rwlock_trywlock'; did you mean 'pthread_rwlock_trywrlock'? [-Wimplicit-function-declaration] return pthread_rwlock_trywlock(&lock->rwlock) == 0 ? 1 : 0; ^~~~~~~~~~~~~~~~~~~~~~~ pthread_rwlock_trywrlock Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Cc: Johannes Berg Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Sasha Levin Cc: Thomas Gleixner Cc: Waiman Long Cc: johannes.berg@intel.com Cc: tj@kernel.org Fixes: 5a52c9b480e0 ("liblockdep: Add public headers for pthread_rwlock_t implementation") Link: https://lkml.kernel.org/r/20181207011148.251812-6-bvanassche@acm.org Signed-off-by: Ingo Molnar commit 2b28a8609ec9891e37607ae20688b4ab34f2778c Author: Bart Van Assche Date: Thu Dec 6 17:11:28 2018 -0800 tools/lib/lockdep/tests: Run lockdep tests a second time under Valgrind This improves test coverage. Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Cc: Johannes Berg Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Thomas Gleixner Cc: Waiman Long Cc: johannes.berg@intel.com Cc: tj@kernel.org Link: https://lkml.kernel.org/r/20181207011148.251812-5-bvanassche@acm.org Signed-off-by: Ingo Molnar commit 5ecb8e94b494af0df8de4ca9b9ef88d87b30a9c1 Author: Bart Van Assche Date: Thu Dec 6 17:11:27 2018 -0800 tools/lib/lockdep/tests: Improve testing accuracy Instead of checking whether the tests produced any output, check the output itself. This patch avoids that e.g. debug output causes the message "PASSED!" to be reported for failed tests. Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Cc: Johannes Berg Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Thomas Gleixner Cc: Waiman Long Cc: johannes.berg@intel.com Cc: tj@kernel.org Link: https://lkml.kernel.org/r/20181207011148.251812-4-bvanassche@acm.org Signed-off-by: Ingo Molnar commit 7e9798871a9186cb831cf693d7ff58085384ccbd Author: Bart Van Assche Date: Thu Dec 6 17:11:26 2018 -0800 tools/lib/lockdep/tests: Fix shellcheck warnings Use find instead of ls to avoid splitting filenames that contain spaces. Use rm -f instead of if ... then rm ...; fi. This patch addresses all shellcheck complaints about the run_tests.sh shell script. Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Cc: Johannes Berg Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Thomas Gleixner Cc: Waiman Long Cc: johannes.berg@intel.com Cc: tj@kernel.org Link: https://lkml.kernel.org/r/20181207011148.251812-3-bvanassche@acm.org Signed-off-by: Ingo Molnar commit da087b2229618f78ecea5c203fed8ba2245de636 Author: Bart Van Assche Date: Thu Dec 6 17:11:25 2018 -0800 tools/lib/lockdep/tests: Display compiler warning and error messages If compilation of liblockdep fails, display an error message and exit immediately. Display compiler warning and error messages that are generated while building a test. Only run a test if compilation of it succeeded. Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Cc: Johannes Berg Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Sasha Levin Cc: Thomas Gleixner Cc: Waiman Long Cc: johannes.berg@intel.com Cc: tj@kernel.org Link: https://lkml.kernel.org/r/20181207011148.251812-2-bvanassche@acm.org Signed-off-by: Ingo Molnar commit 2421b7f3573babfe1673a5ffee1677a5013e6df1 Author: Waiman Long Date: Mon Nov 19 13:55:10 2018 -0500 locking/lockdep: Remove ::version from lock_class structure It turns out the version field in the lock_class structure isn't used anywhere. Just remove it. Signed-off-by: Waiman Long Signed-off-by: Peter Zijlstra (Intel) Cc: Andrew Morton Cc: Andrey Ryabinin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Petr Mladek Cc: Sasha Levin Cc: Sergey Senozhatsky Cc: Tejun Heo Cc: Thomas Gleixner Cc: Will Deacon Cc: iommu@lists.linux-foundation.org Cc: kasan-dev@googlegroups.com Link: https://lkml.kernel.org/r/1542653726-5655-2-git-send-email-longman@redhat.com Signed-off-by: Ingo Molnar commit bd44735418221e15b45102c31f0bc00046194f35 Author: YueHaibing Date: Tue Dec 11 17:52:07 2018 +0800 EDAC, i5000: Remove set but not used local variables Remove unused local variables as reported by gcc's -Wunused-but-set-variable option. [ bp: simplify commit message. ] Signed-off-by: YueHaibing Signed-off-by: Borislav Petkov Cc: Mauro Carvalho Chehab Cc: linux-edac Link: https://lkml.kernel.org/r/20181211095207.25936-1-yuehaibing@huawei.com commit fcf9ab35ba418edbab3ba0882ff230f82b16403b Author: Randy Dunlap Date: Sat Dec 1 09:31:34 2018 -0800 PCI/P2PDMA: Clean up documentation and kernel-doc Fix typos, spellos, and grammar in p2pdma.rst and p2pdma.c. Fix return value(s) in function pci_p2pmem_alloc_sgl(). Signed-off-by: Randy Dunlap Signed-off-by: Bjorn Helgaas Acked-by: Logan Gunthorpe Cc: Jonathan Corbet commit 6aa69750ef1b162417811aa2d940a8df30acd930 Author: Christoph Hellwig Date: Sat Dec 8 09:40:03 2018 -0800 sparc: merge 32-bit and 64-bit version of pci.h There are enough common defintions that a single header seems nicer. Also drop the pointless include. Signed-off-by: Christoph Hellwig Acked-by: David S. Miller Acked-by: Sam Ravnborg commit b535d1fca6d63ae6096e7030331e6e698aac4455 Author: Christoph Hellwig Date: Sat Dec 8 09:39:12 2018 -0800 sparc: move the leon PCI memory space comment to It has nothing to do with the content of the pci.h header. Suggested by: Sam Ravnborg Signed-off-by: Christoph Hellwig Acked-by: David S. Miller commit a24ca8a253bd6e2644eba069b78fec80928d7b76 Author: Christoph Hellwig Date: Mon Dec 3 14:21:58 2018 +0100 sparc: remove not required includes from dma-mapping.h The only thing we need to explicitly pull in is the defines for the CPU type. Signed-off-by: Christoph Hellwig Acked-by: David S. Miller commit ce65d36f3ea79368170ca58f2efd28cdba3d70e9 Author: Christoph Hellwig Date: Mon Dec 3 14:04:32 2018 +0100 sparc: remove the sparc32_dma_ops indirection There is no good reason to have a double indirection for the sparc32 dma ops, so remove the sparc32_dma_ops and define separate dma_map_ops instance for the different IOMMU types. Signed-off-by: Christoph Hellwig Acked-by: David S. Miller commit 53b7670e5735ba1c662230377d764799aaf57300 Author: Christoph Hellwig Date: Mon Dec 3 14:02:26 2018 +0100 sparc: factor the dma coherent mapping into helper Factor the code to remap memory returned from the DMA coherent allocator into two helpers that can be shared by the IOMMU and direct mapping code. Signed-off-by: Christoph Hellwig Acked-by: David S. Miller Acked-by: Sam Ravnborg commit 7227b202623986505c9dd6d2eadad977cd43625e Author: Christoph Hellwig Date: Mon Dec 3 12:28:35 2018 +0100 sparc: remove not needed sbus_dma_ops methods No need to BUG_ON() on the cache maintainance ops - they are no-ops by default, and there is nothing in the DMA API contract that prohibits calling them on sbus devices (even if such drivers are unlikely to ever appear). Similarly a dma_supported method that always returns 0 is rather pointless. The only thing that indicates is that no one ever calls the method on sbus devices. Signed-off-by: Christoph Hellwig Acked-by: David S. Miller commit 4fe4f9fecc36956fd53c8edf96dd0c691ef98ff9 Author: Minas Harutyunyan Date: Mon Dec 10 18:09:32 2018 +0400 usb: dwc2: Fix disable all EP's on disconnect Disabling all EP's allow to reset EP's to initial state. Introduced new function dwc2_hsotg_ep_disable_lock() which before calling dwc2_hsotg_ep_disable() function acquire hsotg->lock and release on exiting. From dwc2_hsotg_ep_disable() function removed acquiring hsotg->lock. In dwc2_hsotg_core_init_disconnected() function when USB reset interrupt asserted disabling all ep’s by dwc2_hsotg_ep_disable() function. This updates eliminating sparse imbalance warnings. Reverted changes in dwc2_hostg_disconnect() function. Introduced new function dwc2_hsotg_ep_disable_lock(). Changed dwc2_hsotg_ep_ops. Now disable point to dwc2_hsotg_ep_disable_lock() function. In functions dwc2_hsotg_udc_stop() and dwc2_hsotg_suspend() dwc2_hsotg_ep_disable() function replaced by dwc2_hsotg_ep_disable_lock() function. In dwc2_hsotg_ep_disable() function removed acquiring of hsotg->lock. Fixes: dccf1bad4be7 ("usb: dwc2: Disable all EP's on disconnect") Signed-off-by: Minas Harutyunyan Signed-off-by: Felipe Balbi commit 3c15ddb97c77f34ba009910becd5921f169770a2 Author: Victor Chong Date: Wed Apr 11 10:19:53 2018 +0100 tee: optee: log message if dynamic shm is enabled When dynamic shared memory support is enabled in the OP-TEE Trusted OS, it doesn't mean that the driver supports it, which can confuse users during debugging. Log a message when dynamic shared memory is enabled in the driver, to let users know for sure. Suggested-by: Jerome Forissier Signed-off-by: Victor Chong Reviewed-by: Jerome Forissier Signed-off-by: Jens Wiklander commit b2d102bd0146d9eb1fa630ca0cd19a15ef2f74c8 Author: Zhizhou Zhang Date: Wed Nov 21 11:01:43 2018 +0800 tee: optee: avoid possible double list_del() This bug occurs when: - a new request arrives, one thread(let's call it A) is pending in optee_supp_req() with req->busy is initial value false. - tee-supplicant is killed, then optee_supp_release() is called, this function calls list_del(&req->link), and set supp->ctx to NULL. And it also wake up process A. - process A continues, it firstly checks supp->ctx which is NULL, then checks req->busy which is false, at last run list_del(&req->link). This triggers double list_del() and results kernel panic. For solve this problem, we rename req->busy to req->in_queue, and associate it with state of whether req is linked to supp->reqs. So we can just only check req->in_queue to make decision calling list_del() or not. Signed-off-by: Zhizhou Zhang Signed-off-by: Jens Wiklander commit ad78dee0b630527bdfed809d1f5ed95c601886ae Author: Robin Murphy Date: Mon Dec 10 14:00:33 2018 +0000 dma-debug: Batch dma_debug_entry allocation DMA debug entries are one of those things which aren't that useful individually - we will always want some larger quantity of them - and which we don't really need to manage the exact number of - we only care about having 'enough'. In that regard, the current behaviour of creating them one-by-one leads to a lot of unwarranted function call overhead and memory wasted on alignment padding. Now that we don't have to worry about freeing anything via dma_debug_resize_entries(), we can optimise the allocation behaviour by grabbing whole pages at once, which will save considerably on the aforementioned overheads, and probably offer a little more cache/TLB locality benefit for traversing the lists under normal operation. This should also give even less reason for an architecture-level override of the preallocation size, so make the definition unconditional - if there is still any desire to change the compile-time value for some platforms it would be better off as a Kconfig option anyway. Since freeing a whole page of entries at once becomes enough of a challenge that it's not really worth complicating dma_debug_init(), we may as well tweak the preallocation behaviour such that as long as we manage to allocate *some* pages, we can leave debugging enabled on a best-effort basis rather than otherwise wasting them. Signed-off-by: Robin Murphy Tested-by: Qian Cai Signed-off-by: Christoph Hellwig commit 0cb0e25e421436a83ee39857923e4213b983e463 Author: Robin Murphy Date: Mon Dec 10 14:00:32 2018 +0000 dma/debug: Remove dma_debug_resize_entries() With the only caller now gone, we can clean up this part of dma-debug's exposed internals and make way to tweak the allocation behaviour. Signed-off-by: Robin Murphy Tested-by: Qian Cai Signed-off-by: Christoph Hellwig commit a8a4c98fc9ac84ee9e068fbb16210d2ab8cfefe0 Author: Robin Murphy Date: Mon Dec 10 14:00:31 2018 +0000 x86/dma/amd-gart: Stop resizing dma_debug_entry pool dma-debug is now capable of adding new entries to its pool on-demand if the initial preallocation was insufficient, so the IOMMU_LEAK logic no longer needs to explicitly change the pool size. This does lose it the ability to save a couple of megabytes of RAM by reducing the pool size below its default, but it seems unlikely that that is a realistic concern these days (or indeed that anyone is actively debugging AGP drivers' DMA usage any more). Getting rid of dma_debug_resize_entries() will make room for further streamlining in the dma-debug code itself. Removing the call reveals quite a lot of cruft which has been useless for nearly a decade since commit 19c1a6f5764d ("x86 gart: reimplement IOMMU_LEAK feature by using DMA_API_DEBUG"), including the entire 'iommu=leak' parameter, which controlled nothing except whether dma_debug_resize_entries() was called or not. Signed-off-by: Robin Murphy Acked-by: Thomas Gleixner Tested-by: Qian Cai Signed-off-by: Christoph Hellwig commit ceb51173b2b5bd7af0d99079f6bbacdcfc58fe08 Author: Robin Murphy Date: Mon Dec 10 14:00:30 2018 +0000 dma-debug: Make leak-like behaviour apparent Now that we can dynamically allocate DMA debug entries to cope with drivers maintaining excessively large numbers of live mappings, a driver which *does* actually have a bug leaking mappings (and is not unloaded) will no longer trigger the "DMA-API: debugging out of memory - disabling" message until it gets to actual kernel OOM conditions, which means it could go unnoticed for a while. To that end, let's inform the user each time the pool has grown to a multiple of its initial size, which should make it apparent that they either have a leak or might want to increase the preallocation size. Signed-off-by: Robin Murphy Tested-by: Qian Cai Signed-off-by: Christoph Hellwig commit 2b9d9ac02b9d8d32c515c82bb17401c429f160ab Author: Robin Murphy Date: Mon Dec 10 14:00:29 2018 +0000 dma-debug: Dynamically expand the dma_debug_entry pool Certain drivers such as large multi-queue network adapters can use pools of mapped DMA buffers larger than the default dma_debug_entry pool of 65536 entries, with the result that merely probing such a device can cause DMA debug to disable itself during boot unless explicitly given an appropriate "dma_debug_entries=..." option. Developers trying to debug some other driver on such a system may not be immediately aware of this, and at worst it can hide bugs if they fail to realise that dma-debug has already disabled itself unexpectedly by the time their code of interest gets to run. Even once they do realise, it can be a bit of a pain to emprirically determine a suitable number of preallocated entries to configure, short of massively over-allocating. There's really no need for such a static limit, though, since we can quite easily expand the pool at runtime in those rare cases that the preallocated entries are insufficient, which is arguably the least surprising and most useful behaviour. To that end, refactor the prealloc_memory() logic a little bit to generalise it for runtime reallocations as well. Signed-off-by: Robin Murphy Tested-by: Qian Cai Signed-off-by: Christoph Hellwig commit f737b095c60c635db260e02fdb9f0efb9f3360c4 Author: Robin Murphy Date: Mon Dec 10 14:00:27 2018 +0000 dma-debug: Use pr_fmt() Use pr_fmt() to generate the "DMA-API: " prefix consistently. This results in it being added to a couple of pr_*() messages which were missing it before, and for the err_printk() calls moves it to the actual start of the message instead of somewhere in the middle. Signed-off-by: Robin Murphy Tested-by: Qian Cai Signed-off-by: Christoph Hellwig commit 9f191555ba4ba8fc82e589670e46a7f79b72a157 Author: Robin Murphy Date: Mon Dec 10 14:00:28 2018 +0000 dma-debug: Expose nr_total_entries in debugfs Expose nr_total_entries in debugfs, so that {num,min}_free_entries become even more meaningful to users interested in current/maximum utilisation. This becomes even more relevant once nr_total_entries may change at runtime beyond just the existing AMD GART debug code. Suggested-by: John Garry Signed-off-by: Robin Murphy Tested-by: Qian Cai Signed-off-by: Christoph Hellwig commit 6451fe73fa0f542a49bfacd7205b88a597897f58 Author: Jens Axboe Date: Sun Dec 9 11:21:45 2018 -0700 nvme: fix irq vs io_queue calculations Guenter reported an boot hang issue on HPPA after we default to 0 poll queues. We have two issues in the queue count calculations: 1) We don't separate the poll queues from the read/write queues. This is important, since the former doesn't need interrupts. 2) The adjust logic is broken. Adjust the poll queue count before doing nvme_calc_io_queues(). The poll queue count is only limited by the IO queue count we were able to get from the controller, not failures in the IRQ allocation loop. This leaves nvme_calc_io_queues() just adjusting the read/write queue map. Reported-by: Reported-by: Guenter Roeck Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Signed-off-by: Jens Axboe commit 2701e804f00f79823f69f37c87fef171ac345484 Merge: c20c809f92591 a2dc50914744e Author: Greg Kroah-Hartman Date: Tue Dec 11 14:24:54 2018 +0100 Merge tag 'extcon-next-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next Chanwoo writes: Update extcon for 4.21 Detailed description for this pull request: 1. Fix minor issue of Maxim MUIC (Micro USB IC) device driver - Avoid forcing UART path on probe for extcon-max77843/77693/14577/8997.c - Set USB path in USB device mode for extcon-max8997.c * tag 'extcon-next-for-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon: extcon: max8997: Fix lack of path setting in USB device mode extcon: max8997: Avoid forcing UART path on drive probe extcon: max14577: Avoid forcing UART path on drive probe extcon: max77693: Avoid forcing UART path on drive probe extcon: max77843: Avoid forcing UART path on drive probe commit e4f752dda0de351efd198f438b68e743029da68a Author: Nick Desaulniers Date: Mon Dec 10 14:27:16 2018 -0800 x86/um/vdso: Drop implicit common-page-size linker flag GNU linker's -z common-page-size's default value is based on the target architecture. arch/x86/um/vdso/Makefile sets it to the architecture default, which is implicit and redundant. Drop it so that one more LLVM build issue gets addressed. Signed-off-by: Nick Desaulniers Signed-off-by: Borislav Petkov Acked-by: Richard Weinberger Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Jeff Dike Cc: Masahiro Yamada Cc: Thomas Gleixner Cc: linux-um@lists.infradead.org Cc: x86-ml Link: https://lkml.kernel.org/r/20181206191231.192355-1-ndesaulniers@google.com commit a802ed0dd9c2607cc219574e881062d43ea3b7e0 Author: Mimi Zohar Date: Wed Nov 14 12:30:19 2018 -0500 selftests/ima: kexec_load syscall test The kernel CONFIG_KEXEC_VERIFY_SIG option is limited to verifying a kernel image's signature, when loaded via the kexec_file_load syscall. There is no method for verifying a kernel image's signature loaded via the kexec_load syscall. This test verifies loading the kernel image via the kexec_load syscall fails when the kernel CONFIG_KEXEC_VERIFY_SIG option is enabled on systems with secureboot enabled[1]. [1] Detecting secureboot enabled is architecture specific. Signed-off-by: Mimi Zohar commit 060190fbe676268a04a80d5f4b426fc3db9c2401 Author: Mimi Zohar Date: Wed Nov 14 17:24:13 2018 -0500 ima: don't measure/appraise files on efivarfs Update the builtin IMA policies specified on the boot command line (eg. ima_policy="tcb|appraise_tcb") to permit accessing efivar files. Signed-off-by: Mimi Zohar commit 399574c64eaf94e82b7cf056978d7e68748c0f1d Author: Mimi Zohar Date: Sun Nov 18 04:08:12 2018 -0500 x86/ima: retry detecting secure boot mode The secure boot mode may not be detected on boot for some reason (eg. buggy firmware). This patch attempts one more time to detect the secure boot mode. Signed-off-by: Mimi Zohar commit 0a26d6df4fd8aa8f4fb444446d162e01c3e349c0 Author: Kuninori Morimoto Date: Tue Dec 11 03:25:37 2018 +0000 ASoC: simple-scu-card: care multi DPCM codec_conf Current simple-scu-card didn't care about codec_conf for multi DPCM case. This patch cares it. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit e6a3ff2ed4c9c4df217c64e0fc0a280a24055790 Author: Kuninori Morimoto Date: Tue Dec 11 03:25:27 2018 +0000 ASoC: simple-scu-card: use cpu/codec pointer on graph_dai_props In DPCM case, it uses CPU-dummy / dummy-Codec dai links, and non DPCM case, it uses CPU-Codec dai links. Now, we want to merge simple-card and simple-scu-card. These sound cards are using silimar but not same logic on each functions. Then, of course we want to share same logic. To compromise, this patch uses cpu/codec pointer on simple-scu-card. It is same logic with simple-card, thus easy merging. This is prepare for merging simple card Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 09ee833679761f4995daaa6fd6200c77b8fcdaef Author: Kuninori Morimoto Date: Tue Dec 11 03:25:18 2018 +0000 ASoC: simple-scu-card: tidyup "convert-rate/channels" parsing simple-scu-card.c is supporting "convert-rate/channels" which is used for DPCM. But, sound card might have multi codecs, and each codec might need each convert-rate/channels. This patch supports each codec's convert-rate/channles support. top node convert-rate/channels will overwrite settings if exist. It can't support each codec's convert-rate/channels if sound card had multi codecs without this patch. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit b8d8f9a58fd971ec215fb8bfec5a4fb6e539a3ab Author: Kuninori Morimoto Date: Tue Dec 11 03:25:08 2018 +0000 ASoC: simple-scu-card: care link / dai count In DPCM case, it uses CPU-dummy / dummy-Codec dai links. If sound card is caring only DPCM, link count = dai count, but, if non DPCM case, link count != dai count. Now, we want to merge simple-card and simple-scu-card, then, we need to care both link / dai count more carefly This patch cares it, and prepare for merging simple card Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit da32d6537802a257879e9ba91a5e351a24ada889 Author: Kuninori Morimoto Date: Tue Dec 11 03:24:57 2018 +0000 ASoC: simple-scu-card: add dai-link support simple-card is supporting dai-link support, but simple-scu-card doesn't have it. This patch support it. This is prepare for merging simple-card and simple-scu-card. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 4264f27a0815c46dfda9c9dd6d5f4abc1df04415 Author: Stefan Berger Date: Fri Oct 19 06:17:58 2018 -0400 docs: Extend trusted keys documentation for TPM 2.0 Extend the documentation for trusted keys with documentation for how to set up a key for a TPM 2.0 so it can be used with a TPM 2.0 as well. Signed-off-by: Stefan Berger Reviewed-by: Mimi Zohar Reviewed-by: Dave Jiang Acked-by: Dan Williams Acked-by: Jerry Snitselaar Signed-off-by: Mimi Zohar commit d958083a8f6408e76850bc7394976050d7e43173 Author: Eric Richter Date: Tue Oct 9 23:00:37 2018 +0530 x86/ima: define arch_get_ima_policy() for x86 On x86, there are two methods of verifying a kexec'ed kernel image signature being loaded via the kexec_file_load syscall - an architecture specific implementaton or a IMA KEXEC_KERNEL_CHECK appraisal rule. Neither of these methods verify the kexec'ed kernel image signature being loaded via the kexec_load syscall. Secure boot enabled systems require kexec images to be signed. Therefore, this patch loads an IMA KEXEC_KERNEL_CHECK policy rule on secure boot enabled systems not configured with CONFIG_KEXEC_VERIFY_SIG enabled. When IMA_APPRAISE_BOOTPARAM is configured, different IMA appraise modes (eg. fix, log) can be specified on the boot command line, allowing unsigned or invalidly signed kernel images to be kexec'ed. This patch permits enabling IMA_APPRAISE_BOOTPARAM or IMA_ARCH_POLICY, but not both. Signed-off-by: Eric Richter Signed-off-by: Nayna Jain Cc: David Howells Cc: Eric Biederman Cc: Peter Jones Cc: Vivek Goyal Cc: Dave Young Signed-off-by: Mimi Zohar commit 6191706246de99ff2fac4b6f157f20205a0943cd Author: Nayna Jain Date: Tue Oct 9 23:00:36 2018 +0530 ima: add support for arch specific policies Builtin IMA policies can be enabled on the boot command line, and replaced with a custom policy, normally during early boot in the initramfs. Build time IMA policy rules were recently added. These rules are automatically enabled on boot and persist after loading a custom policy. There is a need for yet another type of policy, an architecture specific policy, which is derived at runtime during kernel boot, based on the runtime secure boot flags. Like the build time policy rules, these rules persist after loading a custom policy. This patch adds support for loading an architecture specific IMA policy. Signed-off-by: Nayna Jain Co-Developed-by: Mimi Zohar Signed-off-by: Mimi Zohar commit c52657d93b0530449233979514a08cf9fe5c24bc Author: Nayna Jain Date: Tue Oct 9 23:00:35 2018 +0530 ima: refactor ima_init_policy() This patch removes the code duplication in ima_init_policy() by defining a new function named add_rules(). The new function adds the rules to the initial IMA policy, the custom policy or both based on the policy mask (IMA_DEFAULT_POLICY, IMA_CUSTOM_POLICY). Signed-off-by: Nayna Jain Signed-off-by: Mimi Zohar commit b5ca117365d960fe5e4fe272bcc8142c28769383 Author: Nayna Jain Date: Tue Oct 9 23:00:34 2018 +0530 ima: prevent kexec_load syscall based on runtime secureboot flag When CONFIG_KEXEC_VERIFY_SIG is enabled, the kexec_file_load syscall requires the kexec'd kernel image to be signed. Distros are concerned about totally disabling the kexec_load syscall. As a compromise, the kexec_load syscall will only be disabled when CONFIG_KEXEC_VERIFY_SIG is configured and the system is booted with secureboot enabled. This patch disables the kexec_load syscall only for systems booted with secureboot enabled. [zohar@linux.ibm.com: add missing mesage on kexec_load failure] Signed-off-by: Nayna Jain Cc: David Howells Cc: Eric Biederman Cc: Peter Jones Cc: Vivek Goyal Cc: Dave Young Signed-off-by: Mimi Zohar commit 3f75720d0ebb388ff52200d00f2455cc0e6d95a9 Author: Uwe Kleine-König Date: Fri Nov 30 07:47:09 2018 +0100 spi: imx: drop useless member speed_hz from driver data struct The driver data's member variable just caches the transfer's speed_hz member. All users of the former now have access directly to the latter. So fix them to use the uncached value and remove the cache. Signed-off-by: Uwe Kleine-König Signed-off-by: Mark Brown commit 1d374703fb988d5c78c8ee68c4e56df4a4f37217 Author: Uwe Kleine-König Date: Fri Nov 30 07:47:08 2018 +0100 spi: imx: rename config callback and add useful parameters The config callback is called once per transfer while some things can (and should) be done on a per message manner. To have unambiguous naming in the end include "transfer" in the callback's name and rename the implementations accordingly. Also pass the driver struct and transfer which allows further simplifications in the following patch. There is no change in behavior intended here. Reviewed-by: Marek Vasut Signed-off-by: Uwe Kleine-König Signed-off-by: Mark Brown commit 30d6714223c4972b05fbf2ec92ca7a5a4b6ee1fd Author: Uwe Kleine-König Date: Fri Nov 30 07:47:07 2018 +0100 spi: imx: style fixes This change fixes some random style issues that I noticed while debugging the driver: Remove some double spaces, use tabs for indention instead of spaces if possible, fix comment style. Signed-off-by: Uwe Kleine-König Signed-off-by: Mark Brown commit 00b80ac9355397455adec24c9ee76f1b0225cd27 Author: Uwe Kleine-König Date: Fri Nov 30 07:47:06 2018 +0100 spi: imx: mx51-ecspi: Move some initialisation to prepare_message hook. The relevant difference between prepare_message and config is that the former is run before the CS signal is asserted. So the polarity of the CLK line must be configured in prepare_message as an edge generated by config might already result in a latch of the MOSI line. Signed-off-by: Uwe Kleine-König Signed-off-by: Mark Brown commit e697271c4e2987b333148e16a2eb8b5b924fd40a Author: Uwe Kleine-König Date: Fri Nov 30 07:47:05 2018 +0100 spi: imx: add a device specific prepare_message callback This is just preparatory work which allows to move some initialisation that currently is done in the per transfer hook .config to an earlier point in time in the next few patches. There is no change in behaviour introduced by this patch. Signed-off-by: Uwe Kleine-König Signed-off-by: Mark Brown commit 46f48aca2e5aef3f430e95d1a5fb68227ec8ec85 Author: Viresh Kumar Date: Tue Dec 11 16:39:36 2018 +0530 OPP: Fix missing debugfs supply directory for OPPs There is one case where we may end up with no "supply" directory for the OPPs in debugfs. That happens when the OPP core isn't managing the regulators for the device and the device's OPP do have microvolt property. It happens because the opp_table->regulator_count remains set to 0 and the debugfs routines don't add any supply directory in such a case. This commit fixes that by setting opp_table->regulator_count to 1 in that particular case. But to make everything work nicely and not break other parts of the core, regulator_count is defined as "int" now instead of "unsigned int" and it can have different special values now. It is set to -1 initially to mark it "uninitialized" and later only we set it to 0 or positive values after checking how many supplies are there. This also helps in finding the bugs where only few of the OPPs have the "opp-microvolt" property set and not all. Fixes: 1fae788ed640 ("PM / OPP: Don't create debugfs "supply-0" directory unnecessarily") Reported-by: Quentin Perret Signed-off-by: Viresh Kumar commit d84f18d6673f6d93bddfce1aea6cfdd78b822d3e Author: Colin Ian King Date: Thu Dec 6 17:05:57 2018 +0000 drivers: base: swnode: remove need for a temporary string for the node name Currently the node name is being formatting into a temporary string node_name, however, kobject_init_and_add allows one to format up a node name, so use that instead. This removes the need for the node_name string and also cleans up the following warning: Fixes clang warning: warning: format string is not a string literal (potentially insecure) [-Wformat-security] Signed-off-by: Colin Ian King Signed-off-by: Rafael J. Wysocki commit 56131d6d8638b7cb6feee67a8794b3dfa626396e Author: Jay Fang Date: Mon Dec 3 11:15:49 2018 +0800 ACPI / APD: Add clock frequency for Hisilicon Hip08 SPI controller The SPI clock frequency of Designware IP for Hisilicon Hip08 is 250M. The ACPI ID used is "HISI0173". Signed-off-by: Jay Fang Signed-off-by: Rafael J. Wysocki commit 0c166c3deda577955cb39f0242b734634949f1d3 Author: Yangtao Li Date: Fri Nov 30 12:01:06 2018 -0500 ACPI, APEI, EINJ: Change to use DEFINE_SHOW_ATTRIBUTE macro Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Rafael J. Wysocki commit a67d5849c9f1ff6b2afa0704b68ba5e192a3cb32 Author: Yangtao Li Date: Wed Dec 5 10:57:51 2018 -0500 cpufreq: nforce2: Remove meaningless return Delete a line of meaningless return and some useless blank lines. In a function whose return type is void, returning on the last line is not required. Signed-off-by: Yangtao Li Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit df3e1c83a3a7bd65dac951c117cc9c796acd96b0 Author: Yangtao Li Date: Wed Dec 5 10:44:49 2018 -0500 cpufreq: ia64: Remove unused header files seq_file.h does not need to be included, so remove it. Moreover deleted a line of meaningless return and some useless blank lines. In a function whose return type is void, returning on the last line is not required. Signed-off-by: Yangtao Li Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 9456823c842f346c74265fcd98d008d87a7eb6f5 Author: Yangtao Li Date: Mon Dec 10 11:26:41 2018 -0500 cpuidle: big.LITTLE: fix refcount leak of_find_node_by_path() acquires a reference to the node returned by it and that reference needs to be dropped by its caller. bl_idle_init() doesn't do that, so fix it. Signed-off-by: Yangtao Li Acked-by: Daniel Lezcano Signed-off-by: Rafael J. Wysocki commit 61cb5758d3c46bc1ba87694fefc0d9653613ce6b Author: Rafael J. Wysocki Date: Wed Dec 5 23:45:34 2018 +0100 cpuidle: Add cpuidle.governor= command line parameter Add cpuidle.governor= command line parameter to allow the default cpuidle governor to be replaced. That is useful, for example, if someone running a tickful kernel wants to use the menu governor on it. Signed-off-by: Rafael J. Wysocki commit 800fb34a99ce7d22dca839c90f869c7a12b50f70 Author: Rafael J. Wysocki Date: Mon Dec 3 13:32:53 2018 +0100 cpuidle: poll_state: Disregard disable idle states When computing the limit of time to spend in the loop in poll_idle(), use the target residency of the first enabled idle state deeper than state 0 instead of always using the target residency of state 1. This helps when state 1 is disabled for diagnostics, for instance. Signed-off-by: Rafael J. Wysocki commit 90e3577b5feb42bac1269e16bb3d2bdd8f6df40f Author: Viresh Kumar Date: Tue Dec 11 16:32:47 2018 +0530 OPP: Use opp_table->regulators to verify no regulator case The value of opp_table->regulator_count is not very consistent right now and it may end up being 0 while we do have a "opp-microvolt" property in the OPP table. It was kept that way as we used to check if any regulators are set with the OPP core for a device or not using value of regulator_count. Lets use opp_table->regulators for that purpose as the meaning of regulator_count is going to change in the later patches. Reported-by: Quentin Perret Signed-off-by: Viresh Kumar commit c76aa322070ecba18e2269349de4b31a80354ceb Merge: 40e020c129cfc 2d12df47eafe7 Author: Rafael J. Wysocki Date: Tue Dec 11 12:02:46 2018 +0100 Merge back staging AVS changes for v4.21. commit 5b5e4d623ec8a34689df98e42d038a3b594d2ff9 Author: Michal Hocko Date: Tue Nov 13 19:49:10 2018 +0100 x86/speculation/l1tf: Drop the swap storage limit restriction when l1tf=off Swap storage is restricted to max_swapfile_size (~16TB on x86_64) whenever the system is deemed affected by L1TF vulnerability. Even though the limit is quite high for most deployments it seems to be too restrictive for deployments which are willing to live with the mitigation disabled. We have a customer to deploy 8x 6,4TB PCIe/NVMe SSD swap devices which is clearly out of the limit. Drop the swap restriction when l1tf=off is specified. It also doesn't make much sense to warn about too much memory for the l1tf mitigation when it is forcefully disabled by the administrator. [ tglx: Folded the documentation delta change ] Fixes: 377eeaa8e11f ("x86/speculation/l1tf: Limit swap file size to MAX_PA/2") Signed-off-by: Michal Hocko Signed-off-by: Thomas Gleixner Reviewed-by: Pavel Tatashin Reviewed-by: Andi Kleen Acked-by: Jiri Kosina Cc: Linus Torvalds Cc: Dave Hansen Cc: Andi Kleen Cc: Borislav Petkov Cc: Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20181113184910.26697-1-mhocko@kernel.org commit 3f7bb2ec20ce07c02b2002349d256c91a463fcc5 Author: Marc Zyngier Date: Tue Nov 13 22:57:34 2018 +0000 PCI: dwc: Move interrupt acking into the proper callback The write to the status register is really an ACK for the HW, and should be treated as such by the driver. Let's move it to the irq_ack() callback, which will prevent people from moving it around in order to paper over other bugs. Fixes: 8c934095fa2f ("PCI: dwc: Clear MSI interrupt status after it is handled, not before") Fixes: 7c5925afbc58 ("PCI: dwc: Move MSI IRQs allocation to IRQ domains hierarchical API") Link: https://lore.kernel.org/linux-pci/20181113225734.8026-1-marc.zyngier@arm.com/ Reported-by: Trent Piepho Tested-by: Niklas Cassel Tested-by: Gustavo Pimentel Tested-by: Stanimir Varbanov Signed-off-by: Marc Zyngier [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org commit fce5423e4f431c71933d6c1f850b540a314aa6ee Author: Marc Zyngier Date: Tue Nov 13 22:57:33 2018 +0000 PCI: dwc: Take lock when ACKing an interrupt Bizarrely, there is no lock taken in the irq_ack() helper. This puts the ACK callback provided by a specific platform in a awkward situation where there is no synchronization that would be expected on other callback. Introduce the required lock, giving some level of uniformity among callbacks. Fixes: 7c5925afbc58 ("PCI: dwc: Move MSI IRQs allocation to IRQ domains hierarchical API") Link: https://lore.kernel.org/linux-pci/20181113225734.8026-1-marc.zyngier@arm.com/ Tested-by: Niklas Cassel Tested-by: Gustavo Pimentel Tested-by: Stanimir Varbanov Signed-off-by: Marc Zyngier [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org commit 732291c4fab8b790847aa572703c01ad483b14d0 Author: Arnd Bergmann Date: Tue Dec 11 11:05:46 2018 +0100 arm64: kexec_file: include linux/vmalloc.h This is needed for compilation in some configurations that don't include it implicitly: arch/arm64/kernel/machine_kexec_file.c: In function 'arch_kimage_file_post_load_cleanup': arch/arm64/kernel/machine_kexec_file.c:37:2: error: implicit declaration of function 'vfree'; did you mean 'kvfree'? [-Werror=implicit-function-declaration] Fixes: 52b2a8af7436 ("arm64: kexec_file: load initrd and device-tree") Signed-off-by: Arnd Bergmann Signed-off-by: Will Deacon commit 830920e065e90db318a0da98bf13a02b641eae7f Author: Marc Zyngier Date: Tue Nov 13 22:57:32 2018 +0000 PCI: dwc: Use interrupt masking instead of disabling The dwc driver is showing an interesting level of brokeness, as it insists on using the enable/disable set of registers to mask/unmask MSIs, meaning that an MSIs being generated while the interrupt is in that "disabled" state will simply be lost. Let's move to the mask/unmask set of registers, which offers the expected semantics. Fixes: 7c5925afbc58 ("PCI: dwc: Move MSI IRQs allocation to IRQ domains hierarchical API") Link: https://lore.kernel.org/linux-pci/20181113225734.8026-1-marc.zyngier@arm.com/ Tested-by: Niklas Cassel Tested-by: Gustavo Pimentel Tested-by: Stanimir Varbanov Signed-off-by: Marc Zyngier [lorenzo.pieralisi@arm.com: updated commit log] Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org commit 108c35a908d484df094f46a1e9d961d732737013 Author: Daniel Lezcano Date: Mon Dec 3 11:29:29 2018 +0100 sched/cpufreq: Add the SPDX tags The SPDX tags are not present in cpufreq.c and cpufreq_schedutil.c. Add them and remove the license descriptions Signed-off-by: Daniel Lezcano Acked-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki commit 2c3b0463bb28e07e5d4c0ae10f440d5d1bf0d72e Merge: 40e020c129cfc 5903195605287 Author: Rafael J. Wysocki Date: Tue Dec 11 10:58:17 2018 +0100 Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq Pull devfreq framework changes for v4.21 from MyungJoo Ham: "This includes the suspend-frequency support for devfreq, which is similar with suspend_freq in cpufreq." * 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/mzx/devfreq: PM / devfreq: add devfreq_suspend/resume() functions PM / devfreq: add support for suspend/resume of a devfreq device PM / devfreq: refactor set_target frequency function commit ac9498d6864495c3e5e4439300111d7b61a35fea Author: Nikolay Borisov Date: Tue Dec 11 10:27:23 2018 +0200 fanotify: Use inode_is_open_for_write Use the aptly named function rather than opencoding i_writecount check. No functional changes. Reviewed-by: Jan Kara Signed-off-by: Nikolay Borisov Signed-off-by: Jan Kara commit cb6f4c2c3478b2ff68bd5d0b6020394120075e30 Merge: e69aa5f9b97f7 d1810909d8413 Author: Jani Nikula Date: Tue Dec 11 11:48:43 2018 +0200 Merge tag 'gvt-next-2018-12-07' of https://github.com/intel/gvt-linux into drm-intel-next-fixes gvt-next-2018-12-07 - Fix -next regression on shadow ctx's ppgtt destroy (Xiong) - Update force-to-nonpriv register list (Yan) - three typo fixes Signed-off-by: Jani Nikula From: Zhenyu Wang Link: https://patchwork.freedesktop.org/patch/msgid/20181207043659.GI12743@zhen-hp.sh.intel.com commit 6d68b88e0993d67e9ebb1240f84240b712fbc8a4 Author: Lu Baolu Date: Mon Dec 10 09:59:06 2018 +0800 iommu/vt-d: Remove deferred invalidation Deferred invalidation is an ECS specific feature. It will not be supported when IOMMU works in scalable mode. As we deprecated the ECS support, remove deferred invalidation and cleanup the code. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Cc: Sanjay Kumar Signed-off-by: Lu Baolu Reviewed-by: Ashok Raj Signed-off-by: Joerg Roedel commit 1c4f88b7f1f9298b56c7dac18c0bcd8d2f75059a Author: Lu Baolu Date: Mon Dec 10 09:59:05 2018 +0800 iommu/vt-d: Shared virtual address in scalable mode This patch enables the current SVA (Shared Virtual Address) implementation to work in the scalable mode. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Signed-off-by: Sanjay Kumar Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Ashok Raj Signed-off-by: Joerg Roedel commit 437f35e1cd4c8d043633bb72f4260369af68fbf7 Author: Lu Baolu Date: Mon Dec 10 09:59:04 2018 +0800 iommu/vt-d: Add first level page table interface This adds an interface to setup the PASID entries for first level page table translation. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Signed-off-by: Sanjay Kumar Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Ashok Raj Signed-off-by: Joerg Roedel commit 7373a8cc381978cfafa4b0285cdd935682f1b2d2 Author: Lu Baolu Date: Mon Dec 10 09:59:03 2018 +0800 iommu/vt-d: Setup context and enable RID2PASID support This patch enables the translation for requests without PASID in the scalable mode by setting up the root and context entries. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Signed-off-by: Sanjay Kumar Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Ashok Raj Signed-off-by: Joerg Roedel commit ca6e322d60498087a160fad1c4ea8765ff2d21e7 Author: Lu Baolu Date: Mon Dec 10 09:59:02 2018 +0800 iommu/vt-d: Pass pasid table to context mapping So that the pasid related info, such as the pasid table and the maximum of pasid could be used during setting up scalable mode context. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Cc: Sanjay Kumar Signed-off-by: Lu Baolu Reviewed-by: Ashok Raj Reviewed-by: Kevin Tian Signed-off-by: Joerg Roedel commit ef848b7e5a6a0ef5b10640debce790e12717375b Author: Lu Baolu Date: Mon Dec 10 09:59:01 2018 +0800 iommu/vt-d: Setup pasid entry for RID2PASID support when the scalable mode is enabled, there is no second level page translation pointer in the context entry any more (for DMA request without PASID). Instead, a new RID2PASID field is introduced in the context entry. Software can choose any PASID value to set RID2PASID and then setup the translation in the corresponding PASID entry. Upon receiving a DMA request without PASID, hardware will firstly look at this RID2PASID field and then treat this request as a request with a pasid value specified in RID2PASID field. Though software is allowed to use any PASID for the RID2PASID, we will always use the PASID 0 as a sort of design decision. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Signed-off-by: Sanjay Kumar Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Ashok Raj Signed-off-by: Joerg Roedel commit 6f7db75e1c469057fe7588ed959328ead771ccc7 Author: Lu Baolu Date: Mon Dec 10 09:59:00 2018 +0800 iommu/vt-d: Add second level page table interface This adds the interfaces to setup or tear down the structures for second level page table translations. This includes types of second level only translation and pass through. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Signed-off-by: Sanjay Kumar Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Ashok Raj Signed-off-by: Joerg Roedel commit 3b33d4ab3217337f648f7ff3e57e755e6444c748 Author: Lu Baolu Date: Mon Dec 10 09:58:59 2018 +0800 iommu/vt-d: Reserve a domain id for FL and PT modes Vt-d spec rev3.0 (section 6.2.3.1) requires that each pasid entry for first-level or pass-through translation should be programmed with a domain id different from those used for second-level or nested translation. It is recommended that software could use a same domain id for all first-only and pass-through translations. This reserves a domain id for first-level and pass-through translations. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Cc: Sanjay Kumar Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit 5d308fc1ecf5351418a4f003ccb74dc91b424bd1 Author: Lu Baolu Date: Mon Dec 10 09:58:58 2018 +0800 iommu/vt-d: Add 256-bit invalidation descriptor support Intel vt-d spec rev3.0 requires software to use 256-bit descriptors in invalidation queue. As the spec reads in section 6.5.2: Remapping hardware supporting Scalable Mode Translations (ECAP_REG.SMTS=1) allow software to additionally program the width of the descriptors (128-bits or 256-bits) that will be written into the Queue. Software should setup the Invalidation Queue for 256-bit descriptors before progra- mming remapping hardware for scalable-mode translation as 128-bit descriptors are treated as invalid descriptors (see Table 21 in Section 6.5.2.10) in scalable-mode. This patch adds 256-bit invalidation descriptor support if the hardware presents scalable mode capability. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Signed-off-by: Sanjay Kumar Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu Signed-off-by: Joerg Roedel commit 4f2ed183cfebf42b29ed8fe442169de97bc0fe61 Author: Lu Baolu Date: Mon Dec 10 09:58:57 2018 +0800 iommu/vt-d: Move page table helpers into header So that they could also be used in other source files. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Cc: Liu Yi L Cc: Sanjay Kumar Signed-off-by: Lu Baolu Reviewed-by: Ashok Raj Reviewed-by: Kevin Tian Signed-off-by: Joerg Roedel commit 0bbeb01a4fafbf8422e5c8882d461d6ac4f71e15 Author: Lu Baolu Date: Mon Dec 10 09:58:56 2018 +0800 iommu/vt-d: Manage scalalble mode PASID tables In scalable mode, pasid structure is a two level table with a pasid directory table and a pasid table. Any pasid entry can be identified by a pasid value in below way. 1 9 6 5 0 .-----------------------.-------. | PASID | | '-----------------------'-------' .-------------. | | | | | | | | | | | | | .-----------. | .-------------. | | | |----->| PASID Entry | | | | | '-------------' | | | |Plus | | | .-----------. | | | |---->| DIR Entry |-------->| | | '-----------' '-------------' .---------. |Plus | | | Context | | | | | Entry |------->| | '---------' '-----------' This changes the pasid table APIs to support scalable mode PASID directory and PASID table. It also adds a helper to get the PASID table entry according to the pasid value. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Signed-off-by: Sanjay Kumar Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Ashok Raj Signed-off-by: Joerg Roedel commit 765b6a98c1de3d84dfdae344cc4ee4c24d9447f7 Author: Lu Baolu Date: Mon Dec 10 09:58:55 2018 +0800 iommu/vt-d: Enumerate the scalable mode capability The Intel vt-d spec rev3.0 introduces a new translation mode called scalable mode, which enables PASID-granular translations for first level, second level, nested and pass-through modes. At the same time, the previous Extended Context (ECS) mode is deprecated (no production ever implements ECS). This patch adds enumeration for Scalable Mode and removes the deprecated ECS enumeration. It provides a boot time option to disable scalable mode even hardware claims to support it. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Signed-off-by: Sanjay Kumar Signed-off-by: Liu Yi L Signed-off-by: Lu Baolu Reviewed-by: Ashok Raj Reviewed-by: Kevin Tian Signed-off-by: Joerg Roedel commit c4b17afb0a4e8d042320efaf2acf55cb26795f78 Author: Ganapatrao Kulkarni Date: Fri Nov 30 19:14:00 2018 +0800 iommu/dma: Use NUMA aware memory allocations in __iommu_dma_alloc_pages() Change function __iommu_dma_alloc_pages() to allocate pages for DMA from respective device NUMA node. The ternary operator which would be for alloc_pages_node() is tidied along with this. The motivation for this change is to have a policy for page allocation consistent with direct DMA mapping, which attempts to allocate pages local to the device, as mentioned in [1]. In addition, for certain workloads it has been observed a marginal performance improvement. The patch caused an observation of 0.9% average throughput improvement for running tcrypt with HiSilicon crypto engine. We also include a modification to use kvzalloc() for kzalloc()/vzalloc() combination. [1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1692998.html Signed-off-by: Ganapatrao Kulkarni [JPG: Added kvzalloc(), drop pages ** being device local, remove ternary operator, update message] Signed-off-by: John Garry Reviewed-by: Robin Murphy Signed-off-by: Joerg Roedel commit 1e73359a24fad529b0794515b46cbfff99e5fbe6 Author: Arnd Bergmann Date: Mon Dec 10 21:54:25 2018 +0100 ALSA: hda/ca0132 - make pci_iounmap() call conditional When building without CONFIG_PCI, we can (depending on the architecture) get a link failure: ERROR: "pci_iounmap" [sound/pci/hda/snd-hda-codec-ca0132.ko] undefined! Adding a compile-time check for PCI gets it to work correctly on 32-bit ARM. Fixes: d99501b8575d ("ALSA: hda/ca0132 - Call pci_iounmap() instead of iounmap()") Signed-off-by: Arnd Bergmann Signed-off-by: Takashi Iwai commit 46594d3345f0432ddc83b9f3c1b04492fdfafd07 Author: Takashi Iwai Date: Sun Dec 9 10:10:19 2018 +0100 ALSA: hda/hdmi: Always set display_power_control for Intel HSW+ codecs We've excluded the display_power_control flag for Intel HSW and BDW codecs as the HD-audio controllers of the corresponding platforms take care of the display power as well. But the recent refactoring separates the controller and the codec power accounting, so it's fine to call the display PM even for HSW/BDW codecs. This is less confusing since we can avoid this well-hidden condition. Signed-off-by: Takashi Iwai commit 77a49672aae384125942ce621365b11d42cefa32 Author: Takashi Iwai Date: Sun Dec 9 10:06:59 2018 +0100 ASoC: hdac_hdmi: Add missing display power-off at driver removal The display power is in unbalance at removing the driver since it misses the snd_hdac_display_power(OFF) call. Acked-by: Mark Brown Signed-off-by: Takashi Iwai commit 4f799e734094f09feaae89ee75982fac84742c56 Author: Takashi Iwai Date: Sun Dec 9 10:04:25 2018 +0100 ALSA: hda: Make snd_hdac_display_power() void function After the recent refactoring, snd_hdac_display_power() doesn't return any error, hence it can be defined to return void. This makes many error checks redundant and allows us to reduce them gracefully. Signed-off-by: Takashi Iwai commit 457f3c86d3358beb0ae19774fef8a9035dedd88f Author: Takashi Iwai Date: Sun Dec 9 09:59:03 2018 +0100 ALSA: hda/intel: Properly free the display power at error path When an error occurs in azx_probe_continue(), we should release the display power. However, the current code ignores it and releases the display power only for HSW/BDW cases. Fix it. Signed-off-by: Takashi Iwai commit e454ff8e89b6db0a2054260d48635fbc781e94ce Author: Takashi Iwai Date: Sun Dec 9 09:57:37 2018 +0100 ALSA: hda/intel: Drop superfluous AZX_DCAPS_I915_POWERWELL checks snd_hdac_display_power() can be called even for a HDA controller without DRM binding. The same is true for other helpers, snd_hdac_i915_set_bclk() and snd_hdac_set_codec_wakeup(). So all superfluous AZX_DCAPS_I915_POWERWELL checks in hda_intel.c can be dropped, and the definition of AZX_DCAPS_I915_POWERWELL itself can be removed as well. This simplifies the code a lot. Signed-off-by: Takashi Iwai commit 029d92c289bdad08ed08e61bf31b17cdc9ee61cf Author: Takashi Iwai Date: Sat Dec 8 17:31:49 2018 +0100 ALSA: hda: Refactor display power management The current HD-audio code manages the DRM audio power via too complex redirections, and this seems even still unbalanced in a corner case as Intel DRM CI has been intermittently reporting. This patch is a big surgery for addressing the complexity and the possible unbalance. Basically the patch changes the display PM in the following ways: - Both HD-audio controller and codec drivers call a single helper, snd_hdac_display_power(). (Formerly, the display power control from a codec was done indirectly via link_power bus ops.) - snd_hdac_display_power() receives the codec address index. For turning on/off from the controller, pass HDA_CODEC_IDX_CONTROLLER. - snd_hdac_display_power() doesn't manage refcounts any longer, but keeps the power status in bitmap. If any of controller or codecs is turned on, the function updates the DRM power state via get_power() or put_power(). Also this refactor allows us more cleanup: - The link_power bus ops is dropped, so there is no longer indirect management, as mentioned in the above. - hdac_device link_power_control flag is moved to hda_codec display_power_control flag, as it's only for HDA legacy. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106525 Signed-off-by: Takashi Iwai commit 8ff01abcccbb563fbf50b84a476bd9b22c42c0a3 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/ce/tu106: initial support Appears to be compatible with TU104. Signed-off-by: Ben Skeggs commit 1b2a5aff3505b49873777247ccf4372eea5959f3 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fifo/tu106: initial support Appears to be compatible with TU104. Signed-off-by: Ben Skeggs commit 7f7bc32e23e72a96c2fed518166d16abea24504e Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/disp/tu106: initial support Appears to be compatible with TU104. Signed-off-by: Ben Skeggs commit 1a38496cdd444e870b2bbbbc8f8c7f6b21291656 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/dma/tu106: initial support Appears to be compatible with GV100. Signed-off-by: Ben Skeggs commit bb1e3ff70128ee18f2a8902e695ef08c4fe96d59 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/therm/tu106: initial support Appears to be compatible with GP100. Signed-off-by: Ben Skeggs commit 25a46a4a95d8298d0451ac90a1471263522d9571 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/pmu/tu106: initial support Appears to be compatible with GP102. Signed-off-by: Ben Skeggs commit f5459f34f5ed18aacea1780dd174632dab4131ea Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fault/tu106: initial support Appears to be compatible with TU104. Signed-off-by: Ben Skeggs commit 340e96a7c3aa6e47287ca048847f5fc871d03014 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/bar/tu106: initial support Appears to be compatible with TU104. Signed-off-by: Ben Skeggs commit 70ec09080d85802e2f1514fe8401007890e3f7f4 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/mmu/tu106: initial support Appears to be compatible with TU104. Signed-off-by: Ben Skeggs commit 13f91e8e5ae50d84875431e03102acf137edff35 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/ltc/tu106: initial support Appears to be compatible with GP102. Signed-off-by: Ben Skeggs commit cfcfb6d0a34fdd552f6f1dea5252ead3575a34a0 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fb/tu106: initial support Appears to be compatible with GV100. Signed-off-by: Ben Skeggs commit 75794c41242c54b229978e2cc4e0af023d07bceb Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/imem/tu106: initial support Appears to be compatible with NV50. Signed-off-by: Ben Skeggs commit 2fedee302da0a0f767f2a18deb6a7b7071b5f82e Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/tmr/tu106: initial support Appears to be compatible with GK20A. Signed-off-by: Ben Skeggs commit 25e6a89076df4760710ea26812e091dbd349ad0b Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/bus/tu106: initial support Appears to be compatible with GF100. Signed-off-by: Ben Skeggs commit 476740843bf84bde9c96f414b6cd62a3644ad57f Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/mc/tu106: initial support Appears to be compatible with TU104. Signed-off-by: Ben Skeggs commit 6a9207ecf5df0d4987fab5d30ea0dc48b904346f Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fuse/tu106: initial support Appears to be compatible with GM107. Signed-off-by: Ben Skeggs commit 52c887539d6ddc226da0fa53736e491477aa7250 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/i2c/tu106: initial support Appears to be compatible with GM200. Signed-off-by: Ben Skeggs commit 1b0a47548274eecdd802857060636058134c1efe Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/gpio/tu106: initial support Appears to be compatible with GK104. Signed-off-by: Ben Skeggs commit 8d12c4846d4ba7cfe17e0b4c5181f37d0bb550e4 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/ibus/tu106: initial support Appears to be compatible with GM200. Signed-off-by: Ben Skeggs commit 73010b8e2b9a0b82e43a3c01a8c7a94f839eb480 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/top/tu106: initial support Appears to be compatible with GK104. Signed-off-by: Ben Skeggs commit 9d7693fe07d67f45dcf619d41a6cc9efb5e5c773 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/devinit/tu106: initial support Appears to be compatible with TU104. Signed-off-by: Ben Skeggs commit b0216803e361446b2b849fd3e802cbbb7c0d5c8c Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/bios/tu106: initial support No real surprised here so far. Signed-off-by: Ben Skeggs commit a39cb42a754168f6f88800edce426d3de0621945 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/pci/tu106: initial support Appears to be compatible with GP100. Signed-off-by: Ben Skeggs commit 2cc0d7c0f761b1cfad7a904919397d245df2f129 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/core: recognise TU106 Signed-off-by: Ben Skeggs commit 2d583ade740939f679c7f99e07c40f17dc9de1ab Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/core: increase maximum number of nvdec instances to 3 RTX2070 appears to have 3 copies of the engine. Signed-off-by: Ben Skeggs commit 563737c525ea4bbe1edea0075d61eff4f954c5df Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/kms/tu104: initial support Signed-off-by: Ben Skeggs commit c36322d23d5d84cbe03c93beaa5dd6c705d48122 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/ce/tu104: initial support Signed-off-by: Ben Skeggs commit 641d0b3056e058fa64a02e41535050d896fa5a75 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fifo/tu104: initial support Various different bits and pieces vs GV100. Signed-off-by: Ben Skeggs commit 114b6556db76b0377a1c8a92fec6d760c91f715e Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/disp/tu104: initial support Signed-off-by: Ben Skeggs commit aff70760be71a9d2fa38814d23cbb851c0c08d4c Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/dma/tu104: initial support Appears to be compatible with GV100. Signed-off-by: Ben Skeggs commit 5a991efdfa81c48fbff3df957568fd07569c9f53 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/therm/tu104: initial support Appears to be compatible with GP100. Signed-off-by: Ben Skeggs commit e7e0e946bbf26cb974a904508213ec60111b5a30 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/pmu/tu104: initial support Appears to be compatible with GP102. Signed-off-by: Ben Skeggs commit 17fb2807c678ae30f02129c0c5ab3c616e6579af Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fault/tu104: initial support New registers. Currently uncertain how exactly to mask fault buffer interrupts. This will likely be corrected at around the same time as the new MC interrupt stuff has been properly figured out and implemented. For the moment, it shouldn't matter too much. Signed-off-by: Ben Skeggs commit 838efaa5743802f78a64fc64d3237b79517cee9f Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/bar/tu104: initial support New registers. Signed-off-by: Ben Skeggs commit 7986f813c62b295c618a1612e468b84d37c7e2fc Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/mmu/tu104: initial support New flush method. Signed-off-by: Ben Skeggs commit 01e0930617d072e306db2fdfaee75c708d9db5fd Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/ltc/tu104: initial support Appears to be compatible with GP102. Signed-off-by: Ben Skeggs commit 5386148b31b2729f29d80f9635cff746d46d475d Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fb/tu104: initial support Appears to be compatible with GV100. Signed-off-by: Ben Skeggs commit c44349b054c8f13f9759fec1ce8aea1d74173ba3 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/imem/tu104: initial support Appears to be compatible with NV50. Signed-off-by: Ben Skeggs commit ead5bf1e3cd82fd9baf63eb631518a1df0a0b4a3 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/tmr/tu104: initial support Appears to be compatible with GK20A. Signed-off-by: Ben Skeggs commit 75ad1b00208ce34bf3a17936e2e75bf0aef46b9b Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/bus/tu104: initial support Appears to be compatible with GF100. Signed-off-by: Ben Skeggs commit f2e55b9ea903ccd31f8d38f460a063f41e646232 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/mc/tu104: initial support Things are a bit different here on Turing, and will require further changes yet once I've investigated them more thoroughly. For now though, the existing GP100 code is compatible enough with one small hack to forward on fault buffer interrupts. Signed-off-by: Ben Skeggs commit 575d583ab6a497499010489035e683787f2b385b Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fuse/tu104: initial support Appears to be compatible with GM107. Signed-off-by: Ben Skeggs commit 298fd472ea4dbb8cdff104de65166e9528dd88cb Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/i2c/tu104: initial support Appears to be compatible with GM200. Signed-off-by: Ben Skeggs commit 3273483c32ab0836b7fe187bde629754a06d2d71 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/gpio/tu104: initial support Appears to be compatible with GK104. Signed-off-by: Ben Skeggs commit ba9070d3ecaa4d55232c5c8d43752eacf3ea0dd2 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/ibus/tu104: initial support Appears to be compatible with GM200. Signed-off-by: Ben Skeggs commit 67e5abb78d0e5a5c019b7c62fb0c5461a724c3e0 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/top/tu104: initial support Appears to be compatible with GK104. Signed-off-by: Ben Skeggs commit 43d61cda30653e4c13e92f604cf8a29cb4440146 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/devinit/tu104: initial support The GPU executes DEVINIT itself now, which makes our lives a bit easier. Signed-off-by: Ben Skeggs commit acbe55a5d4c3e36585700044365a957e14c81951 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/bios/tu104: initial support No real surprises here so far. Signed-off-by: Ben Skeggs commit 2d7ca8cb19953b4424ab97b92510e1bf434bacfd Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/pci/tu104: initial support Appears to be compatible with GP100. Signed-off-by: Ben Skeggs commit 344d9c8f35b99bbb893d0e2bce5f41b72f9b5f26 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/core: recognise TU104 Signed-off-by: Ben Skeggs commit cb55cd0c66a16fd965a44e2634755b060dc64bd7 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/kms/nv50-: allow more flexibility with lut formats Will be required for Turing. Signed-off-by: Ben Skeggs commit 5949dd8ee2a4e09926240c7009df95ea6e0a6684 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau: remove left-over struct member Signed-off-by: Ben Skeggs commit 9d24907ccffefc45c7ae53dede30f5bba93a4245 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fifo/gv100: return work submission token in channel ctor args The token will also contain runlist ID on Turing, so instead expose it as an opaque value from NVKM so the client doesn't need to care. Signed-off-by: Ben Skeggs commit a98a3c52f81d20d61b43d084ddb724ab55d32526 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fifo/gv100: allocate method buffer The GPU saves off some stuff to the address specified in this part of RAMFC when the channel faults, so we should probably point it at a valid address. Signed-off-by: Ben Skeggs commit f7cc47e436c1238031548e0380eecc1ab66f24ba Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fifo/gm200-: read pbdma count more directly The trick we used (and still use for older GPUs) doesn't work on Turing. Signed-off-by: Ben Skeggs commit f37a302e67195af7d5a410901c5e8ddbbe895182 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fifo/gk104-: virtualise pbdma enable function Turing will require different code. Signed-off-by: Ben Skeggs commit fb80ad15f86f9e7eb510930b1e02dfa86adffa8f Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fifo/gk104-: group pbdma functions together We're about to be adding more of them. Signed-off-by: Ben Skeggs commit efa44c664f6aef0a2b94cffd197c501b0965db97 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fifo/gk104-: separate runlist building from committing to hw We will need to bash different registers on Turing. Signed-off-by: Ben Skeggs commit 85532bd984d77cef5a59e9cbb73e8161b94017ae Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fifo/gk104-: support enabling privileged ce functions Will be used by SVM code to allow direct (without going through MMU) memcpy using the GPU copy engines. Signed-off-by: Ben Skeggs commit 86b442d74c333936a3085354d8c8d73ab21863ad Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fifo/gk104-: return channel instance in ctor args Will be used to match fault buffer entries with a channel. Signed-off-by: Ben Skeggs commit 302daab1a7b1206d33a9191d5b42ce606ed46e21 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fifo/gf100-: call into BAR to reset BARs after MMU fault This is needed for Turing, but we're supposed to wait for completion after re-writing the value on older GPUs anyway. Signed-off-by: Ben Skeggs commit 03da9faae1562746e85f1a5e94e4c50a3b85b6b5 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/disp/gv100: fix name of window channels in debug output Signed-off-by: Ben Skeggs commit 729eba3355674f2d9524629b73683ba1d1cd3f10 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/mmu: add more general vmm free/node handling functions Aside from being a nice cleanup, these will to allow the upcoming direct page mapping interfaces to play nicely with normal mappings. Signed-off-by: Ben Skeggs commit 3968d6920bf3fef56eab1f21e71d135ef43e7b88 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fault: add explicit control over fault buffer interrupts The GPU will continually fire interrupts while a fault buffer GET != PUT, and to stop the spurious interrupts while the handler does its thing, we were disabling the fault buffer temporarily. This is not actually a great idea to begin with, and made worse by Volta resetting GET/PUT when it's reactivated. So, let's not do that. Signed-off-by: Ben Skeggs commit 809724560f3403c2bc15a40cbe4efd55764ae8e2 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fault: store get/put pri address in nvkm_fault_buffer Will allow more shared fault buffer handling code between Pascal/Volta. Signed-off-by: Ben Skeggs commit 4d326469d98a9ea64d20a34ad064ada04a0891fb Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/fault: remove manual mapping of fault buffers into BAR2 Signed-off-by: Ben Skeggs commit 1786bf56e4180dfd6a51929230e60d11b899032e Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/imem/nv50: support pinning objects in BAR2 and returning address Various structures are accessed by the GPU through BAR2 for some reason on newer GPUs. This commit makes it more convenient to handle. Will be used for GP100- fault buffers, and GV100- fault method buffers. Signed-off-by: Ben Skeggs commit e4f90a35c9668f8d0469a0160482b1856d07c2b5 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/tmr: detect stalled gpu timer and break out of waits Signed-off-by: Ben Skeggs commit a31e24a781bc0cb60ec43499673ef49460597fec Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/devinit/gm200-: export function to upload+execute PMU/PRE_OS Will be used for Turing. Signed-off-by: Ben Skeggs commit 7919faab51e616e1e1aaa6709ea18fb488603eb4 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/bios: translate USB-C connector type Signed-off-by: Ben Skeggs commit 2d5257b73e1ac97e1ead4328940cd10d8b4956ee Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/bios: translate additional memory types Signed-off-by: Ben Skeggs commit 936a1678f3f8b3c918185f0c5ba3a03ccedfb8d5 Author: Ben Skeggs Date: Tue Dec 11 14:50:02 2018 +1000 drm/nouveau/core: support multiple nvdec instances Turing GPUs can have more than one. Signed-off-by: Ben Skeggs commit 3c7fc252b3fab080db110057d2d6d8c9a56d349b Author: Lyude Paul Date: Thu Jul 12 13:13:52 2018 -0400 drm/nouveau/drm/nouveau: Don't forget to label dp_aux devices This makes debugging with DP tracing a lot harder to interpret, so name each i2c based off the name of the encoder that it's for Signed-off-by: Lyude Paul Reviewed-by: Karol Herbst Signed-off-by: Ben Skeggs commit b89fdf7ae8500feae1100d8b283176a44d31d698 Author: Lyude Paul Date: Wed Nov 14 20:39:51 2018 -0500 drm/nouveau/drm/nouveau: Check rc from drm_dp_mst_topology_mgr_resume() We need to actually make sure we check this on resume since otherwise we won't know whether or not the topology is still there once we've resumed, which will cause us to still think the topology is connected even after it's been removed if the removal happens mid-suspend. Signed-off-by: Lyude Paul Cc: stable@vger.kernel.org Signed-off-by: Ben Skeggs Signed-off-by: Ben Skeggs commit 6f5521da028c7905ce292a60184ffd64abddad8e Author: Lyude Paul Date: Wed Sep 19 13:13:52 2018 -0400 drm/nouveau: Add size to vbios.rom file in debugfs With this, nvbios /sys/kernel/debug/dri/*/vbios.rom now works! Signed-off-by: Lyude Paul Reviewed-by: Karol Herbst Signed-off-by: Ben Skeggs commit 67287964dae3aae65ec006f15c094936f0146812 Author: Lyude Paul Date: Wed Sep 19 13:13:51 2018 -0400 drm/nouveau: Add strap_peek to debugfs Since we already expose the vbios.rom file here, why not also expose the strap_peek? Signed-off-by: Lyude Paul Reviewed-by: Karol Herbst Signed-off-by: Ben Skeggs commit 167e63702d090b831c513d726b11a412b70aab09 Author: Arnd Bergmann Date: Mon Dec 10 21:47:59 2018 +0100 ARM: imx: fix dependencies on imx7ulp The i.MX7D configuration was reworked, but that change did not get propagated into the newly added i.MX7ULP, which now produces a Kconfig warning: WARNING: unmet direct dependencies detected for HAVE_ARM_ARCH_TIMER Depends on [n]: CPU_V7 [=n] Selected by [y]: - SOC_IMX7ULP [=y] && ARCH_MXC [=y] && (ARCH_MULTI_V7 [=n] || ARM_SINGLE_ARMV7M [=y]) Change it to work the same way as i.MX7D. Fixes: 1a1f919eb52e ("ARM: imx: Provide support for NXP i.MX7D Cortex-M4") Fixes: de70d0e9d43d ("ARM: imx: add initial support for imx7ulp") Signed-off-by: Arnd Bergmann Signed-off-by: Shawn Guo commit 5903195605287681f55094bbcdf8711ea109969b Author: Lukasz Luba Date: Wed Dec 5 12:05:54 2018 +0100 PM / devfreq: add devfreq_suspend/resume() functions This patch adds implementation for global suspend/resume for devfreq framework. System suspend will next use these functions. Suggested-by: Tobias Jakobi Suggested-by: Chanwoo Choi Signed-off-by: Lukasz Luba Reviewed-by: Chanwoo Choi Signed-off-by: MyungJoo Ham commit 83f8ca45afbf041e312909f442128b99657d90b7 Author: Lukasz Luba Date: Wed Dec 5 12:05:53 2018 +0100 PM / devfreq: add support for suspend/resume of a devfreq device The patch prepares devfreq device for handling suspend/resume functionality. The new fields will store needed information during this process. Devfreq framework handles opp-suspend DT entry and there is no need of modyfications in the drivers code. It uses atomic variables to make sure no race condition affects the process. Suggested-by: Tobias Jakobi Suggested-by: Chanwoo Choi Signed-off-by: Lukasz Luba Reviewed-by: Chanwoo Choi Signed-off-by: MyungJoo Ham commit 633141721b5bfce7017033a767208af591134b8f Author: Lukasz Luba Date: Wed Dec 5 12:05:52 2018 +0100 PM / devfreq: refactor set_target frequency function The refactoring is needed for the new client in devfreq: suspend. To avoid code duplication, move it to the new local function devfreq_set_target. Suggested-by: Tobias Jakobi Suggested-by: Chanwoo Choi Reviewed-by: Chanwoo Choi Signed-off-by: Lukasz Luba Signed-off-by: MyungJoo Ham commit addb0679839a1f74da6ec742137558be244dd0e9 Merge: 8cc196d6ef86b aa570ff4fd368 Author: David S. Miller Date: Mon Dec 10 18:00:43 2018 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2018-12-11 The following pull-request contains BPF updates for your *net-next* tree. It has three minor merge conflicts, resolutions: 1) tools/testing/selftests/bpf/test_verifier.c Take first chunk with alignment_prevented_execution. 2) net/core/filter.c [...] case bpf_ctx_range_ptr(struct __sk_buff, flow_keys): case bpf_ctx_range(struct __sk_buff, wire_len): return false; [...] 3) include/uapi/linux/bpf.h Take the second chunk for the two cases each. The main changes are: 1) Add support for BPF line info via BTF and extend libbpf as well as bpftool's program dump to annotate output with BPF C code to facilitate debugging and introspection, from Martin. 2) Add support for BPF_ALU | BPF_ARSH | BPF_{K,X} in interpreter and all JIT backends, from Jiong. 3) Improve BPF test coverage on archs with no efficient unaligned access by adding an "any alignment" flag to the BPF program load to forcefully disable verifier alignment checks, from David. 4) Add a new bpf_prog_test_run_xattr() API to libbpf which allows for proper use of BPF_PROG_TEST_RUN with data_out, from Lorenz. 5) Extend tc BPF programs to use a new __sk_buff field called wire_len for more accurate accounting of packets going to wire, from Petar. 6) Improve bpftool to allow dumping the trace pipe from it and add several improvements in bash completion and map/prog dump, from Quentin. 7) Optimize arm64 BPF JIT to always emit movn/movk/movk sequence for kernel addresses and add a dedicated BPF JIT backend allocator, from Ard. 8) Add a BPF helper function for IR remotes to report mouse movements, from Sean. 9) Various cleanups in BPF prog dump e.g. to make UAPI bpf_prog_info member naming consistent with existing conventions, from Yonghong and Song. 10) Misc cleanups and improvements in allowing to pass interface name via cmdline for xdp1 BPF example, from Matteo. 11) Fix a potential segfault in BPF sample loader's kprobes handling, from Daniel T. 12) Fix SPDX license in libbpf's README.rst, from Andrey. ==================== Signed-off-by: David S. Miller commit fb7255a923115188ac134bb562d1c44f4f3a413b Author: Vadim Pasternak Date: Thu Nov 15 17:27:00 2018 +0000 platform/x86: mlx-platform: Convert to use SPDX identifier Reduce size of duplicated comments by switching to use SPDX identifier. Signed-off-by: Vadim Pasternak Signed-off-by: Darren Hart (VMware) commit 52675da1d087f009b59d2808b1a7363c9ab2c6e7 Author: Vadim Pasternak Date: Thu Nov 15 17:26:59 2018 +0000 Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces Add documentation for the new attributes for systems of type MQM87xx, MSN34xx, MSN37xx. It includes the attributes related to ComEx resets, system platform reset, JTAG interface enabling, additional CPLD device. All the above system are equipped with ComEX board, have JTAG selector and extra CPLD. Signed-off-by: Vadim Pasternak [dvhart: Change kernel version from 5.0 to 4.21 until we know for sure] Signed-off-by: Darren Hart (VMware) commit e2883859dd0b4ee6fc70151e417fed8680efaa4b Author: Vadim Pasternak Date: Thu Nov 15 17:26:58 2018 +0000 platform/x86: mlx-platform: Allow mlxreg-io driver activation for new systems Allow mlxreg-io platform driver activation for the next generation systems, in particular for MQM87xx, MSN34xx, MSN37xx types, which have: - extended reset causes bits related to ComEx reset, voltage devices firmware upgrade, system platform reset; - additional CPLD device; - JTAG select capability; Signed-off-by: Vadim Pasternak Signed-off-by: Darren Hart (VMware) commit 440f343df1996302d9a3904647ff11b689bf27bc Author: Vadim Pasternak Date: Thu Nov 15 17:26:57 2018 +0000 platform/x86: mlx-platform: Fix LED configuration Exchange LED configuration between msn201x and next generation systems types. Bug was introduced when LED driver activation was added to mlx-platform. LED configuration for the three new system MQMB7, MSN37, MSN34 was assigned to MSN21 and vice versa. This bug affects MSN21 only and likely requires backport to v4.19. Fixes: 1189456b1cce ("platform/x86: mlx-platform: Add LED platform driver activation") Signed-off-by: Vadim Pasternak Signed-off-by: Darren Hart (VMware) commit edd45cba5ed7f53974475ddc9a1453c2c87b3328 Author: Vadim Pasternak Date: Thu Nov 15 17:26:56 2018 +0000 platform/x86: mlx-platform: Fix tachometer registers Shift by one the registers for tachometers (7 - 12). This fix is relevant for the same new systems MQMB7, MSN37, MSN34, which are about to be released to the customers. At the moment, none of them is at customers sites. The customers will not suffer from this change. This fix is necessary, because register used before for tachometer 7 has been than reserved for the second PWM for newer systems, which are not supported yet in mlx-platform driver. So registers of tachometers 7-12 have been shifted by one. Fixes: 0378123c5800 ("platform/x86: mlx-platform: Add mlxreg-fan platform driver activation") Signed-off-by: Vadim Pasternak Signed-off-by: Darren Hart (VMware) commit 3752e5c764b4fb1abe43c78f635bf019c8e98db2 Author: Vadim Pasternak Date: Thu Nov 15 17:26:55 2018 +0000 platform/x86: mlx-platform: Rename new systems product names Rename product names for next generation systems QMB7, SN37, SN34 to respectively MQMB7, MSN37, MSN34. All these systems are about to be released to the customers. At the moment, none of them is at customers sites. The customers will not suffer from this change. The names have been changed due to marketing decision. Signed-off-by: Vadim Pasternak Signed-off-by: Darren Hart (VMware) commit 59e96ec85e8e59170f6d5cba028e199a2e5dfe67 Author: Vadim Pasternak Date: Thu Nov 15 17:26:54 2018 +0000 platform/x86: mlx-platform: Add definitions for new registers Add definitions for new registers: - CPLD3 version - next generation systems are equipped with three CPLD; - Two reset cause registers, which store the system reset reason (like system failures, upgrade failures and so on; Signed-off-by: Vadim Pasternak Signed-off-by: Darren Hart (VMware) commit 8cc196d6ef86bbab01dbf16f6c596cf56aa0839e Author: David Ahern Date: Mon Dec 10 13:54:07 2018 -0800 neighbor: gc_list changes should be protected by table lock Adding and removing neighbor entries to / from the gc_list need to be done while holding the table lock; a couple of places were missed in the original patch. Move the list_add_tail in neigh_alloc to ___neigh_create where the lock is already obtained. Since neighbor entries should rarely be moved to/from PERMANENT state, add lock/unlock around the gc_list changes in neigh_change_state rather than extending the lock hold around all neighbor updates. Fixes: 58956317c8de ("neighbor: Improve garbage collection") Reported-by: Andrei Vagin Reported-by: syzbot+6cc2fd1d3bdd2e007363@syzkaller.appspotmail.com Reported-by: syzbot+35e87b87c00f386b041f@syzkaller.appspotmail.com Reported-by: syzbot+b354d1fb59091ea73c37@syzkaller.appspotmail.com Reported-by: syzbot+3ddead5619658537909b@syzkaller.appspotmail.com Reported-by: syzbot+424d47d5c456ce8b2bbe@syzkaller.appspotmail.com Reported-by: syzbot+e4d42eb35f6a27b0a628@syzkaller.appspotmail.com Signed-off-by: David Ahern Signed-off-by: David S. Miller commit d407c81adae57041ba82577e604e351f36b8afce Merge: 40e020c129cfc 2bb1666369339 Author: Mark Brown Date: Tue Dec 11 01:17:23 2018 +0000 Merge branch 'regulator-4.20' into regulator-linus commit 2a9d92fb3a1282a4659f1bb6d5684018846537b7 Author: Arnd Bergmann Date: Mon Dec 10 21:38:16 2018 +0100 mtd: atmel-quadspi: disallow building on ebsa110 I ran into a link-time error with the atmel-quadspi driver on the EBSA110 platform: drivers/mtd/built-in.o: In function `atmel_qspi_run_command': :(.text+0x1ee3c): undefined reference to `_memcpy_toio' :(.text+0x1ee48): undefined reference to `_memcpy_fromio' The problem is that _memcpy_toio/_memcpy_fromio are not available on that platform, and we have to prevent building the driver there. In case we want to backport this to older kernels: between linux-4.8 and linux-4.20, the Kconfig entry was in drivers/mtd/spi-nor/Kconfig but had the same problem. Link: https://lore.kernel.org/patchwork/patch/812860/ Fixes: 161aaab8a067 ("mtd: atmel-quadspi: add driver for Atmel QSPI controller") Signed-off-by: Arnd Bergmann Reviewed-by: Boris Brezillon Signed-off-by: Mark Brown Cc: stable@vger.kernel.org commit 9049fce897edae50835a8f799d4b05f67a538e9a Author: Uwe Kleine-König Date: Tue Dec 4 09:31:31 2018 +0100 usb: chipidea: imx: allow to configure oc polarity on i.MX25 Up to now the polarity of the over current pin was hard coded to active high. Use the already defined device tree properties to configure polarity on i.MX25, too. In difference to i.MX6/7 use active high behavior if the polarity is unspecified to keep compatibility to existing device trees. Signed-off-by: Uwe Kleine-König Signed-off-by: Peter Chen commit 1bf4743f641d85f32fe3f3a4d8aa01a387549e3e Author: Uwe Kleine-König Date: Tue Dec 4 09:31:30 2018 +0100 usb: chipidea: imx: Warn if oc polarity isn't specified The polarity of the over current detection pin isn't configured on i.MX6/7 if it's unspecified in the device tree. So the actual configuration depends on bootloader behavior which is bad. So encourage users to fix their device tree by issuing a warning in this case. Signed-off-by: Uwe Kleine-König Signed-off-by: Peter Chen commit a82bf696aa39b08c0dfce5569525e61368c6827f Author: Uwe Kleine-König Date: Tue Dec 4 09:31:29 2018 +0100 usb: chipidea: imx: support configuring for active low oc signal The status quo on i.MX6 is that if "over-current-active-high" is specified in the device tree this is configured as expected. If the property is missing polarity isn't changed and so the polarity is kept as setup by the bootloader. Reset default is active high, so active low can only be used with help by the bootloader. On i.MX7 it is similar, but there disabling of over current detection has a similar inconsistency. This patch introduces a new property that allows to explicitly configure for active low over current detection and consistently sets this up. In the absence of an explicit configuration the bit is kept as is. On i.MX7 over current detection is used unless disabled in the device tree. Signed-off-by: Uwe Kleine-König Signed-off-by: Peter Chen commit 4dddb862d3e3438129927bfcce6ee2c2c7064eaf Author: Peter Chen Date: Tue Oct 16 12:30:37 2018 +0800 doc: usb: ci-hdrc-usb2: Add pinctrl properties for HSIC pin groups For USB HSIC, the data and strobe pin needs to be pulled down at default, we consider it as "idle" state. When the USB host is ready to be used, the strobe pin needs to be pulled up, we consider it as "active" state. Signed-off-by: Peter Chen commit 2c4593ecc920b6f3c148f2d123a5c6aa2f1f3e73 Author: Peter Chen Date: Tue Oct 16 10:11:42 2018 +0800 usb: chipidea: host: override ehci->hub_control The chipidea controller has some special requirements during suspend/resume, override common ehci->hub_control to implement it. Reviewed-by: Frieder Schrempf Tested-by: Frieder Schrempf Signed-off-by: Peter Chen commit 7c8e8909417eb6342ac487dc5ab3076d46718f71 Author: Peter Chen Date: Tue Oct 16 09:17:02 2018 +0800 usb: chipidea: imx: add HSIC support To support imx HSIC, there are some special requirement: - The HSIC pad is 1.2v, it may need to supply from external - The data/strobe pin needs to be pulled down first, and after host mode is initialized, the strobe pin needs to be pulled up - During the USB suspend/resume, special setting is needed Reviewed-by: Frieder Schrempf Tested-by: Frieder Schrempf Signed-off-by: Peter Chen commit 014abe34a9095daaa6cbb2693ee90bbb54674693 Author: Peter Chen Date: Mon Oct 15 17:02:57 2018 +0800 usb: chipidea: add flag for imx hsic implementation NXP (Freecale) imx HSIC design has some special requirements, add some flags at host code to handle them. Reviewed-by: Frieder Schrempf Tested-by: Frieder Schrempf Signed-off-by: Peter Chen commit dbd08fe59cf8c2f4bad0a72e912913c20db4774e Author: Kuninori Morimoto Date: Tue Dec 4 08:20:13 2018 +0000 ASoC: simple-scu-card: tidyup asoc_simple_card_parse_daifmt() timing Current simple-scu-card driver is parsing codec position for DPCM and consider DAI format. But, current operation is doing totally pointless, because it should be called for each CPU/Codec pair. Let's tidyup asoc_simple_card_parse_daifmt() timing. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 4fb7f4df49d37a9a769b6e8ba517e453903142cc Author: Kuninori Morimoto Date: Tue Dec 4 08:19:43 2018 +0000 ASoC: simple-card: use cpu/codec pointer on simple_dai_props In DPCM case, it uses CPU-dummy / dummy-Codec dai links, and non DPCM case, it uses CPU-Codec dai links. Now, we want to merge simple-card and simple-scu-card. These sound cards are using silimar but not same logic on each functions. Then, of course we want to share same logic. To compromise, this patch uses cpu/codec pointer on simple-card. It is same logic with simple-scu-card, thus easy merging. This is prepare for merging audio card Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown commit b7934ba4147a883f7a1b32c6408179274a4d6ed1 Author: Jens Axboe Date: Mon Dec 10 15:45:53 2018 -0700 dm: fix inflight IO check After switching to percpu inflight counters, the inflight check is totally buggy. It's perfectly valid for some counters to be non-zero while having a total inflight IO count of 0, that's how these kinds of counters work (inc on one CPU, dec on another). Fix the md_in_flight() check to sum all counters before returning a false positive, potentially. While at it, remove the inflight read for IO completion. We don't need it, just wake anyone that's waiting for the IO count to drop to zero. The caller needs to re-check that value anyway when woken, which it does. Fixes: 6f75723190d8 ("dm: remove the pending IO accounting") Acked-by: Mike Snitzer Reported-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 2b320e046495e6cf02d1f0b1abf07042ac5635ea Author: Arnd Bergmann Date: Mon Dec 10 21:46:10 2018 +0100 ASoC: simple-card-utils: fix build warning without CONFIG_OF When CONFIG_OF is disabled, of_graph_parse_endpoint() does not initialize 'info', and gcc can see that: sound/soc/generic/simple-card-utils.c: In function 'asoc_simple_card_parse_graph_dai': sound/soc/generic/simple-card-utils.c:284:13: error: 'info.port' may be used uninitialized in this function [-Werror=maybe-uninitialized] It's probably best to check the return code anyway, and that also takes care of the warning. Fixes: b6f3fc005a2c ("ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting") Signed-off-by: Arnd Bergmann Acked-by: Kuninori Morimoto Signed-off-by: Mark Brown commit 93698321f72cb351ae6ab59185b611ba26e6e1d0 Merge: d8ed257f313f6 69bd48404f251 Author: David S. Miller Date: Mon Dec 10 17:06:58 2018 -0800 Merge tag 'mlx5e-updates-2018-12-10' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed: ==================== mlx5e-updates-2018-12-10 (gre) This patch set adds GRE offloading support to Mellanox ethernet driver. Patches 1-5 replace the existing egdev mechanism with the new TC indirect block binds mechanism that was introduced by Netronome: 7f76fa36754b ("net: sched: register callbacks for indirect tc block binds") Patches 6-9 add GRE offloading support along with some required refactoring work. Patch 10, Add netif_is_gretap()/netif_is_ip6gretap() - Changed the is_gretap_dev and is_ip6gretap_dev logic from structure comparison to string comparison of the rtnl_link_ops kind field. Patch 11, add GRE offloading support to mlx5. Patch 12 removes the egdev mechanism from TC as it is no longer used by any of the drivers. ==================== Signed-off-by: David S. Miller commit e9dc919043c56dccedce93fe402e6c94423a70b0 Author: Arnd Bergmann Date: Mon Dec 10 21:49:28 2018 +0100 ASoC: sdm845: add rt5663 codec select Calling into the codec driver adds a dependency on that being reachable from the module: ERROR: "rt5663_sel_asrc_clk_src" [sound/soc/qcom/snd-soc-sdm845.ko] undefined! Add the corresponding select statement, as it is done in the other user (Intel). Fixes: f7485875a687 ("ASoC: sdm845: Add configuration for headset codec") Signed-off-by: Arnd Bergmann Signed-off-by: Mark Brown commit 2b96edb570709d6ca2e06842941c4bdf04b55f47 Author: Linus Walleij Date: Thu Dec 6 13:43:51 2018 +0100 regulator: s2mps11: Hand over GPIO to regulator core The GPIO descriptors used by the S2MPS11 driver are retrieved during probe() and it is really helpful to have those under devres management because of all the errorpaths in the intialization. Using the new dev_gpiod_unhinge() call we can remove the devres management of the descriptor right before handing it over to the regulators core. Signed-off-by: Linus Walleij Reviewed-by: Marek Szyprowski Tested-by: Marek Szyprowski Reviewed-by: Charles Keepax Signed-off-by: Mark Brown commit 870311e52bbf53838df937a5099ec92a657c1db5 Author: Linus Walleij Date: Thu Dec 6 13:43:50 2018 +0100 regulator: tps65090: Hand over GPIO to regulator core The GPIO descriptors used by the TPS65090 driver are retrieved during probe() and it is really helpful to have those under devres management because of all the errorpaths in the intialization. Using the new dev_gpiod_unhinge() call we can remove the devres management of the descriptor right before handing it over to the regulators core. Signed-off-by: Linus Walleij Reviewed-by: Marek Szyprowski Tested-by: Marek Szyprowski Reviewed-by: Charles Keepax Signed-off-by: Mark Brown commit 1f5163fcf1523e2890d3e8909daed777661765ab Author: Linus Walleij Date: Thu Dec 6 13:43:49 2018 +0100 regulator: s5m8767: Hand over GPIO to regulator core The GPIO descriptors used by the S5M8767 driver are retrieved during probe() and it is really helpful to have those under devres management because of all the errorpaths in the intialization. Using the new dev_gpiod_unhinge() call we can remove the devres management of the descriptor right before handing it over to the regulators core. Signed-off-by: Linus Walleij Reviewed-by: Marek Szyprowski Tested-by: Marek Szyprowski Reviewed-by: Charles Keepax Signed-off-by: Mark Brown commit b23328d76dba826265f4b0fc625280865eec9782 Author: Linus Walleij Date: Thu Dec 6 13:43:48 2018 +0100 regulator: da9211: Hand over GPIO to regulator core The GPIO descriptors used by the DA9211 driver are retrieved during probe() and it is really helpful to have those under devres management because of all the errorpaths in the intialization. Using the new dev_gpiod_unhinge() call we can remove the devres management of the descriptor right before handing it over to the regulators core. Signed-off-by: Linus Walleij Reviewed-by: Marek Szyprowski Reviewed-by: Charles Keepax Signed-off-by: Mark Brown commit 48bd226f0ab3b91a837213cbfa15319f377effad Author: Linus Walleij Date: Thu Dec 6 13:43:47 2018 +0100 regulator: max8973: Let core handle GPIO descriptor The probe path of this driver is a bit complex: sometimes the GPIO descriptor is passed to the regulator core, sometimes it is not. To handle it in a simple way: stick with the devm_* resource management and unhinge the GPIO descriptor devres handling right before passing it to the regulator core, if we pass it to the regulator core. Fixes: e7d2be696faa ("regulator: max8973: Pass descriptor instead of GPIO number") Signed-off-by: Linus Walleij Reviewed-by: Marek Szyprowski Reviewed-by: Charles Keepax Signed-off-by: Mark Brown commit 891ddbc79a61eb5b919cf56202ecaf7259878cb2 Author: Linus Walleij Date: Thu Dec 6 13:43:46 2018 +0100 gpio: Add devm_gpiod_unhinge() This adds a function named devm_gpiod_unhinge() that removes the resource management from a GPIO descriptor. I am not sure if this is the best anglosaxon name for the function, no other managed resources have an equivalent currently, but I chose "unhinge" as the closest intuitive thing I could imagine that fits Rusty Russell's API design criterions "the obvious use is the correct one" and "the name tells you how to use it". The idea came out of a remark from Mark Brown that it should be possible to handle over management of a resource from devres to the regulator core, and indeed we can do that. Signed-off-by: Linus Walleij Reviewed-by: Marek Szyprowski Tested-by: Marek Szyprowski Reviewed-by: Charles Keepax Signed-off-by: Mark Brown commit cb28ee388e465a956b05ada682f9ef90e776a9b7 Author: Linus Walleij Date: Thu Dec 6 13:43:45 2018 +0100 gpio: devres: Handle nonexclusive GPIOs When we get a nonexeclusive GPIO descriptor using managed resources, we should only add it to the list of managed resources once: on the first user. Augment the devm_gpiod_get_index() and devm_gpiod_get_from_of_node() calls to account for this by checking if the descriptor is already resource managed before we proceed to allocate a new resource management struct. Fixes: b0ce7b29bfcd ("regulator/gpio: Allow nonexclusive GPIO access") Reported-by: Marek Szyprowski Signed-off-by: Linus Walleij Reviewed-by: Marek Szyprowski Tested-by: Marek Szyprowski Reviewed-by: Charles Keepax Signed-off-by: Mark Brown commit ec757001c818c175e6b610e8ef80c2a25d1ed1a5 Author: Linus Walleij Date: Thu Dec 6 13:43:44 2018 +0100 gpio: Enable nonexclusive gpiods from DT nodes This makes gpiod_get_from_of_node() respect the GPIOD_FLAGS_BIT_NONEXCLUSIVE flag which is especially nice when getting regulator GPIOs right out of device tree nodes. Suggested-by: Marek Szyprowski Fixes: b0ce7b29bfcd ("regulator/gpio: Allow nonexclusive GPIO access") Signed-off-by: Linus Walleij Reviewed-by: Marek Szyprowski Tested-by: Marek Szyprowski Reviewed-by: Charles Keepax Signed-off-by: Mark Brown commit d03c63dbcaa1ee570d0435a7f79c7083ffb59245 Author: Linus Walleij Date: Thu Dec 6 13:43:43 2018 +0100 regulator: max77686: Let core handle GPIO descriptor Use the gpiod_get_from_of_node() rather than the devm_* version so that the regulator core can handle the lifecycle of these descriptors. Fix up the errorpath so that we free this descriptor if an error occurs in the callback. Rely on the regulator core to deal with it after this point: a previous patch fixed up the regulator core to properly dispose any GPIO descriptors once you call regulator_register(). Fixes: 96392c3d8ca4 ("regulator: max77686: Pass descriptor instead of GPIO number") Signed-off-by: Linus Walleij Reviewed-by: Marek Szyprowski Tested-by: Marek Szyprowski Reviewed-by: Charles Keepax Signed-off-by: Mark Brown commit fe6c473e3e41114301bfbf5710be56bf0eb233dc Author: Linus Walleij Date: Thu Dec 6 13:43:42 2018 +0100 gpio: Export gpiod_get_from_of_node() This function already exist inside gpiolib, we were just reluctant to make it available to the kernel at large as the devm_* seemed to be enough for anyone. However we found out that regulators need to do their own lifecycle/refcounting on GPIO descriptors and explicitly call gpiod_put() when done with a descriptor, so export this function so we can hand the refcounting over to the regulator core for these descriptors after retrieveal. Signed-off-by: Linus Walleij Reviewed-by: Marek Szyprowski Tested-by: Marek Szyprowski Reviewed-by: Charles Keepax Signed-off-by: Mark Brown commit 894077d5c871f86e6c88a70ac016b6811a910b23 Author: Linus Walleij Date: Thu Dec 6 13:43:41 2018 +0100 regulator: max8952: Let core handle GPIO descriptor Use the gpiod_get() rather than the devm_* version so that the regulator core can handle the lifecycle of these descriptors. Fixes: d7a261c2d1f2 ("regulator: max8952: Pass descriptor instead of GPIO number") Signed-off-by: Linus Walleij Reviewed-by: Marek Szyprowski Tested-by: Marek Szyprowski Reviewed-by: Charles Keepax Signed-off-by: Mark Brown commit 2bb8ede0b14187c19b5eedc62cf0b18b3bf00d3b Author: Linus Walleij Date: Thu Dec 6 13:43:40 2018 +0100 regulator: lp8788-ldo: Let core handle GPIO descriptor Use the gpiod_get() rather than the devm_* version so that the regulator core can handle the lifecycle of these descriptors. Fixes: 2468f0d51548 ("regulator: lp8788-ldo: Pass descriptor instead of GPIO number") Signed-off-by: Linus Walleij Reviewed-by: Marek Szyprowski Reviewed-by: Charles Keepax Signed-off-by: Mark Brown commit e8a33aa0e3bc22134bf2bf3ca6339d6a1b7ffe16 Author: Linus Walleij Date: Thu Dec 6 13:43:39 2018 +0100 regulator: lm363x: Let core handle GPIO descriptor Use the gpiod_get() rather than the devm_* version so that the regulator core can handle the lifecycle of these descriptors. Fixes: b2d751b7f69b ("regulator: lm363x: Pass descriptor instead of GPIO number") Signed-off-by: Linus Walleij Reviewed-by: Marek Szyprowski Reviewed-by: Charles Keepax Signed-off-by: Mark Brown commit 5e6f3ae5c13b12ecd440da2f511fc5fd3c8de520 Author: Linus Walleij Date: Thu Dec 6 13:43:38 2018 +0100 regulator: fixed: Let core handle GPIO descriptor Use the gpiod_get() rather than the devm_* version so that the regulator core can handle the lifecycle of these descriptors. Fixes: efdfeb079cc3 ("regulator: fixed: Convert to use GPIO descriptor only") Signed-off-by: Linus Walleij Reviewed-by: Marek Szyprowski Tested-by: Marek Szyprowski Reviewed-by: Charles Keepax Signed-off-by: Mark Brown commit 0edb040d416ab350c02ac710233349aeaf8c2a26 Author: Linus Walleij Date: Thu Dec 6 13:43:37 2018 +0100 regulator: core: Track dangling GPIO descriptors If a GPIO descriptor is passed to the regulator_register() function inside the config->ena_gpiod callers must be sure that once they call this API the regulator core owns that descriptor and will make sure to issue gpiod_put() on it, no matter whether the call is successful or not. For device tree regulators, the regulator core will automatically set up regulator init data from the device tree when registering a regulator by calling regulator_of_get_init_data() which in turn calls down to the regulator driver's .of_parse_cb() callback. This callback (in drivers such as for max77686) may also choose to fill in the config->ena_gpiod field with a GPIO descriptor. Harden the errorpath of regulator_register() to properly gpiod_put() any passed in cfg->ena_gpiod or any gpiod coming from the device tree on any type of error. Signed-off-by: Linus Walleij Reviewed-by: Marek Szyprowski Tested-by: Marek Szyprowski Reviewed-by: Charles Keepax Signed-off-by: Mark Brown commit 3d9cbe37c16ffd19eeab6b49a0311bbb999627d8 Author: Andy Shevchenko Date: Mon Jun 11 16:47:21 2018 +0300 libnvdimm, namespace: Replace kmemdup() with kstrndup() kstrndup() takes care of '\0' terminator for the strings. Use it here instead of kmemdup() + explicit terminating the input string. Signed-off-by: Andy Shevchenko Signed-off-by: Dave Jiang Signed-off-by: Dan Williams commit 9065ed1281a57f8cf84695b4a1e86ee9bd586b01 Author: Andy Shevchenko Date: Thu Aug 30 13:32:07 2018 +0300 libnvdimm, label: Switch to bitmap_zalloc() Switch to bitmap_zalloc() to show clearly what we are allocating. Besides that it returns pointer of bitmap type instead of opaque void *. Signed-off-by: Andy Shevchenko Reviewed-by: Johannes Thumshirn Signed-off-by: Dave Jiang Signed-off-by: Dan Williams commit 69bd48404f251b9c45a15799fdcfc87a7ad6ab8a Author: Oz Shlomo Date: Tue Nov 6 09:58:37 2018 +0200 net/sched: Remove egdev mechanism The egdev mechanism was replaced by the TC indirect block notifications platform. Signed-off-by: Oz Shlomo Reviewed-by: Eli Britstein Reviewed-by: Jiri Pirko Cc: John Hurley Cc: Jakub Kicinski Signed-off-by: Saeed Mahameed commit df2ef3bff193229973830fd3fd8acf29fa92715e Author: Oz Shlomo Date: Mon Oct 29 08:54:42 2018 +0200 net/mlx5e: Add GRE protocol offloading Add HW offloading support for TC flower filters configured on gretap/ip6gretap net devices. Signed-off-by: Oz Shlomo Reviewed-by: Eli Britstein Signed-off-by: Saeed Mahameed commit 0621e6fc5ed2b6e58a2ba6904074e366f290b1d8 Author: Oz Shlomo Date: Wed Nov 21 12:15:34 2018 +0200 net: Add netif_is_gretap()/netif_is_ip6gretap() Changed the is_gretap_dev and is_ip6gretap_dev logic from structure comparison to string comparison of the rtnl_link_ops kind field. This approach aligns with the current identification methods and function names of vxlan and geneve network devices. Convert mlxsw to use these helpers and use them in downstream mlx5 patch. Signed-off-by: Oz Shlomo Reviewed-by: Eli Britstein Reviewed-by: Ido Schimmel Signed-off-by: Saeed Mahameed commit 101f4de9dd521c6d06dfdacaa35e506a8db8494b Author: Oz Shlomo Date: Sun Dec 2 14:43:27 2018 +0200 net/mlx5e: Move TC tunnel offloading code to separate source file Move tunnel offloading related code to a separate source file for better code maintainability. Code refactoring with no functional change. Signed-off-by: Oz Shlomo Reviewed-by: Eli Britstein Signed-off-by: Saeed Mahameed commit 54c177ca9c6efe5df516eefb886761b89a82eaf0 Author: Oz Shlomo Date: Wed Nov 14 15:21:27 2018 +0200 net/mlx5e: Branch according to classified tunnel type Currently the tunnel offloading encap/decap methods assumes that VXLAN is the sole tunneling protocol. Lay the infrastructure for supporting multiple tunneling protocols by branching according to the tunnel net device kind. Encap filters tunnel type is determined according to the egress/mirred net device. Decap filters classify the tunnel type according to the filter's ingress net device kind. Distinguish between the tunnel type as defined by the SW model and the FW reformat type that specifies the HW operation being made. Signed-off-by: Oz Shlomo Reviewed-by: Eli Britstein Signed-off-by: Saeed Mahameed commit 4d70564d1c9e812b83f30c8dc23cd506abfcfc08 Author: Oz Shlomo Date: Wed Nov 14 15:41:50 2018 +0200 net/mlx5e: Refactor VXLAN tunnel decap offloading code Separates the vxlan header match handling from the matching on the general fields of ipv4/6 tunnels, thus allowing the common IP tunnel match code to branch in down stream patch, to multiple IP tunnels. This patch doesn't add any functionality. Signed-off-by: Oz Shlomo Reviewed-by: Eli Britstein Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit ea7162ac3a33a44a7bb0b5793057015d25617e68 Author: Oz Shlomo Date: Wed Nov 14 15:41:50 2018 +0200 net/mlx5e: Refactor VXLAN tunnel encap offloading code Separates the vxlan header encap logic from the general ipv4/6 encapsulation methods, thus allowing the common IP encap/decap code to branch in downstream patch to multiple IP tunnels. Code refactoring with no functional change. Signed-off-by: Oz Shlomo Reviewed-by: Eli Britstein Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit ef381359e3a81422cee85ddee1f7dc3ac90f3c38 Author: Oz Shlomo Date: Sun Oct 28 13:03:54 2018 +0200 net/mlx5e: Replace egdev with indirect block notifications Use TC indirect block notifications to offload filters that are configured on higher level device interfaces (e.g. tunnel devices). This mechanism replaces the current egdev implementation. Signed-off-by: Oz Shlomo Reviewed-by: Eli Britstein Signed-off-by: Saeed Mahameed commit d11afc2600377c6775abcbc1fd410f199c5bf458 Author: Oz Shlomo Date: Sun Oct 28 10:46:34 2018 +0200 net/mlx5e: Propagate the filter's net device to mlx5e structures Propagate the filter's net_device parameter to the tc flower parsed attributes structure so that it can later be used in tunnel decap offloading sequences. Pre-step for replacing egdev logic with the indirect block notification mechanism. Signed-off-by: Oz Shlomo Reviewed-by: Eli Britstein Signed-off-by: Saeed Mahameed commit 71d82d2a90327c9c816e65471b7859b601993f89 Author: Oz Shlomo Date: Sun Oct 28 09:14:50 2018 +0200 net/mlx5e: Provide the TC filter netdev as parameter to flower callbacks Currently the driver controls flower filters that are installed on its devices. However, with the introduction of the indirect block notifications platform the driver may receive control events for filters that are installed on higher level net devices (e.g. tunnel devices). Therefore, the driver filter control API will not be able to implicitly assume the filter's net device. Explicitly specify the filter's net device, no functional change Signed-off-by: Oz Shlomo Reviewed-by: Eli Britstein Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit f5bc2c5de1015caf7e49b0bf9e7e97077736045a Author: Oz Shlomo Date: Sun Oct 28 08:34:51 2018 +0200 net/mlx5e: Support TC indirect block notifications for eswitch uplink reprs Towards using this mechanism as the means to offload tunnel decap rules set on SW tunnel devices instead of egdev, add the supporting structures and functions. Signed-off-by: Oz Shlomo Reviewed-by: Eli Britstein Reviewed-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit ec1366c20721157cc2d077e84d2a062f93175ce5 Author: Oz Shlomo Date: Thu Oct 25 21:51:11 2018 +0300 net/mlx5e: Store eswitch uplink representor state on a dedicated struct Currently only a single field in the representor private structure is relevant for uplink representors. As a pre-step to allow adding additional uplink representor fields, introduce uplink representor private structure. This is prepration step towards replacing egdev logic with the indirect block notification mechanism. This patch doesn't change any functionality. Signed-off-by: Oz Shlomo Reviewed-by: Eli Britstein Acked-by: Or Gerlitz Signed-off-by: Saeed Mahameed commit 2f62747c77e2e5a8acb720aaec9ee4860d55118f Merge: d8ed257f313f6 6c22a11957f46 Author: Saeed Mahameed Date: Mon Dec 10 15:43:47 2018 -0800 Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux mlx5-next shared branch with rdma subtree to avoid mlx5 rdma v.s. netdev conflicts. Highlights: 1) RDMA ODP (On Demand Paging) improvements and moving ODP logic to mlx5 RDMA driver 2) Improved mlx5 core driver and device events handling and provided API for upper layers to subscribe to device events. 3) RDMA only code cleanup from mlx5 core 4) Add helper to get CQE opcode 5) Rework handling of port module events 6) shared mlx5_ifc.h updates to avoid conflicts Signed-off-by: Saeed Mahameed commit fc979933bcf162595b6004d0de4effb64c323152 Author: Biju Das Date: Fri Dec 7 11:27:44 2018 +0000 rtc: pcf85363: Add support for NXP pcf85263 rtc Add support for NXP pcf85263 real-time clock. pcf85263 rtc is compatible with pcf85363,except that pcf85363 has additional 64 bytes of RAM. 1 byte of nvmem is supported and exposed in sysfs (# is the instance number,starting with 0): /sys/bus/nvmem/devices/pcf85x63-#/nvmem Signed-off-by: Biju Das Signed-off-by: Alexandre Belloni commit bae5e94bea188e652d798eeb4b92b88a355591f6 Author: Biju Das Date: Fri Dec 7 11:27:43 2018 +0000 dt-bindings: rtc: pcf85363: Document pcf85263 real-time clock The pcf85263 RTC is compatible with the pcf85363 RTC. The difference between the pcf85263 and pcf85363 RTC is that the latter has 64 bytes more RAM. This renders them incompatible from a DT point of view. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring Reviewed-by: Simon Horman Signed-off-by: Alexandre Belloni commit ecb4a353d3afd45b9bb30c85d03ee113a0589079 Author: Baruch Siach Date: Wed Dec 5 17:00:09 2018 +0200 rtc: pcf8523: don't return invalid date when battery is low The RTC_VL_READ ioctl reports the low battery condition. Still, pcf8523_rtc_read_time() happily returns invalid dates in this case. Check the battery health on pcf8523_rtc_read_time() to avoid that. Reported-by: Erik Čuk Signed-off-by: Baruch Siach Signed-off-by: Alexandre Belloni commit 9f619d4769a22b1c2f9d8687adbbe4baae12c375 Author: Ocean He Date: Tue Aug 7 02:15:31 2018 -0400 ACPI/nfit: Adjust annotation for why return 0 if fail to find NFIT at start Add detailed explanation for why it's ok to return 0 if we fail to find an NFIT at startup. Refer to chapter 9.20.2 NVDIMM Root Device in ACPI 6.2 spec. Signed-off-by: Ocean He Reviewed-by: Vishal Verma Signed-off-by: Dave Jiang Signed-off-by: Dan Williams commit 9bf3aa44644721b287724ecac835d38f1dae4e2d Author: Ocean He Date: Fri Aug 3 08:08:33 2018 -0400 libnvdimm, bus: Check id immediately following ida_simple_get The id check was not executed immediately following ida_simple_get. Just change the codes position, without function change. Signed-off-by: Ocean He Reviewed-by: Vishal Verma Signed-off-by: Dave Jiang Signed-off-by: Dan Williams commit 2cb5e4743ab52d3a43ef25f229f6770fd9ca0065 Author: Lubomir Rintel Date: Mon Dec 3 12:47:36 2018 +0100 dt-bindings: rtc: use a generic node name for ds1307 The example should follow the practice or using a generic node name instead of the precise programming model, as recommended by the DTSpec. Signed-off-by: Lubomir Rintel Signed-off-by: Alexandre Belloni commit aa570ff4fd3682d35cdcc5190c380e6c4d7d08e2 Merge: 7a5725ddc6e18 cfc542411bd40 Author: Alexei Starovoitov Date: Mon Dec 10 14:51:45 2018 -0800 Merge branch 'rename-info_cnt-to-nr_info' Yonghong Song says: ==================== Before func_info and line_info are added to the kernel, there are several fields in structure bpf_prog_info specifying the "count" of a user buffer, e.g., __u32 nr_jited_ksyms; __u32 nr_jited_func_lens; The naming convention has the prefix "nr_". The func_info and line_info support added several fields __u32 func_info_cnt; __u32 line_info_cnt; __u32 jited_line_info_cnt; to indicate the "count" of buffers func_info, line_info and jited_line_info. The original intention is to keep the field names the same as those in structure bpf_attr, so it will be clear that the "count" returned to user space will be the same as the one passed to the kernel during prog load. Unfortunately, the field names *_info_cnt are not consistent with other existing fields in bpf_prog_info. This patch set renamed the fields *_info_cnt to nr_*_info to keep naming convention consistent. ==================== Signed-off-by: Alexei Starovoitov commit cfc542411bd40ff4f8a70b3d061bd6acdfb05629 Author: Yonghong Song Date: Mon Dec 10 14:14:10 2018 -0800 tools/bpf: rename *_info_cnt to nr_*_info Rename all occurances of *_info_cnt field access to nr_*_info in tools directory. The local variables finfo_cnt, linfo_cnt and jited_linfo_cnt in function do_dump() of tools/bpf/bpftool/prog.c are also changed to nr_finfo, nr_linfo and nr_jited_linfo to keep naming convention consistent. Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov commit b4f8623c0cefdfb818f99b3eb3c1e4c7708dd84e Author: Yonghong Song Date: Mon Dec 10 14:14:09 2018 -0800 tools/bpf: sync kernel uapi bpf.h to tools directory Sync kernel uapi bpf.h "*_info_cnt => nr_*_info" changes to tools directory. Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov commit 11d8b82d2222cade12caad2c125f23023777dcbc Author: Yonghong Song Date: Mon Dec 10 14:14:08 2018 -0800 bpf: rename *_info_cnt to nr_*_info in bpf_prog_info In uapi bpf.h, currently we have the following fields in the struct bpf_prog_info: __u32 func_info_cnt; __u32 line_info_cnt; __u32 jited_line_info_cnt; The above field names "func_info_cnt" and "line_info_cnt" also appear in union bpf_attr for program loading. The original intention is to keep the names the same between bpf_prog_info and bpf_attr so it will imply what we returned to user space will be the same as what the user space passed to the kernel. Such a naming convention in bpf_prog_info is not consistent with other fields like: __u32 nr_jited_ksyms; __u32 nr_jited_func_lens; This patch made this adjustment so in bpf_prog_info newly introduced *_info_cnt becomes nr_*_info. Acked-by: Song Liu Acked-by: Martin KaFai Lau Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov commit 7a5725ddc6e18aab61f647c0996d3b7eb03ff5cb Author: Song Liu Date: Mon Dec 10 11:17:50 2018 -0800 bpf: clean up bpf_prog_get_info_by_fd() info.nr_jited_ksyms and info.nr_jited_func_lens cannot be 0 in these two statements, so we don't need to check them. Signed-off-by: Song Liu Acked-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov commit 0f51659a438eebd84b0b96cb910b67b141653b83 Author: Stephen Boyd Date: Fri Nov 30 12:59:38 2018 -0800 clk: Loongson1: Remove usage of CLK_IS_BASIC This flag doesn't look to be used by any code, just set in the clk init structure and then never tested again. Remove it from this driver as it doesn't provide any benefit. Also remove parenthesis nearby that are not needed and include clk.h to fix a sparse warning about static function definition. Signed-off-by: Stephen Boyd commit f246affc0825cb7c1b4938802d33075afb0ca996 Author: Stephen Boyd Date: Fri Nov 30 12:59:38 2018 -0800 clk: samsung: s3c2410: Remove usage of CLK_IS_BASIC This flag doesn't look to be used by any code, just set in the clk init structure and then never tested again. Remove it from this drivers as it doesn't provide any benefit. Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: Sylwester Nawrocki Acked-by: Krzysztof Kozlowski Signed-off-by: Stephen Boyd commit 354e12100665a30537bc816aa1a1607436948677 Author: Stephen Boyd Date: Fri Nov 30 11:07:30 2018 -0800 clk: versatile: sp810: Remove usage of CLK_IS_BASIC This flag doesn't look to be used by any code, just set in the clk init structure and then never tested again. Remove it from this driver as it doesn't provide any benefit. Cc: Linus Walleij Acked-by: Linus Walleij Signed-off-by: Stephen Boyd commit 5a727ff63032dc6cde780f960c6e3f22f8bf2783 Author: Stephen Boyd Date: Fri Nov 30 11:07:30 2018 -0800 clk: hisilicon: Remove usage of CLK_IS_BASIC This flag doesn't look to be used by any code, just set in various clk init structures and then never tested again. Remove it from these drivers as it doesn't provide any benefit. Cc: Jiancheng Xue Cc: Leo Yan Cc: Jianguo Sun Cc: Wei Yongjun Signed-off-by: Stephen Boyd commit c0156e5509e41453adff9b70dc32b92a10b3f185 Author: Stephen Boyd Date: Fri Nov 30 11:07:30 2018 -0800 clk: h8300: Remove usage of CLK_IS_BASIC This flag doesn't look to be used by any code, just set in various clk init structures and then never tested again. Remove it from these drivers as it doesn't provide any benefit. Cc: Yoshinori Sato Cc: Signed-off-by: Stephen Boyd commit 2239fe59ace650bb22345ba6f8ea9bb291bbaacc Author: Stephen Boyd Date: Fri Nov 30 11:07:30 2018 -0800 clk: axm5516: Remove usage of CLK_IS_BASIC This flag doesn't look to be used by any code, just set in various clk init structures and then never tested again. Remove it from these drivers as it doesn't provide any benefit. Cc: Anders Berg Signed-off-by: Stephen Boyd commit c179c21e2c7a83b521984b75505c6bbfed23242a Author: Stephen Boyd Date: Thu Dec 6 10:38:31 2018 -0800 clk: st: Remove usage of CLK_IS_BASIC This flag doesn't look to be used by any code, just set in various clk init structures and then never tested again. Remove it from these drivers as it doesn't provide any benefit. Signed-off-by: Stephen Boyd commit ddbae6658d4dc495ac62f7977062b33bb15d1af6 Author: Stephen Boyd Date: Fri Nov 30 11:05:35 2018 -0800 clk: renesas: Remove usage of CLK_IS_BASIC This flag doesn't look to be used by any code, just set in various clk init structures and then never tested again. Remove it from these drivers as it doesn't provide any benefit. Cc: Geert Uytterhoeven Reviewed-by: Geert Uytterhoeven Cc: Signed-off-by: Stephen Boyd commit 4014c08ba39476a18af546186da625a6833a1529 Author: Tony Lindgren Date: Mon Dec 10 14:11:26 2018 -0800 bus: ti-sysc: Check for no-reset and no-idle flags at the child level With ti-sysc, we need to now have the device tree properties for ti,no-reset-on-init and ti,no-idle-on-init at the module level instead of the child device level. Let's check for these properties at the child device level to enable quirks, and warn about moving the properties to the module level. Otherwise am335x-evm based boards tagging gpio1 with ti,no-reset-on-init will have their DDR power disabled if wired up in such a tricky way. Note that this should not be an issue for earlier kernels as we don't rely on this until the dts files have been updated to probe with ti-sysc interconnect target driver. Cc: Peter Ujfalusi Reported-by: Peter Ujfalusi Signed-off-by: Tony Lindgren commit 4f2122473363b569db652dc09029715ad808e1a6 Author: Tony Lindgren Date: Mon Dec 10 14:11:10 2018 -0800 ARM: OMAP2+: Check also the first dts child for hwmod flags Until the board specific dts files are updated to have hwmod flags at the interconnect target module level, we want to keep things working both for old and new dts files. So let's also check the first child for hwmod flags. The module flags are for the whole module, so only the first child should ever have them. Cc: Peter Ujfalusi Reported-by: Peter Ujfalusi Signed-off-by: Tony Lindgren commit 6c22a11957f46ca7e9b8db20ac7c6b05441c55ed Author: Or Gerlitz Date: Mon Dec 10 13:15:17 2018 -0800 net/mlx5: Remove the get protocol device interface entry This isn't used anywhere across the mlx5 driver stack, remove it. Signed-off-by: Or Gerlitz Reviewed-by: Saeed Mahameed Signed-off-by: Saeed Mahameed commit a2c6162b12f15fbbbe38d0eb3a38186bcfc79c0f Author: Eli Britstein Date: Mon Dec 10 13:15:16 2018 -0800 net/mlx5: Support extended destination format in flow steering command Update the flow steering command formatting according to the extended destination API. Note that the FW dictates that multi destination FTEs that involve at least one encap must use the extended destination format, while single destination ones must use the legacy format. Using extended destination format requires FW support. Check for its capabilities and return error if not supported. Signed-off-by: Eli Britstein Reviewed-by: Or Gerlitz Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit aa39c2c0e44d16b5804f8fb6b5350cdf4e33b4c3 Author: Eli Britstein Date: Mon Dec 10 13:15:15 2018 -0800 net/mlx5: E-Switch, Change vhca id valid bool field to bit flag Change the driver flow destination struct to use bit flags with the vhca id valid being the 1st one. The flags field is more extendable and will be used in downstream patch. Signed-off-by: Eli Britstein Reviewed-by: Or Gerlitz Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 1b115498598f25d578cfc0df7b7aea9772bae0a1 Author: Eli Britstein Date: Mon Dec 10 13:15:14 2018 -0800 net/mlx5: Introduce extended destination fields Extended destinations provide the ability to configure different encapsulation properties per destination on a single FTE. This is needed for use-cases such as remote mirroring over tunneled networks. Signed-off-by: Eli Britstein Reviewed-by: Or Gerlitz Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 5886a96ad19dacebe6c4f7f8c001d489b06125dc Author: Oz Shlomo Date: Mon Dec 10 13:15:13 2018 -0800 net/mlx5: Revise gre and nvgre key formats GRE RFC defines a 32 bit key field. NVGRE RFC splits the 32 bit key field to 24 bit VSID (gre_key_h) and 8 bit flow entropy (gre_key_l). Define the two key parsing alternatives in a union, thus enabling both access methods. Signed-off-by: Oz Shlomo Reviewed-by: Eli Britstein Signed-off-by: Saeed Mahameed commit fd4572b3ff3ff57ca7fa612f9ea42b90afdd8bff Author: Eyal Davidovich Date: Mon Dec 10 13:15:12 2018 -0800 net/mlx5: Add monitor commands layout and event data Will be used in downstream patch to monitor counter changes by the HCA and report it to the driver by an event. The driver will update its counters cached data accordingly. Signed-off-by: Eyal Davidovich Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit 8d6b57e6445989e9f34077ef1aac80b621029b08 Author: Mikhael Goikhman Date: Mon Dec 10 13:15:11 2018 -0800 net/mlx5: Add support for plugged-disabled cable status in PME Support a new hardware module status in port module events: - module_status=0x4 (Cable plugged, but disabled) Signed-off-by: Mikhael Goikhman Signed-off-by: Saeed Mahameed commit 37a12aae06fda00f36eadb168d5d7ba0be3a8c86 Author: Mikhael Goikhman Date: Mon Dec 10 13:15:10 2018 -0800 net/mlx5: Add support for PCIe power slot exceeded error in PME Support a new hardware error type in port module events: - error_type=0xc (PCIe system power slot exceeded) Signed-off-by: Mikhael Goikhman Signed-off-by: Saeed Mahameed commit c2fb3db22d35f01774d0547b1d8e5085df193646 Author: Mikhael Goikhman Date: Mon Dec 10 13:15:09 2018 -0800 net/mlx5: Rework handling of port module events Add explicit HW defined error values. For simplicity, keep counters for all statuses starting from 0, although currently status=0 is not used. Additionally, when HW signals an unexpected cable status, it is reported now rather than ignored. And status counter is now updated on errors. Signed-off-by: Mikhael Goikhman Signed-off-by: Saeed Mahameed commit 4ba09f69e20d0a768d91277847ddbd31f476590e Author: Jens Axboe Date: Mon Dec 10 14:45:19 2018 -0700 mtip32xx: use BLK_STS_DEV_RESOURCE for device resources For cases where we can only fail with IO in-flight, we should be using BLK_STS_DEV_RESOURCE instead of BLK_STS_RESOURCE. The latter refers to system wide resource constraints. Signed-off-by: Jens Axboe commit e4025e46f093d4549d3043c2c54d444cec480d2b Author: Arnd Bergmann Date: Mon Dec 10 22:34:39 2018 +0100 mtip32xx: avoid using semaphores The "cmd_slot_unal" semaphore is never used in a blocking way but only as an atomic counter. Change the code to using atomic_dec_if_positive() as a better API. Signed-off-by: Arnd Bergmann Signed-off-by: Jens Axboe commit a07995be61e18a504f37db0169b50de4036fc02d Author: Andy Shevchenko Date: Tue Dec 4 23:23:30 2018 +0200 PM: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Cc: linux-pm@vger.kernel.org Acked-by: Rafael J. Wysocki Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit 906254441564f27ec360b72d487fbee314481c75 Author: Andy Shevchenko Date: Tue Dec 4 23:23:29 2018 +0200 m68k/mac: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Cc: Geert Uytterhoeven Cc: linux-m68k Signed-off-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Signed-off-by: Alexandre Belloni commit 804cfcb98232ee8acfa187cc59d6aec39aa50bdb Author: Andy Shevchenko Date: Tue Dec 4 23:23:28 2018 +0200 Input: hp_sdc_rtc - Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Cc: Dmitry Torokhov Signed-off-by: Andy Shevchenko Acked-by: Dmitry Torokhov Signed-off-by: Alexandre Belloni commit d54fb4861666c8259933547841e1a0c04471c4da Author: Andy Shevchenko Date: Tue Dec 4 23:23:27 2018 +0200 rtc: tegra: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Cc: Thierry Reding Cc: Jonathan Hunter Signed-off-by: Andy Shevchenko Acked-by: Thierry Reding Signed-off-by: Alexandre Belloni commit 5527842eab2331ed58abf69aa77f5c81e21025e4 Author: Andy Shevchenko Date: Tue Dec 4 23:23:26 2018 +0200 rtc: s5m: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Cc: Bartlomiej Zolnierkiewicz Reviewed-by: Krzysztof Kozlowski Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit 9a1bacf4239ec197fe6a04d04ce924a8e6e701ce Author: Andy Shevchenko Date: Tue Dec 4 23:23:25 2018 +0200 rtc: s3c: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit 1921cab117237bfe84e22ec3b525e0e075b420c8 Author: Andy Shevchenko Date: Tue Dec 4 23:23:24 2018 +0200 rtc: rx8025: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit a3f60bb35fcad65ad1d727f93fcb19d6d932533b Author: Andy Shevchenko Date: Tue Dec 4 23:23:23 2018 +0200 rtc: rx6110: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit 0991e754b99cc262f7dfd5e33390404327446d51 Author: Andy Shevchenko Date: Tue Dec 4 23:23:22 2018 +0200 rtc: rk808: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit b2db0a291ac66a3526a8d9592263d40791b72e50 Author: Andy Shevchenko Date: Tue Dec 4 23:23:21 2018 +0200 rtc: puv3: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Cc: Guan Xuetao Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit 4f5ef6eec475cbcef92dd905db195b551fba867d Author: Andy Shevchenko Date: Tue Dec 4 23:23:20 2018 +0200 rtc: pm8xxx: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit 93206f9315bba8a1c00fad5d9fe29bdb79938a5b Author: Andy Shevchenko Date: Tue Dec 4 23:23:19 2018 +0200 rtc: pic32: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit 8d2e6b22bbc609d08f22d3a63541d978ad729c6d Author: Andy Shevchenko Date: Tue Dec 4 23:23:18 2018 +0200 rtc: pcf50633: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit 1481376072460fee7f25f142f3e3dac81651dfb6 Author: Andy Shevchenko Date: Tue Dec 4 23:23:17 2018 +0200 rtc: mcp795: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit ad78343e40cb03f3eb8d713ed67ca8a5941967da Author: Andy Shevchenko Date: Tue Dec 4 23:23:16 2018 +0200 rtc: m48t59: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit 22b844ae3318fa4bc097cf24d30b6512f198ebae Author: Andy Shevchenko Date: Tue Dec 4 23:23:15 2018 +0200 rtc: m41t80: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit 285166cb8c77a01c510f05003cb38efcd2a66740 Author: Andy Shevchenko Date: Tue Dec 4 23:23:14 2018 +0200 rtc: at91sam9: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit d422f8835d29e1d0f915fe11fbfa61875df3508f Author: Andy Shevchenko Date: Tue Dec 4 23:23:13 2018 +0200 rtc: at91rm9200: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit 5548cbf7f148b9a039b19fa4697f1b9beaba2c78 Author: Andy Shevchenko Date: Tue Dec 4 23:23:12 2018 +0200 rtc: Switch to use %ptR Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Note, we drop the validation option. This is only used in a deprecated ABI and is mostly wrong as many RTCs will still be valid after 2100. Cc: Arnd Bergmann Acked-by: Greg Kroah-Hartman Signed-off-by: Andy Shevchenko Signed-off-by: Alexandre Belloni commit 4d42c44727a062e233e446c6c86da1c84d762d79 Author: Andy Shevchenko Date: Tue Dec 4 23:23:11 2018 +0200 lib/vsprintf: Print time and date in human readable format via %pt There are users which print time and date represented by content of struct rtc_time in human readable format. Instead of open coding that each time introduce %ptR[dt][r] specifier. Cc: Arnd Bergmann Cc: Bartlomiej Zolnierkiewicz Cc: Dmitry Torokhov Cc: Geert Uytterhoeven Cc: Guan Xuetao Cc: Ingo Molnar Cc: Jason Wessel Cc: Jonathan Corbet Cc: Jonathan Hunter Cc: Krzysztof Kozlowski Cc: "Rafael J. Wysocki" Cc: Thierry Reding Cc: Petr Mladek Signed-off-by: Andy Shevchenko Reviewed-by: Petr Mladek Signed-off-by: Alexandre Belloni commit 27b4feb7fe373e1ed92b9362b1e33cead271ac84 Author: Stefano Stabellini Date: Mon Dec 3 14:26:09 2018 -0800 devicetree,xen: add xen,shared-memory binding Introduce a device tree binding for Xen reserved-memory regions. They are used to share memory across VMs from the VM config files. (See static_shm config option.) Signed-off-by: Stefano Stabellini Cc: julien.grall@arm.com Cc: devicetree@vger.kernel.org Cc: robh+dt@kernel.org Cc: mark.rutland@arm.com Cc: xen-devel@lists.xen.org Signed-off-by: Rob Herring commit 6e9982918c3fc4f0c4c32c95d1eb0a345baea5f1 Author: Martin Kelly Date: Sun Dec 9 19:14:55 2018 -0800 iio: bmi160: use all devm functions in probe Currently, we're using the devm version of some but not all functions. Switch to the devm version of iio_triggered_buffer_setup and iio_device_register to simplify the code a bit and decrease the chance of bugs. Signed-off-by: Martin Kelly Signed-off-by: Jonathan Cameron commit b422847877e35d6818f65cb359a60f529fe22c4b Author: Fabrizio Castro Date: Thu Nov 8 17:04:41 2018 +0000 mtd: spi-nor: Add support for is25lp016d The is25lp016d is found on the iwg23s from iWave, therefore add driver support for it so that we can upstream board support. Signed-off-by: Fabrizio Castro Reviewed-by: Tudor Ambarus Signed-off-by: Boris Brezillon commit 816873eaeec63ba2e58bbd514d15a7efc6e572f7 Author: Cyrille Pitchen Date: Thu Dec 6 14:43:39 2018 +0000 mtd: spi-nor: parse SFDP 4-byte Address Instruction Table Add support for SFDP (JESD216B) 4-byte Address Instruction Table. This table is optional but when available, we parse it to get the 4-byte address op codes supported by the memory. Using these op codes is stateless as opposed to entering the 4-byte address mode or setting the Base Address Register (BAR). Flashes that have the 4BAIT table declared can now support SPINOR_OP_PP_1_1_4_4B and SPINOR_OP_PP_1_4_4_4B opcodes. Tested on MX25L25673G. Signed-off-by: Cyrille Pitchen [tudor.ambarus@microchip.com: - rework erase and page program logic, - pass DMA-able buffer to spi_nor_read_sfdp(), - introduce SPI_NOR_HAS_4BAIT - various minor updates.] Signed-off-by: Tudor Ambarus Signed-off-by: Boris Brezillon commit d05e21e3cfc7f2d4d152c7f8b0738cacdc913cb5 Author: Liu Xiang Date: Wed Nov 14 20:55:18 2018 +0800 mtd: spi-nor: Add 4B_OPCODES flag to is25lp256 The is25lp256 supports 4-byte opcodes and quad output. Suggested-by: Boris Brezillon Signed-off-by: Liu Xiang Reviewed-by: Tudor Ambarus Signed-off-by: Boris Brezillon commit e9f3a2bcc3742960e28c8d37165406c6c55500b9 Author: Boris Brezillon Date: Thu Dec 6 11:41:20 2018 +0100 mtd: spi-nor: Add an SPDX tag to spi-nor.{c,h} Add SPDX tags to replace the license boiler-plate and fix the MODULE_LICENSE() definition in spi-nor.c to match the license text (GPL v2). Interestingly, spi-nor.h and spi-nor.c do not use the same license (GPL v2+ for spi-nor.h, GPL v2 for spi-nor.c). Signed-off-by: Boris Brezillon Reviewed-by: Tudor Ambarus commit eb6ec1d79b40badeecea4194547ebd90dc560d5e Author: Boris Brezillon Date: Thu Dec 6 11:41:19 2018 +0100 mtd: spi-nor: Make the enable argument passed to set_byte() a bool No need to use an integer when the value is either true or false. Make it a boolean. Signed-off-by: Boris Brezillon Reviewed-by: Tudor Ambarus commit b296379fef7ce9f96129798825ab04683414313b Author: Boris Brezillon Date: Thu Dec 6 11:41:18 2018 +0100 mtd: spi-nor: Stop passing flash_info around Some functions called from spi_nor_scan() need a flash_info object. Let's assign nor->info early on to avoid passing info as an extra argument to each of these sub-functions. We also stop passing a flash_info object to set_4byte() and use nor->info directly. Signed-off-by: Boris Brezillon Reviewed-by: Tudor Ambarus commit f10aa369d5c2ccfc734e158c0a802009953e8c68 Author: Boris Brezillon Date: Thu Dec 6 11:41:17 2018 +0100 mtd: spi-nor: Avoid forward declaration of internal functions Reorganize the code to kill forward declarations of spi_nor_match_id() macronix_quad_enable() and spi_nor_hwcaps_read2cmd(). Signed-off-by: Boris Brezillon Reviewed-by: Tudor Ambarus commit 87f3ed184d97a76fb8ad3a4eb07d89750307616a Author: Boris Brezillon Date: Thu Dec 6 11:41:16 2018 +0100 mtd: spi-nor: Drop inline on all internal helpers gcc should be smart enough to decide when inlining a function makes sense. Drop all inline specifiers. Signed-off-by: Boris Brezillon Reviewed-by: Tudor Ambarus commit 2bffa65da43e399079dad5947c6aa9ab3cfa4ad4 Author: Boris Brezillon Date: Thu Dec 6 11:37:36 2018 +0100 mtd: spi-nor: Add a post BFPT fixup for MX25L25635E MX25L25635F and MX25L25635E share the same JEDEC-ID, but the F variant supports 4-byte opcodes while the E variant doesn't. We need a way to differentiate those 2 chips and set the SNOR_F_4B_OPCODES flag only for the F variant. Luckily, 4-byte opcode support is not the only difference: Fast Read 4-4-4 is only supported by the F variant, and this feature is advertised in the BFPT table. Use this to decide when to set the SNOR_F_4B_OPCODES flag. Signed-off-by: Boris Brezillon Reviewed-by: Tudor Ambarus commit 2aaa5f7e0c07a0f14e514ed3b343d66a31dfb300 Author: Boris Brezillon Date: Thu Dec 6 11:37:35 2018 +0100 mtd: spi-nor: Add a post BFPT parsing fixup hook Experience has proven that SFDP tables are sometimes wrong, and parsing of these broken tables can lead to erroneous flash config. This leaves us 2 options: 1/ set the SPI_NOR_SKIP_SFDP flag and completely ignore SFDP parsing 2/ fix things at runtime While #1 should always work, it might imply extra work if most of the SFDP is correct. #2 has the benefit of keeping the generic SFDP parsing logic almost untouched while allowing SPI NOR manufacturer drivers to fix the broken bits. Add a spi_nor_fixups struct where we'll put all our fixup hooks, each of them being called at a different point in the scan process. We start a hook called just after the BFPT parsing to allow fixing up info extracted from the BFPT section. More hooks will be added if other sections need to be fixed. Signed-off-by: Boris Brezillon Reviewed-by: Tudor Ambarus commit 548ed6847f5303e4f33ecd6de5670cac15bfe6ac Author: Boris Brezillon Date: Thu Dec 6 11:37:34 2018 +0100 mtd: spi-nor: Add the SNOR_F_4B_OPCODES flag Some flash_info entries have the SPI_NOR_4B_OPCODES flag set to let the core know that the flash supports 4B opcode. While this solution works fine for id-based caps detection, it doesn't work that well when relying on SFDP-based caps detection. Let's add an SNOR_F_4B_OPCODES flag so that the SFDP parsing code can set it when appropriate. Signed-off-by: Boris Brezillon Reviewed-by: Tudor Ambarus commit 84a1c2109d23df3543d96231c4fee1757299bb1a Author: huijin.park Date: Wed Nov 28 03:02:14 2018 -0500 mtd: spi-nor: cast to u64 to avoid uint overflows The "params->size" is defined as "u64". And "info->sector_size" and "info->n_sectors" are defined as unsigned int and u16. Thus, u64 data might have strange data(loss data) if the result overflows an unsigned int. This patch casts "info->sector_size" to an u64. Signed-off-by: huijin.park Reviewed-by: Geert Uytterhoeven Signed-off-by: Boris Brezillon commit 4cc106f8f245bae0c458224804733240cb22394d Author: Uwe Kleine-König Date: Wed Nov 21 14:34:00 2018 +0100 mtd: spi-nor: Add support for IS25LP032/064 The datasheet is publically available at http://www.issi.com/WW/pdf/IS25LP032-064-128.pdf. The parameters fit to what is already available for IS25LP128/256. Signed-off-by: Uwe Kleine-König Reviewed-by: Tudor Ambarus Signed-off-by: Boris Brezillon commit a98086e00420ad92cfa961bcbb457fbe52ec28c9 Author: Yogesh Narayan Gaur Date: Fri Oct 12 02:23:13 2018 +0000 mtd: spi-nor: add entry for mt35xu512aba flash Add entry for mt35xu512aba Micron NOR flash. This flash is having uniform sector erase size of 128KB, have support of FSR(flag status register), flash size is 64MB and supports 4-byte commands. Signed-off-by: Yogesh Gaur Reviewed-by: Tudor Ambarus Signed-off-by: Boris Brezillon commit 0005aad094538e1c290b1cdb5b940e4a16f405b0 Author: Yogesh Narayan Gaur Date: Fri Oct 12 02:23:08 2018 +0000 mtd: spi-nor: add macros related to MICRON flash Some MICRON related macros in spi-nor domain were ST. Rename entries related to STMicroelectronics under macro SNOR_MFR_ST. Added entry of MFR Id for Micron flashes, 0x002C. Signed-off-by: Yogesh Gaur Reviewed-by: Tudor Ambarus Signed-off-by: Boris Brezillon commit f66734ae2d8d2b5e39f4ac3c5dc9666125bcb76e Author: Tudor.Ambarus@microchip.com Date: Fri Nov 9 17:40:21 2018 +0000 mtd: spi-nor: mark desirable switch case fall through gcc 7 with -Wimplicit-fallthrough raises: drivers/mtd/spi-nor/spi-nor.c: In function ‘set_4byte’: drivers/mtd/spi-nor/spi-nor.c:289:13: warning: this statement may fall through [-Wimplicit-fallthrough=] need_wren = true; ~~~~~~~~~~^~~~~~ drivers/mtd/spi-nor/spi-nor.c:290:2: note: here case SNOR_MFR_MACRONIX: ^~~~ Quiet the warning by marking the expected switch fall through. Signed-off-by: Tudor Ambarus Signed-off-by: Boris Brezillon commit 81554171373018b83f3554b9e725d2b5bf1844a5 Author: Alexander Sverdlin Date: Fri Jul 13 15:06:46 2018 +0200 mtd: spi-nor: Add support for mx25u12835f This chip supports dual and quad read and uniform 4K-byte erase. Signed-off-by: Alexander Sverdlin Reviewed-by: Tudor Ambarus Signed-off-by: Boris Brezillon commit d720a43333b0c21694a00bd67a24fac8bebfbc3f Author: Robert Marko Date: Mon Jun 25 13:17:48 2018 +0200 mtd: spi-nor: Add Winbond w25q128jv support Datasheet: http://www.winbond.com/resource-files/w25q128jv%20revf%2003272018%20plus.pdf Testing done on Mikrotik Routerboard wAP R board. It does not support Dual or Quad modes. Signed-off-by: Robert Marko Reviewed-by: Tudor Ambarus Signed-off-by: Boris Brezillon commit e7b65a49c43fffb61c489a5e07e6d2f6c8a5efe2 Author: Tudor.Ambarus@microchip.com Date: Fri Nov 9 16:56:56 2018 +0000 mtd: spi-nor: remove unneeded smpt zeroization The entire smpt array is initialized with data read from sfdp, there is no need to init it with zeroes before. Signed-off-by: Tudor Ambarus Signed-off-by: Boris Brezillon commit 2e62246b08a69a35fb7ea832873f6e005d672cd5 Author: Matti Vaittinen Date: Fri Dec 7 12:01:44 2018 +0200 clk: bd718x7: Initial support for ROHM bd71837/bd71847 PMIC clock ROHM bd71837 and bd71847 contain 32768Hz clock gate. Support the clock using generic clock framework. Note, only bd71837 is tested but bd71847 should be identical what comes to clk parts. Signed-off-by: Matti Vaittinen Signed-off-by: Stephen Boyd commit e9e863dc1dc88212b09d279a143027e1521b35d1 Author: Martin Blumenstingl Date: Fri Nov 23 20:53:06 2018 +0100 ARM: meson: select HAVE_ARM_TWD and ARM_GLOBAL_TIMER The 32-bit Meson SoCs use multiple Cortex-A9 (Meson8 and Meson8m2) or Cortex-A5 (Meson8b) CPU cores. These come with the "ARM global timer" and "Timer-Watchdog" (aka TWD, which provides both a per-cpu local timer and watchdog). Selecting ARM_GLOBAL_TIMER and HAVE_ARM_TWD allows us to add the timers to the SoC.dtsi files. Signed-off-by: Martin Blumenstingl Signed-off-by: Kevin Hilman commit 816b6931315b641c5864cf33a9363cb89da05d0b Author: Alex Deucher Date: Thu Dec 6 10:41:27 2018 -0500 drm/amdgpu/powerplay: Add special avfs cases for some polaris asics (v3) Add special avfs handling for some polaris variants. v2: fix copy paste typo. v3: fix asic rid check Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 8146aace60c7409cc60a1598bc9647a5bbb12eb4 Author: Krzysztof Kozlowski Date: Mon Dec 10 10:29:59 2018 +0100 led: triggers: Initialize LED_INIT_DEFAULT_TRIGGER if trigger is brought after class Trigger driver can be initialized after the LED class device driver. In such case led_trigger_set_default() won't be called and flag LED_INIT_DEFAULT_TRIGGER should be set from led_trigger_register(). Signed-off-by: Krzysztof Kozlowski Signed-off-by: Jacek Anaszewski commit 02d31765bb35101d711b862fc619a49857bb9070 Author: Jacek Anaszewski Date: Mon Dec 10 10:29:58 2018 +0100 led: triggers: Add LED_INIT_DEFAULT_TRIGGER flag Add the flag LED_INIT_DEFAULT_TRIGGER for indicating that trigger being set is a default trigger for the LED class device, and thus it should be initialized with settings provided in the fwnode. Set the flag in the led_trigger_set_default(). It is expected to be cleared in the activate() op of a trigger after trigger fwnode initialization data is parsed and applied. This should happen only once after LED class device registration, to allow leaving triggers in the idle state on re-apply and let the users apply their own settings without interference from the default ones. Signed-off-by: Jacek Anaszewski Acked-by: Pavel Machek Signed-off-by: Krzysztof Kozlowski commit 10a5ce98539948affbdc28dc0f39a1b6b2307f9d Author: Martin KaFai Lau Date: Mon Dec 10 10:53:24 2018 -0800 bpf: bpftool: Fix newline and p_err issue This patch fixes a few newline issues and also replaces p_err with p_info in prog.c Fixes: b053b439b72a ("bpf: libbpf: bpftool: Print bpf_line_info during prog dump") Cc: Jakub Kicinski Signed-off-by: Martin KaFai Lau Acked-by: Jakub Kicinski Signed-off-by: Alexei Starovoitov commit 2e431a1788c52d510bb24229cef93ba935f5785b Author: YueHaibing Date: Sat Dec 8 15:01:13 2018 +0000 drm/amdgpu: remove set but not used variable 'grbm_soft_reset' Fixes gcc '-Wunused-but-set-variable' warning: drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c: In function 'gfx_v8_0_pre_soft_reset': drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:4950:27: warning: variable 'srbm_soft_reset' set but not used [-Wunused-but-set-variable] drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c: In function 'gfx_v8_0_post_soft_reset': drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c:5054:27: warning: variable 'srbm_soft_reset' set but not used [-Wunused-but-set-variable] It never used since introduction in commit d31a501ead7f ("drm/amdgpu: add pre_soft_reset ip func") and e4ae0fc33631 ("drm/amdgpu: implement gfx8 post_soft_reset") Reviewed-by: Chunming Zhou Signed-off-by: YueHaibing Signed-off-by: Alex Deucher commit 08d1bdd4cc57e89d037205687a61d2b6ff9dddd4 Author: Rex Zhu Date: Wed Oct 24 16:10:33 2018 +0800 drm/amdgpu: Limit vm max ctx number to 4096 driver need to reserve resource for each ctx for some hw features. so add this limitation. Reviewed-by: Christian König Signed-off-by: Rex Zhu Signed-off-by: Alex Deucher commit 31edd7c0a813d9dc778fcb5da1eb8202c140dc4d Author: Tiecheng Zhou Date: Fri Dec 7 09:11:35 2018 +0800 drm/amdgpu: bypass RLC init under sriov for Tonga (v2) RLC will go wrong in soft_reset under sriov Workaroound: only need to init RLC csb, and skip RLC stop, reset, start this is because host-driver has already done full initialization on RLC v2: squash in build fix Signed-off-by: Tiecehng Zhou Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 05d9fcbcf402fa4dd219ffeeb341d1b48d75404c Author: Corentin Labbe Date: Mon Dec 10 19:45:54 2018 +0000 MAINTAINERS: add drivers/soc/amlogic/ to amlogic list While sending a patch for drivers/soc/amlogic/Kconfig, I saw that getmaintainer.pl give nobody for it. This patchs adds drivers/soc/amlogic/ to amlogic maintainers. Signed-off-by: Corentin Labbe Signed-off-by: Kevin Hilman commit f56c06271c1c3caef9c7ef200e3d89967fd98a8e Author: Corentin Labbe Date: Mon Dec 10 19:45:55 2018 +0000 soc: amlogic: meson-clk-measure: Add missing REGMAP_MMIO dependency This patchs adds a missing dependency on REGMAP_MMIO. This cause the following build failure on SPARC: drivers/soc/amlogic/meson-clk-measure.o: In function `meson_msr_probe': meson-clk-measure.c:(.text+0xc4): undefined reference to `__devm_regmap_init_mmio_clk' Signed-off-by: Corentin Labbe Signed-off-by: Kevin Hilman commit c4f7bd4a42758ed42cf7f7a5fd46e0b54ce23ad2 Author: Jacek Anaszewski Date: Mon Dec 10 10:29:57 2018 +0100 led: triggers: Break the for loop after default trigger is found It is of no avail to continue iterating through registered triggers in the led_trigger_set_default() after the trigger to set has been found. Add "break" statement to fix this omission. Signed-off-by: Jacek Anaszewski Acked-by: Pavel Machek Signed-off-by: Krzysztof Kozlowski commit d8ed257f313f64e9835e61d1365dea95a0a1c9c6 Author: Eric Dumazet Date: Mon Dec 10 06:10:02 2018 -0800 tcp: handle EOR and FIN conditions the same in tcp_tso_should_defer() In commit f9bfe4e6a9d0 ("tcp: lack of available data can also cause TSO defer") we moved the test in tcp_tso_should_defer() for packets with a FIN flag, and we mentioned that the same would be done later for EOR flag. Both flags should be handled at the same time, after all other heuristics have been considered. They both mean that no more bytes can be added to this skb by an application. Signed-off-by: Eric Dumazet Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller commit c535293f6351c7047fdaebde4d8b0f665a98a481 Merge: 4e6feb7adb9a6 924352c3d6347 Author: David S. Miller Date: Mon Dec 10 12:07:56 2018 -0800 Merge branch 'dsa-ksz-Add-reset-GPIO-handling' Marek Vasut says: ==================== net: dsa: ksz: Add reset GPIO handling Add code to handle optional reset GPIO in the KSZ switch driver and a matching DT property adjustments. ==================== Signed-off-by: David S. Miller commit 924352c3d6347d96528cebcef9461cebe928c117 Author: Marek Vasut Date: Mon Dec 10 14:43:06 2018 +0100 net: dsa: ksz: Add reset GPIO handling Add code to handle optional reset GPIO in the KSZ switch driver. The switch has a reset GPIO line which can be controlled by the CPU, so make sure it is configured correctly in such setups. Signed-off-by: Marek Vasut Cc: Vivien Didelot Cc: Woojung Huh Cc: David S. Miller Cc: Tristram Ha Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit a324d6e454aa986d64cb650caa8ed7150023b3f3 Author: Marek Vasut Date: Mon Dec 10 14:43:05 2018 +0100 net: dsa: ksz: Add optional reset GPIO to Microchip KSZ switch binding Add optional reset GPIO, as such a signal is available on the KSZ switches. Signed-off-by: Marek Vasut Cc: Andrew Lunn Cc: Florian Fainelli Cc: Woojung Huh Cc: David S. Miller Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 4e6feb7adb9a69e51271eae4715d546507c1e998 Author: Yangtao Li Date: Mon Dec 10 11:08:45 2018 -0500 bonding: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: David S. Miller commit a93f5b56962538b85aa0594492aa27d539295d5e Author: Yangtao Li Date: Mon Dec 10 10:57:38 2018 -0500 fjes: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: David S. Miller commit 5061e3f43b7da28e1fe13c300b66fc5a4f98b0e8 Author: Yangtao Li Date: Mon Dec 10 10:53:29 2018 -0500 net: xenbus: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Acked-by: Wei Liu Signed-off-by: David S. Miller commit f578e6764958704960e78daf624887da1d3e6d90 Author: Yangtao Li Date: Mon Dec 10 10:46:03 2018 -0500 ieee802154: at86rf230: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: David S. Miller commit b1dd054dbb72551d42686862f935f96c3e2a53ea Author: YueHaibing Date: Mon Dec 10 19:25:38 2018 +0800 ipvlan: Remove a useless comparison Fix following gcc warning: drivers/net/ipvlan/ipvlan_main.c:543:12: warning: comparison is always false due to limited range of data type [-Wtype-limits] 'mode' is a u16 variable, IPVLAN_MODE_L2 is zero, the comparison is always false Signed-off-by: YueHaibing Signed-off-by: David S. Miller commit c1c8c27701b8fcc0cbbe4af0f9304df466b0123e Author: Colin Ian King Date: Mon Dec 10 09:29:48 2018 +0000 net: hns3: fix spelling mistake "offser" -> "offset" There is a spelling mistake in a msg string, fix this. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit f071bcebee0ad2d8c3e22736210110523fb4b692 Author: Stephen Boyd Date: Wed Nov 21 12:39:44 2018 -0800 clk: qcom: Move to menuconfig and reduce lines We duplicate the 'depends on' in almost every Kconfig here, and it's getting out of hand now that we have tens of options for various SoC drivers here. Let's clean it up a little by making a menuconfig for a submenu and adding an if wrapper around the driver section. Cc: Bjorn Andersson Cc: Taniya Das Signed-off-by: Stephen Boyd commit 3cc48976e9763209ccf0ccc47c8e3e5fc464c557 Author: Lucas Stach Date: Thu Nov 15 15:30:28 2018 +0100 clk: imx6q: handle ENET PLL bypass The ENET PLL is different from the other i.MX6 PLLs, as it has multiple outputs with different post-dividers, which are all bypassed if the single bypass bit is activated. The hardware setup looks something like this: _ refclk-o---PLL---o----DIV1-----| \ | | |M |----OUT1 o-----------------------|_/ | | _ | o----DIV2-----| \ | | |M |----OUT2 o-----------------------|_/ | | _ | `----DIV3-----| \ | |M |----OUT3 `-----------------------|_/ The bypass bit not only bypasses the PLL, but also the attached post-dividers. This would be reasonbly straight forward to model with a single output, or with different bypass bits for each output, but sadly the HW guys decided that it would be good to actuate all 3 muxes with a single bit. So the need to have the PLL bypassed for one of the outputs always affects 2 other (in our model) independent branches of the clock tree. This means the decision to bypass this PLL is a system wide design choice and should not be changed on-the-fly, so we can treat any bapass configuration as static. As such we can just register the post-dividiers with a ratio that reflects the bypass status, which allows us to bypass the PLL without breaking our abstraction model and with it DT stability. Signed-off-by: Lucas Stach Signed-off-by: Stephen Boyd commit a29be9185d195bf5abd5ff5482a26800d58bac19 Author: Lucas Stach Date: Thu Nov 15 15:30:27 2018 +0100 clk: imx6q: optionally get CCM inputs via standard clock handles When specifying external clock inputs to the CCM the current code requires the clocks to be in a "clocks" child node of the DT root. This is not really conformant with DT best practices. To avoid the need to deviate from those best practices, allow the clock inputs to be specified via standard clock handles. This is in line with how drivers of the later CCM driver revisions on newer i.MX SoCs handle this. As we can't retroactively change the DT binding, allow this as an option with a fallback to the old way of how this has been handled. Signed-off-by: Lucas Stach Acked-by: Rob Herring Reviewed-by: Dong Aisheng Signed-off-by: Stephen Boyd commit f7542d817733f461258fd3a47d77da35b2d9fc81 Author: Lucas Stach Date: Thu Nov 15 15:30:26 2018 +0100 clk: imx6q: reset exclusive gates on init The exclusive gates may be set up in the wrong way by software running before the clock driver comes up. In that case the exclusive setup is locked in its initial state, as the complementary function can't be activated without disabling the initial setup first. To avoid this lock situation, reset the exclusive gates to the off state and allow the kernel to provide the proper setup. Signed-off-by: Lucas Stach Reviewed-by: Dong Aisheng Signed-off-by: Stephen Boyd commit 929914946fa615889d176568b175984e5128e0a3 Author: Anson Huang Date: Fri Nov 30 06:31:40 2018 +0000 clk: imx6q: add DCICx clocks gate On i.MX6QP/i.MX6Q/i.MX6DL, there are DCIC1/DCIC2 clocks gate in CCM_CCGR0 register, add them into clock tree for clock management. Signed-off-by: Anson Huang Signed-off-by: Stephen Boyd commit 0efcc2c0fd2001a83240a8c3d71f67770484917e Author: Anson Huang Date: Fri Nov 30 07:23:47 2018 +0000 clk: imx6sl: ensure MMDC CH0 handshake is bypassed Same as other i.MX6 SoCs, ensure unused MMDC channel's handshake is bypassed, this is to make sure no request signal will be generated when periphe_clk_sel is changed or SRC warm reset is triggered. Signed-off-by: Anson Huang Signed-off-by: Stephen Boyd commit 4a1daf29d33d766a1a6f03015b93bfb01b93f46e Author: Will Deacon Date: Mon Dec 10 19:20:23 2018 +0000 arm64: mm: EXPORT vabits_user to modules TASK_SIZE is defined using the vabits_user variable for 64-bit tasks, so ensure that this variable is exported to modules to avoid the following build breakage with allmodconfig: | ERROR: "vabits_user" [lib/test_user_copy.ko] undefined! | ERROR: "vabits_user" [drivers/misc/lkdtm/lkdtm.ko] undefined! | ERROR: "vabits_user" [drivers/infiniband/hw/mlx5/mlx5_ib.ko] undefined! Signed-off-by: Will Deacon commit 67ee606a6bbb5ed2df86e968b6d0d60ad6c60b76 Author: Jernej Skrabec Date: Sat Dec 8 19:02:22 2018 +0100 clk: sunxi-ng: a64: Allow parent change for VE clock Cedrus driver wants to set VE clock higher than it's possible without changing parent rate. Allow changing parent rate for VE clock, so clock rate can be set freely. Signed-off-by: Jernej Skrabec Acked-by: Maxime Ripard Signed-off-by: Stephen Boyd commit d34664f63bba9c884920d86ab67379a08a4ee8e9 Merge: bc84a2d106bea 394135c1ff13e Author: Will Deacon Date: Mon Dec 10 18:57:17 2018 +0000 Merge branch 'for-next/kexec' into aarch64/for-next/core Merge in kexec_file_load() support from Akashi Takahiro. commit bc84a2d106beab6000223b569c3bcb9ebf49d9ec Merge: f357b3a7e17af a457b0f7f50d4 Author: Will Deacon Date: Mon Dec 10 18:53:03 2018 +0000 Merge branch 'kvm/cortex-a76-erratum-1165522' into aarch64/for-next/core Pull in KVM workaround for A76 erratum #116522. Conflicts: arch/arm64/include/asm/cpucaps.h commit f357b3a7e17af7736d67d8267edc1ed3d1dd9391 Author: Suzuki K Poulose Date: Mon Dec 10 18:07:33 2018 +0000 arm64: smp: Handle errors reported by the firmware The __cpu_up() routine ignores the errors reported by the firmware for a CPU bringup operation and looks for the error status set by the booting CPU. If the CPU never entered the kernel, we could end up in assuming stale error status, which otherwise would have been set/cleared appropriately by the booting CPU. Reported-by: Steve Capper Cc: Will Deacon Signed-off-by: Suzuki K Poulose Signed-off-by: Will Deacon commit 66f16a24512fa44680504effe908df8326885594 Author: Will Deacon Date: Mon Dec 10 14:21:13 2018 +0000 arm64: smp: Rework early feature mismatched detection Rather than add additional variables to detect specific early feature mismatches with secondary CPUs, we can instead dedicate the upper bits of the CPU boot status word to flag specific mismatches. This allows us to communicate both granule and VA-size mismatches back to the primary CPU without the need for additional book-keeping. Tested-by: Steve Capper Signed-off-by: Will Deacon commit 68d23da4373aba76f5300017c4746440f276698e Author: Will Deacon Date: Mon Dec 10 14:15:15 2018 +0000 arm64: Kconfig: Re-jig CONFIG options for 52-bit VA Enabling 52-bit VAs for userspace is pretty confusing, since it requires you to select "48-bit" virtual addressing in the Kconfig. Rework the logic so that 52-bit user virtual addressing is advertised in the "Virtual address space size" choice, along with some help text to describe its interaction with Pointer Authentication. The EXPERT-only option to force all user mappings to the 52-bit range is then made available immediately below the VA size selection. Signed-off-by: Will Deacon commit b9567720a1b8e739380e0241413606c056c57859 Author: Steve Capper Date: Thu Dec 6 22:50:42 2018 +0000 arm64: mm: Allow forcing all userspace addresses to 52-bit On arm64 52-bit VAs are provided to userspace when a hint is supplied to mmap. This helps maintain compatibility with software that expects at most 48-bit VAs to be returned. In order to help identify software that has 48-bit VA assumptions, this patch allows one to compile a kernel where 52-bit VAs are returned by default on HW that supports it. This feature is intended to be for development systems only. Signed-off-by: Steve Capper Acked-by: Catalin Marinas Signed-off-by: Will Deacon commit 67e7fdfcc6824a4f768d76d89377b33baad58fad Author: Steve Capper Date: Thu Dec 6 22:50:41 2018 +0000 arm64: mm: introduce 52-bit userspace support On arm64 there is optional support for a 52-bit virtual address space. To exploit this one has to be running with a 64KB page size and be running on hardware that supports this. For an arm64 kernel supporting a 48 bit VA with a 64KB page size, some changes are needed to support a 52-bit userspace: * TCR_EL1.T0SZ needs to be 12 instead of 16, * TASK_SIZE needs to reflect the new size. This patch implements the above when the support for 52-bit VAs is detected at early boot time. On arm64 userspace addresses translation is controlled by TTBR0_EL1. As well as userspace, TTBR0_EL1 controls: * The identity mapping, * EFI runtime code. It is possible to run a kernel with an identity mapping that has a larger VA size than userspace (and for this case __cpu_set_tcr_t0sz() would set TCR_EL1.T0SZ as appropriate). However, when the conditions for 52-bit userspace are met; it is possible to keep TCR_EL1.T0SZ fixed at 12. Thus in this patch, the TCR_EL1.T0SZ size changing logic is disabled. Reviewed-by: Catalin Marinas Signed-off-by: Steve Capper Signed-off-by: Will Deacon commit a96a33b1ca57dbea4285893dedf290aeb8eb090b Author: Steve Capper Date: Thu Dec 6 22:50:40 2018 +0000 arm64: mm: Prevent mismatched 52-bit VA support For cases where there is a mismatch in ARMv8.2-LVA support between CPUs we have to be careful in allowing secondary CPUs to boot if 52-bit virtual addresses have already been enabled on the boot CPU. This patch adds code to the secondary startup path. If the boot CPU has enabled 52-bit VAs then ID_AA64MMFR2_EL1 is checked to see if the secondary can also enable 52-bit support. If not, the secondary is prevented from booting and an error message is displayed indicating why. Technically this patch could be implemented using the cpufeature code when considering 52-bit userspace support. However, we employ low level checks here as the cpufeature code won't be able to run if we have mismatched 52-bit kernel va support. Signed-off-by: Steve Capper Signed-off-by: Will Deacon commit e842dfb5a2d3b4c43766508ef89a4eb67471d53a Author: Steve Capper Date: Thu Dec 6 22:50:39 2018 +0000 arm64: mm: Offset TTBR1 to allow 52-bit PTRS_PER_PGD Enabling 52-bit VAs on arm64 requires that the PGD table expands from 64 entries (for the 48-bit case) to 1024 entries. This quantity, PTRS_PER_PGD is used as follows to compute which PGD entry corresponds to a given virtual address, addr: pgd_index(addr) -> (addr >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1) Userspace addresses are prefixed by 0's, so for a 48-bit userspace address, uva, the following is true: (uva >> PGDIR_SHIFT) & (1024 - 1) == (uva >> PGDIR_SHIFT) & (64 - 1) In other words, a 48-bit userspace address will have the same pgd_index when using PTRS_PER_PGD = 64 and 1024. Kernel addresses are prefixed by 1's so, given a 48-bit kernel address, kva, we have the following inequality: (kva >> PGDIR_SHIFT) & (1024 - 1) != (kva >> PGDIR_SHIFT) & (64 - 1) In other words a 48-bit kernel virtual address will have a different pgd_index when using PTRS_PER_PGD = 64 and 1024. If, however, we note that: kva = 0xFFFF << 48 + lower (where lower[63:48] == 0b) and, PGDIR_SHIFT = 42 (as we are dealing with 64KB PAGE_SIZE) We can consider: (kva >> PGDIR_SHIFT) & (1024 - 1) - (kva >> PGDIR_SHIFT) & (64 - 1) = (0xFFFF << 6) & 0x3FF - (0xFFFF << 6) & 0x3F // "lower" cancels out = 0x3C0 In other words, one can switch PTRS_PER_PGD to the 52-bit value globally provided that they increment ttbr1_el1 by 0x3C0 * 8 = 0x1E00 bytes when running with 48-bit kernel VAs (TCR_EL1.T1SZ = 16). For kernel configuration where 52-bit userspace VAs are possible, this patch offsets ttbr1_el1 and sets PTRS_PER_PGD corresponding to the 52-bit value. Reviewed-by: Catalin Marinas Reviewed-by: Suzuki K Poulose Suggested-by: Catalin Marinas Signed-off-by: Steve Capper [will: added comment to TTBR1_BADDR_4852_OFFSET calculation] Signed-off-by: Will Deacon commit e5d99157459f79ed26953e8a77addb9d3e0122b7 Author: Steve Capper Date: Thu Dec 6 22:50:38 2018 +0000 arm64: mm: Define arch_get_mmap_end, arch_get_mmap_base Now that we have DEFAULT_MAP_WINDOW defined, we can arch_get_mmap_end and arch_get_mmap_base helpers to allow for high addresses in mmap. Signed-off-by: Steve Capper Reviewed-by: Catalin Marinas Signed-off-by: Will Deacon commit 363524d2b12270d86677e1154ecc1c5061f43219 Author: Steve Capper Date: Thu Dec 6 22:50:37 2018 +0000 arm64: mm: Introduce DEFAULT_MAP_WINDOW We wish to introduce a 52-bit virtual address space for userspace but maintain compatibility with software that assumes the maximum VA space size is 48 bit. In order to achieve this, on 52-bit VA systems, we make mmap behave as if it were running on a 48-bit VA system (unless userspace explicitly requests a VA where addr[51:48] != 0). On a system running a 52-bit userspace we need TASK_SIZE to represent the 52-bit limit as it is used in various places to distinguish between kernelspace and userspace addresses. Thus we need a new limit for mmap, stack, ELF loader and EFI (which uses TTBR0) to represent the non-extended VA space. This patch introduces DEFAULT_MAP_WINDOW and DEFAULT_MAP_WINDOW_64 and switches the appropriate logic to use that instead of TASK_SIZE. Signed-off-by: Steve Capper Reviewed-by: Catalin Marinas Signed-off-by: Will Deacon commit f6795053dac8d4d2f90d4a98842dd6d2ccd544ad Author: Steve Capper Date: Thu Dec 6 22:50:36 2018 +0000 mm: mmap: Allow for "high" userspace addresses This patch adds support for "high" userspace addresses that are optionally supported on the system and have to be requested via a hint mechanism ("high" addr parameter to mmap). Architectures such as powerpc and x86 achieve this by making changes to their architectural versions of arch_get_unmapped_* functions. However, on arm64 we use the generic versions of these functions. Rather than duplicate the generic arch_get_unmapped_* implementations for arm64, this patch instead introduces two architectural helper macros and applies them to arch_get_unmapped_*: arch_get_mmap_end(addr) - get mmap upper limit depending on addr hint arch_get_mmap_base(addr, base) - get mmap_base depending on addr hint If these macros are not defined in architectural code then they default to (TASK_SIZE) and (base) so should not introduce any behavioural changes to architectures that do not define them. Signed-off-by: Steve Capper Reviewed-by: Catalin Marinas Acked-by: Andrew Morton Signed-off-by: Will Deacon commit 9f83cfdb1ace3ef268ecc6fda50058d2ec37d603 Author: Sergei Shtylyov Date: Sat Nov 24 21:14:16 2018 +0300 sata_rcar: fix deferred probing The driver overrides the error codes returned by platform_get_irq() to -EINVAL, so if it returns -EPROBE_DEFER, the driver would fail the probe permanently instead of the deferred probing. Switch to propagating the error code upstream, still checking/overriding IRQ0 as libata regards it as "no IRQ" (thus polling) anyway... Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq") Reviewed-by: Simon Horman Reviewed-by: Geert Uytterhoeven Signed-off-by: Sergei Shtylyov Signed-off-by: Jens Axboe commit b708a3cc9600390ccaa2b68a88087dd265154b2b Author: Dmitry V. Levin Date: Mon Dec 10 02:00:47 2018 +0300 selftests: do not macro-expand failed assertion expressions I've stumbled over the current macro-expand behaviour of the test harness: $ gcc -Wall -xc - <<'__EOF__' TEST(macro) { int status = 0; ASSERT_TRUE(WIFSIGNALED(status)); } TEST_HARNESS_MAIN __EOF__ $ ./a.out [==========] Running 1 tests from 1 test cases. [ RUN ] global.macro :4:global.macro:Expected 0 (0) != (((signed char) (((status) & 0x7f) + 1) >> 1) > 0) (0) global.macro: Test terminated by assertion [ FAIL ] global.macro [==========] 0 / 1 tests passed. [ FAILED ] With this change the output of the same test looks much more comprehensible: [==========] Running 1 tests from 1 test cases. [ RUN ] global.macro :4:global.macro:Expected 0 (0) != WIFSIGNALED(status) (0) global.macro: Test terminated by assertion [ FAIL ] global.macro [==========] 0 / 1 tests passed. [ FAILED ] The issue is very similar to the bug fixed in glibc assert(3) three years ago: https://sourceware.org/bugzilla/show_bug.cgi?id=18604 Cc: Shuah Khan Cc: Kees Cook Cc: Andy Lutomirski Cc: Will Drewry Cc: linux-kselftest@vger.kernel.org Signed-off-by: Dmitry V. Levin Acked-by: Kees Cook Signed-off-by: Shuah Khan commit 33e7a8422546b5cd65d4af4dfe4ed92ea543d8df Author: Colin Ian King Date: Sun Dec 9 15:08:32 2018 +0000 clk: imx: remove redundant initialization of ret to zero The initialization of ret is redundant as it is being re-assigned to the return value from the call to imx8m_clk_composite_compute_dividers. Clean this up by removing the initialization. Signed-off-by: Colin Ian King Signed-off-by: Stephen Boyd commit 6e8830674ea77f57d57a33cca09083b117a71f41 Author: Qian Cai Date: Fri Dec 7 17:34:49 2018 -0500 arm64: kasan: Increase stack size for KASAN_EXTRA If the kernel is configured with KASAN_EXTRA, the stack size is increased significantly due to setting the GCC -fstack-reuse option to "none" [1]. As a result, it can trigger a stack overrun quite often with 32k stack size compiled using GCC 8. For example, this reproducer https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/madvise/madvise06.c can trigger a "corrupted stack end detected inside scheduler" very reliably with CONFIG_SCHED_STACK_END_CHECK enabled. There are other reports at: https://lore.kernel.org/lkml/1542144497.12945.29.camel@gmx.us/ https://lore.kernel.org/lkml/721E7B42-2D55-4866-9C1A-3E8D64F33F9C@gmx.us/ There are just too many functions that could have a large stack with KASAN_EXTRA due to large local variables that have been called over and over again without being able to reuse the stacks. Some noticiable ones are, size 7536 shrink_inactive_list 7440 shrink_page_list 6560 fscache_stats_show 3920 jbd2_journal_commit_transaction 3216 try_to_unmap_one 3072 migrate_page_move_mapping 3584 migrate_misplaced_transhuge_page 3920 ip_vs_lblcr_schedule 4304 lpfc_nvme_info_show 3888 lpfc_debugfs_nvmestat_data.constprop There are other 49 functions over 2k in size while compiling kernel with "-Wframe-larger-than=" on this machine. Hence, it is too much work to change Makefiles for each object to compile without -fsanitize-address-use-after-scope individually. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715#c23 Signed-off-by: Qian Cai Signed-off-by: Will Deacon commit e434b8cdf788568ba65a0a0fd9f3cb41f3ca1803 Author: Jiong Wang Date: Fri Dec 7 12:16:18 2018 -0500 bpf: relax verifier restriction on BPF_MOV | BPF_ALU Currently, the destination register is marked as unknown for 32-bit sub-register move (BPF_MOV | BPF_ALU) whenever the source register type is SCALAR_VALUE. This is too conservative that some valid cases will be rejected. Especially, this may turn a constant scalar value into unknown value that could break some assumptions of verifier. For example, test_l4lb_noinline.c has the following C code: struct real_definition *dst 1: if (!get_packet_dst(&dst, &pckt, vip_info, is_ipv6)) 2: return TC_ACT_SHOT; 3: 4: if (dst->flags & F_IPV6) { get_packet_dst is responsible for initializing "dst" into valid pointer and return true (1), otherwise return false (0). The compiled instruction sequence using alu32 will be: 412: (54) (u32) r7 &= (u32) 1 413: (bc) (u32) r0 = (u32) r7 414: (95) exit insn 413, a BPF_MOV | BPF_ALU, however will turn r0 into unknown value even r7 contains SCALAR_VALUE 1. This causes trouble when verifier is walking the code path that hasn't initialized "dst" inside get_packet_dst, for which case 0 is returned and we would then expect verifier concluding line 1 in the above C code pass the "if" check, therefore would skip fall through path starting at line 4. Now, because r0 returned from callee has became unknown value, so verifier won't skip analyzing path starting at line 4 and "dst->flags" requires dereferencing the pointer "dst" which actually hasn't be initialized for this path. This patch relaxed the code marking sub-register move destination. For a SCALAR_VALUE, it is safe to just copy the value from source then truncate it into 32-bit. A unit test also included to demonstrate this issue. This test will fail before this patch. This relaxation could let verifier skipping more paths for conditional comparison against immediate. It also let verifier recording a more accurate/strict value for one register at one state, if this state end up with going through exit without rejection and it is used for state comparison later, then it is possible an inaccurate/permissive value is better. So the real impact on verifier processed insn number is complex. But in all, without this fix, valid program could be rejected. >From real benchmarking on kernel selftests and Cilium bpf tests, there is no impact on processed instruction number when tests ares compiled with default compilation options. There is slightly improvements when they are compiled with -mattr=+alu32 after this patch. Also, test_xdp_noinline/-mattr=+alu32 now passed verification. It is rejected before this fix. Insn processed before/after this patch: default -mattr=+alu32 Kernel selftest === test_xdp.o 371/371 369/369 test_l4lb.o 6345/6345 5623/5623 test_xdp_noinline.o 2971/2971 rejected/2727 test_tcp_estates.o 429/429 430/430 Cilium bpf === bpf_lb-DLB_L3.o: 2085/2085 1685/1687 bpf_lb-DLB_L4.o: 2287/2287 1986/1982 bpf_lb-DUNKNOWN.o: 690/690 622/622 bpf_lxc.o: 95033/95033 N/A bpf_netdev.o: 7245/7245 N/A bpf_overlay.o: 2898/2898 3085/2947 NOTE: - bpf_lxc.o and bpf_netdev.o compiled by -mattr=+alu32 are rejected by verifier due to another issue inside verifier on supporting alu32 binary. - Each cilium bpf program could generate several processed insn number, above number is sum of them. v1->v2: - Restrict the change on SCALAR_VALUE. - Update benchmark numbers on Cilium bpf tests. Signed-off-by: Jiong Wang Signed-off-by: Alexei Starovoitov commit 45fe439bc3699851802062c05acf4cbac4d672bc Author: Steven Rostedt (VMware) Date: Fri Dec 7 12:25:52 2018 -0500 fgraph: Add comment to describe ftrace_graph_get_ret_stack The ret_stack should not be accessed directly via the curr_ret_stack variable on the task_struct. This is because the ret_stack is going to be converted into a series of longs and not an array of ret_stack structures. The way that a ret_stack should be retrieved is via the ftrace_graph_get_ret_stack structure, but it needs to be documented on how to use it. Signed-off-by: Steven Rostedt (VMware) commit e4c07bf9867aeaec14bac042fbbd50d885f6ed3a Author: Steven Rostedt (VMware) Date: Wed Dec 5 12:48:54 2018 -0500 arm64: ftrace: Set FTRACE_MAY_SLEEP before ftrace_modify_all_code() It has been reported that ftrace_replace_code() which is called by ftrace_modify_all_code() can cause a soft lockup warning for an allmodconfig kernel. This is because all the debug options enabled causes the loop in ftrace_replace_code() (which loops over all the functions being enabled where there can be 10s of thousands), is too slow, and never schedules out. To solve this, setting FTRACE_MAY_SLEEP to the command passed into ftrace_replace_code() will make it call cond_resched() in the loop, which prevents the soft lockup warning from triggering. Link: http://lkml.kernel.org/r/20181204192903.8193-1-anders.roxell@linaro.org Link: http://lkml.kernel.org/r/20181205183304.000714627@goodmis.org Acked-by: Will Deacon Reported-by: Anders Roxell Tested-by: Anders Roxell Signed-off-by: Steven Rostedt (VMware) commit a0572f687fb3c46e15554f4789797a077cc393b4 Author: Steven Rostedt (VMware) Date: Wed Dec 5 12:48:53 2018 -0500 ftrace: Allow ftrace_replace_code() to be schedulable The function ftrace_replace_code() is the ftrace engine that does the work to modify all the nops into the calls to the function callback in all the functions being traced. The generic version which is normally called from stop machine, but an architecture can implement a non stop machine version and still use the generic ftrace_replace_code(). When an architecture does this, ftrace_replace_code() may be called from a schedulable context, where it can allow the code to be preemptible, and schedule out. In order to allow an architecture to make ftrace_replace_code() schedulable, a new command flag is added called: FTRACE_MAY_SLEEP Which can be or'd to the command that is passed to ftrace_modify_all_code() that calls ftrace_replace_code() and will have it call cond_resched() in the loop that modifies the nops into the calls to the ftrace trampolines. Link: http://lkml.kernel.org/r/20181204192903.8193-1-anders.roxell@linaro.org Link: http://lkml.kernel.org/r/20181205183303.828422192@goodmis.org Reported-by: Anders Roxell Tested-by: Anders Roxell Signed-off-by: Steven Rostedt (VMware) commit dbc3f042fbc8d75392b128af0eafbcf357733dd6 Author: Masami Hiramatsu Date: Mon Nov 5 18:05:26 2018 +0900 selftests/ftrace: Add testcases for dynamic event Add common testcases for dynamic_events interface. - Add/remove kprobe events via dynamic_events - Add/remove synthetic events via dynamic_events - Selective clear events (clear events other interfaces) - Genelic clear events ("!LINE" syntax) Link: http://lkml.kernel.org/r/154140872590.17322.10394440849261743052.stgit@devbox Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 1ce25e9f6fff7633955e8ce776e5e9d7a780d34b Author: Masami Hiramatsu Date: Mon Nov 5 18:04:57 2018 +0900 tracing: Add generic event-name based remove event method Add a generic method to remove event from dynamic event list. This is same as other system under ftrace. You just need to pass the event name with '!', e.g. # echo p:new_grp/new_event _do_fork > dynamic_events This creates an event, and # echo '!p:new_grp/new_event _do_fork' > dynamic_events Or, # echo '!p:new_grp/new_event' > dynamic_events will remove new_grp/new_event event. Note that this doesn't check the event prefix (e.g. "p:") strictly, because the "group/event" name must be unique. Link: http://lkml.kernel.org/r/154140869774.17322.8887303560398645347.stgit@devbox Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 7e1413edd6194a9807aa5f3ac0378b9b4b9da879 Author: Steven Rostedt (VMware) Date: Tue Dec 4 13:35:45 2018 -0500 tracing: Consolidate trace_add/remove_event_call back to the nolock functions The trace_add/remove_event_call_nolock() functions were added to allow the tace_add/remove_event_call() code be called when the event_mutex lock was already taken. Now that all callers are done within the event_mutex, there's no reason to have two different interfaces. Remove the current wrapper trace_add/remove_event_call()s and rename the _nolock versions back to the original names. Link: http://lkml.kernel.org/r/154140866955.17322.2081425494660638846.stgit@devbox Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 5fd98eb7e8ce0f7d7e4f3c138e5b46fc98389804 Author: Masahiro Yamada Date: Wed Nov 28 11:42:30 2018 +0900 ARM: dts: uniphier: add MIO DMAC nodes Add MIO-DMAC (Media IO DMA Controller) nodes, and use them as the DMA engine of SD/eMMC controllers. Signed-off-by: Masahiro Yamada commit 072ae88ad2f60cbe95bec147892046df3f195d79 Author: Viresh Kumar Date: Fri Nov 16 15:34:33 2018 +0530 arm64: dts: uniphier: Add all CPUs in cooling maps Each CPU can (and does) participate in cooling down the system but the DT only captures a handful of them, normally CPU0, in the cooling maps. Things work by chance currently as under normal circumstances its the first CPU of each cluster which is used by the operating systems to probe the cooling devices. But as soon as this CPU ordering changes and any other CPU is used to bring up the cooling device, we will start seeing failures. Also the DT is rather incomplete when we list only one CPU in the cooling maps, as the hardware doesn't have any such limitations. Update cooling maps to include all devices affected by individual trip points. Signed-off-by: Viresh Kumar Signed-off-by: Masahiro Yamada commit 7f63196eaa83e033de523602324ff91288390a67 Author: Zhuohao Lee Date: Mon Dec 10 12:32:13 2018 +0800 ASoC: Intel: kbl_da7219_max98927: fix the audio jack button remapping From the da7219 spec, the button A, B, C and D are remapped to 0, 1, 2 and 3 respectively where button A is KEY_PLAYPAUSE, B is KEY_VOLUMEUP, C is KEY_VOLUMEDOWN and D is KEY_VOICECOMMAND. Signed-off-by: Zhuohao Lee Signed-off-by: Max Chang Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 02e5af6575627ca0692d5b93e7c3fc3b86f62f40 Author: Hans de Goede Date: Sat Dec 8 14:01:14 2018 +0100 ASoC: Intel: bytcr_rt5640: Add quirk for the Point of View Mobii TAB-P1005W-232 Add a quirk for the Point of View Mobii TAB-P1005W-232 v2.0 tablet, this BYTCR device uses IN1 for its MIC and JD2 for jack-detect, rather then the default IN3 and JD1. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 271248f4c2bf56dc6b3582e37c7ac19dd483d989 Author: Hans de Goede Date: Sat Dec 8 14:01:13 2018 +0100 ASoC: Intel: bytcr_rt5640: Add quirk for the Prowise PT301 tablet Add a quirk for the Prowise PT301 tablet, this BYTCR tablet has no CHAN package in its ACPI tables and uses SSP0-AIF1 rather then SSP0-AIF2 which is the default for BYTCR devices. Also it uses IN1 for its MIC and JD2 for jack-detect, rather then the default IN3 and JD1. Signed-off-by: Hans de Goede Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown commit 6f75723190d88e1319bea623bfe0292bf3917965 Author: Mikulas Patocka Date: Thu Dec 6 11:41:22 2018 -0500 dm: remove the pending IO accounting Remove the "pending" atomic counters, that duplicate block-core's in_flight counters, and update md_in_flight() to look at percpu in_flight counters. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Jens Axboe commit e016b78201a2d9ff40f3f0da072292689af24c7f Author: Mikulas Patocka Date: Thu Dec 6 11:41:21 2018 -0500 block: return just one value from part_in_flight The previous patches deleted all the code that needed the second value returned from part_in_flight - now the kernel only uses the first value. Consequently, part_in_flight (and blk_mq_in_flight) may be changed so that it only returns one value. This patch just refactors the code, there's no functional change. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Jens Axboe commit 1226b8dd0e91331cfab500f305b2c264445a0392 Author: Mikulas Patocka Date: Thu Dec 6 11:41:20 2018 -0500 block: switch to per-cpu in-flight counters Now when part_round_stats is gone, we can switch to per-cpu in-flight counters. We use the local-atomic type local_t, so that if part_inc_in_flight or part_dec_in_flight is reentrantly called from an interrupt, the value will be correct. The other counters could be corrupted due to reentrant interrupt, but the corruption only results in slight counter skew - the in_flight counter must be exact, so it needs local_t. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Jens Axboe commit 5b18b5a737600fd20ba2045f320d5926ebbf341a Author: Mikulas Patocka Date: Thu Dec 6 11:41:19 2018 -0500 block: delete part_round_stats and switch to less precise counting We want to convert to per-cpu in_flight counters. The function part_round_stats needs the in_flight counter every jiffy, it would be too costly to sum all the percpu variables every jiffy, so it must be deleted. part_round_stats is used to calculate two counters - time_in_queue and io_ticks. time_in_queue can be calculated without part_round_stats, by adding the duration of the I/O when the I/O ends (the value is almost as exact as the previously calculated value, except that time for in-progress I/Os is not counted). io_ticks can be approximated by increasing the value when I/O is started or ended and the jiffies value has changed. If the I/Os take less than a jiffy, the value is as exact as the previously calculated value. If the I/Os take more than a jiffy, io_ticks can drift behind the previously calculated value. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Jens Axboe commit 112f158f66cbe25fd561a5dfe9c3826e06abf757 Author: Mike Snitzer Date: Thu Dec 6 11:41:18 2018 -0500 block: stop passing 'cpu' to all percpu stats methods All of part_stat_* and related methods are used with preempt disabled, so there is no need to pass cpu around to allow of them. Just call smp_processor_id() as needed. Suggested-by: Jens Axboe Signed-off-by: Mike Snitzer Signed-off-by: Jens Axboe commit dbd3bbd291a03f1383de6242e7999e8487cb869b Author: Mike Snitzer Date: Thu Dec 6 11:41:17 2018 -0500 dm rq: leverage blk_mq_queue_busy() to check for outstanding IO Now that request-based dm-multipath only supports blk-mq, make use of the newly introduced blk_mq_queue_busy() to check for outstanding IO -- rather than (ab)using the block core's in_flight counters. Signed-off-by: Mike Snitzer Signed-off-by: Jens Axboe commit 80a787ba3809deb694ee632919badb73890daf05 Author: Mikulas Patocka Date: Thu Dec 6 11:41:16 2018 -0500 dm: dont rewrite dm_disk(md)->part0.in_flight generic_start_io_acct and generic_end_io_acct already update the variable in_flight using atomic operations, so we don't have to overwrite them again. Signed-off-by: Mikulas Patocka Signed-off-by: Mike Snitzer Signed-off-by: Jens Axboe commit 37cf28d3b5bca1b532a0b6aac722e7f2788a9294 Author: Adrian Bunk Date: Thu Nov 29 21:58:58 2018 +0200 eeprom: at24: add support for 24c2048 Works with ST M24M02. Signed-off-by: Adrian Bunk Signed-off-by: Bartosz Golaszewski commit 6c0c5dc33ff42af49243e94842d0ebdb153189ea Author: Adrian Bunk Date: Thu Nov 29 21:58:57 2018 +0200 dt-bindings: eeprom: at24: add "atmel,24c2048" compatible string Add new compatible to the device tree bindings. Signed-off-by: Adrian Bunk Acked-by: Rob Herring Signed-off-by: Bartosz Golaszewski commit c7fe060885c4c0b78934c3d7507aa5e68de4099f Author: Eugen Cazacu Date: Sat Dec 1 17:03:22 2018 +0100 user/Makefile: Fix typo and capitalization in comment section Signed-off-by: Eugen Cazacu Signed-off-by: Masahiro Yamada commit 33309ecda0070506c49182530abe7728850ebe78 Author: Will Deacon Date: Mon Dec 10 13:39:48 2018 +0000 arm64: Fix minor issues with the dcache_by_line_op macro The dcache_by_line_op macro suffers from a couple of small problems: First, the GAS directives that are currently being used rely on assembler behavior that is not documented, and probably not guaranteed to produce the correct behavior going forward. As a result, we end up with some undefined symbols in cache.o: $ nm arch/arm64/mm/cache.o ... U civac ... U cvac U cvap U cvau This is due to the fact that the comparisons used to select the operation type in the dcache_by_line_op macro are comparing symbols not strings, and even though it seems that GAS is doing the right thing here (undefined symbols by the same name are equal to each other), it seems unwise to rely on this. Second, when patching in a DC CVAP instruction on CPUs that support it, the fallback path consists of a DC CVAU instruction which may be affected by CPU errata that require ARM64_WORKAROUND_CLEAN_CACHE. Solve these issues by unrolling the various maintenance routines and using the conditional directives that are documented as operating on strings. To avoid the complexity of nested alternatives, we move the DC CVAP patching to __clean_dcache_area_pop, falling back to a branch to __clean_dcache_area_poc if DCPOP is not supported by the CPU. Reported-by: Ard Biesheuvel Suggested-by: Robin Murphy Signed-off-by: Will Deacon commit e9e685480b74aef3f3d0967dadb52eea3ff625d2 Author: Tony Lindgren Date: Wed Dec 5 14:48:51 2018 -0800 ARM: dts: Fix hsi gdd range for omap4 While reviewing the missing mcasp ranges I noticed omap4 hsi range for gdd is wrong so let's fix it. I'm not aware of any omap4 devices in mainline kernel though that use hsi though. Fixes: 84badc5ec5fc ("ARM: dts: omap4: Move l4 child devices to probe them with ti-sysc") Reviewed-by: Sebastian Reichel Signed-off-by: Tony Lindgren commit 89cddc563743cb1e0068867ac97013b2a5bf86aa Author: Vivek Gautam Date: Tue Dec 4 11:52:13 2018 +0530 iommu/arm-smmu: Add support for qcom,smmu-v2 variant qcom,smmu-v2 is an arm,smmu-v2 implementation with specific clock and power requirements. On msm8996, multiple cores, viz. mdss, video, etc. use this smmu. On sdm845, this smmu is used with gpu. Add bindings for the same. Signed-off-by: Vivek Gautam Reviewed-by: Rob Herring Reviewed-by: Tomasz Figa Tested-by: Srinivas Kandagatla Reviewed-by: Robin Murphy Signed-off-by: Will Deacon commit f1518cd84b44d6c28fb40e0551a9785bc38f55af Author: Vivek Gautam Date: Tue Dec 4 11:52:12 2018 +0530 dt-bindings: arm-smmu: Add bindings for qcom,smmu-v2 Add bindings doc for Qcom's smmu-v2 implementation. Signed-off-by: Vivek Gautam Reviewed-by: Tomasz Figa Tested-by: Srinivas Kandagatla Reviewed-by: Rob Herring Reviewed-by: Robin Murphy Signed-off-by: Will Deacon commit 655e364374e74a910d87dbe758bad3e4794f659e Author: Sricharan R Date: Tue Dec 4 11:52:11 2018 +0530 iommu/arm-smmu: Add the device_link between masters and smmu Finally add the device link between the master device and smmu, so that the smmu gets runtime enabled/disabled only when the master needs it. This is done from add_device callback which gets called once when the master is added to the smmu. Signed-off-by: Sricharan R Signed-off-by: Vivek Gautam Reviewed-by: Tomasz Figa Tested-by: Srinivas Kandagatla Reviewed-by: Robin Murphy Signed-off-by: Will Deacon commit d4a44f0750bb9bf7c44c22444a482756b2344a79 Author: Sricharan R Date: Tue Dec 4 11:52:10 2018 +0530 iommu/arm-smmu: Invoke pm_runtime across the driver Enable pm-runtime on devices that implement a pm domain. Then, add pm runtime hooks to several iommu_ops to power cycle the smmu device for explicit TLB invalidation requests, and register space accesses, etc. We need these hooks when the smmu, linked to its master through device links, has to be powered-up without the master device being in context. Signed-off-by: Sricharan R [vivek: Cleanup pm runtime calls] Signed-off-by: Vivek Gautam Reviewed-by: Tomasz Figa Tested-by: Srinivas Kandagatla Reviewed-by: Robin Murphy Signed-off-by: Will Deacon commit 96a299d24cfb6b9659304131b598fa09f4c9041e Author: Sricharan R Date: Tue Dec 4 11:52:09 2018 +0530 iommu/arm-smmu: Add pm_runtime/sleep ops The smmu needs to be functional only when the respective master's using it are active. The device_link feature helps to track such functional dependencies, so that the iommu gets powered when the master device enables itself using pm_runtime. So by adapting the smmu driver for runtime pm, above said dependency can be addressed. This patch adds the pm runtime/sleep callbacks to the driver and the corresponding bulk clock handling for all the clocks needed by smmu. Also, while we enable the runtime pm, add a pm sleep suspend callback that pushes devices to low power state by turning the clocks off in a system sleep. Add corresponding clock enable path in resume callback as well. Signed-off-by: Sricharan R Signed-off-by: Archit Taneja [Thor: Rework to get clocks from device tree] Signed-off-by: Thor Thayer [vivek: rework for clock and pm ops] Signed-off-by: Vivek Gautam Reviewed-by: Tomasz Figa Tested-by: Srinivas Kandagatla Reviewed-by: Robin Murphy Tested-by: Thor Thayer Signed-off-by: Will Deacon commit a868e8530441286342f90c1fd9c5f24de3aa2880 Author: Will Deacon Date: Wed Nov 7 22:58:24 2018 +0000 iommu/arm-smmu-v3: Use explicit mb() when moving cons pointer After removing an entry from a queue (e.g. reading an event in arm_smmu_evtq_thread()) it is necessary to advance the MMIO consumer pointer to free the queue slot back to the SMMU. A memory barrier is required here so that all reads targetting the queue entry have completed before the consumer pointer is updated. The implementation of queue_inc_cons() relies on a writel() to complete the previous reads, but this is incorrect because writel() is only guaranteed to complete prior writes. This patch replaces the call to writel() with an mb(); writel_relaxed() sequence, which gives us the read->write ordering which we require. Cc: Robin Murphy Signed-off-by: Will Deacon commit 84a9a75774961612d0c7dd34a1777e8f98a65abd Author: Zhen Lei Date: Wed Oct 31 12:02:07 2018 +0800 iommu/arm-smmu-v3: Avoid memory corruption from Hisilicon MSI payloads The GITS_TRANSLATER MMIO doorbell register in the ITS hardware is architected to be 4 bytes in size, yet on hi1620 and earlier, Hisilicon have allocated the adjacent 4 bytes to carry some IMPDEF sideband information which results in an 8-byte MSI payload being delivered when signalling an interrupt: MSIAddr: |----4bytes----|----4bytes----| | MSIData | IMPDEF | This poses no problem for the ITS hardware because the adjacent 4 bytes are reserved in the memory map. However, when delivering MSIs to memory, as we do in the SMMUv3 driver for signalling the completion of a SYNC command, the extended payload will corrupt the 4 bytes adjacent to the "sync_count" member in struct arm_smmu_device. Fortunately, the current layout allocates these bytes to padding, but this is fragile and we should make this explicit. Reviewed-by: Robin Murphy Signed-off-by: Zhen Lei [will: Rewrote commit message and comment] Signed-off-by: Will Deacon commit 3cd508a8c1379427afb5e16c2e0a7c986d907853 Author: Robin Murphy Date: Wed Oct 17 21:32:58 2018 +0100 iommu/arm-smmu-v3: Fix big-endian CMD_SYNC writes When we insert the sync sequence number into the CMD_SYNC.MSIData field, we do so in CPU-native byte order, before writing out the whole command as explicitly little-endian dwords. Thus on big-endian systems, the SMMU will receive and write back a byteswapped version of sync_nr, which would be perfect if it were targeting a similarly-little-endian ITS, but since it's actually writing back to memory being polled by the CPUs, they're going to end up seeing the wrong thing. Since the SMMU doesn't care what the MSIData actually contains, the minimal-overhead solution is to simply add an extra byteswap initially, such that it then writes back the big-endian format directly. Cc: Fixes: 37de98f8f1cf ("iommu/arm-smmu-v3: Use CMD_SYNC completion MSI") Signed-off-by: Robin Murphy Signed-off-by: Will Deacon commit c20c809f925910737bdb932fe86cfa261a12e559 Merge: c4aa8b2a8b63a dcc3c9e37fbd7 Author: Greg Kroah-Hartman Date: Mon Dec 10 13:26:17 2018 +0100 Merge tag 'thunderbolt-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into char-misc-next Mika writes: thunderbolt: Changes for v4.21 merge window * tag 'thunderbolt-for-v4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Export IOMMU based DMA protection support to userspace iommu/vt-d: Do not enable ATS for untrusted devices iommu/vt-d: Force IOMMU on for platform opt in hint PCI / ACPI: Identify untrusted PCI devices commit a457b0f7f50d4d189f0d009617885e4341133e8e Author: Marc Zyngier Date: Thu Dec 6 17:31:26 2018 +0000 arm64: Add configuration/documentation for Cortex-A76 erratum 1165522 Now that the infrastructure to handle erratum 1165522 is in place, let's make it a selectable option and add the required documentation. Reviewed-by: James Morse Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon commit eb036ad2ddf008309ea25e34470898c8cd122f6b Author: Marc Zyngier Date: Thu Dec 6 17:31:25 2018 +0000 arm64: KVM: Handle ARM erratum 1165522 in TLB invalidation In order to avoid TLB corruption whilst invalidating TLBs on CPUs affected by erratum 1165522, we need to prevent S1 page tables from being usable. For this, we set the EL1 S1 MMU on, and also disable the page table walker (by setting the TCR_EL1.EPD* bits to 1). This ensures that once we switch to the EL1/EL0 translation regime, speculated AT instructions won't be able to parse the page tables. Acked-by: Christoffer Dall Reviewed-by: James Morse Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon commit 1e4448c5ddbe93ab6070160f094f49e7c95477e6 Author: Marc Zyngier Date: Thu Dec 6 17:31:24 2018 +0000 arm64: KVM: Add synchronization on translation regime change for erratum 1165522 In order to ensure that slipping HCR_EL2.TGE is done at the right time when switching translation regime, let insert the required ISBs that will be patched in when erratum 1165522 is detected. Take this opportunity to add the missing include of asm/alternative.h which was getting there by pure luck. Acked-by: Christoffer Dall Reviewed-by: James Morse Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon commit 8b2cca9ade2c0f1d2ba94e39781e7306c918e544 Author: Marc Zyngier Date: Thu Dec 6 17:31:23 2018 +0000 arm64: KVM: Force VHE for systems affected by erratum 1165522 In order to easily mitigate ARM erratum 1165522, we need to force affected CPUs to run in VHE mode if using KVM. Reviewed-by: James Morse Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon commit 793d5d9213c701fcef8823e053ecd6919d1e4c21 Author: Marc Zyngier Date: Thu Dec 6 17:31:22 2018 +0000 arm64: Add TCR_EPD{0,1} definitions We are soon going to play with TCR_EL1.EPD{0,1}, so let's add the relevant definitions. Reviewed-by: James Morse Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon commit bfae1b98ef0baeac1b724ef890cc75f77eccbdd9 Author: Marc Zyngier Date: Thu Dec 6 17:31:21 2018 +0000 arm64: KVM: Install stage-2 translation before enabling traps It is a bit odd that we only install stage-2 translation after having cleared HCR_EL2.TGE, which means that there is a window during which AT requests could fail as stage-2 is not configured yet. Let's move stage-2 configuration before we clear TGE, making the guest entry sequence clearer: we first configure all the guest stuff, then only switch to the guest translation regime. While we're at it, do the same thing for !VHE. It doesn't hurt, and keeps things symmetric. Acked-by: Christoffer Dall Reviewed-by: James Morse Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon commit 33e5f4e50917c2508c05898f391a971b15eec93e Author: Marc Zyngier Date: Thu Dec 6 17:31:20 2018 +0000 KVM: arm64: Rework detection of SVE, !VHE systems An SVE system is so far the only case where we mandate VHE. As we're starting to grow this requirements, let's slightly rework the way we deal with that situation, allowing for easy extension of this check. Acked-by: Christoffer Dall Reviewed-by: James Morse Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon commit c987876a80e7bcb98a839f10dca9ce7fda4feced Author: Marc Zyngier Date: Thu Dec 6 17:31:19 2018 +0000 arm64: KVM: Make VHE Stage-2 TLB invalidation operations non-interruptible Contrary to the non-VHE version of the TLB invalidation helpers, the VHE code has interrupts enabled, meaning that we can take an interrupt in the middle of such a sequence, and start running something else with HCR_EL2.TGE cleared. That's really not a good idea. Take the heavy-handed option and disable interrupts in __tlb_switch_to_guest_vhe, restoring them in __tlb_switch_to_host_vhe. The latter also gain an ISB in order to make sure that TGE really has taken effect. Cc: stable@vger.kernel.org Acked-by: Christoffer Dall Reviewed-by: James Morse Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon commit 2a9cee5b7a7e39245b835403520f5e80de537130 Author: Mark Rutland Date: Fri Dec 7 18:08:23 2018 +0000 arm64: remove arm64ksyms.c Now that arm64ksyms.c has been reduced to a stub, let's remove it entirely. New exports should be associated with their function definition. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit dbd3196299fe5878caf43f6637ee08feb0942411 Author: Mark Rutland Date: Fri Dec 7 18:08:22 2018 +0000 arm64: frace: use asm EXPORT_SYMBOL() For a while now it's been possible to use EXPORT_SYMBOL() in assembly files, which allows us to place exports immediately after assembly functions, as we do for C functions. As a step towards removing arm64ksyms.c, let's move the ftrace exports to the assembly files the functions are defined in. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit ac0e8c72b03b0e2634a355b99e1d3b780090c403 Author: Mark Rutland Date: Fri Dec 7 18:08:21 2018 +0000 arm64: string: use asm EXPORT_SYMBOL() For a while now it's been possible to use EXPORT_SYMBOL() in assembly files, which allows us to place exports immediately after assembly functions, as we do for C functions. As a step towards removing arm64ksyms.c, let's move the string routine exports to the assembly files the functions are defined in. Routines which should only be exported for !KASAN builds are exported using the EXPORT_SYMBOL_NOKASAN() helper. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Will Deacon Cc: Catalin Marinas Signed-off-by: Will Deacon commit 56c08ec5162c7cf87632c59714ac625e7d54106a Author: Mark Rutland Date: Fri Dec 7 18:08:20 2018 +0000 arm64: uaccess: use asm EXPORT_SYMBOL() For a while now it's been possible to use EXPORT_SYMBOL() in assembly files, which allows us to place exports immediately after assembly functions, as we do for C functions. As a step towards removing arm64ksyms.c, let's move the uaccess exports to the assembly files the functions are defined in. As we have to include , the existing includes are fixed to follow the usual ordering conventions. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Will Deacon Cc: Catalin Marinas Signed-off-by: Will Deacon commit 50fdecb292e0b2d98b0b2bf319a4faa1aa7d666f Author: Mark Rutland Date: Fri Dec 7 18:08:19 2018 +0000 arm64: page: use asm EXPORT_SYMBOL() For a while now it's been possible to use EXPORT_SYMBOL() in assembly files, which allows us to place exports immediately after assembly functions, as we do for C functions. As a step towards removing arm64ksyms.c, let's move the copy_page and clear_page exports to the assembly files the functions are defined in. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Will Deacon Cc: Catalin Marinas Signed-off-by: Will Deacon commit 23fe04c0c58c0432d26fd9c8d974d2fd9ab8a493 Author: Mark Rutland Date: Fri Dec 7 18:08:18 2018 +0000 arm64: smccc: use asm EXPORT_SYMBOL() For a while now it's been possible to use EXPORT_SYMBOL() in assembly files, which allows us to place exports immediately after assembly functions, as we do for C functions. As a step towards removing arm64ksyms.c, let's move the SMCCC exports to the assembly file the functions are defined in. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Will Deacon Cc: Catalin Marinas Signed-off-by: Will Deacon commit abb77f3d96407cf30c2068f4a23a14b9540a1c1f Author: Mark Rutland Date: Fri Dec 7 18:08:17 2018 +0000 arm64: tishift: use asm EXPORT_SYMBOL() For a while now it's been possible to use EXPORT_SYMBOL() in assembly files, which allows us to place exports immediately after assembly functions, as we do for C functions. As a step towards removing arm64ksyms.c, let's move the tishift exports to the assembly file the functions are defined in. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Will Deacon Cc: Catalin Marinas Signed-off-by: Will Deacon commit 386b3c7bdafcc67aaf4168e9627b381370b6538a Author: Mark Rutland Date: Fri Dec 7 18:08:16 2018 +0000 arm64: add EXPORT_SYMBOL_NOKASAN() So that we can export symbols directly from assembly files, let's make use of the generic . We have a few symbols that we'll want to conditionally export for !KASAN kernel builds, so we add a helper for that in . Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit 03ef055fd364e498c0633c163e7b0b0a52418e96 Author: Mark Rutland Date: Fri Dec 7 18:08:15 2018 +0000 arm64: move memstart_addr export inline Since we define memstart_addr in a C file, we can have the export immediately after the definition of the symbol, as we do elsewhere. As a step towards removing arm64ksyms.c, move the export of memstart_addr to init.c, where the symbol is defined. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit 2d7c89b02c62e02879c1fcecaaaccc7da0ea18e0 Author: Mark Rutland Date: Fri Dec 7 18:08:14 2018 +0000 arm64: remove bitop exports Now that the arm64 bitops are inlines built atop of the regular atomics, we don't need to export anything. Remove the redundant exports. Signed-off-by: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Will Deacon commit 77990464bb39eb0f5cd41e4f9e3d6411f2883cac Author: Colin Ian King Date: Thu Dec 6 17:52:28 2018 +0000 xfrm: clean an indentation issue, remove a space Trivial fix to clean up indentation issue, remove an extraneous space. Signed-off-by: Colin Ian King Signed-off-by: Steffen Klassert commit 83fd1e52496b782a261804fadef8ff086e978584 Merge: 40e020c129cfc e822eac560a89 Author: Rafael J. Wysocki Date: Mon Dec 10 12:11:04 2018 +0100 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 v4.21 from Viresh Kumar. * 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: OPP: Remove of_dev_pm_opp_find_required_opp() OPP: Rename and relocate of_genpd_opp_to_performance_state() OPP: Configure all required OPPs OPP: Add dev_pm_opp_{set|put}_genpd_virt_dev() helper PM / Domains: Add genpd_opp_to_performance_state() OPP: Populate OPPs from "required-opps" property OPP: Populate required opp tables from "required-opps" property OPP: Separate out custom OPP handler specific code OPP: Identify and mark genpd OPP tables PM / Domains: Rename genpd virtual devices as virt_dev commit 244add8ebfb231c39db9e33b204bd0ce8f24f782 Author: Tejas Joglekar Date: Mon Dec 10 16:08:13 2018 +0530 usb: dwc3: gadget: Disable CSP for stream OUT ep In stream mode, when fast-forwarding TRBs, the stream number is not cleared causing the new stream to not get assigned. So we don't want controller to carry on transfers when short packet is received. So disable the CSP for stream capable endpoint. This is based on the 3.30a Programming guide, where table 3-1 device descriptor structure field definitions says for CSP bit If this bit is 0, the controller generates an XferComplete event and remove the stream. So if we keep CSP as 1 then switching between streams would not happen as in stream mode, when fast-forwarding TRBs, the stream number is not cleared causing the new stream to not get assigned. Signed-off-by: Tejas Joglekar Signed-off-by: Felipe Balbi commit 46079bacb469c2eff15802fcccc88b0bd56b1e6e Merge: e854747d7593c 0bea4cc838351 Author: Takashi Iwai Date: Mon Dec 10 11:26:53 2018 +0100 Merge branch 'for-linus' into for-next Back-merge for resolving the conflict of fixup entries added in both branches. Signed-off-by: Takashi Iwai commit e80c1a9d5f514ce5134c6c4263a11607341466c9 Author: Tetsuo Handa Date: Tue Dec 4 19:00:01 2018 +0900 printk: fix printk_time race. Since printk_time can be toggled via /sys/module/printk/parameters/time , it is not safe to assume that output length does not change across multiple msg_print_text() calls. If we hit this race, we can observe failures such as SYSLOG_ACTION_READ_ALL writes more bytes than userspace has supplied, SYSLOG_ACTION_SIZE_UNREAD returns -EFAULT when succeeded, SYSLOG_ACTION_READ reads garbage memory or even triggers an kernel oops at _copy_to_user() due to integer overflow. To close this race, get a snapshot value of printk_time and pass it to SYSLOG_ACTION_READ, SYSLOG_ACTION_READ_ALL, SYSLOG_ACTION_SIZE_UNREAD and kmsg_dump_get_buffer(). Link: http://lkml.kernel.org/r/555af37c-b9e0-f940-cb73-a78eba2d4944@i-love.sakura.ne.jp To: Sergey Senozhatsky Cc: linux-kernel@vger.kernel.org Signed-off-by: Tetsuo Handa Reviewed-by: Sergey Senozhatsky Signed-off-by: Petr Mladek commit ef688fc79c5442d7115c6dffa31c5a87f95bc0d6 Author: Yangtao Li Date: Wed Dec 5 10:12:55 2018 -0500 platform/x86: intel_telemetry: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Andy Shevchenko commit 3b1f99558ddc204f1ece3dc8d4996dbdc26eb18d Author: Yangtao Li Date: Wed Dec 5 10:12:54 2018 -0500 platform/x86: intel_pmc_core: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Andy Shevchenko commit 599eefffcf6b9cff3e8cc2d96fd8eebfadab339c Author: Jouke Witteveen Date: Wed Dec 5 12:17:52 2018 +0100 platform/x86: thinkpad_acpi: Cleanup quirks macros - Use generic quirks macros for fan quirks The fan-specific quirks macros were duplicates of the generic ones. - Remove useless #undef lines The referenced macros are not defined anywhere. Signed-off-by: Jouke Witteveen Acked-by: Henrique de Moraes Holschuh Signed-off-by: Andy Shevchenko commit 01688a6d66b5aaa06f49d4d1336a9ee641fe3c46 Author: YueHaibing Date: Fri Dec 7 02:50:42 2018 +0000 USB: serial: mos7840: remove set but not used variables 'number, serial' Fixes gcc '-Wunused-but-set-variable' warning: drivers/usb/serial/mos7840.c: In function 'mos7840_send_cmd_write_baud_rate': drivers/usb/serial/mos7840.c:1584:16: warning: variable 'number' set but not used [-Wunused-but-set-variable] drivers/usb/serial/mos7840.c: In function 'mos7840_change_port_settings': drivers/usb/serial/mos7840.c:1695:21: warning: variable 'serial' set but not used [-Wunused-but-set-variable] 'number' never used since introduction in commit 3f5429746d91 ("USB: Moschip 7840 USB-Serial Driver") 'serial' not used since commit 5833041f1b13 ("USB: serial: remove unnecessary reinitialisations of urb->dev") Signed-off-by: YueHaibing Signed-off-by: Johan Hovold commit b53bde6686fb6952f560e82c5b6c529966d205a4 Merge: e67ebf1b3815b 40e020c129cfc Author: Greg Kroah-Hartman Date: Mon Dec 10 10:19:08 2018 +0100 Merge 4.20-rc6 into usb-next We want the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 9c96f401e91a4358eb4a5e227c1521dea1c20127 Merge: 1528e40fd7d38 40e020c129cfc Author: Greg Kroah-Hartman Date: Mon Dec 10 10:17:45 2018 +0100 Merge 4.20-rc6 into tty-next We want the TTY changes in here as well. Signed-off-by: Greg Kroah-Hartman commit 4addd2640fcaeb150b42a8a352b6c9d13d6c00af Author: Chanho Min Date: Mon Dec 10 16:49:54 2018 +0900 exec: make prepare_bprm_creds static prepare_bprm_creds is not used outside exec.c, so there's no reason for it to have external linkage. Signed-off-by: Chanho Min Signed-off-by: Al Viro commit a40612ef0ee1e524aafee58d0e5713cf5fdb3d62 Author: Al Viro Date: Mon Dec 10 03:40:11 2018 -0500 genheaders: %-s had been there since v6; %-*s - since v7 Please, use at least K&R C; printf had been able to left-adjust a field for as long as stdio existed and use of '*' for variable width had been there since v7. Yes, the first edition of K&R didn't cover the latter feature (it slightly predates v7), but you are using a much later feature of the language than that - in K&R C static char *stoupperx(const char *s) { ... } would've been spelled as static char *stoupperx(s) char *s; { ... } While we are at it, the use of strstr() is bogus - it finds the _first_ instance of substring, so it's a lousy fit for checking if a string ends with given suffix... Signed-off-by: Al Viro commit d3086550faea48d87343b34aca15be853ea79f96 Merge: 7146a4f02635f 40e020c129cfc Author: Greg Kroah-Hartman Date: Mon Dec 10 09:23:50 2018 +0100 Merge 4.20-rc6 into staging-next We want the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit c4aa8b2a8b63a269d63acafc0358a7b9f5d9e563 Merge: 48d365de7746a 40e020c129cfc Author: Greg Kroah-Hartman Date: Mon Dec 10 09:22:34 2018 +0100 Merge 4.20-rc6 into char-misc-next This should resolve the hv driver merge conflict. Signed-off-by: Greg Kroah-Hartman commit 67566ae474e628c0077163d1e20d09d3e33b0ae3 Author: Vladimir Zapolskiy Date: Sat Dec 8 16:38:41 2018 +0200 gpio: lpc18xx: fix GPIO controller driver build as a module The problem is reported for allmodconfig build setup: ERROR: "irq_chip_retrigger_hierarchy" [drivers/gpio/gpio-lpc18xx.ko] undefined! make[2]: *** [scripts/Makefile.modpost:92: __modpost] Error 1 make[1]: *** [Makefile:1271: modules] Error 2 My testing in runtime shows that it is sufficient to remove .irq_retrigger callback, which is assigned to unexported irq_chip_retrigger_hierarchy() function, I did't observe any regressions, and thus apparently it is a better fix rather than exporting the function defined in kernel/irq/chip.c (see commit 52b2a05fa7c8 ("genirq: Export IRQ functions for module use")) or sticking the GPIO controller driver build to built-in option only. Reported-by: kbuild test robot Fixes: 5ddabfe8d3de ("gpio: lpc18xx: add GPIO pin interrupt controller support") Signed-off-by: Vladimir Zapolskiy Signed-off-by: Linus Walleij commit 930e12992ed32a71048e4bf7abc8939eabcad0d7 Author: Firoz Khan Date: Mon Oct 8 09:36:47 2018 +0530 parisc: syscalls: ignore nfsservctl for other architectures This adds an exception to the syscall table checking script. nfsservctl entry is only provided on x86, and there is no reason to add it elsewhere. However, including it on the syscall table caused a warning for most configurations on non-x86. :696:2: warning: #warning syscall nfsservctl not implemented [-Wcpp] Signed-off-by: Firoz Khan Acked-by: Helge Deller Signed-off-by: Helge Deller commit 575afc4d7f6040d7227dfcdd29cf0538fe644359 Author: Firoz Khan Date: Mon Nov 19 12:04:36 2018 +0530 parisc: generate uapi header and system call table files System call table generation script must be run to gener- ate unistd_32/64.h and syscall_table_32/64/c32.h files. This patch will have changes which will invokes the script. This patch will generate unistd_32/64.h and syscall_table- _32/64/c32.h files by the syscall table generation script invoked by parisc/Makefile and the generated files against the removed files must be identical. The generated uapi header file will be included in uapi/- asm/unistd.h and generated system call table header file will be included by kernel/syscall.S file. Signed-off-by: Firoz Khan Acked-by: Helge Deller Signed-off-by: Helge Deller commit 85e69701f58c9b2ec2975e31518b60e056bfebdf Author: Firoz Khan Date: Sun Sep 9 07:22:50 2018 +0530 parisc: add system call table generation support The system call tables are in different format in all architecture and it will be difficult to manually add, modify or delete the syscall table entries in the res- pective files. To make it easy by keeping a script and which will generate the uapi header and syscall table file. This change will also help to unify the implemen- tation across all architectures. The system call table generation script is added in kernel/syscalls directory which contain the scripts to generate both uapi header file and system call table files. The syscall.tbl will be input for the scripts. syscall.tbl contains the list of available system calls along with system call number and corresponding entry point. Add a new system call in this architecture will be possible by adding new entry in the syscall.tbl file. Adding a new table entry consisting of: - System call number. - ABI. - System call name. - Entry point name. - Compat entry name, if required. syscallhdr.sh and syscalltbl.sh will generate uapi header unistd_32/64.h and syscall_table_32/64/c32.h files respect- ively. Both .sh files will parse the content syscall.tbl to generate the header and table files. unistd_32/64.h will be included by uapi/asm/unistd.h and syscall_table_32/64/- c32.h is included by kernel/syscall.S - the real system call table. ARM, s390 and x86 architecuture does have similar support. I leverage their implementation to come up with a generic solution. Signed-off-by: Firoz Khan Acked-by: Helge Deller Signed-off-by: Helge Deller commit 28ff62a4b41ea782d07a4f219fbbb60d3c705e39 Author: Firoz Khan Date: Mon Nov 19 11:41:59 2018 +0530 parisc: remove __NR_Linux from uapi header file. The __NR_Linux defined as 0 to support HP-UX syscalls along with an offset to other system call. But support for HP-UX is gone and there is no need to define __NR_Linux as 0. One of the patch in this patch series will generate uapi header file which does have offset logic support. But here the offset value __NR_Linux defined as 0 and it doesn't make much effect. So remove the offset __NR_Linux from uapi header file. Signed-off-by: Firoz Khan Acked-by: Helge Deller Signed-off-by: Helge Deller commit dbf91a54f7cbf2b33c622e42ec0ec87f0423426c Author: Firoz Khan Date: Wed Sep 26 11:06:25 2018 +0530 parisc: add __NR_syscalls along with __NR_Linux_syscalls __NR_Linux_syscalls macro holds the number of system call exist in parisc architecture. We have to change the value of __NR_Linux_syscalls, if we add or delete a system call. One of the patch in this patch series has a script which will generate a uapi header based on syscall.tbl file. The syscall.tbl file contains the total number of system calls information. So we have two option to update __NR- _Linux_syscalls value. 1. Update __NR_Linux_syscalls in asm/unistd.h manually by counting the no.of system calls. No need to update __NR- _Linux_syscalls until we either add a new system call or delete existing system call. 2. We can keep this feature it above mentioned script, that will count the number of syscalls and keep it in a generated file. In this case we don't need to expli- citly update __NR_Linux_syscalls in asm/unistd.h file. The 2nd option will be the recommended one. For that, I added the __NR_syscalls macro in uapi/asm/unistd.h along with __NR_Linux_syscalls asm/unistd.h. The macro __NR_sys- calls also added for making the name convention same across all architecture. While __NR_syscalls isn't strictly part of the uapi, having it as part of the generated header to simplifies the implementation. We also need to enclose this macro with #ifdef __KERNEL__ to avoid side effects. Signed-off-by: Firoz Khan Acked-by: Helge Deller Signed-off-by: Helge Deller commit dfddd1a841c67d73dea4a24762c24194cb81808f Author: Firoz Khan Date: Sun Sep 9 07:04:16 2018 +0530 parisc: move __IGNORE* entries to non uapi header All the __IGNORE* entries are resides in the uapi header file move to non uapi header asm/unistd.h as it is not used by any user space applications. It is correct to keep __IGNORE* entry in non uapi header asm/unistd.h while uapi/asm/unistd.h must hold information only useful for user space applications. One of the patch in this patch series will generate uapi header file. The information which directly used by the user space application must be present in uapi file. Signed-off-by: Firoz Khan Acked-by: Helge Deller Signed-off-by: Helge Deller commit cc10ce0c51b13d1566d0ec1dcb472fb86330b391 Author: Martin Blumenstingl Date: Sun Dec 9 20:01:29 2018 +0100 usb: dwc2: disable power_down on Amlogic devices Disable power_down by setting the parameter to DWC2_POWER_DOWN_PARAM_NONE. This fixes a problem on various Amlogic Meson SoCs where USB devices are only recognized when plugged in before booting Linux. A hot-plugged USB device was not detected even though the device got power (my USB thumb drive for example has an LED which lit up). A similar fix was implemented for Rockchip SoCs in commit c216765d3a1def ("usb: dwc2: disable power_down on rockchip devices"). That commit suggests that a change in the dwc2 driver is the cause because the default value for the "hibernate" parameter (which then got renamed to "power_down" to support other modes) was changed in the v4.17 merge window with: commit 6d23ee9caa6790 ("Merge tag 'usb-for-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-testing"). Cc: # 4.19 Acked-by: Minas Harutyunyan Suggested-by: Christian Hewitt Signed-off-by: Martin Blumenstingl Signed-off-by: Felipe Balbi commit c4bff35ca1bfba886da6223c9fed76a2b1382b8e Author: Helge Deller Date: Thu Nov 15 21:06:34 2018 +0100 parisc: Fix HP SDC hpa address output Show the hpa address of the HP SDC instead of a hashed value, e.g.: HP SDC: HP SDC at 0xf0201000, IRQ 23 (NMI IRQ 24) Signed-off-by: Helge Deller commit 785145171d17af2554128becd6a7c8f89e101141 Author: Helge Deller Date: Thu Nov 15 21:09:59 2018 +0100 parisc: Fix serio address output We want the hpa addresses printed in the serio modules, not some virtual ioremap()ed address, e.g.: serio: gsc-ps2-keyboard port at 0xf0108000 irq 22 @ 2:0:11 serio: gsc-ps2-mouse port at 0xf0108100 irq 22 @ 2:0:12 Signed-off-by: Helge Deller commit 8cc28269b9574103aae9088a02a20929ec75f983 Author: Helge Deller Date: Sat Nov 10 16:14:59 2018 +0100 parisc: Split out alternative live patching code Move the alternative implemenation coding to alternative.c and add code to patch modules while loading. Signed-off-by: Helge Deller commit 4cc1feeb6ffc2799f8badb4dea77c637d340cb0d Merge: a60956ed72f7b 40e020c129cfc Author: David S. Miller Date: Sun Dec 9 21:27:48 2018 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net Several conflicts, seemingly all over the place. I used Stephen Rothwell's sample resolutions for many of these, if not just to double check my own work, so definitely the credit largely goes to him. The NFP conflict consisted of a bug fix (moving operations past the rhashtable operation) while chaning the initial argument in the function call in the moved code. The net/dsa/master.c conflict had to do with a bug fix intermixing of making dsa_master_set_mtu() static with the fixing of the tagging attribute location. cls_flower had a conflict because the dup reject fix from Or overlapped with the addition of port range classifiction. __set_phy_supported()'s conflict was relatively easy to resolve because Andrew fixed it in both trees, so it was just a matter of taking the net-next copy. Or at least I think it was :-) Joe Stringer's fix to the handling of netns id 0 in bpf_sk_lookup() intermixed with changes on how the sdif and caller_net are calculated in these code paths in net-next. The remaining BPF conflicts were largely about the addition of the __bpf_md_ptr stuff in 'net' overlapping with adjustments and additions to the relevant data structure where the MD pointer macros are used. Signed-off-by: David S. Miller commit 0a1e8258a4fecd5aad2815b43bbe0ff014de1d8a Author: Chengguang Xu Date: Mon Dec 10 00:22:38 2018 -0500 ext4: compare old and new mode before setting update_mode flag If new mode is the same as old mode we don't have to reset inode mode in the rest of the code, so compare old and new mode before setting update_mode flag. Signed-off-by: Chengguang Xu Signed-off-by: Theodore Ts'o commit a73900b826ce6faded48ee3e41aa890fbeba4068 Author: A.s. Dong Date: Sat Nov 10 15:13:12 2018 +0000 ARM: dts: imx: add imx7ulp evk support The NXP i.MX 7ULP Evaluation Kit (EVK) provides a platform for rapid evaluation of the i.MX 7ULP, which features NXP's advanced implementation of the Arm Cortex-A7 core, the Arm Cortex-M4 core, as well as a 3D and 2D Graphics Processing Units (GPUs). The EVK enables HDMI output for simple out-of-the-box to bring up but allows reconfiguration for MIPI displays. The EVK is designed as a System-On-Module(SOM) board that connects to an associated baseboard. The SOM provides 1 GB LPDDR3, 8 MB Quad SPI flash, Micro SD 3.0 card socket, WiFi/ Bluetooth capability, USB 2.0 OTG with Type C connector and an NXP PF1550 power management IC (PMIC). The baseboard provides additional capabilities including a full SD/MMC 3.0 card socket, audio codec, multiple sensors, an HDMI connector, and an alternate MIPI display connector. Additionally, the EVK facilitates software development with the ultimate goal of faster time to market through the support of both Linux OS and AndroidTM rich operating systems, as well as FreeRTOS. This patch aims to support the preliminary booting up features as follows: GPIO LPUART FEC SD/MMC See more board details: https://www.nxp.com/products/processors-and-microcontrollers/ arm-based-processors-and-mcus/i.mx-applications-processors/ i.mx-7-processors/evaluation-kit-for-the-i.mx-7ulp-applications -processor:MCIMX7ULP-EVK Cc: Rob Herring Cc: Shawn Guo Cc: devicetree@vger.kernel.org Cc: Sascha Hauer Reviewed-by: Fabio Estevam Signed-off-by: Dong Aisheng Signed-off-by: Shawn Guo commit 20434dc92c058898cc394e352e9c1f83f503dcfe Author: A.s. Dong Date: Sat Nov 10 15:13:08 2018 +0000 ARM: dts: imx: add common imx7ulp dtsi support The i.MX 7ULP family of processors features NXP's advanced implementation of the Arm Cortex-A7 core, the Arm Cortex-M4 core, as well as a 3D and 2D Graphics Processing Units (GPUs). This patch aims to add the initial support including: 1) CLK 2) GPIO PTC, PTD, PTE, PTF 3) uSDHC 1/2 4) LPUART 4/5/6/7 5) LPI2C 6/7 Cc: Rob Herring Cc: Shawn Guo Cc: devicetree@vger.kernel.org Cc: Sascha Hauer Cc: Fabio Estevam Signed-off-by: Dong Aisheng Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 61ccb001534b7d555e01d013ecb7f94bbf3d1bbe Author: A.s. Dong Date: Sat Nov 10 15:13:00 2018 +0000 dt-bindings: fsl: add imx7ulp pm related components bindings Add imx7ulp pm related components bindings. Cc: Shawn Guo Cc: devicetree@vger.kernel.org Reviewed-by: Rob Herring Signed-off-by: Dong Aisheng Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 2bf5751726e8face217a39f2132df643b995d8bc Author: A.s. Dong Date: Sat Nov 10 15:12:56 2018 +0000 dt-bindings: fsl: add compatible for imx7ulp evk Add compatible string for imx7ulp evk board. Cc: devicetree@vger.kernel.org Cc: Shawn Guo Acked-by: Rob Herring Signed-off-by: Dong Aisheng Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 7f68ffe0617b44fe189271701f6443beb23907ad Author: Fabio Estevam Date: Thu Dec 6 08:09:05 2018 -0200 ARM: dts: imx7d-pico: Add the imx7d-pico-hobbit variant The imx7d-pico-hobbit contains a imx7d-pico SoM and a hobbit baseboard. Add support for it. Signed-off-by: Fabio Estevam Signed-off-by: Otavio Salvador Signed-off-by: Shawn Guo commit 9c77ba961ff2bca9ad0b158d0e23a76773c3eaf1 Author: Fabio Estevam Date: Thu Dec 6 08:09:04 2018 -0200 ARM: dts: imx7d-pico-pi: Extend peripherals support This adds following peripherals for the imx7d-pico-pi as: - LED - Touchscreen - GPIO Signed-off-by: Fabio Estevam Signed-off-by: Otavio Salvador Signed-off-by: Shawn Guo commit f13f571ac8a18c45f4c21bceda7cff3ad4e7ba03 Author: Fabio Estevam Date: Thu Dec 6 08:09:03 2018 -0200 ARM: dts: imx7d-pico: Extend peripherals support This extends the peripherals supported by the imx7d-pico.dtsi. It adds: - I2C2 - Flexcan (flexcan1 and flexcan2 ports) - USDHC1 - UART (6 and 7 ports) - PWM (4 ports) - eCSPI3 Signed-off-by: Fabio Estevam Signed-off-by: Otavio Salvador Signed-off-by: Shawn Guo commit bb1ff7ed6c1abfa1d4a376dd8750a0f7c731709f Author: Otavio Salvador Date: Thu Dec 6 08:09:02 2018 -0200 ARM: dts: imx7d-pico: Improve WiFi regulator name There are different models of WiFi being used in the SoM and the handle name was too restrictive. This reworks it to a more generic and meaningful name. Signed-off-by: Otavio Salvador Signed-off-by: Shawn Guo commit 26255a529769e93736d1a9f955ec379513f71e27 Author: Fabio Estevam Date: Thu Dec 6 08:09:01 2018 -0200 ARM: dts: imx7d-pico: Pass the Ethernet PHY reset GPIO Pass the "phy-reset-gpios" property in order to describe the GPIO that performs the Ethernet PHY reset. Signed-off-by: Fabio Estevam Signed-off-by: Otavio Salvador Signed-off-by: Shawn Guo commit ce48443443303904032686bf50587c2cf08a83e7 Author: Fabio Estevam Date: Thu Dec 6 08:09:00 2018 -0200 ARM: dts: imx7d-pico: Pass the USBOTG1_PWR pinctrl Pass the USBOTG1_PWR pinctrl description in the USBOTG GPIO controlled regulator. Signed-off-by: Fabio Estevam Signed-off-by: Otavio Salvador Signed-off-by: Shawn Guo commit 4edbe6aa46d15c8ac632b2b9f15c27414f940051 Author: Fabio Estevam Date: Thu Dec 6 08:08:59 2018 -0200 ARM: dts: imx7d-pico-pi: Move SoM related part to imx7d-pico.dtsi imx7d-pico-pi board contains: - One SoM board (imx7d pico) - One base board (pi). In order to make it easier for adding support for other board variants, move the commom SoM part to the imx7d-pico.dtsi file. Signed-off-by: Fabio Estevam Signed-off-by: Otavio Salvador Signed-off-by: Shawn Guo commit a26aec533ec065cd54949d6958f97e0fd79c3bfb Author: Fabio Estevam Date: Thu Dec 6 08:08:58 2018 -0200 ARM: dts: imx7d-pico: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Otavio Salvador Signed-off-by: Shawn Guo commit 50536c661194dcb43faeba8aaae85e3f34145ee4 Author: Fabio Estevam Date: Thu Dec 6 08:08:57 2018 -0200 ARM: dts: imx7d-pico: Do not harcode the memory size Currently the memory size described in dts is 2GB, which is incorrect. There are 512MB and 1GB versions of imx7d-pico boards, so remove the hardcoded memory size and let the bootloader pass the correct value to the kernel. Signed-off-by: Fabio Estevam Signed-off-by: Otavio Salvador Signed-off-by: Shawn Guo commit 2e8566106d284badf6ec94509f77fdf7725d04b4 Merge: 79da07dec740a f15096f12a4e9 Author: Shawn Guo Date: Mon Dec 10 10:32:51 2018 +0800 Merge tag 'imx-fixes-4.20-3' into imx7d/pico i.MX fixes for 4.20, round 3: - A couple of fixes on imx7d-pico and imx7d-nitrogen7 boards to correct the description of the Wifi clock. - Change SW2ISO count to get a safer ARM LDO ramp-up time, so that different boards can be covered. This fixes the ARM LDO failure seen on some customer boards. commit 7300375f181e06ba98183509065c6b71bead442d Author: Saeed Mahameed Date: Tue Dec 4 18:03:03 2018 -0800 net/mlx5: Move flow counters data structures from flow steering header After the following flow counters API refactoring: ("net/mlx5: Use flow counter IDs and not the wrapping cache object") flow counters private data structures mlx5_fc_cache and mlx5_fc are redundantly exposed in fs_core.h, they have nothing to do with flow steering core and they are private to fs_counter.c, this patch moves them to where they belong and reduces their exposure in the driver. Signed-off-by: Saeed Mahameed commit bdefffd13bf294a5a0c16255650020bff98954c7 Author: Tariq Toukan Date: Tue Dec 4 18:03:02 2018 -0800 IB/mlx5: Use helper to get CQE opcode Use the new helper that extracts the opcode from a CQE (completion queue entry) structure. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed Acked-by: Leon Romanovsky commit 6254adeb1f6943a66cbed892a5f683400b9db194 Author: Tariq Toukan Date: Tue Dec 4 18:03:01 2018 -0800 net/mlx5: Use helper to get CQE opcode Introduce and use a helper that extracts the opcode from a CQE (completion queue entry) structure. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit fe206c209314f3cebe232518db9b5ad2606e34f1 Author: Daniel Jurgens Date: Tue Dec 4 18:03:00 2018 -0800 net/mlx5: When fetching CQEs return CQE instead of void pointer The function is only used to retrieve CQEs, use the proper type as the return value. Signed-off-by: Daniel Jurgens Signed-off-by: Saeed Mahameed commit 79da07dec740a42c70963ebacbd2bf8866af9e20 Author: Andrey Smirnov Date: Thu Dec 6 21:41:17 2018 -0200 ARM: dts: imx51-zii-rdu1: Do not specify "power-gpio" for hpa1 TPA6130A2 SD pin on RDU1 is not really controlled by SoC and instead is only meant to notify the system that audio was "muted" by external actors. To accommodate that, drop "power-gpio" property of hpa1 node as well as specify a name for that GPIO so that userspace can access it. Signed-off-by: Andrey Smirnov Signed-off-by: Fabio Estevam Tested-by: Chris Healy Signed-off-by: Shawn Guo commit 81c0039b13c11bf77bbca700350d4f25d5cb2ec8 Author: Leonard Crestez Date: Thu Dec 6 19:22:16 2018 +0000 ARM: dts: imx6ul: Remove extra space between node name and brace Fixes: 7d1cd2978664 ("ARM: dts: imx6ul: add gpmi support") Signed-off-by: Leonard Crestez Signed-off-by: Shawn Guo commit 5649dbd31ef7c74acbf14c2f18c779572f75485e Author: Fabio Estevam Date: Thu Dec 6 08:36:41 2018 -0200 ARM: dts: imx6qdl-sabresd: Use GPIO_ACTIVE_HIGH for regulators Passing GPIO_ACTIVE_HIGH as GPIO flags for the GPIO controlled regulator improves the readability, so use it instead of the hardcoded number. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit ca5c36ba42c1ad65f874c5e41edbd72866e47f83 Author: Dong Aisheng Date: Thu Dec 6 03:51:27 2018 +0000 ARM: dts: imx6ul: add flexcan support Add flexcan support for i.MX6UL board. Change the place of CAN node delete due to i.MX6ULZ include i.MX6UL dts but not support flexcan. Signed-off-by: Dong Aisheng Signed-off-by: Joakim Zhang Signed-off-by: Shawn Guo commit 006303d6ba8edda0bbb2c2a271c2faa2968f18c8 Author: Jonathan Marek Date: Tue Dec 4 10:17:00 2018 -0500 ARM: dts: imx5: add gpu nodes This adds the gpu nodes for the adreno 200 GPU on iMX51 and iMX53, now supported by the freedreno driver. The compatible for the iMX51 uses a patchid of 1, which is used by drm/msm driver to identify the smaller 128KiB GMEM size. Signed-off-by: Jonathan Marek Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 47853f18b63557740ef730cb212035fae8d13c88 Author: Anson Huang Date: Thu Dec 6 01:42:42 2018 +0000 ARM: dts: imx6qdl-sabresd: add accelerometer sensor support Add accelerometer sensor mma8451 support on i2c1 bus. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 9e6a7c47c3c4b5478c0ba0e42b271930038b1765 Author: Anson Huang Date: Thu Dec 6 01:42:38 2018 +0000 ARM: dts: imx6qdl-sabresd: add magnetometer sensor support Add magnetometer sensor mag3110 support on i2c3 bus. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit ab43e984049008ecfca7cba7a9d7666da4916d2e Author: Anson Huang Date: Thu Dec 6 01:42:34 2018 +0000 ARM: dts: imx6qdl-sabresd: add light sensor support Add isl29023 light sensor support on i2c3 bus, the light sensor's power is controlled by a fixed regulator, since the isl29023 driver and most of other sensors on same board like mag3110 and mma8451 do NOT support regulator operation currently, they are all controlled by this regulator, so this patch also adds the fixed regulator support and make it always on. Signed-off-by: Anson Huang Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 75ad7ff1797f62b011c7dde68981b10a089cfef9 Author: Fabio Estevam Date: Thu Dec 6 01:42:30 2018 +0000 ARM: dts: imx6qdl-sabresd: Move regulators outside of "simple-bus" It is not recommended to place regulators inside "simple-bus", so move them out to make it cleaner the addition of new regulators. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 404c0c9314f4f204ad82ef059424ff7e0b20fcd0 Author: Marco Franchi Date: Wed Dec 5 16:10:03 2018 -0200 ARM: dts: imx6qdl: Fix memory node duplication Boards based on imx6qdl have duplicate memory nodes: - One coming from the board device tree file: memory@ - One coming from the imx6qdl.dtsi file. Fix the duplication by removing the memory node from the imx6qdl.dtsi file and by adding 'device_type = "memory";' in the board Device Tree. Converted using the following command: perl -p0777i -e 's/memory\@10000000 \{\n/memory\@10000000 \{\n\t\tdevice_type = \"memory\";\n/m' `find ./arch/arm/boot/dts -name "imx6*"`` Reported-by: Rob Herring Signed-off-by: Marco Franchi Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 69bf2fec500b59e2011bbf528e39c4a8f1b25020 Author: Fabio Estevam Date: Wed Dec 5 16:10:02 2018 -0200 ARM: dts: imx6dl-mamoj: Add a memory node Add a memory node, with an empty memory size, which will be filled by the bootloader. This is done in preparation for removing the memory node from imx6qdl.dtsi. Reported-by: Marco Franchi Signed-off-by: Fabio Estevam Signed-off-by: Marco Franchi Signed-off-by: Shawn Guo commit 998a84c27a7f3f9133d32af64e19c05cec161a1a Author: Fabio Estevam Date: Wed Dec 5 16:10:01 2018 -0200 ARM: dts: imx53-voipac-dmm-668: Fix memory node duplication imx53-voipac-dmm-668 has two memory nodes, but the correct representation would be to use a single one with two reg entries - one for each RAM chip select, so fix it accordingly. Reported-by: Marco Franchi Signed-off-by: Fabio Estevam Signed-off-by: Marco Franchi Signed-off-by: Shawn Guo commit 3e03b4ac50454ea2dfacc135f2a5e2e935937ae6 Author: Fabio Estevam Date: Wed Dec 5 09:19:35 2018 -0200 ARM: dts: vf610-zii-scu4-aib: Add HI8435 support On the vf610-zii-scu4-aib board there is a hi8435 (32-channel discrete-to-digital SPI sensor device) in the DSPI0 bus. Add support for it. Signed-off-by: Fabio Estevam Reviewed-by: Chris Healy Signed-off-by: Shawn Guo commit c9a8cf0f1d6960911aa7303f95aef8a49a7e1f1f Author: Anson Huang Date: Wed Dec 5 01:14:25 2018 +0000 ARM: dts: imx6qdl-sabresd: add egalax touch screen support on i2c2 bus Add egalax touch screen support on i2c2 bus, it is connected to LVDS0, while the existing one on i2c3 bus is connected to LVDS1. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit cf1bb82b0bd5ac64b8a19674283558a79968305f Author: Aisheng Dong Date: Mon Dec 3 05:20:31 2018 +0000 ARM: dts: imx7s: Add flexcan stop mode wakeup support Add stop-mode property which is required by stop mode wakeup feature. Signed-off-by: Aisheng Dong Signed-off-by: Joakim Zhang Signed-off-by: Shawn Guo commit f049557e478b96d654e7d7e29d1855bf031ca293 Author: Aisheng Dong Date: Mon Dec 3 05:20:27 2018 +0000 ARM: dts: imx6ul: Add flexcan stop mode wakeup support Add stop-mode property which is required by stop mode wakeup feature. Signed-off-by: Aisheng Dong Signed-off-by: Joakim Zhang Signed-off-by: Shawn Guo commit d2463e8631ce5d4f7e7c294cac6ee6bbfbbd01c7 Author: Aisheng Dong Date: Mon Dec 3 05:20:23 2018 +0000 ARM: dts: imx6qdl: Add flexcan stop mode wakeup support Add stop-mode property which is required by stop mode wakeup feature. Signed-off-by: Aisheng Dong Signed-off-by: Joakim Zhang Signed-off-by: Shawn Guo commit 807d043c1226fe9f807fcebe498b51f96c822207 Author: Aisheng Dong Date: Mon Dec 3 05:20:19 2018 +0000 ARM: dts: imx6sx: Add flexcan stop mode wakeup support Add stop-mode property which is required by stop mode wakeup feature. Signed-off-by: Aisheng Dong Signed-off-by: Joakim Zhang Signed-off-by: Shawn Guo commit 0aa49c61995fdffd1b9bb7d222ca8f105f3e7c36 Author: Fabio Estevam Date: Sun Dec 2 19:18:09 2018 -0200 ARM: dts: imx6ul-pico: Add the imx6ul-pico-pi variant The imx6ul-pico-pi contains a imx6ul-pico SoM and a pi baseboard: https://www.technexion.com/products/pico-baseboards/detail/PICO-PI Add support for it. Signed-off-by: Fabio Estevam Signed-off-by: Otavio Salvador Signed-off-by: Shawn Guo commit cb430d971a568b4de940ef3aebd6e75e413283fd Author: Fabio Estevam Date: Sun Dec 2 19:18:08 2018 -0200 ARM: dts: imx6ul-pico-hobbit: Extend peripherals support This adds following peripherals support: - ADC - GPIO LED - GPIOs Signed-off-by: Fabio Estevam Signed-off-by: Otavio Salvador Signed-off-by: Shawn Guo commit 4a20c26023f379ac41edd1479aec01d6de30e02b Author: Fabio Estevam Date: Sun Dec 2 19:18:07 2018 -0200 ARM: dts: imx6ul-pico-hobbit: Make the child led nodes standard Use the same child led node and label name as used in the imx7d-pico-hobbit board. Signed-off-by: Fabio Estevam Signed-off-by: Otavio Salvador Signed-off-by: Shawn Guo commit 093f911dba8c882225af0340fdedaf4a6118f4f6 Author: Fabio Estevam Date: Sun Dec 2 19:18:06 2018 -0200 ARM: dts: imx6ul-pico-hobbit: Move SoM related part to imx6ul-pico.dtsi imx6ul-pico-hobbit board contains: - One SoM board (imx6ul pico) - One base board (hobbit). In order to make it easier for adding support for other board variants, move the commom SoM part to the imx6ul-pico.dtsi file. Signed-off-by: Fabio Estevam Signed-off-by: Otavio Salvador Signed-off-by: Shawn Guo commit dda0553cc270ee7e0b07674ab615be1d2700bda8 Author: Fabio Estevam Date: Sun Dec 2 19:18:05 2018 -0200 ARM: dts: imx6ul-pico-hobbit: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Otavio Salvador Signed-off-by: Shawn Guo commit 1b9c329e1d02a0175f8bb77729ff13ba832d9752 Author: Peng Ma Date: Tue Oct 30 10:36:01 2018 +0800 ARM: dts: ls1021a: add qdma device tree nodes add the qDMA device tree nodes for LS1021A devices. Signed-off-by: Wen He Signed-off-by: Peng Ma Signed-off-by: Shawn Guo commit f535d100985548e8458cf28027198b71709a1ebe Author: Fabio Estevam Date: Fri Nov 30 22:44:52 2018 -0200 ARM: dts: vf: Fix memory node duplication Boards based on vf500/vf600 have duplicate memory nodes: - One coming from the board dts file: memory@ - One coming from the vf500.dtsi/vf610m4.dtsi files. Fix the duplication by removing the memory node from the dtsi file and by adding 'device_type = "memory";' in the board dts. Reported-by: Rob Herring Signed-off-by: Fabio Estevam Reviewed-by: Stefan Agner Signed-off-by: Shawn Guo commit d7f3894f0e46802ea55af4b859b9606d3a6bb107 Author: Fabio Estevam Date: Mon Dec 3 15:40:20 2018 -0200 ARM: dts: imx7: Correct mask for GIC PPI interrupts The GIC_CPU_MASK_SIMPLE() macro should take as its argument the actual number of CPU cores the interrupt controller is wired to. i.MX7S contains a single Cortex-A7, hence the second interrupt specifier cell for Private Peripheral Interrupts should use "GIC_CPU_MASK_SIMPLE(1)". Likewise, i.MX7D contains two Cortex-A7 cores, so it should use "GIC_CPU_MASK_SIMPLE(2)" instead. Tested on a imx7s-warp. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 0c29339d53bf7cf3b96847081ad7f64e835de4d4 Author: Fabio Estevam Date: Mon Dec 3 15:40:19 2018 -0200 ARM: dts: imx6ul: Correct mask for GIC PPI interrupts The GIC_CPU_MASK_SIMPLE() macro should take as its argument the actual number of CPU cores the interrupt controller is wired to. i.MX6UL contains a single Cortex-A7, hence the second interrupt specifier cell for Private Peripheral Interrupts should use "GIC_CPU_MASK_SIMPLE(1)". Tested on a imx6ul-evk. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit f46af111c6948a842708d68d16564666ea2d1c68 Author: Fabio Estevam Date: Thu Nov 29 09:18:14 2018 -0200 ARM: dts: imx53: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 9a79142655a420d4ad567d459755c09a90aba003 Author: Fabio Estevam Date: Thu Nov 29 09:18:13 2018 -0200 ARM: dts: imx50: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 577f0104e3fc7fd6120432a85d7a4ed41f60e28d Author: Aisheng Dong Date: Wed Nov 28 11:03:56 2018 +0000 ARM: dts: imx6qdl-sabreauto: add flexcan support The flexcan1 is pin conflict with fec. User would make flexcan1 enabled with fec disabled to use CAN. Signed-off-by: Aisheng Dong Signed-off-by: Joakim Zhang Signed-off-by: Shawn Guo commit 57ab56fa0b94c6e08e029fdf508db79511c81da4 Author: Aisheng Dong Date: Wed Nov 28 11:03:52 2018 +0000 ARM: dts: imx6sx-sabreauto: add flexcan support The CAN transceiver on MX6SX Sabreauto board seems in sleep mode by default after power up the board. User has to press the wakeup key on ARD baseboard before using the transceiver, or it may not work properly when power up the board at the first time(warm reset does not have such issue). This patch operates the wake pin too besides stby/en pins by chaining them together in regulator mode. Signed-off-by: Aisheng Dong Signed-off-by: Joakim Zhang Signed-off-by: Shawn Guo commit 88dddae62eefb309391e2b442c3dd077a12aa35a Author: Aisheng Dong Date: Wed Nov 28 11:03:48 2018 +0000 ARM: dts: imx6sx-sdb: add flexcan support CAN transceiver is different on RevA and RevB board. It's active high on RevA while active low on Rev B. Signed-off-by: Aisheng Dong Signed-off-by: Joakim Zhang Signed-off-by: Shawn Guo commit f820ca29bfde05be286c346fdea69bd2a7b592c3 Author: Patrick Havelange Date: Tue Nov 27 15:09:44 2018 +0100 ARM: dts: ls1021a: add nodes for PWMs The LS1021A has 8 possible PWMs, so adding them (disabled by default) Signed-off-by: Patrick Havelange Signed-off-by: Shawn Guo commit 7ccdc892104eb897abb5c5ce24f99e7d15ac069e Author: Alex Gonzalez Date: Thu Oct 25 17:09:33 2018 +0200 ARM: dts: ccimx6ulsbcpro: Add support for Goodix touch controller The ConnectCore 6UL SBC Pro has an AUO/Goodix LCD accessory kit that is connected on the LVDS interface through an on-board LVDS transceiver. This change adds support for the touch interface. Signed-off-by: Alex Gonzalez Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 429c4580287c4a73c7a0065210a08871f7a928bd Author: Alex Gonzalez Date: Thu Oct 25 17:09:31 2018 +0200 ARM: dts: ccimx6ulsbcpro: Enable AUO G101EVN010 lcdif panel This change adds support for the AUO G101EVN010 lcdif panel for the mxsfb DRM driver. Signed-off-by: Alex Gonzalez Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 59d8bb363f563e4a147a291037bf979cb8ff9a59 Author: Fabio Estevam Date: Mon Nov 26 10:40:54 2018 -0200 ARM: dts: imx25: Fix memory node duplication Boards based on imx25 have duplicate memory nodes: - One coming from the board dts file: memory@ - One coming from the imx25.dtsi file. Fix the duplication by removing the memory node from the dtsi file and by adding 'device_type = "memory";' in the board dts. Reported-by: Rob Herring Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 38715dcd49b4430ac5b6bc1293278d91a4d32bd5 Author: Fabio Estevam Date: Mon Nov 26 10:40:53 2018 -0200 ARM: dts: imx27: Fix memory node duplication Boards based on imx27 have duplicate memory nodes: - One coming from the board dts file: memory@ - One coming from the imx27.dtsi file. Fix the duplication by removing the memory node from the dtsi file and by adding 'device_type = "memory";' in the board dts. Reported-by: Rob Herring Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 62864d5665c4fc636d3021f829b3ac00fa058e30 Author: Fabio Estevam Date: Mon Nov 26 10:40:52 2018 -0200 ARM: dts: imx1: Fix memory node duplication Boards based on imx1 have duplicate memory nodes: - One coming from the board dts file: memory@ - One coming from the imx1.dtsi file. Fix the duplication by removing the memory node from the dtsi file and by adding 'device_type = "memory";' in the board dts. Reported-by: Rob Herring Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 32018d1525c6b8bcdb0fd99bf61f4e56c3d25963 Author: Fabio Estevam Date: Mon Nov 26 10:08:56 2018 -0200 ARM: dts: imx28: Fix memory node duplication Boards based on imx28 have duplicate memory nodes: - One coming from the board dts file: memory@ - One coming from the imx28.dtsi file. Fix the duplication by removing the memory node from the dtsi file and by adding 'device_type = "memory";' in the board dts. Reported-by: Rob Herring Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit b629e83520fafe6f4c2f3e8c88c78a496fc4987c Author: Fabio Estevam Date: Mon Nov 26 10:08:55 2018 -0200 ARM: dts: imx23: Fix memory node duplication Boards based on imx23 have duplicate memory nodes: - One coming from the board dts file: memory@ - One coming from the imx23.dtsi file. Fix the duplication by removing the memory node from the dtsi file and by adding 'device_type = "memory";' in the board dts. Reported-by: Rob Herring Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 07a4b4600974c5473131dc3a48a532128ee094d3 Author: Fabio Estevam Date: Sun Nov 25 18:02:45 2018 -0200 ARM: dts: imx6: Switch NXP board dts to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Most of the i.MX NXP reference board dts files have already been converted, so switch the remaining ones. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit d9359f5807971add9eb10063837b003b193b7b88 Author: Fabio Estevam Date: Sun Nov 25 18:02:44 2018 -0200 ARM: dts: imx6qdl-wandboard: Switch to SPDX identifier Adopt the SPDX license identifier headers to ease license compliance management. Most of the wandboard dts files have already been converted, so switch the remaining ones. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit aab5e3ea95b958cf22a24e756a84e635bdb081c1 Author: Fabio Estevam Date: Fri Nov 23 11:25:19 2018 -0200 ARM: dts: imx50: Fix memory node duplication imx50-evk has duplicate memory nodes: - One coming from the board dts file: memory@ - One coming from the imx50.dtsi file. Fix the duplication by removing the memory node from the dtsi file and by adding 'device_type = "memory";' in the board dts. Reported-by: Rob Herring Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 88d22f13a66cd9a767ae83c0cf8859ade1dd621d Author: Anson Huang Date: Thu Nov 22 02:55:45 2018 +0000 ARM: dts: imx6sll-evk: use WDOG_B pin reset i.MX6SLL EVK board has WDOG_B pin connected to the PMIC; Add the WDOG_B pinctrl entry and 'fsl,ext-reset-output' property to wdog node to let watchdog trigger a system POR reset via the PMIC. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 366a209c928a80c68f4a608f2f172b06ba9f9f9e Author: Anson Huang Date: Wed Nov 21 07:03:44 2018 +0000 ARM: dts: imx6sll-evk: add debug LED support On i.MX6SLL EVK board, there is a debug LED controlled by MX6SLL_PAD_EPDC_VCOM1__GPIO2_IO04 pin, add support for it. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 4f6de45f1eee524d0230e49ca1c1c26865b33a31 Author: Leonard Crestez Date: Tue Nov 20 18:57:06 2018 +0000 ARM: dts: imx6qdl-sabreauto: Enable pcie The imx6qdl-sabreauto boards have a pcie slot so let's enable it. Tested on imx6dl-sabreauto with an atk9k wifi card; scanning works. There are unhandled differences for imx6qp but imx6qp-sabreauto.dts already contains a snippet explicitly disabling the &pcie node so that can be dealt with later. Signed-off-by: Leonard Crestez Signed-off-by: Shawn Guo commit 7fa8ab65ee15e386558ac5e971004712da91e2dd Author: Fabio Estevam Date: Tue Nov 20 13:59:45 2018 -0200 ARM: dts: imx6sl: Fix memory node duplication Boards based on imx6sl have duplicate memory nodes: - One coming from the board dts file: memory@ - One coming from the imx6sl.dtsi file. Fix the duplication by removing the memory node from the dtsi file and by adding 'device_type = "memory";' in the board dts. Reported-by: Rob Herring Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 216f35fedd8688c8b654ebfbad18c6e64713fad7 Author: Fabio Estevam Date: Tue Nov 20 13:59:44 2018 -0200 ARM: dts: imx6sx: Fix memory node duplication Boards based on imx6sx have duplicate memory nodes: - One coming from the board dts file: memory@ - One coming from the imx6sx.dtsi file. Fix the duplication by removing the memory node from the dtsi file and by adding 'device_type = "memory";' in the board dts. Reported-by: Rob Herring Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 750d8df6e7b269b828f66631a1d39ea027afc92a Author: Fabio Estevam Date: Tue Nov 20 13:59:43 2018 -0200 ARM: dts: imx6ul: Fix memory node duplication Boards based on imx6ul have duplicate memory nodes: - One coming from the board dts file: memory@ - One coming from the imx6ul.dtsi file. Fix the duplication by removing the memory node from the dtsi file and by adding 'device_type = "memory";' in the board dts. Reported-by: Rob Herring Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 76368cca639e95b1c15d3a3abcc3b72e1afdbb5a Author: Fabio Estevam Date: Tue Nov 20 13:59:42 2018 -0200 ARM: dts: imx6ul-ccimx6ulsom: Add memory node to board dts Add memory node to board dts. This is done in preparation of removing the memory node from imx6ul.dtsi. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 3f343ec3eabcded338b62c04eadc8173955ec64e Author: Anson Huang Date: Tue Nov 20 01:35:34 2018 +0000 ARM: dts: imx7d-sdb: add rev-a board support Current imx7d-sdb.dts has some incorrect settings about Rev-A and Rev-B boards, some of the settings are based on Rev-A board but some are based on Rev-B board, clean up it by adding i.MX7D SDB Rev-A board support, make default imx7d-sdb.dts for Rev-B board as usual, and introduce imx7d-sdb-reva.dts for Rev-A board. Below are the affected differences of Rev-A and Rev-B board: Rev-A Rev-B USB_OTG2_PWR: UART3_CTS_B GPIO1_IO07 ENET_EN_B: None GPIO1_IO04 TP_INT_B: EPDC_DATA13 EPDC_BDR1 Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 4d8aa0097dcc5285c4cbc2d709188dc19e967599 Author: Viresh Kumar Date: Fri Nov 16 15:31:11 2018 +0530 ARM: dts: ls1021a: Add all CPUs in cooling maps Each CPU can (and does) participate in cooling down the system but the DT only captures a handful of them, normally CPU0, in the cooling maps. Things work by chance currently as under normal circumstances its the first CPU of each cluster which is used by the operating systems to probe the cooling devices. But as soon as this CPU ordering changes and any other CPU is used to bring up the cooling device, we will start seeing failures. Also the DT is rather incomplete when we list only one CPU in the cooling maps, as the hardware doesn't have any such limitations. Update cooling maps to include all devices affected by individual trip points. Signed-off-by: Viresh Kumar Signed-off-by: Shawn Guo commit 63e71fedc07c4ece748cb0d35642df1e42ebba79 Author: Jan Tuerk Date: Tue Nov 27 16:04:03 2018 +0100 ARM: dts: Add support for emtrion emCON-MX6 series This patch adds support for the emtrion GmbH emCON-MX6 modules. They are available with imx.6 Solo, Dual-Lite, Dual and Quad equipped with Memory from 512MB to 2GB (configured by U-Boot). Our default developer-Kit ships with the Avari baseboard and the EDT ETM0700G0BDH6 Display (imx6[q|dl]-emcon-avari). The devicetree is split into the common part providing all module components and the basic support for all SoC versions (imx6qdl-emcon.dtsi) and parts which are i.mx6 S|DL and D|Q relevant. Finally the support for the avari baseboard in the developer-kit configuration is provided by the emcon-avari dts files. Signed-off-by: Jan Tuerk Signed-off-by: Shawn Guo commit d87cf8ce52820256dcff3a52871d67e3994e39e0 Author: Jan Tuerk Date: Tue Nov 27 16:04:02 2018 +0100 dt-bindings: arm: Document emtrion emCON-MX6 bindings Document the compatible strings for emtrion emCON-MX6 SoM's. Signed-off-by: Jan Tuerk Reviewed-by: Rob Herring Signed-off-by: Shawn Guo commit fd12087d4882e32f061cabf168b4dafd69d41773 Author: Jan Tuerk Date: Tue Nov 27 16:04:01 2018 +0100 ARM: dts: imx: Add an cpu0 label for imx6dl devices Adding the label cpu0 allows the adjustment of cpu-parameters by reference in overlaying dtsi files in the same way as it is possible for imx6q devices. Signed-off-by: Jan Tuerk Reviewed-by: Andreas Färber Signed-off-by: Shawn Guo commit 4ca7dbdb06c1eda3ba68846c78ebbaefd70c55c0 Author: Frieder Schrempf Date: Thu Oct 18 09:45:04 2018 +0200 ARM: dts: imx: Add dummy PHYs for HSIC-only USB controllers Some SOCs in the i.MX6 family have a USB host controller that is only capable of the HSIC interface and has no on-board PHY. To be able to use these controllers, we need to add "usb-nop-xceiv" dummy PHYs. Signed-off-by: Frieder Schrempf Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 7cd1abb3ae6b84391d68edcb9acd342398ee29c2 Author: Anson Huang Date: Wed Nov 7 08:51:07 2018 +0000 ARM: dts: imx6sx: specify proper clock for nodes with dummy clock From i.MX6SX reference manual CCM chapter, KPP and WDOGn use IPG clock as their clock, specify IPG clock for KPP and WDOGn instead of DUMMY clock. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 4246bd46ee99248301297b6adf251a680059899f Author: Hou Zhiqiang Date: Wed Nov 7 05:35:27 2018 +0000 ARM: dts: ls1021a: removed compatible string "snps,dw-pcie" Removed the wrong compatible string "snps,dw-pcie", in case match incorrect driver. Signed-off-by: Hou Zhiqiang Signed-off-by: Shawn Guo commit ac8ed2824e8d7655bbf4eb6d22ee08ca3f1f63d4 Author: Hou Zhiqiang Date: Wed Nov 7 05:35:22 2018 +0000 dt-bindings: pci: layerscape-pci: removed compatible string "snps,dw-pcie" Removed the compatible string "snps,dw-pcie", it is for the reference platform driver for PCI RC IP Protoyping Kits based on the ARC SDP, so it is not suitable for all platform with designware PCIe controller, and platform vendors have themselves' drivers. The compatible string "snsp,dw-pcie" was added by mistake and it's not matched that time, but it is matched because PCIe drivers has been collected recently. Signed-off-by: Hou Zhiqiang Reviewed-by: Rob Herring Signed-off-by: Shawn Guo commit 8ff7754ae1f57c50a977aab7565ab84376ed6af6 Author: Hou Zhiqiang Date: Wed Nov 7 05:35:17 2018 +0000 dt-bindings: pci: layerscape-pci: add compatible strings "fsl,ls1043a-pcie" The PCIe compatible string for LS1043A was lost, so add it. Signed-off-by: Hou Zhiqiang Reviewed-by: Rob Herring Signed-off-by: Shawn Guo commit 29988e867cb17de7119e971f9acfad2c3fccdb47 Author: Fabio Estevam Date: Tue Nov 6 13:40:47 2018 -0200 ARM: dts: imx7: Fix memory node duplication Boards based on imx7 have duplicate memory nodes: - One coming from the board dts file: memory@ - One coming from the imx7s.dtsi file. Fix the duplication by removing the memory node from the dtsi file and by adding 'device_type = "memory";' in the board dts. Reported-by: Rob Herring Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 8721610a6c2b8c42fc57819d8c3bfbb9166f95a3 Author: Fabio Estevam Date: Tue Nov 6 13:40:46 2018 -0200 ARM: dts: imx35: Fix memory node duplication Boards based on imx35 have duplicate memory nodes: - One coming from the board dts file: memory@ - One coming from the imx35.dtsi file. Fix the duplication by removing the memory node from the dtsi file and by adding 'device_type = "memory";' in the board dts. Reported-by: Rob Herring Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 013d37e4707e24c7b9bc3fc55aeda55ce9c2b262 Author: Fabio Estevam Date: Tue Nov 6 13:40:45 2018 -0200 ARM: dts: imx31: Fix memory node duplication Boards based on imx31 have duplicate memory nodes: - One coming from the board dts file: memory@ - One coming from the imx31.dtsi file. Fix the duplication by removing the memory node from the dtsi file and by adding 'device_type = "memory";' in the board dts. Reported-by: Rob Herring Signed-off-by: Fabio Estevam Reviewed-by: Vladimir Zapolskiy Tested-by: Vladimir Zapolskiy Signed-off-by: Shawn Guo commit d2cf9fd301538267015fdb6a5494da0cc8979868 Author: Fabio Estevam Date: Tue Nov 6 10:03:42 2018 -0200 ARM: dts: imx6sx: Complete the PXP support According to Documentation/devicetree/bindings/media/fsl-pxp.txt, only one PXP clock needs to be described and it should be named "axi". Also pass the compatible string as suggested in the bindings doc. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 6ff9ec2fea5ff2054520029cc717bca8a93b53a7 Author: Anson Huang Date: Tue Nov 6 09:19:41 2018 +0000 ARM: dts: imx6sl: vddpu is NOT an always-on regulator Remove "regulator-always-on" property for vddpu regulator since it can be OFF when GPU power domain is OFF. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit 48dd72f82acaa10dddb3cddc64e6c41ae57defa3 Author: Anson Huang Date: Tue Nov 6 09:19:36 2018 +0000 ARM: dts: imx6sll: remove unused property in gpc node The "fsl,mf-mix-wakeup-irq" is ONLY used as a temporary solution in NXP's internal tree for Mega/Fast Mix off feature after suspend, upstream kernel does NOT need it, remove it. Signed-off-by: Anson Huang Signed-off-by: Shawn Guo commit e8fd17b900a4a1e3a8bef7b44727cbad35db05a7 Author: Fabio Estevam Date: Mon Nov 5 19:14:46 2018 -0200 ARM: dts: imx53: Fix memory node duplication Boards based on imx53 have duplicate memory nodes: - One coming from the board dts file: memory@ - One coming from the imx53.dtsi file. Fix the duplication by removing the memory node from the dtsi file and by adding 'device_type = "memory";' in the board dts. Reported-by: Rob Herring Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 6a9681168b83c62abfa457c709f2f4b126bd6b92 Author: Fabio Estevam Date: Mon Nov 5 19:14:45 2018 -0200 ARM: dts: imx51: Fix memory node duplication Boards based on imx51 have duplicate memory nodes: - One coming from the board dts file: memory@ - One coming from the imx51.dtsi file. Fix the duplication by removing the memory node from the dtsi file and by adding 'device_type = "memory";' in the board dts. Reported-by: Rob Herring Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit de70d0e9d43dd5fa899ce3a1560a4d2536b6b71e Author: A.s. Dong Date: Sat Nov 10 15:13:04 2018 +0000 ARM: imx: add initial support for imx7ulp The i.MX 7ULP family of processors features NXP's advanced implementation of the Arm Cortex-A7 core, the Arm Cortex-M4 core, as well as a 3D and 2D Graphics Processing Units (GPUs). This patch aims to add an initial support for imx7ulp. Note that we need configure power mode to Partial Stop mode 3 with system/bus clock enabled first as the default enabled STOP mode will gate off system/bus clock when execute WFI in MX7ULP SoC. And there's still no MXC_CPU_IMX7ULP IDs read from register as ULP has no anatop as before. So we encode one with 0xff in reverse order in case new ones will be in the future. Cc: Shawn Guo Signed-off-by: Dong Aisheng Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 7c41ea57beb2aee96fa63091a457b1a2826f3c42 Author: Uwe Kleine-König Date: Wed Nov 28 10:04:16 2018 +0100 ARM: debug-imx: only define DEBUG_IMX_UART_PORT if needed If debugging on i.MX is enabled DEBUG_IMX_UART_PORT defines which UART is used for the debug output. If however debugging is off don't only hide the then unused config item but drop it completely by using a dependency instead of a conditional prompt. This fixes DEBUG_IMX_UART_PORT being present in the kernel config even if DEBUG_LL is disabled. Signed-off-by: Uwe Kleine-König Signed-off-by: Shawn Guo commit b6444cf5fa607469d9a14edef2edad32773f4514 Author: Leonard Crestez Date: Mon Oct 8 18:06:19 2018 +0000 soc: imx: gpc: Increase GPC_CLK_MAX to 7 The DISPLAY power domain on imx6sx has 7 clocks. Signed-off-by: Leonard Crestez Signed-off-by: Shawn Guo commit 96f774106ed48808a5e314741e3414c617d14460 Merge: 58ab5e32e6fd8 40e020c129cfc Author: Jens Axboe Date: Sun Dec 9 17:45:40 2018 -0700 Merge tag 'v4.20-rc6' into for-4.21/block Pull in v4.20-rc6 to resolve the conflict in NVMe, but also to get the two corruption fixes. We're going to be overhauling the direct dispatch path, and we need to do that on top of the changes we made for that in mainline. Signed-off-by: Jens Axboe commit 58ab5e32e6fd83e33943614e7257f2ac5823824a Author: Jens Axboe Date: Sun Dec 9 17:43:20 2018 -0700 sbitmap: silence bogus lockdep IRQ warning Ming reports that lockdep spews the following trace. What this essentially says is that the sbitmap swap_lock was used inconsistently in IRQ enabled and disabled context, and that is usually indicative of a bug that will cause a deadlock. For this case, it's a false positive. The swap_lock is used from process context only, when we swap the bits in the word and cleared mask. We also end up doing that when we are getting a driver tag, from the blk_mq_mark_tag_wait(), and from there we hold the waitqueue lock with IRQs disabled. However, this isn't from an actual IRQ, it's still process context. In lieu of a better way to fix this, simply always disable interrupts when grabbing the swap_lock if lockdep is enabled. [ 100.967642] ================start test sanity/001================ [ 101.238280] null: module loaded [ 106.093735] [ 106.094012] ===================================================== [ 106.094854] WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected [ 106.095759] 4.20.0-rc3_5d2ee7122c73_for-next+ #1 Not tainted [ 106.096551] ----------------------------------------------------- [ 106.097386] fio/1043 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: [ 106.098231] 000000004c43fa71 (&(&sb->map[i].swap_lock)->rlock){+.+.}, at: sbitmap_get+0xd5/0x22c [ 106.099431] [ 106.099431] and this task is already holding: [ 106.100229] 000000007eec8b2f (&(&hctx->dispatch_wait_lock)->rlock){....}, at: blk_mq_dispatch_rq_list+0x4c1/0xd7c [ 106.101630] which would create a new lock dependency: [ 106.102326] (&(&hctx->dispatch_wait_lock)->rlock){....} -> (&(&sb->map[i].swap_lock)->rlock){+.+.} [ 106.103553] [ 106.103553] but this new dependency connects a SOFTIRQ-irq-safe lock: [ 106.104580] (&sbq->ws[i].wait){..-.} [ 106.104582] [ 106.104582] ... which became SOFTIRQ-irq-safe at: [ 106.105751] _raw_spin_lock_irqsave+0x4b/0x82 [ 106.106284] __wake_up_common_lock+0x119/0x1b9 [ 106.106825] sbitmap_queue_wake_up+0x33f/0x383 [ 106.107456] sbitmap_queue_clear+0x4c/0x9a [ 106.108046] __blk_mq_free_request+0x188/0x1d3 [ 106.108581] blk_mq_free_request+0x23b/0x26b [ 106.109102] scsi_end_request+0x345/0x5d7 [ 106.109587] scsi_io_completion+0x4b5/0x8f0 [ 106.110099] scsi_finish_command+0x412/0x456 [ 106.110615] scsi_softirq_done+0x23f/0x29b [ 106.111115] blk_done_softirq+0x2a7/0x2e6 [ 106.111608] __do_softirq+0x360/0x6ad [ 106.112062] run_ksoftirqd+0x2f/0x5b [ 106.112499] smpboot_thread_fn+0x3a5/0x3db [ 106.113000] kthread+0x1d4/0x1e4 [ 106.113457] ret_from_fork+0x3a/0x50 [ 106.113969] [ 106.113969] to a SOFTIRQ-irq-unsafe lock: [ 106.114672] (&(&sb->map[i].swap_lock)->rlock){+.+.} [ 106.114674] [ 106.114674] ... which became SOFTIRQ-irq-unsafe at: [ 106.116000] ... [ 106.116003] _raw_spin_lock+0x33/0x64 [ 106.116676] sbitmap_get+0xd5/0x22c [ 106.117134] __sbitmap_queue_get+0xe8/0x177 [ 106.117731] __blk_mq_get_tag+0x1e6/0x22d [ 106.118286] blk_mq_get_tag+0x1db/0x6e4 [ 106.118756] blk_mq_get_driver_tag+0x161/0x258 [ 106.119383] blk_mq_dispatch_rq_list+0x28e/0xd7c [ 106.120043] blk_mq_do_dispatch_sched+0x23a/0x287 [ 106.120607] blk_mq_sched_dispatch_requests+0x379/0x3fc [ 106.121234] __blk_mq_run_hw_queue+0x137/0x17e [ 106.121781] __blk_mq_delay_run_hw_queue+0x80/0x25f [ 106.122366] blk_mq_run_hw_queue+0x151/0x187 [ 106.122887] blk_mq_sched_insert_requests+0x13f/0x175 [ 106.123492] blk_mq_flush_plug_list+0x7d6/0x81b [ 106.124042] blk_flush_plug_list+0x392/0x3d7 [ 106.124557] blk_finish_plug+0x37/0x4f [ 106.125019] read_pages+0x3ef/0x430 [ 106.125446] __do_page_cache_readahead+0x18e/0x2fc [ 106.126027] force_page_cache_readahead+0x121/0x133 [ 106.126621] page_cache_sync_readahead+0x35f/0x3bb [ 106.127229] generic_file_buffered_read+0x410/0x1860 [ 106.127932] __vfs_read+0x319/0x38f [ 106.128415] vfs_read+0xd2/0x19a [ 106.128817] ksys_read+0xb9/0x135 [ 106.129225] do_syscall_64+0x140/0x385 [ 106.129684] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 106.130292] [ 106.130292] other info that might help us debug this: [ 106.130292] [ 106.131226] Chain exists of: [ 106.131226] &sbq->ws[i].wait --> &(&hctx->dispatch_wait_lock)->rlock --> &(&sb->map[i].swap_lock)->rlock [ 106.131226] [ 106.132865] Possible interrupt unsafe locking scenario: [ 106.132865] [ 106.133659] CPU0 CPU1 [ 106.134194] ---- ---- [ 106.134733] lock(&(&sb->map[i].swap_lock)->rlock); [ 106.135318] local_irq_disable(); [ 106.136014] lock(&sbq->ws[i].wait); [ 106.136747] lock(&(&hctx->dispatch_wait_lock)->rlock); [ 106.137742] [ 106.138110] lock(&sbq->ws[i].wait); [ 106.138625] [ 106.138625] *** DEADLOCK *** [ 106.138625] [ 106.139430] 3 locks held by fio/1043: [ 106.139947] #0: 0000000076ff0fd9 (rcu_read_lock){....}, at: hctx_lock+0x29/0xe8 [ 106.140813] #1: 000000002feb1016 (&sbq->ws[i].wait){..-.}, at: blk_mq_dispatch_rq_list+0x4ad/0xd7c [ 106.141877] #2: 000000007eec8b2f (&(&hctx->dispatch_wait_lock)->rlock){....}, at: blk_mq_dispatch_rq_list+0x4c1/0xd7c [ 106.143267] [ 106.143267] the dependencies between SOFTIRQ-irq-safe lock and the holding lock: [ 106.144351] -> (&sbq->ws[i].wait){..-.} ops: 82 { [ 106.144926] IN-SOFTIRQ-W at: [ 106.145314] _raw_spin_lock_irqsave+0x4b/0x82 [ 106.146042] __wake_up_common_lock+0x119/0x1b9 [ 106.146785] sbitmap_queue_wake_up+0x33f/0x383 [ 106.147567] sbitmap_queue_clear+0x4c/0x9a [ 106.148379] __blk_mq_free_request+0x188/0x1d3 [ 106.149148] blk_mq_free_request+0x23b/0x26b [ 106.149864] scsi_end_request+0x345/0x5d7 [ 106.150546] scsi_io_completion+0x4b5/0x8f0 [ 106.151367] scsi_finish_command+0x412/0x456 [ 106.152157] scsi_softirq_done+0x23f/0x29b [ 106.152855] blk_done_softirq+0x2a7/0x2e6 [ 106.153537] __do_softirq+0x360/0x6ad [ 106.154280] run_ksoftirqd+0x2f/0x5b [ 106.155020] smpboot_thread_fn+0x3a5/0x3db [ 106.155828] kthread+0x1d4/0x1e4 [ 106.156526] ret_from_fork+0x3a/0x50 [ 106.157267] INITIAL USE at: [ 106.157713] _raw_spin_lock_irqsave+0x4b/0x82 [ 106.158542] prepare_to_wait_exclusive+0xa8/0x215 [ 106.159421] blk_mq_get_tag+0x34f/0x6e4 [ 106.160186] blk_mq_get_request+0x48e/0xaef [ 106.160997] blk_mq_make_request+0x27e/0xbd2 [ 106.161828] generic_make_request+0x4d1/0x873 [ 106.162661] submit_bio+0x20c/0x253 [ 106.163379] mpage_bio_submit+0x44/0x4b [ 106.164142] mpage_readpages+0x3c2/0x407 [ 106.164919] read_pages+0x13a/0x430 [ 106.165633] __do_page_cache_readahead+0x18e/0x2fc [ 106.166530] force_page_cache_readahead+0x121/0x133 [ 106.167439] page_cache_sync_readahead+0x35f/0x3bb [ 106.168337] generic_file_buffered_read+0x410/0x1860 [ 106.169255] __vfs_read+0x319/0x38f [ 106.169977] vfs_read+0xd2/0x19a [ 106.170662] ksys_read+0xb9/0x135 [ 106.171356] do_syscall_64+0x140/0x385 [ 106.172120] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 106.173051] } [ 106.173308] ... key at: [] __key.26481+0x0/0x40 [ 106.174219] ... acquired at: [ 106.174646] _raw_spin_lock+0x33/0x64 [ 106.175183] blk_mq_dispatch_rq_list+0x4c1/0xd7c [ 106.175843] blk_mq_do_dispatch_sched+0x23a/0x287 [ 106.176518] blk_mq_sched_dispatch_requests+0x379/0x3fc [ 106.177262] __blk_mq_run_hw_queue+0x137/0x17e [ 106.177900] __blk_mq_delay_run_hw_queue+0x80/0x25f [ 106.178591] blk_mq_run_hw_queue+0x151/0x187 [ 106.179207] blk_mq_sched_insert_requests+0x13f/0x175 [ 106.179926] blk_mq_flush_plug_list+0x7d6/0x81b [ 106.180571] blk_flush_plug_list+0x392/0x3d7 [ 106.181187] blk_finish_plug+0x37/0x4f [ 106.181737] __se_sys_io_submit+0x171/0x304 [ 106.182346] do_syscall_64+0x140/0x385 [ 106.182895] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 106.183607] [ 106.183830] -> (&(&hctx->dispatch_wait_lock)->rlock){....} ops: 1 { [ 106.184691] INITIAL USE at: [ 106.185119] _raw_spin_lock+0x33/0x64 [ 106.185838] blk_mq_dispatch_rq_list+0x4c1/0xd7c [ 106.186697] blk_mq_do_dispatch_sched+0x23a/0x287 [ 106.187551] blk_mq_sched_dispatch_requests+0x379/0x3fc [ 106.188481] __blk_mq_run_hw_queue+0x137/0x17e [ 106.189307] __blk_mq_delay_run_hw_queue+0x80/0x25f [ 106.190189] blk_mq_run_hw_queue+0x151/0x187 [ 106.190989] blk_mq_sched_insert_requests+0x13f/0x175 [ 106.191902] blk_mq_flush_plug_list+0x7d6/0x81b [ 106.192739] blk_flush_plug_list+0x392/0x3d7 [ 106.193535] blk_finish_plug+0x37/0x4f [ 106.194269] __se_sys_io_submit+0x171/0x304 [ 106.195059] do_syscall_64+0x140/0x385 [ 106.195794] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 106.196705] } [ 106.196950] ... key at: [] __key.51231+0x0/0x40 [ 106.197853] ... acquired at: [ 106.198270] lock_acquire+0x280/0x2f3 [ 106.198806] _raw_spin_lock+0x33/0x64 [ 106.199337] sbitmap_get+0xd5/0x22c [ 106.199850] __sbitmap_queue_get+0xe8/0x177 [ 106.200450] __blk_mq_get_tag+0x1e6/0x22d [ 106.201035] blk_mq_get_tag+0x1db/0x6e4 [ 106.201589] blk_mq_get_driver_tag+0x161/0x258 [ 106.202237] blk_mq_dispatch_rq_list+0x5b9/0xd7c [ 106.202902] blk_mq_do_dispatch_sched+0x23a/0x287 [ 106.203572] blk_mq_sched_dispatch_requests+0x379/0x3fc [ 106.204316] __blk_mq_run_hw_queue+0x137/0x17e [ 106.204956] __blk_mq_delay_run_hw_queue+0x80/0x25f [ 106.205649] blk_mq_run_hw_queue+0x151/0x187 [ 106.206269] blk_mq_sched_insert_requests+0x13f/0x175 [ 106.206997] blk_mq_flush_plug_list+0x7d6/0x81b [ 106.207644] blk_flush_plug_list+0x392/0x3d7 [ 106.208264] blk_finish_plug+0x37/0x4f [ 106.208814] __se_sys_io_submit+0x171/0x304 [ 106.209415] do_syscall_64+0x140/0x385 [ 106.209965] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 106.210684] [ 106.210904] [ 106.210904] the dependencies between the lock to be acquired [ 106.210905] and SOFTIRQ-irq-unsafe lock: [ 106.212541] -> (&(&sb->map[i].swap_lock)->rlock){+.+.} ops: 1969 { [ 106.213393] HARDIRQ-ON-W at: [ 106.213840] _raw_spin_lock+0x33/0x64 [ 106.214570] sbitmap_get+0xd5/0x22c [ 106.215282] __sbitmap_queue_get+0xe8/0x177 [ 106.216086] __blk_mq_get_tag+0x1e6/0x22d [ 106.216876] blk_mq_get_tag+0x1db/0x6e4 [ 106.217627] blk_mq_get_driver_tag+0x161/0x258 [ 106.218465] blk_mq_dispatch_rq_list+0x28e/0xd7c [ 106.219326] blk_mq_do_dispatch_sched+0x23a/0x287 [ 106.220198] blk_mq_sched_dispatch_requests+0x379/0x3fc [ 106.221138] __blk_mq_run_hw_queue+0x137/0x17e [ 106.221975] __blk_mq_delay_run_hw_queue+0x80/0x25f [ 106.222874] blk_mq_run_hw_queue+0x151/0x187 [ 106.223686] blk_mq_sched_insert_requests+0x13f/0x175 [ 106.224597] blk_mq_flush_plug_list+0x7d6/0x81b [ 106.225444] blk_flush_plug_list+0x392/0x3d7 [ 106.226255] blk_finish_plug+0x37/0x4f [ 106.227006] read_pages+0x3ef/0x430 [ 106.227717] __do_page_cache_readahead+0x18e/0x2fc [ 106.228595] force_page_cache_readahead+0x121/0x133 [ 106.229491] page_cache_sync_readahead+0x35f/0x3bb [ 106.230373] generic_file_buffered_read+0x410/0x1860 [ 106.231277] __vfs_read+0x319/0x38f [ 106.231986] vfs_read+0xd2/0x19a [ 106.232666] ksys_read+0xb9/0x135 [ 106.233350] do_syscall_64+0x140/0x385 [ 106.234097] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 106.235012] SOFTIRQ-ON-W at: [ 106.235460] _raw_spin_lock+0x33/0x64 [ 106.236195] sbitmap_get+0xd5/0x22c [ 106.236913] __sbitmap_queue_get+0xe8/0x177 [ 106.237715] __blk_mq_get_tag+0x1e6/0x22d [ 106.238488] blk_mq_get_tag+0x1db/0x6e4 [ 106.239244] blk_mq_get_driver_tag+0x161/0x258 [ 106.240079] blk_mq_dispatch_rq_list+0x28e/0xd7c [ 106.240937] blk_mq_do_dispatch_sched+0x23a/0x287 [ 106.241806] blk_mq_sched_dispatch_requests+0x379/0x3fc [ 106.242751] __blk_mq_run_hw_queue+0x137/0x17e [ 106.243579] __blk_mq_delay_run_hw_queue+0x80/0x25f [ 106.244469] blk_mq_run_hw_queue+0x151/0x187 [ 106.245277] blk_mq_sched_insert_requests+0x13f/0x175 [ 106.246191] blk_mq_flush_plug_list+0x7d6/0x81b [ 106.247044] blk_flush_plug_list+0x392/0x3d7 [ 106.247859] blk_finish_plug+0x37/0x4f [ 106.248749] read_pages+0x3ef/0x430 [ 106.249463] __do_page_cache_readahead+0x18e/0x2fc [ 106.250357] force_page_cache_readahead+0x121/0x133 [ 106.251263] page_cache_sync_readahead+0x35f/0x3bb [ 106.252157] generic_file_buffered_read+0x410/0x1860 [ 106.253084] __vfs_read+0x319/0x38f [ 106.253808] vfs_read+0xd2/0x19a [ 106.254488] ksys_read+0xb9/0x135 [ 106.255186] do_syscall_64+0x140/0x385 [ 106.255943] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 106.256867] INITIAL USE at: [ 106.257300] _raw_spin_lock+0x33/0x64 [ 106.258033] sbitmap_get+0xd5/0x22c [ 106.258747] __sbitmap_queue_get+0xe8/0x177 [ 106.259542] __blk_mq_get_tag+0x1e6/0x22d [ 106.260320] blk_mq_get_tag+0x1db/0x6e4 [ 106.261072] blk_mq_get_driver_tag+0x161/0x258 [ 106.261902] blk_mq_dispatch_rq_list+0x28e/0xd7c [ 106.262762] blk_mq_do_dispatch_sched+0x23a/0x287 [ 106.263626] blk_mq_sched_dispatch_requests+0x379/0x3fc [ 106.264571] __blk_mq_run_hw_queue+0x137/0x17e [ 106.265409] __blk_mq_delay_run_hw_queue+0x80/0x25f [ 106.266302] blk_mq_run_hw_queue+0x151/0x187 [ 106.267111] blk_mq_sched_insert_requests+0x13f/0x175 [ 106.268028] blk_mq_flush_plug_list+0x7d6/0x81b [ 106.268878] blk_flush_plug_list+0x392/0x3d7 [ 106.269694] blk_finish_plug+0x37/0x4f [ 106.270432] read_pages+0x3ef/0x430 [ 106.271139] __do_page_cache_readahead+0x18e/0x2fc [ 106.272040] force_page_cache_readahead+0x121/0x133 [ 106.272932] page_cache_sync_readahead+0x35f/0x3bb [ 106.273811] generic_file_buffered_read+0x410/0x1860 [ 106.274709] __vfs_read+0x319/0x38f [ 106.275407] vfs_read+0xd2/0x19a [ 106.276074] ksys_read+0xb9/0x135 [ 106.276764] do_syscall_64+0x140/0x385 [ 106.277500] entry_SYSCALL_64_after_hwframe+0x49/0xbe [ 106.278417] } [ 106.278676] ... key at: [] __key.26212+0x0/0x40 [ 106.279586] ... acquired at: [ 106.280026] lock_acquire+0x280/0x2f3 [ 106.280559] _raw_spin_lock+0x33/0x64 [ 106.281101] sbitmap_get+0xd5/0x22c [ 106.281610] __sbitmap_queue_get+0xe8/0x177 [ 106.282221] __blk_mq_get_tag+0x1e6/0x22d [ 106.282809] blk_mq_get_tag+0x1db/0x6e4 [ 106.283368] blk_mq_get_driver_tag+0x161/0x258 [ 106.284018] blk_mq_dispatch_rq_list+0x5b9/0xd7c [ 106.284685] blk_mq_do_dispatch_sched+0x23a/0x287 [ 106.285371] blk_mq_sched_dispatch_requests+0x379/0x3fc [ 106.286135] __blk_mq_run_hw_queue+0x137/0x17e [ 106.286806] __blk_mq_delay_run_hw_queue+0x80/0x25f [ 106.287515] blk_mq_run_hw_queue+0x151/0x187 [ 106.288149] blk_mq_sched_insert_requests+0x13f/0x175 [ 106.289041] blk_mq_flush_plug_list+0x7d6/0x81b [ 106.289912] blk_flush_plug_list+0x392/0x3d7 [ 106.290590] blk_finish_plug+0x37/0x4f [ 106.291238] __se_sys_io_submit+0x171/0x304 [ 106.291864] do_syscall_64+0x140/0x385 [ 106.292534] entry_SYSCALL_64_after_hwframe+0x49/0xbe Reported-by: Ming Lei Tested-by: Guenter Roeck Signed-off-by: Jens Axboe commit 01d3240a04f4c09392e13c77b54d4423ebce2d72 Author: Sean Young Date: Thu Dec 6 13:01:03 2018 +0000 media: bpf: add bpf function to report mouse movement Some IR remotes have a directional pad or other pointer-like thing that can be used as a mouse. Make it possible to decode these types of IR protocols in BPF. Cc: netdev@vger.kernel.org Signed-off-by: Sean Young Signed-off-by: Alexei Starovoitov commit ca5d1a7fad0f8a95cbcc992fcfd687b4c5653619 Merge: 6baefa1aa46f0 b053b439b72ad Author: Alexei Starovoitov Date: Sun Dec 9 13:54:39 2018 -0800 Merge branch 'bpf_line_info' Martin Lau says: ==================== This patch series introduces the bpf_line_info. Please see individual patch for details. It will be useful for introspection purpose, like: [root@arch-fb-vm1 bpf]# ~/devshare/fb-kernel/linux/tools/bpf/bpftool/bpftool prog dump jited pinned /sys/fs/bpf/test_btf_haskv [...] int test_long_fname_2(struct dummy_tracepoint_args * arg): bpf_prog_44a040bf25481309_test_long_fname_2: ; static int test_long_fname_2(struct dummy_tracepoint_args *arg) 0: push %rbp 1: mov %rsp,%rbp 4: sub $0x30,%rsp b: sub $0x28,%rbp f: mov %rbx,0x0(%rbp) 13: mov %r13,0x8(%rbp) 17: mov %r14,0x10(%rbp) 1b: mov %r15,0x18(%rbp) 1f: xor %eax,%eax 21: mov %rax,0x20(%rbp) 25: xor %esi,%esi ; int key = 0; 27: mov %esi,-0x4(%rbp) ; if (!arg->sock) 2a: mov 0x8(%rdi),%rdi ; if (!arg->sock) 2e: cmp $0x0,%rdi 32: je 0x0000000000000070 34: mov %rbp,%rsi ; counts = bpf_map_lookup_elem(&btf_map, &key); 37: add $0xfffffffffffffffc,%rsi 3b: movabs $0xffff8881139d7480,%rdi 45: add $0x110,%rdi 4c: mov 0x0(%rsi),%eax 4f: cmp $0x4,%rax 53: jae 0x000000000000005e 55: shl $0x3,%rax 59: add %rdi,%rax 5c: jmp 0x0000000000000060 5e: xor %eax,%eax ; if (!counts) 60: cmp $0x0,%rax 64: je 0x0000000000000070 ; counts->v6++; 66: mov 0x4(%rax),%edi 69: add $0x1,%rdi 6d: mov %edi,0x4(%rax) 70: mov 0x0(%rbp),%rbx 74: mov 0x8(%rbp),%r13 78: mov 0x10(%rbp),%r14 7c: mov 0x18(%rbp),%r15 80: add $0x28,%rbp 84: leaveq 85: retq [...] ==================== Signed-off-by: Alexei Starovoitov commit b053b439b72ad152257ecc3f71cfb4c619b0137e Author: Martin KaFai Lau Date: Fri Dec 7 16:42:32 2018 -0800 bpf: libbpf: bpftool: Print bpf_line_info during prog dump This patch adds print bpf_line_info function in 'prog dump jitted' and 'prog dump xlated': [root@arch-fb-vm1 bpf]# ~/devshare/fb-kernel/linux/tools/bpf/bpftool/bpftool prog dump jited pinned /sys/fs/bpf/test_btf_haskv [...] int test_long_fname_2(struct dummy_tracepoint_args * arg): bpf_prog_44a040bf25481309_test_long_fname_2: ; static int test_long_fname_2(struct dummy_tracepoint_args *arg) 0: push %rbp 1: mov %rsp,%rbp 4: sub $0x30,%rsp b: sub $0x28,%rbp f: mov %rbx,0x0(%rbp) 13: mov %r13,0x8(%rbp) 17: mov %r14,0x10(%rbp) 1b: mov %r15,0x18(%rbp) 1f: xor %eax,%eax 21: mov %rax,0x20(%rbp) 25: xor %esi,%esi ; int key = 0; 27: mov %esi,-0x4(%rbp) ; if (!arg->sock) 2a: mov 0x8(%rdi),%rdi ; if (!arg->sock) 2e: cmp $0x0,%rdi 32: je 0x0000000000000070 34: mov %rbp,%rsi ; counts = bpf_map_lookup_elem(&btf_map, &key); 37: add $0xfffffffffffffffc,%rsi 3b: movabs $0xffff8881139d7480,%rdi 45: add $0x110,%rdi 4c: mov 0x0(%rsi),%eax 4f: cmp $0x4,%rax 53: jae 0x000000000000005e 55: shl $0x3,%rax 59: add %rdi,%rax 5c: jmp 0x0000000000000060 5e: xor %eax,%eax ; if (!counts) 60: cmp $0x0,%rax 64: je 0x0000000000000070 ; counts->v6++; 66: mov 0x4(%rax),%edi 69: add $0x1,%rdi 6d: mov %edi,0x4(%rax) 70: mov 0x0(%rbp),%rbx 74: mov 0x8(%rbp),%r13 78: mov 0x10(%rbp),%r14 7c: mov 0x18(%rbp),%r15 80: add $0x28,%rbp 84: leaveq 85: retq [...] With linum: [root@arch-fb-vm1 bpf]# ~/devshare/fb-kernel/linux/tools/bpf/bpftool/bpftool prog dump jited pinned /sys/fs/bpf/test_btf_haskv linum int _dummy_tracepoint(struct dummy_tracepoint_args * arg): bpf_prog_b07ccb89267cf242__dummy_tracepoint: ; return test_long_fname_1(arg); [file:/data/users/kafai/fb-kernel/linux/tools/testing/selftests/bpf/test_btf_haskv.c line_num:54 line_col:9] 0: push %rbp 1: mov %rsp,%rbp 4: sub $0x28,%rsp b: sub $0x28,%rbp f: mov %rbx,0x0(%rbp) 13: mov %r13,0x8(%rbp) 17: mov %r14,0x10(%rbp) 1b: mov %r15,0x18(%rbp) 1f: xor %eax,%eax 21: mov %rax,0x20(%rbp) 25: callq 0x000000000000851e ; return test_long_fname_1(arg); [file:/data/users/kafai/fb-kernel/linux/tools/testing/selftests/bpf/test_btf_haskv.c line_num:54 line_col:2] 2a: xor %eax,%eax 2c: mov 0x0(%rbp),%rbx 30: mov 0x8(%rbp),%r13 34: mov 0x10(%rbp),%r14 38: mov 0x18(%rbp),%r15 3c: add $0x28,%rbp 40: leaveq 41: retq [...] Signed-off-by: Martin KaFai Lau Acked-by: Yonghong Song Signed-off-by: Alexei Starovoitov commit 3d65014146c69bbc4d2947f60dbd722d352cdc46 Author: Martin KaFai Lau Date: Fri Dec 7 16:42:31 2018 -0800 bpf: libbpf: Add btf_line_info support to libbpf This patch adds bpf_line_info support to libbpf: 1) Parsing the line_info sec from ".BTF.ext" 2) Relocating the line_info. If the main prog *_info relocation fails, it will ignore the remaining subprog line_info and continue. If the subprog *_info relocation fails, it will bail out. 3) BPF_PROG_LOAD a prog with line_info Signed-off-by: Martin KaFai Lau Acked-by: Yonghong Song Signed-off-by: Alexei Starovoitov commit f0187f0b17fad7439f510eff4d65606c9ea1190f Author: Martin KaFai Lau Date: Fri Dec 7 16:42:29 2018 -0800 bpf: libbpf: Refactor and bug fix on the bpf_func_info loading logic This patch refactor and fix a bug in the libbpf's bpf_func_info loading logic. The bug fix and refactoring are targeting the same commit 2993e0515bb4 ("tools/bpf: add support to read .BTF.ext sections") which is in the bpf-next branch. 1) In bpf_load_program_xattr(), it should retry when errno == E2BIG regardless of log_buf and log_buf_sz. This patch fixes it. 2) btf_ext__reloc_init() and btf_ext__reloc() are essentially the same except btf_ext__reloc_init() always has insns_cnt == 0. Hence, btf_ext__reloc_init() is removed. btf_ext__reloc() is also renamed to btf_ext__reloc_func_info() to get ready for the line_info support in the next patch. 3) Consolidate func_info section logic from "btf_ext_parse_hdr()", "btf_ext_validate_func_info()" and "btf_ext__new()" to a new function "btf_ext_copy_func_info()" such that similar logic can be reused by the later libbpf's line_info patch. 4) The next line_info patch will store line_info_cnt instead of line_info_len in the bpf_program because the kernel is taking line_info_cnt also. It will save a few "len" to "cnt" conversions and will also save some function args. Hence, this patch also makes bpf_program to store func_info_cnt instead of func_info_len. 5) btf_ext depends on btf. e.g. the func_info's type_id in ".BTF.ext" is not useful when ".BTF" is absent. This patch only init the obj->btf_ext pointer after it has successfully init the obj->btf pointer. This can avoid always checking "obj->btf && obj->btf_ext" together for accessing ".BTF.ext". Checking "obj->btf_ext" alone will do. 6) Move "struct btf_sec_func_info" from btf.h to btf.c. There is no external usage outside btf.c. Fixes: 2993e0515bb4 ("tools/bpf: add support to read .BTF.ext sections") Signed-off-by: Martin KaFai Lau Acked-by: Yonghong Song Signed-off-by: Alexei Starovoitov commit 4d6304c763551cdb420201b1b754cc625d56bdd6 Author: Martin KaFai Lau Date: Fri Dec 7 16:42:28 2018 -0800 bpf: Add unit tests for bpf_line_info Add unit tests for bpf_line_info for both BPF_PROG_LOAD and BPF_OBJ_GET_INFO_BY_FD. jit enabled: [root@arch-fb-vm1 bpf]# ./test_btf -k 0 BTF prog info raw test[5] (line_info (No subprog)): OK BTF prog info raw test[6] (line_info (No subprog. insn_off >= prog->len)): OK BTF prog info raw test[7] (line_info (No subprog. zero tailing line_info): OK BTF prog info raw test[8] (line_info (No subprog. nonzero tailing line_info)): OK BTF prog info raw test[9] (line_info (subprog)): OK BTF prog info raw test[10] (line_info (subprog + func_info)): OK BTF prog info raw test[11] (line_info (subprog. missing 1st func line info)): OK BTF prog info raw test[12] (line_info (subprog. missing 2nd func line info)): OK BTF prog info raw test[13] (line_info (subprog. unordered insn offset)): OK jit disabled: BTF prog info raw test[5] (line_info (No subprog)): not jited. skipping jited_line_info check. OK BTF prog info raw test[6] (line_info (No subprog. insn_off >= prog->len)): OK BTF prog info raw test[7] (line_info (No subprog. zero tailing line_info): not jited. skipping jited_line_info check. OK BTF prog info raw test[8] (line_info (No subprog. nonzero tailing line_info)): OK BTF prog info raw test[9] (line_info (subprog)): not jited. skipping jited_line_info check. OK BTF prog info raw test[10] (line_info (subprog + func_info)): not jited. skipping jited_line_info check. OK BTF prog info raw test[11] (line_info (subprog. missing 1st func line info)): OK BTF prog info raw test[12] (line_info (subprog. missing 2nd func line info)): OK BTF prog info raw test[13] (line_info (subprog. unordered insn offset)): OK Signed-off-by: Martin KaFai Lau Acked-by: Yonghong Song Signed-off-by: Alexei Starovoitov commit 05687352c600930058ca4c68048302502e07a572 Author: Martin KaFai Lau Date: Fri Dec 7 16:42:27 2018 -0800 bpf: Refactor and bug fix in test_func_type in test_btf.c 1) bpf_load_program_xattr() is absorbing the EBIG error which makes testing this case impossible. It is replaced with a direct syscall(__NR_bpf, BPF_PROG_LOAD,...). 2) The test_func_type() is renamed to test_info_raw() to prepare for the new line_info test in the next patch. 3) The bpf_obj_get_info_by_fd() testing for func_info is refactored to test_get_finfo(). A new test_get_linfo() will be added in the next patch for testing line_info purpose. 4) The test->func_info_cnt is checked instead of a static value "2". 5) Remove unnecessary "\n" in error message. 6) Adding back info_raw_test_num to the cmd arg such that a specific test case can be tested, like all other existing tests. 7) Fix a bug in handling expected_prog_load_failure. A test could pass even if prog_fd != -1 while expected_prog_load_failure is true. 8) The min rec_size check should be < 8 instead of < 4. Fixes: 4798c4ba3ba9 ("tools/bpf: extends test_btf to test load/retrieve func_type info") Signed-off-by: Martin KaFai Lau Acked-by: Yonghong Song Signed-off-by: Alexei Starovoitov commit ee491d8dbe496c510fa06a786460638d78428147 Author: Martin KaFai Lau Date: Fri Dec 7 16:42:26 2018 -0800 bpf: tools: Sync uapi bpf.h Sync uapi bpf.h to tools/include/uapi/linux for the new bpf_line_info. Signed-off-by: Martin KaFai Lau Acked-by: Yonghong Song Signed-off-by: Alexei Starovoitov commit c454a46b5efd8eff8880e88ece2976e60a26bf35 Author: Martin KaFai Lau Date: Fri Dec 7 16:42:25 2018 -0800 bpf: Add bpf_line_info support This patch adds bpf_line_info support. It accepts an array of bpf_line_info objects during BPF_PROG_LOAD. The "line_info", "line_info_cnt" and "line_info_rec_size" are added to the "union bpf_attr". The "line_info_rec_size" makes bpf_line_info extensible in the future. The new "check_btf_line()" ensures the userspace line_info is valid for the kernel to use. When the verifier is translating/patching the bpf_prog (through "bpf_patch_insn_single()"), the line_infos' insn_off is also adjusted by the newly added "bpf_adj_linfo()". If the bpf_prog is jited, this patch also provides the jited addrs (in aux->jited_linfo) for the corresponding line_info.insn_off. "bpf_prog_fill_jited_linfo()" is added to fill the aux->jited_linfo. It is currently called by the x86 jit. Other jits can also use "bpf_prog_fill_jited_linfo()" and it will be done in the followup patches. In the future, if it deemed necessary, a particular jit could also provide its own "bpf_prog_fill_jited_linfo()" implementation. A few "*line_info*" fields are added to the bpf_prog_info such that the user can get the xlated line_info back (i.e. the line_info with its insn_off reflecting the translated prog). The jited_line_info is available if the prog is jited. It is an array of __u64. If the prog is not jited, jited_line_info_cnt is 0. The verifier's verbose log with line_info will be done in a follow up patch. Signed-off-by: Martin KaFai Lau Acked-by: Yonghong Song Signed-off-by: Alexei Starovoitov commit 31eb42bd9353c807522697ddc2a6ab14b4924fa5 Author: Jean Delvare Date: Mon Nov 19 09:17:38 2018 +0100 watchdog: w83627hf_wdt: Add quirk for Inves system On some systems, the NCT6791D comes with a companion chip and the watchdog function is in this companion chip. We must use a different unlocking sequence to access the companion chip. Use DMI strings to identify such system and adjust the unlocking sequence automatically. Signed-off-by: Jean Delvare Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 06f8f2ca0585ea0c8df7e6c65659b1f679b4254b Author: Yangtao Li Date: Tue Nov 20 09:54:45 2018 -0500 watchdog: cpwd: add of_node_put() use of_node_put() to release the refcount. Signed-off-by: Yangtao Li Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit e990e12741877e9bfac402ca468f4007a75f6e2a Author: Wolfram Sang Date: Wed Nov 7 20:46:02 2018 +0100 watchdog: renesas_wdt: don't set divider while watchdog is running The datasheet says we must stop the timer before changing the clock divider. This can happen when the restart handler is called while the watchdog is running. Signed-off-by: Wolfram Sang Reviewed-by: Fabrizio Castro Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 63fea0af43af5beb3779fd2cae078d5d77b4bb11 Author: Masahiro Yamada Date: Mon Nov 12 11:35:20 2018 +0900 x86, powerpc: Remove -funit-at-a-time compiler option entirely GCC 4.6 manual says: -funit-at-a-time This option is left for compatibility reasons. -funit-at-a-time has no effect, while -fno-unit-at-a-time implies -fno-toplevel-reorder and -fno-section-anchors. Enabled by default. Remove it. Signed-off-by: Masahiro Yamada Signed-off-by: Borislav Petkov Acked-by: Ingo Molnar Acked-by: Michael Ellerman Cc: "H. Peter Anvin" Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Richard Weinberger Cc: Thomas Gleixner Cc: linuxppc-dev@lists.ozlabs.org Cc: x86-ml Link: https://lkml.kernel.org/r/1541990120-9643-3-git-send-email-yamada.masahiro@socionext.com commit 829889ac4a7d26858860c297e64051bd27ce8fbe Author: Masahiro Yamada Date: Mon Nov 12 11:35:19 2018 +0900 x86/um: Remove -fno-unit-at-a-time workaround for pre-4.0 GCC Commit cafa0010cd51 ("Raise the minimum required gcc version to 4.6") bumped the minimum GCC version to 4.6 for all architectures. '$(call cc-option,-fno-unit-at-a-time)' is now dead code since '$(cc-version) -lt 0400' is always false. Remove it. Signed-off-by: Masahiro Yamada Signed-off-by: Borislav Petkov Acked-by: Richard Weinberger Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Michael Ellerman Cc: Thomas Gleixner Cc: linuxppc-dev@lists.ozlabs.org Cc: x86-ml Link: https://lkml.kernel.org/r/1541990120-9643-2-git-send-email-yamada.masahiro@socionext.com commit 3baffc4a84d759ba54c461e8e4583bd8890c749a Author: Takashi Iwai Date: Fri Dec 7 15:11:09 2018 +0100 ALSA: hda/intel: Refactoring PM code Make unified suspend / resume helpers and call them from both the runtime- and the system-PM callbacks for simplifying code. There are slight changes of call orders, but there shouldn't be any functional difference after refactoring. Signed-off-by: Takashi Iwai commit 0832e93632c61987d504e251b927a2be769dd21a Author: Uwe Kleine-König Date: Tue Dec 4 17:58:55 2018 -0800 Input: rotary-encoder - don't log EPROBE_DEFER to kernel log When a driver fails to bind because a resource it still missing it's not helpful to report this as (usually) probing is repeated later. Signed-off-by: Uwe Kleine-König Signed-off-by: Dmitry Torokhov commit a60956ed72f7b715e9918df93fcf2f63a30fdda1 Author: Andrew Lunn Date: Sat Dec 8 17:06:31 2018 +0100 net: dsa: Make dsa_master_set_mtu() static Add the missing static keyword. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 91ba479573792e1f375e6c2b587c6eab882baa20 Author: Andrew Lunn Date: Sat Dec 8 17:05:18 2018 +0100 net: dsa: Restore MTU on master device on unload A previous change tries to set the MTU on the master device to take into account the DSA overheads. This patch tries to reset the master device back to the default MTU. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller commit 120d633f199b264e0ad4c98eedc0564a89171c1d Merge: 97ef7b4c5501b dc9d38cec71c5 Author: David S. Miller Date: Sat Dec 8 21:33:31 2018 -0800 Merge branch 'platform-data-controls-for-mdio-gpio' Andrew Lunn says: ==================== platform data controls for mdio-gpio Soon to be mainlined is an x86 platform with a Marvell switch, and a bit-banging MDIO bus. In order to make this work, the phy_mask of the MDIO bus needs to be set to prevent scanning for PHYs, and the phy_ignore_ta_mask needs to be set because the switch has broken turnaround. Add a platform_data structure with these parameters. ==================== Signed-off-by: David S. Miller commit dc9d38cec71c508963b8f41c9d6d9cfd7e4ee393 Author: Andrew Lunn Date: Sat Dec 8 16:12:13 2018 +0100 net: phy: mdio-gpio: Add phy_ignore_ta_mask to platform data The Marvell 6390 Ethernet switch family does not perform MDIO turnaround correctly. Many hardware MDIO bus masters don't care about this, but the bitbangging implementation in Linux does by default. Add phy_ignore_ta_mask to the platform data so that the bitbangging code can be told which devices are known to get TA wrong. v2 Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 04fa26bab06d9335f15a5d529c4bba25cd507a34 Author: Andrew Lunn Date: Sat Dec 8 16:12:12 2018 +0100 net: phy: mdio-gpio: Add platform_data support for phy_mask It is sometimes necessary to instantiate a bit-banging MDIO bus as a platform device, without the aid of device tree. When device tree is being used, the bus is not scanned for devices, only those devices which are in device tree are probed. Without device tree, by default, all addresses on the bus are scanned. This may then find a device which is not a PHY, e.g. a switch. And the switch may have registers containing values which look like a PHY. So during the scan, a PHY device is wrongly created. After the bus has been registered, a search is made for mdio_board_info structures which indicates devices on the bus, and the driver which should be used for them. This is typically used to instantiate Ethernet switches from platform drivers. However, if the scanning of the bus has created a PHY device at the same location as indicated into the board info for a switch, the switch device is not created, since the address is already busy. This can be avoided by setting the phy_mask of the mdio bus. This mask prevents addresses on the bus being scanned. v2 Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 0e2b81f7b52a1c1a8c46986f9ca01eb7b3c421f8 Author: Masami Hiramatsu Date: Mon Nov 5 18:04:01 2018 +0900 tracing: Remove unneeded synth_event_mutex Rmove unneeded synth_event_mutex. This mutex protects the reference count in synth_event, however, those operational points are already protected by event_mutex. 1. In __create_synth_event() and create_or_delete_synth_event(), those synth_event_mutex clearly obtained right after event_mutex. 2. event_hist_trigger_func() is trigger_hist_cmd.func() which is called by trigger_process_regex(), which is a part of event_trigger_regex_write() and this function takes event_mutex. 3. hist_unreg_all() is trigger_hist_cmd.unreg_all() which is called by event_trigger_regex_open() and it takes event_mutex. 4. onmatch_destroy() and onmatch_create() have long call tree, but both are finally invoked from event_trigger_regex_write() and event_trace_del_tracer(), former takes event_mutex, and latter ensures called under event_mutex locked. Finally, I ensured there is no resource conflict. For safety, I added lockdep_assert_held(&event_mutex) for each function. Link: http://lkml.kernel.org/r/154140864134.17322.4796059721306031894.stgit@devbox Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 7bbab38d07f3185fddf6fce126e2239010efdfce Author: Masami Hiramatsu Date: Mon Nov 5 18:03:33 2018 +0900 tracing: Use dyn_event framework for synthetic events Use dyn_event framework for synthetic events. This shows synthetic events on "tracing/dynamic_events" file in addition to tracing/synthetic_events interface. User can also define new events via tracing/dynamic_events with "s:" prefix. So, the new syntax is below; s:[synthetic/]EVENT_NAME TYPE ARG; [TYPE ARG;]... To remove events via tracing/dynamic_events, you can use "-:" prefix as same as other events. Link: http://lkml.kernel.org/r/154140861301.17322.15454611233735614508.stgit@devbox Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 0597c49c69d53f00df99421d832453f4e92a5006 Author: Masami Hiramatsu Date: Mon Nov 5 18:03:04 2018 +0900 tracing/uprobes: Use dyn_event framework for uprobe events Use dyn_event framework for uprobe events. This shows uprobe events on "dynamic_events" file. User can also define new uprobe events via dynamic_events. Link: http://lkml.kernel.org/r/154140858481.17322.9091293846515154065.stgit@devbox Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 6212dd29683eec51d6d05374a66ac953e81250e9 Author: Masami Hiramatsu Date: Mon Nov 5 18:02:36 2018 +0900 tracing/kprobes: Use dyn_event framework for kprobe events Use dyn_event framework for kprobe events. This shows kprobe events on "tracing/dynamic_events" file. User can also define new events via tracing/dynamic_events. Link: http://lkml.kernel.org/r/154140855646.17322.6619219995865980392.stgit@devbox Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 5448d44c38557fc15d1c53b608a9c9f0e1ca8f86 Author: Masami Hiramatsu Date: Mon Nov 5 18:02:08 2018 +0900 tracing: Add unified dynamic event framework Add unified dynamic event framework for ftrace kprobes, uprobes and synthetic events. Those dynamic events can be co-exist on same file because those syntax doesn't overlap. This introduces a framework part which provides a unified tracefs interface and operations. Link: http://lkml.kernel.org/r/154140852824.17322.12250362185969352095.stgit@devbox Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit d00bbea9456f35fb34310d454e561f05d68d07fe Author: Masami Hiramatsu Date: Mon Nov 5 18:01:40 2018 +0900 tracing: Integrate similar probe argument parsers Integrate similar argument parsers for kprobes and uprobes events into traceprobe_parse_probe_arg(). Link: http://lkml.kernel.org/r/154140850016.17322.9836787731210512176.stgit@devbox Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit faacb361f271be4baf2d807e2eeaba87e059225f Author: Masami Hiramatsu Date: Mon Nov 5 18:01:12 2018 +0900 tracing: Simplify creation and deletion of synthetic events Since the event_mutex and synth_event_mutex ordering issue is gone, we can skip existing event check when adding or deleting events, and some redundant code in error path. This changes release_all_synth_events() to abort the process when it hits any error and returns the error code. It succeeds only if it has no error. Link: http://lkml.kernel.org/r/154140847194.17322.17960275728005067803.stgit@devbox Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit fc800a10be26017f8f338bc8e500d48e3e6429d9 Author: Masami Hiramatsu Date: Mon Nov 5 18:00:43 2018 +0900 tracing: Lock event_mutex before synth_event_mutex synthetic event is using synth_event_mutex for protecting synth_event_list, and event_trigger_write() path acquires locks as below order. event_trigger_write(event_mutex) ->trigger_process_regex(trigger_cmd_mutex) ->event_hist_trigger_func(synth_event_mutex) On the other hand, synthetic event creation and deletion paths call trace_add_event_call() and trace_remove_event_call() which acquires event_mutex. In that case, if we keep the synth_event_mutex locked while registering/unregistering synthetic events, its dependency will be inversed. To avoid this issue, current synthetic event is using a 2 phase process to create/delete events. For example, it searches existing events under synth_event_mutex to check for event-name conflicts, and unlocks synth_event_mutex, then registers a new event under event_mutex locked. Finally, it locks synth_event_mutex and tries to add the new event to the list. But it can introduce complexity and a chance for name conflicts. To solve this simpler, this introduces trace_add_event_call_nolock() and trace_remove_event_call_nolock() which don't acquire event_mutex inside. synthetic event can lock event_mutex before synth_event_mutex to solve the lock dependency issue simpler. Link: http://lkml.kernel.org/r/154140844377.17322.13781091165954002713.stgit@devbox Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 547cd9eacd1c699c8d1fa77c95c6cdb33b2eba6a Author: Masami Hiramatsu Date: Mon Nov 5 18:00:15 2018 +0900 tracing/uprobes: Add busy check when cleanup all uprobes Add a busy check loop in cleanup_all_probes() before trying to remove all events in uprobe_events, the same way that kprobe_events does. Without this change, writing null to uprobe_events will try to remove events but if one of them is enabled, it will stop there leaving some events cleared and others not clceared. With this change, writing null to uprobe_events makes sure all events are not enabled before removing events. So, it clears all events, or returns an error (-EBUSY) with keeping all events. Link: http://lkml.kernel.org/r/154140841557.17322.12653952888762532401.stgit@devbox Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit a7b1d74e872a4299e1aef66a648316c9c23e5ab4 Author: Steven Rostedt (VMware) Date: Thu Nov 29 22:36:47 2018 -0500 tracing: Change default buffer_percent to 50 After running several tests, it appears that having the reader wait till half the buffer is full before starting to read (and causing its own events to fill up the ring buffer constantly), works well. It keeps trace-cmd (the main user of this interface) from dominating the traces it records. Signed-off-by: Steven Rostedt (VMware) commit 03329f9939781041424edd29487b9603a704fcd9 Author: Steven Rostedt (VMware) Date: Thu Nov 29 21:38:42 2018 -0500 tracing: Add tracefs file buffer_percentage Add a "buffer_percentage" file, that allows users to specify how much of the buffer (percentage of pages) need to be filled before waking up a task blocked on a per cpu trace_pipe_raw file. Signed-off-by: Steven Rostedt (VMware) commit 2c2b0a78b373908926e4683ea5571332f63c0eb5 Author: Steven Rostedt (VMware) Date: Thu Nov 29 20:32:26 2018 -0500 ring-buffer: Add percentage of ring buffer full to wake up reader Instead of just waiting for a page to be full before waking up a pending reader, allow the reader to pass in a "percentage" of pages that have content before waking up a reader. This should help keep the process of reading the events not cause wake ups that constantly cause reading of the buffer. Signed-off-by: Steven Rostedt (VMware) commit 9c8e2f6d3d361439cc6744a094f1c15681b55269 Author: Joe Lawrence Date: Tue Nov 20 15:19:18 2018 -0500 scripts/recordmcount.{c,pl}: support -ffunction-sections .text.* section names When building with -ffunction-sections, the compiler will place each function into its own ELF section, prefixed with ".text". For example, a simple test module with functions test_module_do_work() and test_module_wq_func(): % objdump --section-headers test_module.o | awk '/\.text/{print $2}' .text .text.test_module_do_work .text.test_module_wq_func .init.text .exit.text Adjust the recordmcount scripts to look for ".text" as a section name prefix. This will ensure that those functions will be included in the __mcount_loc relocations: % objdump --reloc --section __mcount_loc test_module.o OFFSET TYPE VALUE 0000000000000000 R_X86_64_64 .text.test_module_do_work 0000000000000008 R_X86_64_64 .text.test_module_wq_func 0000000000000010 R_X86_64_64 .init.text Link: http://lkml.kernel.org/r/1542745158-25392-2-git-send-email-joe.lawrence@redhat.com Signed-off-by: Joe Lawrence Signed-off-by: Steven Rostedt (VMware) commit ca16b0fbb05242f18da9d810c07d3882ffed831c Author: Dan Carpenter Date: Wed Jun 20 14:08:00 2018 +0300 tracing: Have trace_stack nr_entries compare not be so subtle Dan Carpenter reviewed the trace_stack.c code and figured he found an off by one bug. "From reviewing the code, it seems possible for stack_trace_max.nr_entries to be set to .max_entries and in that case we would be reading one element beyond the end of the stack_dump_trace[] array. If it's not set to .max_entries then the bug doesn't affect runtime." Although it looks to be the case, it is not. Because we have: static unsigned long stack_dump_trace[STACK_TRACE_ENTRIES+1] = { [0 ... (STACK_TRACE_ENTRIES)] = ULONG_MAX }; struct stack_trace stack_trace_max = { .max_entries = STACK_TRACE_ENTRIES - 1, .entries = &stack_dump_trace[0], }; And: stack_trace_max.nr_entries = x; for (; x < i; x++) stack_dump_trace[x] = ULONG_MAX; Even if nr_entries equals max_entries, indexing with it into the stack_dump_trace[] array will not overflow the array. But if it is the case, the second part of the conditional that tests stack_dump_trace[nr_entries] to ULONG_MAX will always be true. By applying Dan's patch, it removes the subtle aspect of it and makes the if conditional slightly more efficient. Link: http://lkml.kernel.org/r/20180620110758.crunhd5bfep7zuiz@kili.mountain Signed-off-by: Dan Carpenter Signed-off-by: Steven Rostedt (VMware) commit b0e21a61d3196762b61f43ae994ffd255f646774 Author: Steven Rostedt (VMware) Date: Mon Nov 19 20:54:08 2018 -0500 function_graph: Have profiler use new helper ftrace_graph_get_ret_stack() The ret_stack processing is going to change, and that is going to break anything that is accessing the ret_stack directly. One user is the function graph profiler. By using the ftrace_graph_get_ret_stack() helper function, the profiler can access the ret_stack entry without relying on the implementation details of the stack itself. Reviewed-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit 76b42b63ed0d004961097d3a3cd979129d4afd26 Author: Steven Rostedt (VMware) Date: Sun Nov 18 18:36:19 2018 -0500 function_graph: Move ftrace_graph_ret_addr() to fgraph.c Move the function function_graph_ret_addr() to fgraph.c, as the management of the curr_ret_stack is going to change, and all the accesses to ret_stack needs to be done in fgraph.c. Reviewed-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit 688f7089d8851b1a81106f0c0b9b29181b2f2dc8 Author: Steven Rostedt (VMware) Date: Thu Nov 15 14:06:47 2018 -0500 fgraph: Add new fgraph_ops structure to enable function graph hooks Currently the registering of function graph is to pass in a entry and return function. We need to have a way to associate those functions together where the entry can determine to run the return hook. Having a structure that contains both functions will facilitate the process of converting the code to be able to do such. This is similar to the way function hooks are enabled (it passes in ftrace_ops). Instead of passing in the functions to use, a single structure is passed in to the registering function. The unregister function is now passed in the fgraph_ops handle. When we allow more than one callback to the function graph hooks, this will let the system know which one to remove. Reviewed-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit 317e04ca905ac6c4b33cb879e9a107c412125f14 Author: Steven Rostedt (VMware) Date: Wed Nov 28 10:26:27 2018 -0500 tracing: Rearrange functions in trace_sched_wakeup.c Rearrange the functions in trace_sched_wakeup.c so that there are fewer #ifdef CONFIG_FUNCTION_TRACER and #ifdef CONFIG_FUNCTION_GRAPH_TRACER, instead of having the #ifdefs spread all over. No functional change is made. Signed-off-by: Steven Rostedt (VMware) commit e73e679f656e678b0e7f8961094201f3544f4541 Author: Steven Rostedt (VMware) Date: Thu Nov 15 12:35:13 2018 -0500 fgraph: Move function graph specific code into fgraph.c To make the function graph infrastructure more managable, the code needs to be in its own file (fgraph.c). Move the code that is specific for managing the function graph infrastructure out of ftrace.c and into fgraph.c Reviewed-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit c8dd0f45874547e6e77bab03d71feb16c4cb98a8 Author: Steven Rostedt (VMware) Date: Fri Nov 23 13:06:07 2018 -0500 function_graph: Do not expose the graph_time option when profiler is not configured When the function profiler is not configured, the "graph_time" option is meaningless, as the function profiler is the only thing that makes use of it. Do not expose it if the profiler is not configured. Link: http://lkml.kernel.org/r/20181123061133.GA195223@google.com Reported-by: Joel Fernandes Signed-off-by: Steven Rostedt (VMware) commit 3306fc4aff464f9c08c8899695a218f4b1125d4a Author: Steven Rostedt (VMware) Date: Thu Nov 15 12:32:38 2018 -0500 ftrace: Create new ftrace_internal.h header In order to move function graph infrastructure into its own file (fgraph.h) it needs to access various functions and variables in ftrace.c that are currently static. Create a new file called ftrace-internal.h that holds the function prototypes and the extern declarations of the variables needed by fgraph.c as well, and make them global in ftrace.c such that they can be used outside that file. Reviewed-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit 761efe8a94cfcd0a3dd90f2008411550f3520b63 Author: Steven Rostedt (VMware) Date: Sun Nov 18 18:44:04 2018 -0500 function_graph: Remove the use of FTRACE_NOTRACE_DEPTH The curr_ret_stack is no longer set to a negative value when a function is not to be traced by the function graph tracer. Remove the usage of FTRACE_NOTRACE_DEPTH, as it is no longer needed. Reviewed-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit 421d1069cd85f6fee9f36984a071a73b6a431f65 Author: Steven Rostedt (VMware) Date: Sun Nov 18 18:41:46 2018 -0500 arm64: function_graph: Remove use of FTRACE_NOTRACE_DEPTH Functions in the set_graph_notrace no longer subtract FTRACE_NOTRACE_DEPTH from curr_ret_stack, as that is now implemented via the trace_recursion flags. Access to curr_ret_stack no longer needs to worry about checking for this. curr_ret_stack is still initialized to -1, when there's not a shadow stack allocated. Cc: Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org Acked-by: Will Deacon Reviewed-by: Joel Fernandes (Google) Signed-off-by: Steven Rostedt (VMware) commit f18fd0f560eb3b798f9835fbd09fad1a27235e13 Author: Linus Walleij Date: Sun Aug 26 12:45:05 2018 +0200 ARM: dts: Bump Gemini platforms to use 100ms debounce The 50ms debounce is too low and give ghost bounces on some platforms. Bump it to 100ms to make it stable. Signed-off-by: Linus Walleij commit d6d0cef55e5b6362bd7e4fe81ea3ac1e5a48b3f4 Author: Linus Walleij Date: Fri Apr 21 20:50:22 2017 +0200 ARM: dts: Add the FOTG210 USB host to Gemini boards This adds the FOTG210 USB host controller to the Gemini device trees. In the main SoC DTSI it is flagged as disabled and then it is selectively enabled on the devices that utilize it. Signed-off-by: Linus Walleij commit d88b11ef91b15d0af9c0676cbf4f441a0dff0c56 Author: Linus Walleij Date: Fri Oct 19 09:00:51 2018 +0200 ARM: dts: Fix up SQ201 flash access This sets the partition information on the SQ201 to be read out from the RedBoot partition table, removes the static partition table and sets our boot options to mount root from /dev/mtdblock2 where the squashfs+JFFS2 resides. Signed-off-by: Linus Walleij commit 137cd7100ec6fa36d610e106df00acb4d8af99df Author: Linus Walleij Date: Thu Oct 11 20:06:23 2018 +0200 ARM: dts: Enable Gemini flash access Some Gemini platforms have a parallel NOR flash which conflicts with use cases reusing some of the flash lines (such as CE1) for GPIO. Fix this on the D-Link DIR-685 and Itian SQ201 by creating "enabled" and "disabled" states for the flash pin control handle, and rely on the flash handling code to switch this in and out when accessed so these lines can be used for GPIO when flash is not accessed, and enable flash access. Signed-off-by: Linus Walleij commit 738a05e673435afb986b53da43befd83ad87ec3b Author: Linus Walleij Date: Thu May 17 17:00:10 2018 +0200 ARM: dts: Fix up the D-Link DIR-685 MTD partition info The vendor firmware was analyzed to get the right idea about this flash layout. /proc/mtd contains: dev: size erasesize name mtd0: 01e7ff40 00020000 "rootfs" mtd1: 01f40000 00020000 "upgrade" mtd2: 00040000 00020000 "rgdb" mtd3: 00020000 00020000 "nvram" mtd4: 00040000 00020000 "RedBoot" mtd5: 00020000 00020000 "LangPack" mtd6: 02000000 00020000 "flash" Here "flash" is obviously the whole device and we know "rootfs" is a bogus hack to point to a squashfs rootfs inside of the main "upgrade partition". We know "RedBoot" is the first 0x40000 of the flash and the "upgrade" partition follows from 0x40000 to 0x1f8000. So we have mtd0, 1, 4 and 6 covered. Remains: mtd2: 00040000 00020000 "rgdb" mtd3: 00020000 00020000 "nvram" mtd5: 00020000 00020000 "LangPack" Inspecting the flash at 0x1f8000 and 0x1fa000 reveals each of these starting with "RGCFG1" so we assume 0x1f8000-1fbfff is "rgdb" of 0x40000. Signed-off-by: Linus Walleij commit 97ef7b4c5501b081c6144a08bba6d87baf69b6e5 Author: Willem de Bruijn Date: Sat Dec 8 06:22:46 2018 -0500 ip: silence udp zerocopy smatch false positive extra_uref is used in __ip(6)_append_data only if uarg is set. Smatch sees that the variable is passed to sock_zerocopy_put_abort. This function accesses it only when uarg is set, but smatch cannot infer this. Make this dependency explicit. Fixes: 52900d22288e ("udp: elide zerocopy operation in hot path") Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit cb14e6d6d8f411b7a05f36d1f877450c036d8c56 Author: Krzysztof Kozlowski Date: Fri Dec 7 13:32:52 2018 +0100 leds: pwm: Use OF variant of LED registering function The PWM leds can be instantiated from Device Tree so pass the respective device node to LED core. This provides the LED system with proper device node and exposes it through uevent. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Jacek Anaszewski commit e5a0436dd08a18834c134ffd08295e36c6f85219 Author: Krzysztof Kozlowski Date: Fri Dec 7 13:32:51 2018 +0100 leds: pwm: Simplify with resource-managed devm_led_classdev_register() Simplify the exit path with resource-managed version of registering LED class device. The code should be functionally the same, except that on device removal the led_pwm_priv->num_leds is not decremented to zero (which should not have any effect as device is going away). Signed-off-by: Krzysztof Kozlowski Signed-off-by: Jacek Anaszewski commit b086592e5dcd9cee360f44be801fbcadb24d5c46 Author: Krzysztof Kozlowski Date: Fri Dec 7 11:10:06 2018 +0100 leds: gpio: Drop unneeded manual of_node assignment This reverts the main change of commit bff23714bc36 ("leds: leds-gpio: Set of_node for created LED devices") because of_node assignment is handled by core since commit 7ea79ae86c28 ("leds: gpio: use OF variant of LED registering function"). Basically the code was overwriting the of_node with same value. No functional change expected. Signed-off-by: Krzysztof Kozlowski Tested-by: Rafał Miłecki Signed-off-by: Jacek Anaszewski commit 0e76df5c978338f3051e5126fc0c4245c57a307a Author: Mircea Caprioru Date: Thu Dec 6 15:53:15 2018 +0200 iio: dac: ad5686: fix bit shift read register This patch solves the register readback issue with the bit shift. When the dac resolution was lower than the register size (ex. 12 bits out of 16 bits) the readback value was not shifted with the difference in bits and the value was higher. Also a mask is applied on the read value in order to get the value relative to the actual bit size. Fixes: 0357e488b8 ("iio:dac:ad5686: Refactor the driver") Signed-off-by: Mircea Caprioru Cc: Signed-off-by: Jonathan Cameron commit 12d323cf6dd558b442fa3f03af3c7703617eed81 Author: Stefan Popa Date: Thu Dec 6 15:38:30 2018 +0200 iio:dac:ad5686: Add AD5310R support The AD5310R is a single channel DAC with 10-bit precision, which is part of the same family as AD5311R, except that it uses the spi interface instead of i2c. The device has a built-in 2.5V reference which is enabled by default. Another important difference is that the SPI write command operation is 16 bits long. The first four bits represent the command, while the remaining 12 bits are for data. In the control reg, DB9 and DB10 are used for power-down modes, while DB8 is the REF bit. In order to accommodate this change, a new regmap type was defined and checked accordingly. Because AD5310R does not have a readback register, the read_raw operation will return "Operation is not supported". Datasheet: Link: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5310R_5311R.pdf Signed-off-by: Stefan Popa Signed-off-by: Mircea Caprioru Signed-off-by: Jonathan Cameron commit 4b1bacab61aa252d15dde99cd0440a965bd863e5 Author: Borislav Petkov Date: Fri Dec 7 20:38:09 2018 +0100 x86/kprobes: Remove trampoline_handler() prototype ... and make it static. It is called only by the kretprobe_trampoline() from asm. It was marked __visible so that it is visible outside of the current compilation unit but that is not needed as it is used only in this compilation unit. Signed-off-by: Borislav Petkov Cc: Masami Hiramatsu Link: https://lkml.kernel.org/r/20181205162526.GB109259@gmail.com commit ad3bc25a320742f42b3015115384f5aec69c7ce2 Author: Borislav Petkov Date: Wed Dec 5 00:34:56 2018 +0100 x86/kernel: Fix more -Wmissing-prototypes warnings ... with the goal of eventually enabling -Wmissing-prototypes by default. At least on x86. Make functions static where possible, otherwise add prototypes or make them visible through includes. asm/trace/ changes courtesy of Steven Rostedt . Signed-off-by: Borislav Petkov Reviewed-by: Masami Hiramatsu Reviewed-by: Ingo Molnar Acked-by: Rafael J. Wysocki # ACPI + cpufreq bits Cc: Andrew Banman Cc: Dimitri Sivanich Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Masami Hiramatsu Cc: Mike Travis Cc: "Steven Rostedt (VMware)" Cc: Thomas Gleixner Cc: Yi Wang Cc: linux-acpi@vger.kernel.org commit 5c608d4dd49a4ffbedc85f8a89820173df12b111 Author: Jeremy Fertic Date: Tue Dec 4 18:49:00 2018 -0700 Revert "Staging: iio: adt7316: Add an extra check for 'ret' equals to 0" This reverts commit 00426e99789357dbff7e719a092ce36a3ce49d94. i2c_smbus_read_byte() returns 0 when a byte with the value 0 is read from the device. This is a valid read so revert the check for 0. Signed-off-by: Jeremy Fertic Signed-off-by: Jonathan Cameron commit c3e566c8cb553026cf530f01c80b665a2a0926f9 Author: Lubomir Rintel Date: Mon Dec 3 12:47:40 2018 +0100 dt-bindings: iio: accel: use a generic node name for lis302 The example should follow the practice or using a generic node name instead of the precise programming model, as recommended by the DTSpec. Signed-off-by: Lubomir Rintel Signed-off-by: Jonathan Cameron commit d45ebf1f986db608e0c7d69e8792ee85c9b7f3f4 Author: Andi Shyti Date: Sun Dec 2 20:30:31 2018 +0200 iio: core: check 'info' value before registering the device When the 'info' structure inside indio_dev is left uninitialized, a segmentation fault occurs. Check the 'info' value before using it and if it is equal to NULL, return with -EINVAL. Signed-off-by: Andi Shyti Signed-off-by: Jonathan Cameron commit dfc1259a3f7a116b96e23e3467607c713c38a383 Author: Baruch Siach Date: Thu Dec 6 13:19:09 2018 +0200 arm64: dts: clearfog-gt-8k: describe mini-PCIe CON2 USB Enable the USB3 peripheral that is wired to CON2 on the Clearfog GT-8K board. Signed-off-by: Baruch Siach Signed-off-by: Gregory CLEMENT commit b1f0bbe2700051886b954192b6c1751233fe0f52 Author: Russell King Date: Mon Nov 5 17:25:41 2018 +0000 arm64: dts: add support for Macchiatobin Single Shot board Add DT support for the Macchiatobin Single Shot board from SolidRun, which is similar to the Double Shot board, but does not have the 10G 3310 PHYs - the two ethernet ports are instead connected directly to the SFP+ cages. Signed-off-by: Russell King Signed-off-by: Gregory CLEMENT commit 43ebc7c1b3ed8198b9acf3019eca16e722f7331c Author: Ding Tao Date: Fri Oct 26 11:50:28 2018 +0000 arm64: dts: marvell: armada-37xx: Enable emmc on espressobin The ESPRESSObin board has a emmc interface available on U11: declare it and let the bootloader enable it if the emmc is present. [gregory.clement@bootlin.com: disable the emmc by default] Signed-off-by: Ding Tao Signed-off-by: Gregory CLEMENT commit 29cadd2bb6670405086b177120593c1291273fb9 Author: Dan Carpenter Date: Fri Dec 7 22:06:12 2018 -0700 scsi: Fix a harmless double shift bug Smatch generates a warning: drivers/scsi/scsi_lib.c:1656 scsi_mq_done() warn: test_bit() takes a bit number The problem is that SCMD_STATE_COMPLETE is supposed to be bit number 0 and not a mask like "(1 << 0)". It is used like this: if (test_and_set_bit(SCMD_STATE_COMPLETE, &scmd->state)) The test_and_set_bit() has a shift built in so it's a double left shift and uses bit number 1 instead of number 0. This bug is harmless because it's done consistently and it doesn't clash with any other flags. Fixes: f1342709d18a ("scsi: Do not rely on blk-mq for double completions") Reviewed-by: Keith Busch Acked-by: Martin K. Petersen Signed-off-by: Dan Carpenter Signed-off-by: Jens Axboe commit 3236b458c475524d0735f6dd0bd250478434c7b1 Author: Israel Rukshin Date: Mon Dec 3 15:50:05 2018 +0000 nvme: remove unused function nvme_ctrl_ready Signed-off-by: Israel Rukshin Reviewed-by: Sagi Grimberg Reviewed-by: Max Gurtovoy Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 49cd84b6f8b677ef45731ed56ddb802cdbb94c9e Author: Keith Busch Date: Tue Nov 27 09:40:57 2018 -0700 nvme: implement Enhanced Command Retry A controller may have an internal state that is not able to successfully process commands for a short duration. In such states, an immediate command requeue is expected to fail. The driver may exceed its max retry count, which permanently ends the command in failure when the same command would succeed after waiting for the controller to be ready. NVMe ratified TP 4033 provides a delay hint in the completion status code for failed commands. Implement the retry delay based on the command completion status and the controller's requested delay. Note that requeued commands are handled per request_queue, not per individual request. If multiple commands fail, the controller should consistently report the desired delay time for retryable commands in all CQEs, otherwise the requeue list may be kicked too soon. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 5a3a6d6965865d0da5c743a0f9c58f84373f88e7 Author: Chaitanya Kulkarni Date: Mon Nov 19 15:16:39 2018 -0800 nvmet: fix the structure member indentation This is a cleanup patch which fixes the structure member indentation introduced by the p2p: commit c6925093d0b2 ("nvmet: Optionally use PCI P2P memory"). We don't change any functionality in this patch. This is needed so that any future members will also follow the uniform indentation. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Acked-by: Logan Gunthorpe Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit cb019da3dabf60d792f76a913540815f06abb1d7 Author: Chaitanya Kulkarni Date: Mon Nov 19 13:35:30 2018 -0800 nvmet: use unlikely for req status check This patch adds unlikely in the nvmet request completion path for the status check in the low level function __nvmet_req_complete. This is helpful in the scenario where host and target connection is working smoothly. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit ad1f824948e4ed886529219cf7cd717d078c630d Author: Israel Rukshin Date: Mon Nov 19 10:58:51 2018 +0000 nvmet-rdma: Add unlikely for response allocated check Signed-off-by: Israel Rukshin Reviewed-by: Sagi Grimberg Reviewed-by: Max Gurtovoy Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 5c4072ad1c151c65c3d60f95536786042cd49e29 Author: Israel Rukshin Date: Mon Nov 19 10:58:52 2018 +0000 nvme: Remove unused forward declaration Signed-off-by: Israel Rukshin Reviewed-by: Sagi Grimberg Reviewed-by: Max Gurtovoy Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 8154ed730bc64f68bc28feb20e641c2e8a0eeba5 Author: Sagi Grimberg Date: Mon Nov 19 14:11:15 2018 -0800 nvme: disable fabrics SQ flow control when asked by the user As for now, we don't care about sq_head pointer updates anyway, so at least allow the controller to micro-optimize by omiting this update. Note that we will probably need to support it when a controller that requires this comes along. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 9b95d2fb857f242aacbf4e205656818b0ef067e1 Author: Sagi Grimberg Date: Tue Nov 20 10:34:19 2018 +0100 nvmet: expose support for fabrics SQ flow control disable in treq Technical Proposal introduces an indication for SQ flow control disable support. Expose it since we are able to operate in this mode. Reviewed-by: Hannes Reinecke Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 0445e1b5a2fed4612b7f72d9a56889c026b60aa9 Author: Sagi Grimberg Date: Mon Nov 19 14:11:13 2018 -0800 nvmet: don't override treq upon modification. Only override the allowed parts of it. Reviewed-by: Hannes Reinecke Signed-off-by: Sagi Grimberg [hch: slight tweak to the NVME_TREQ_SECURE_CHANNEL_MASK definition] Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit e6a622fd6d66b83779357e3400f487fc159a7d83 Author: Sagi Grimberg Date: Mon Nov 19 14:11:12 2018 -0800 nvmet: support fabrics sq flow control Technical proposal 8005 "fabrics SQ flow control" introduces a mode where a host and controller agree to omit sq_head pointer updates when sending nvme completions. In case the host indicated desire to operate in this mode (connect attribute) the controller will return back a connect completion with sq_head value of 0xffff as indication that it will omit sq_head pointer updates. This mode saves us an atomic update in the I/O path. Reviewed-by: Hannes Reinecke [hch: suggested better implementation] Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 6e2e312ea7ff73acfafaa5c9851e151e9483c761 Author: James Smart Date: Wed Nov 14 15:57:46 2018 -0800 nvmet-fc: remove the IN_ISR deferred scheduling options All target lldd's call the cmd receive and op completions in non-isr thread contexts. As such the IN_ISR options are not necessary. Remove the functionality and flags, which also removes cpu assignments to queues. Signed-off-by: James Smart Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 03198c4d9fc8e72ba8a5ad74959b61de7f2780a6 Author: Christoph Hellwig Date: Wed Nov 14 16:46:23 2018 +0100 nvmet: mark nvmet_genctr static Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Signed-off-by: Jens Axboe commit b662a078576e7d6e235b4e1b94863f0474cd8555 Author: Jay Sternberg Date: Mon Nov 12 13:56:40 2018 -0800 nvmet: enable Discovery Controller AENs Add functions to find connections requesting Discovery Change events and send a notification to hosts that maintain an explicit persistent connection and have and active Asynchronous Event Request pending. Only Hosts that have access to the Subsystem effected by the change will receive notifications of Discovery Change event. Call these functions each time there is a configfs change that effects the Discover Log Pages. Set the OAES field in the Identify Controller response to advertise the support for Asynchronous Event Notifications. Signed-off-by: Jay Sternberg Reviewed-by: Phil Cayton Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 253928eec61a52935584777f0dfba6cdb63967b6 Author: Sagi Grimberg Date: Mon Nov 12 13:56:39 2018 -0800 nvmet: allow host connect even if no allowed subsystems are exported It is perfectly valid that a host connects to a discovery subsystem and gets an empty discovery log page since no subsystems are provisioned to it. No reason to disallow connecting to the discovery subsystem all together. Signed-off-by: Sagi Grimberg Reviewed-by: Jay Sternberg Reviewed-by: Phil Cayton Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 6a8ec0ac5ede074232137e505d4b90e56c1e4511 Author: Jay Sternberg Date: Mon Nov 12 13:56:38 2018 -0800 nvmet: add support to Discovery controllers for commands Add custom get/set features to commands allowed by Discovery controllers. Signed-off-by: Jay Sternberg Reviewed-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit f301c2b1368905340133ff8ef4485befdd0b7e2d Author: Jay Sternberg Date: Mon Nov 12 13:56:37 2018 -0800 nvmet: add defines for discovery change async events Add AEN/AER values as defined by the specification Signed-off-by: Jay Sternberg Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 90107455cce753c05a5e1e80cb84b09da1c87eef Author: Jay Sternberg Date: Mon Nov 12 13:56:36 2018 -0800 nvmet: make kato and AEN processing for use by other controllers Make common process of get/set features available to other controllers by making simple functions static inline and others not static and prototypes in nvmet.h file Also remove static from nvmet_execute_async_event and add prototype to nvmet.h to allow used by other controllers Signed-off-by: Jay Sternberg Reviewed-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit f9362ac1738a41cc526fde82e76beb034d8c6053 Author: Jay Sternberg Date: Mon Nov 12 13:56:35 2018 -0800 nvmet: allow Keep Alive for Discovery controller Per change to specification allowing Discovery controllers to have explicit persistent connections, remove restriction on Discovery controllers allowing kato on connect. Signed-off-by: Jay Sternberg Reviewed-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 7114ddeb40c0ccc584d86df598da4054ca4cd79f Author: Jay Sternberg Date: Mon Nov 12 13:56:34 2018 -0800 nvmet: change aen mask functions to use bit numbers Functions nvmet_aen_disabled and nvmet_clear_aen were using values not bit numbers ie 1 << 9 not 9 for bit function clear_bit and test_and_set_bit. Signed-off-by: Jay Sternberg Reviewed-by: Phil Cayton Reviewed-by: Christoph Hellwig Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 6c8312ad509c3aaaa8720fee7abe45b813cd4d87 Author: Jay Sternberg Date: Mon Nov 12 13:56:33 2018 -0800 nvmet: provide aen bit functions for multiple controller types Move nvmet_aen_disabled and nvmet_clear_aen in preparation for other types of controllers to use, initially the discovery controller. Signed-off-by: Jay Sternberg Reviewed-by: Johannes Thumshirn Reviewed-by: Sagi Grimberg Reviewed-by: Christoph Hellwig Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 50a909db36f244bcfec6e02598d31c0b0a468175 Author: Chaitanya Kulkarni Date: Wed Nov 14 01:12:19 2018 -0500 nvmet: use IOCB_NOWAIT for file-ns buffered I/O This patch optimizes read command behavior when file-ns configured with buffered I/O. Instead of offloading the buffered I/O read operations to the worker threads, we first issue the read operation with IOCB_NOWAIT and try and access the data from the cache. Here we only offload the request to the worker thread and complete the request in the worker thread context when IOCB_NOWAIT request fails. Signed-off-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit c09305ae49970e15cd18828c0f78b766e8cf224f Author: Sagi Grimberg Date: Fri Nov 2 10:28:13 2018 -0700 nvmet: support for traffic based keep-alive A controller that supports traffic based keep-alive can restart the keep alive timer even when no keep-alive was not received in the kato period as long as other admin or I/O commands were received. For each command set ctrl->cmd_seen to true, and when keep-alive timer expires, if any commands were seen, resched ka_work instead of escalating to a fatal error. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 6e3ca03ee934572d5de4fb2224c01e12c4d422c8 Author: Sagi Grimberg Date: Fri Nov 2 10:28:15 2018 -0700 nvme: support traffic based keep-alive If the controller supports traffic based keep alive, we restart the keep alive timer if any admin or io commands was completed during the kato period. This prevents a possible starvation of keep alive commands in the presence of heavy traffic as in such case, we already have a health indication from the host perspective. Only set a comp_seen indicator in case the controller supports keep alive to minimize the overhead for pci controllers. Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 3e53ba38a9404434a8b57683825279f4305b5a76 Author: Sagi Grimberg Date: Fri Nov 2 10:28:14 2018 -0700 nvme: cache controller attributes We get the controller attributes in identify, cache them as we'll need them for traffic based keep alive support. Reviewed-by: Chaitanya Kulkarni Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 12b2117161ddbdcdb69777404c5aa2a9fe6ad7d5 Author: Sagi Grimberg Date: Fri Nov 2 10:28:12 2018 -0700 nvme: introduce ctrl attributes enumeration We are growing more controller attributes, so use a proper enumeration for it. For now just add the 128-bit hostid which we support. Reviewed-by: Chaitanya Kulkarni Reviewed-by: Hannes Reinecke Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 103e515efa89be33d04e45aae82de136f0c49865 Author: Hannes Reinecke Date: Fri Nov 16 09:22:29 2018 +0100 nvme: add a numa_node field to struct nvme_ctrl Instead of directly poking into the struct device add a new numa_node field to struct nvme_ctrl. This allows fabrics drivers where ctrl->dev is a virtual device to support NUMA affinity as well. Also expose the field as a sysfs attribute, and populate it for the RDMA and FC transports. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 1190203555ec58d768ea802e8fdbb5c42187d9d5 Author: Chaitanya Kulkarni Date: Mon Oct 29 16:44:18 2018 -0700 nvme: consolidate memset calls in the nvme_setup_cmd path In function nvme_setup_cmd() we call command specific setup function for flush, rw, and discard. Instead of calling memset in each function lets call it once in the parent function. This is purely code cleanup patch and it does not change any existing functionality. Signed-off-by: Chaitanya Kulkarni Reviewed-by: Sagi Grimberg Reviewed-by: Johannes Thumshirn Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 5938870247be4453ef6602c7ce467bebb48113c8 Author: Ming Lei Date: Fri Dec 7 11:03:53 2018 +0800 blk-mq: re-build queue map in case of kdump kernel Now almost all .map_queues() implementation based on managed irq affinity doesn't update queue mapping and it just retrieves the old built mapping, so if nr_hw_queues is changed, the mapping talbe includes stale mapping. And only blk_mq_map_queues() may rebuild the mapping talbe. One case is that we limit .nr_hw_queues as 1 in case of kdump kernel. However, drivers often builds queue mapping before allocating tagset via pci_alloc_irq_vectors_affinity(), but set->nr_hw_queues can be set as 1 in case of kdump kernel, so wrong queue mapping is used, and kernel panic[1] is observed during booting. This patch fixes the kernel panic triggerd on nvme by rebulding the mapping table via blk_mq_map_queues(). [1] kernel panic log [ 4.438371] nvme nvme0: 16/0/0 default/read/poll queues [ 4.443277] BUG: unable to handle kernel NULL pointer dereference at 0000000000000098 [ 4.444681] PGD 0 P4D 0 [ 4.445367] Oops: 0000 [#1] SMP NOPTI [ 4.446342] CPU: 3 PID: 201 Comm: kworker/u33:10 Not tainted 4.20.0-rc5-00664-g5eb02f7ee1eb-dirty #459 [ 4.447630] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.10.2-2.fc27 04/01/2014 [ 4.448689] Workqueue: nvme-wq nvme_scan_work [nvme_core] [ 4.449368] RIP: 0010:blk_mq_map_swqueue+0xfb/0x222 [ 4.450596] Code: 04 f5 20 28 ef 81 48 89 c6 39 55 30 76 93 89 d0 48 c1 e0 04 48 03 83 f8 05 00 00 48 8b 00 42 8b 3c 28 48 8b 43 58 48 8b 04 f8 <48> 8b b8 98 00 00 00 4c 0f a3 37 72 42 f0 4c 0f ab 37 66 8b b8 f6 [ 4.453132] RSP: 0018:ffffc900023b3cd8 EFLAGS: 00010286 [ 4.454061] RAX: 0000000000000000 RBX: ffff888174448000 RCX: 0000000000000001 [ 4.456480] RDX: 0000000000000001 RSI: ffffe8feffc506c0 RDI: 0000000000000001 [ 4.458750] RBP: ffff88810722d008 R08: ffff88817647a880 R09: 0000000000000002 [ 4.464580] R10: ffffc900023b3c10 R11: 0000000000000004 R12: ffff888174448538 [ 4.467803] R13: 0000000000000004 R14: 0000000000000001 R15: 0000000000000001 [ 4.469220] FS: 0000000000000000(0000) GS:ffff88817bac0000(0000) knlGS:0000000000000000 [ 4.471554] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 4.472464] CR2: 0000000000000098 CR3: 0000000174e4e001 CR4: 0000000000760ee0 [ 4.474264] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 4.476007] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 4.477061] PKRU: 55555554 [ 4.477464] Call Trace: [ 4.478731] blk_mq_init_allocated_queue+0x36a/0x3ad [ 4.479595] blk_mq_init_queue+0x32/0x4e [ 4.480178] nvme_validate_ns+0x98/0x623 [nvme_core] [ 4.480963] ? nvme_submit_sync_cmd+0x1b/0x20 [nvme_core] [ 4.481685] ? nvme_identify_ctrl.isra.8+0x70/0xa0 [nvme_core] [ 4.482601] nvme_scan_work+0x23a/0x29b [nvme_core] [ 4.483269] ? _raw_spin_unlock_irqrestore+0x25/0x38 [ 4.483930] ? try_to_wake_up+0x38d/0x3b3 [ 4.484478] ? process_one_work+0x179/0x2fc [ 4.485118] process_one_work+0x1d3/0x2fc [ 4.485655] ? rescuer_thread+0x2ae/0x2ae [ 4.486196] worker_thread+0x1e9/0x2be [ 4.486841] kthread+0x115/0x11d [ 4.487294] ? kthread_park+0x76/0x76 [ 4.487784] ret_from_fork+0x3a/0x50 [ 4.488322] Modules linked in: nvme nvme_core qemu_fw_cfg virtio_scsi ip_tables [ 4.489428] Dumping ftrace buffer: [ 4.489939] (ftrace buffer empty) [ 4.490492] CR2: 0000000000000098 [ 4.491052] ---[ end trace 03cd268ad5a86ff7 ]--- Cc: Christoph Hellwig Cc: linux-nvme@lists.infradead.org Cc: David Milburn Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 4705de735b3383792c84a92e57508d6865caa85f Author: Dennis Zhou Date: Thu Dec 6 12:49:38 2018 -0500 blkcg: put back rcu lock in blkcg_bio_issue_check() I was a little overzealous in removing the rcu_read_lock() call from blkcg_bio_issue_check() and it broke blk-throttle. Put it back. Fixes: e35403a034bf ("blkcg: associate blkg when associating a device") Signed-off-by: Dennis Zhou Signed-off-by: Jens Axboe commit d3fcdff19054575a368dfdac7407cabffea36c43 Author: Josef Bacik Date: Tue Dec 4 12:59:04 2018 -0500 block: convert io-latency to use rq_qos_wait Now that we have this common helper, convert io-latency over to use it as well. Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit b6c7b58f5fcc2386bddf9852011c42c1d2b83979 Author: Josef Bacik Date: Tue Dec 4 12:59:03 2018 -0500 block: convert wbt_wait() to use rq_qos_wait() Now that we have rq_qos_wait() in place, convert wbt_wait() over to using it with it's specific callbacks. Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit 84f603246db9703aca05aad58b94a54dfbf44327 Author: Josef Bacik Date: Tue Dec 4 12:59:02 2018 -0500 block: add rq_qos_wait to rq_qos Originally when I split out the common code from blk-wbt into rq_qos I left the wbt_wait() where it was and simply copied and modified it slightly to work for io-latency. However they are both basically the same thing, and as time has gone on wbt_wait() has ended up much smarter and kinder than it was when I copied it into io-latency, which means io-latency has lost out on these improvements. Since they are the same thing essentially except for a few minor things, create rq_qos_wait() that replicates what wbt_wait() currently does with callbacks that can be passed in for the snowflakes to do their own thing as appropriate. Signed-off-by: Josef Bacik Signed-off-by: Jens Axboe commit 7754f669ffde3919e398a9e591cd7510d6cf4e73 Author: Dennis Zhou Date: Wed Dec 5 12:10:39 2018 -0500 blkcg: rename blkg_try_get() to blkg_tryget() blkg reference counting now uses percpu_ref rather than atomic_t. Let's make this consistent with css_tryget. This renames blkg_try_get to blkg_tryget and now returns a bool rather than the blkg or %NULL. Signed-off-by: Dennis Zhou Reviewed-by: Josef Bacik Acked-by: Tejun Heo Signed-off-by: Jens Axboe commit 7fcf2b033b84e261dca283bc2911aaea4b07b525 Author: Dennis Zhou Date: Wed Dec 5 12:10:38 2018 -0500 blkcg: change blkg reference counting to use percpu_ref Every bio is now associated with a blkg putting blkg_get, blkg_try_get, and blkg_put on the hot path. Switch over the refcnt in blkg to use percpu_ref. Signed-off-by: Dennis Zhou Acked-by: Tejun Heo Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 6f70fb66182b02e50deea65e9a3a86b7bf659a39 Author: Dennis Zhou Date: Wed Dec 5 12:10:37 2018 -0500 blkcg: remove bio_disassociate_task() Now that a bio only holds a blkg reference, so clean up is simply putting back that reference. Remove bio_disassociate_task() as it just calls bio_disassociate_blkg() and call the latter directly. Signed-off-by: Dennis Zhou Acked-by: Tejun Heo Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit fc5a828bfad628c1092194f2814604943561c52d Author: Dennis Zhou Date: Wed Dec 5 12:10:36 2018 -0500 blkcg: remove additional reference to the css The previous patch in this series removed carrying around a pointer to the css in blkg. However, the blkg association logic still relied on taking a reference on the css to ensure we wouldn't fail in getting a reference for the blkg. Here the implicit dependency on the css is removed. The association continues to rely on the tryget logic walking up the blkg tree. This streamlines the three ways that association can happen: normal, swap, and writeback. Signed-off-by: Dennis Zhou Acked-by: Tejun Heo Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit db6638d7d177a8bc74c9e539e2e0d7d061c767b1 Author: Dennis Zhou Date: Wed Dec 5 12:10:35 2018 -0500 blkcg: remove bio->bi_css and instead use bio->bi_blkg Prior patches ensured that any bio that interacts with a request_queue is properly associated with a blkg. This makes bio->bi_css unnecessary as blkg maintains a reference to blkcg already. This removes the bio field bi_css and transfers corresponding uses to access via bi_blkg. Signed-off-by: Dennis Zhou Reviewed-by: Josef Bacik Acked-by: Tejun Heo Signed-off-by: Jens Axboe commit fd42df305f804ddc0d5ac028e944784283b2f92d Author: Dennis Zhou Date: Wed Dec 5 12:10:34 2018 -0500 blkcg: associate writeback bios with a blkg One of the goals of this series is to remove a separate reference to the css of the bio. This can and should be accessed via bio_blkcg(). In this patch, wbc_init_bio() now requires a bio to have a device associated with it. Signed-off-by: Dennis Zhou Reviewed-by: Josef Bacik Acked-by: Tejun Heo Signed-off-by: Jens Axboe commit 6a7f6d86a561473032287c8e4583eac5853c6efa Author: Dennis Zhou Date: Wed Dec 5 12:10:33 2018 -0500 blkcg: associate a blkg for pages being evicted by swap A prior patch in this series added blkg association to bios issued by cgroups. There are two other paths that we want to attribute work back to the appropriate cgroup: swap and writeback. Here we modify the way swap tags bios to include the blkg. Writeback will be tackle in the next patch. Signed-off-by: Dennis Zhou Reviewed-by: Josef Bacik Acked-by: Tejun Heo Signed-off-by: Jens Axboe commit e439bedf6b24264f620cc05627e23a90054bde41 Author: Dennis Zhou Date: Wed Dec 5 12:10:32 2018 -0500 blkcg: consolidate bio_issue_init() to be a part of core bio_issue_init among other things initializes the timestamp for an IO. Rather than have this logic handled by policies, this consolidates it to be on the init paths (normal, clone, bounce clone). Signed-off-by: Dennis Zhou Acked-by: Tejun Heo Reviewed-by: Liu Bo Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 5cdf2e3fea5ee37b66842d76a9b06e6dac0b933d Author: Dennis Zhou Date: Wed Dec 5 12:10:31 2018 -0500 blkcg: associate blkg when associating a device Previously, blkg association was handled by controller specific code in blk-throttle and blk-iolatency. However, because a blkg represents a relationship between a blkcg and a request_queue, it makes sense to keep the blkg->q and bio->bi_disk->queue consistent. This patch moves association into the bio_set_dev macro(). This should cover the majority of cases where the device is set/changed keeping the two pointers consistent. Fallback code is added to blkcg_bio_issue_check() to catch any missing paths. Signed-off-by: Dennis Zhou Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 892ad71f622bbf39c6de321d5ca9b0fdec237c24 Author: Dennis Zhou Date: Wed Dec 5 12:10:30 2018 -0500 dm: set the static flush bio device on demand The next patch changes the macro bio_set_dev() to associate a bio with a blkg based on the device set. However, dm creates a static bio to be used as the basis for cloning empty flush bios on creation. The bio_set_dev() call in alloc_dev() will cause problems with the next patch adding association to bio_set_dev() because the call is before the bdev is associated with a gendisk (bd_disk is %NULL). To get around this, set the device on the static bio every time and use that to clone to the other bios. Signed-off-by: Dennis Zhou Acked-by: Mike Snitzer Cc: Alasdair Kergon Signed-off-by: Jens Axboe commit 2268c0feb0ffb1c1bb6e1d4d5505d30f485aa77b Author: Dennis Zhou Date: Wed Dec 5 12:10:29 2018 -0500 blkcg: introduce common blkg association logic There are 3 ways blkg association can happen: association with the current css, with the page css (swap), or from the wbc css (writeback). This patch handles how association is done for the first case where we are associating bsaed on the current css. If there is already a blkg associated, the css will be reused and association will be redone as the request_queue may have changed. Signed-off-by: Dennis Zhou Reviewed-by: Josef Bacik Acked-by: Tejun Heo Signed-off-by: Jens Axboe commit beea9da07d8a6228a7e4a31a83f9478d513bf03f Author: Dennis Zhou Date: Wed Dec 5 12:10:28 2018 -0500 blkcg: convert blkg_lookup_create() to find closest blkg There are several scenarios where blkg_lookup_create() can fail such as the blkcg dying, request_queue is dying, or simply being OOM. Most handle this by simply falling back to the q->root_blkg and calling it a day. This patch implements the notion of closest blkg. During blkg_lookup_create(), if it fails to create, return the closest blkg found or the q->root_blkg. blkg_try_get_closest() is introduced and used during association so a bio is always attached to a blkg. Signed-off-by: Dennis Zhou Acked-by: Tejun Heo Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit b978962ad4f7f9c06e5aa07b2a9b22f6d600456c Author: Dennis Zhou Date: Wed Dec 5 12:10:27 2018 -0500 blkcg: update blkg_lookup_create() to do locking To know when to create a blkg, the general pattern is to do a blkg_lookup() and if that fails, lock and do the lookup again, and if that fails finally create. It doesn't make much sense for everyone who wants to do creation to write this themselves. This changes blkg_lookup_create() to do locking and implement this pattern. The old blkg_lookup_create() is renamed to __blkg_lookup_create(). If a call site wants to do its own error handling or already owns the queue lock, they can use __blkg_lookup_create(). This will be used in upcoming patches. Signed-off-by: Dennis Zhou Reviewed-by: Josef Bacik Acked-by: Tejun Heo Reviewed-by: Liu Bo Signed-off-by: Jens Axboe commit 0fe061b9f03c27d0370888efc22d4b3ac7af90cf Author: Dennis Zhou Date: Wed Dec 5 12:10:26 2018 -0500 blkcg: fix ref count issue with bio_blkcg() using task_css The bio_blkcg() function turns out to be inconsistent and consequently dangerous to use. The first part returns a blkcg where a reference is owned by the bio meaning it does not need to be rcu protected. However, the third case, the last line, is problematic: return css_to_blkcg(task_css(current, io_cgrp_id)); This can race against task migration and the cgroup dying. It is also semantically different as it must be called rcu protected and is susceptible to failure when trying to get a reference to it. This patch adds association ahead of calling bio_blkcg() rather than after. This makes association a required and explicit step along the code paths for calling bio_blkcg(). In blk-iolatency, association is moved above the bio_blkcg() call to ensure it will not return %NULL. BFQ uses the old bio_blkcg() function, but I do not want to address it in this series due to the complexity. I have created a private version documenting the inconsistency and noting not to use it. Signed-off-by: Dennis Zhou Acked-by: Tejun Heo Reviewed-by: Josef Bacik Signed-off-by: Jens Axboe commit 6e0de61107f03c3222550d9b548cd331d31d82d1 Author: Jens Axboe Date: Wed Dec 5 06:50:40 2018 -0700 blk-mq: remove QUEUE_FLAG_POLL from default MQ flags We only support polling if we have poll queues now, but the flag is being set by default. Remove the default QUEUE_FLAG_POLL setting, we'll set it in blk_mq_init_allocated_queue() if we have poll queues available for this device. Fixes: 6544d229bf43 ("block: enable polling by default if a poll map is initalized") Reported-by: Kirill Tkhai Signed-off-by: Jens Axboe commit de55b786b8a673933f87d68c1b4a7337229d766b Author: James Smart Date: Thu Nov 29 16:09:41 2018 -0800 scsi: lpfc: update driver version to 12.0.0.9 Update the driver version to 12.0.0.9 Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 7c4042a4d0b7532cfbc90478fd3084b2dab5849e Author: James Smart Date: Thu Nov 29 16:09:40 2018 -0800 scsi: lpfc: Fix dif and first burst use in write commands When dif and first burst is used in a write command wqe, the driver was not properly setting fields in the io command request. This resulted in no dif bytes being sent and invalid xfer_rdy's, resulting in the io being aborted by the hardware. Correct the wqe initializaton when both dif and first burst are used. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 1165a5c2206cf8e4811caab145d16a8d87c69111 Author: James Smart Date: Thu Nov 29 16:09:39 2018 -0800 scsi: lpfc: Fix driver release of fw-logging buffers On driver termination, after the driver stops fw logging by writing a register on the chip, the driver immediately unmaps and frees the logging buffer, without confirming in any way that the chip has received the write and terminated the logging. As termination on the chip is not immediate, the chip may issue a dma request to the now unmapped dma buffer, resulting in a iommu fault. Change the driver to receive a confirmation that logging ahs been terminated. As the driver always issues an SLI reset with the device as part of shutdown, and as part of that is receiving confirmation that the reset is complete - the driver was modified to perform the write to disable fw logging prior to the SLI reset and only free the fw log buffer after the SLI reset is complete. That guarantees use of the fw log buffer is fully terminated when it is unmapped. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 76558b25733140a0c6bd53ea8af04b2811c92ec3 Author: James Smart Date: Thu Nov 29 16:09:38 2018 -0800 scsi: lpfc: Correct topology type reporting on G7 adapters Driver missed classifying the chip type for G7 when reporting supported topologies. This resulted in loop being shown as supported on FC links that are not supported per the standard. Add the chip classifications to the topology checks in the driver. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 1c36833d82ff24d0d54215fd956e7cc30fffce54 Author: James Smart Date: Thu Nov 29 16:09:37 2018 -0800 scsi: lpfc: Correct code setting non existent bits in sli4 ABORT WQE Driver is setting bits in word 10 of the SLI4 ABORT WQE (the wqid). The field was a carry over from a prior SLI revision. The field does not exist in SLI4, and the action may result in an overlap with future definition of the WQE. Remove the setting of WQID in the ABORT WQE. Also cleaned up WQE field settings - initialize to zero, don't bother to set fields to zero. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 0a9e9687acaf6ac1198fd41f03d64f8b92e4515e Author: James Smart Date: Thu Nov 29 16:09:36 2018 -0800 scsi: lpfc: Defer LS_ACC to FLOGI on point to point logins The current discovery state machine the driver treated FLOGI oddly. When point to point, an FLOGI is to be exchanged by the two ports, with the port with the most significant WWN then proceeding with PLOGI. The implementation in the driver was keyed to closely with "what have I sent", not with what has happened between the two endpoints. Thus, it blatantly would ACC an FLOGI, but reject PLOGI's until it had its FLOGI ACC'd. The problem is - the sending of FLOGI may be delayed for some reason, or the response to FLOGI held off by the other side. In the failing situation the other side sent an FLOGI, which was ACC'd, then sent PLOGIs which were then rjt'd until the retry count for the PLOGIs were exceeded and the port gave up. The FLOGI may have been very late in transmit, or the response held off until the PLOGIs failed. Given the other port had the higher WWN, no PLOGIs would occur and communication stopped. Correct the situation by changing the FLOGI handling. Defer any response to an FLOGI until the driver has sent its FLOGI as well. Then, upon either completion of the sent FLOGI, or upon sending an ACC to a received FLOGI (which may be received before or just after FLOGI was sent). the driver will act on who has the higher WWN. if the other port does, the driver will noop any handling of an FLOGI response (if outstanding) and wait for PLOGI. If the local port does, the driver will transition to sending PLOGI and will noop any action on responding to an FLOGI (if not yet received). Fortunately, to implement this, it only took another state flag and deferring any FLOGI response if the FLOGI has yet to be transmit. All subsequent actions were already in place. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 287aba2592870fa5b76134b28173b77f1f7a4492 Author: James Smart Date: Thu Nov 29 16:09:35 2018 -0800 scsi: lpfc: ls_rjt erroneus FLOGIs In some link initialization sequences, the fw generates an erroneous FLOGI payload to the driver without an intervening link bounce. The driver, when it sees a 2nd FLOGI without an intervening link bounce, automatically performs a link bounce. In this, the link bounce causes the situate to repeat and in a nasty loop of link bounces. Resolve the issue by validating the FLOGI payload. The erroneous FLOGI will contain VVL signatures that are not normal. When the driver sees these, it will simply reject the flogi rather than bouncing the link. The reject is consumed within the firmware. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 92ea83a878c68f709a172dd0125582b311d4d0d0 Author: James Smart Date: Thu Nov 29 16:09:34 2018 -0800 scsi: lpfc: rport port swap discovery issue. Two initiator ports were cable swapped and after swap both went down. The driver internally swaps the nlp nodes based on matching node wwn's but not the same nport id as before. After detecting a change in the nodes RPI, the driver sends an UNREG_RPI command and clears the NLP_RPI_REGISTERED flag, then swaps the node information with the other node. But the other node's NLP_RPI_REGISTERED flag is also cleared, but it is done so without an UNREG_RPI being sent, which causes the later REG_RPI for that other node to fail as the hardware believes its still registered. Additionally, if the node swap occurred while the two nodes had PLOGI's in flight, the fc4_types weren't properly getting swapped such that when the PLOGIs commpleted and PRLI's were then sent, the PRLI's acted on bad protocol types so the PRLI was for the wrong protocol. NVME devices saw SCSI FCP PRLIs and vice versa. Clean up the node swap so that the NLP_RPI_REGISTERED flag is handled properly. Fix the handling of the fc4_types when the nodes are swapped as well Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 8b47ae69e049ae0b3373859d901f0334322f9fe9 Author: James Smart Date: Thu Nov 29 16:09:33 2018 -0800 scsi: lpfc: Cap NPIV vports to 256 Depending on the chipset, the number of NPIV vports may vary and be in excess of what most switches support (256). To avoid confusion with the users, limit the reported NPIV vports to 256. Additionally correct the 16G adapter which is reporting a bogus NPIV vport number if the link is down. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 5a9eeff57f340238c39c95d8e7e54c96fc722de7 Author: James Smart Date: Thu Nov 29 16:09:32 2018 -0800 scsi: lpfc: Fix kernel Oops due to null pring pointers Driver is hitting null pring pointers in lpfc_do_work(). Pointer assignment occurs based on SLI-revision. If recovering after an error, its possible the sli revision for the port was cleared, making the lpfc_phba_elsring() not return a ring pointer, thus the null pointer. Add SLI revision checking to lpfc_phba_elsring() and status checking to all callers. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 2c4c91415a05677acc5c8131a5eb472d4aa96ae1 Author: James Smart Date: Thu Nov 29 16:09:31 2018 -0800 scsi: lpfc: Fix a duplicate 0711 log message number. Renumber one of the 0711 log messages so there isn't a duplication. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit dea16bdae2f1ab629702ca912dabe00f3dcdac25 Author: James Smart Date: Thu Nov 29 16:09:30 2018 -0800 scsi: lpfc: Fix discovery failures during port failovers with lots of vports The driver is getting hit with 100s of RSCNs during remote port address changes. Each of those RSCN's ends up generating UNREG_RPI and REG_PRI mailbox commands. The discovery engine within the driver doesn't wait for the mailbox command completions. Instead it sets state flags and moves forward. At some point, there's a massive backlog of mailbox commands which take time for the adapter to process. Additionally, it appears there were duplicate events from the switch so the driver generated duplicate mailbox commands for the same remote port. During this window, failures on PLOGI and PRLI ELS's are see as the adapter is rejecting them as they are for remote ports that still have pending mailbox commands. Streamline the discovery engine so that PLOGI log checks for outstanding UNREG_RPIs and defer the processing until the commands complete. This better synchronizes the ELS transmission vs the RPI registrations. Filter out multiple UNREG_RPIs being queued up for the same remote port. Beef up log messages in this area. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 3e1f0718921cd13384ff29d7468c4b328d8980ad Author: James Smart Date: Thu Nov 29 16:09:29 2018 -0800 scsi: lpfc: refactor mailbox structure context fields The driver data structure for managing a mailbox command contained two context fields. Unfortunately, the context were considered "generic" to be used at the whim of the command code. Of course, one section of code used fields this way, while another did it that way, and eventually there were mixups. Refactored the structure so that the generic contexts become a node context and a buffer context and all code standardizes on their use. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 0f31e9593a2fd90b1e7098b0eda03f5977350b20 Author: James Smart Date: Thu Nov 29 16:09:28 2018 -0800 scsi: lpfc: update manufacturer attribute to reflect Broadcom Update manufacturer attribute to reflect Broadcom Inc, not Emulex Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit cb34990b90f73b9a77a504c5129442c9aae0430a Author: James Smart Date: Thu Nov 29 16:09:27 2018 -0800 scsi: lpfc: Fix panic when FW-log buffsize is not initialized While trying to get adapter fw-log for a function whose buffsize was set to 0, kernel panic occurred. When buffsize is 0, the kernel buffer for the log won't be allocated. When fw log usage was enabled, it failed to check the buffer size, and log usage was started. Eventually the driver referenced the unallocated log buffer. Added checks of the buffer size before allowing fw logging to be enabled and added check for valid buffer if enabling fw log. Performed a couple other minor cleanups while fixing this: - clarified log messages - re-evaluated log message severity - treat any error as an error, not only a couple codes Signed-off-by: Dick Kennedy Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 492ca4da6f0798cf20ecaf330abc8d79e540a43a Author: James Bottomley Date: Tue Nov 27 21:41:24 2018 -0800 scsi: aha1542: Fix zeroday __udivdi3 warning dma_addr_t can be u64 on pae systems but isa_virt_to_bus only ever returns unsigned long (because an ISA physical address can only be 24 bits). Cast to unsigned long to avoid division. Fixes: 1794ef2b150d ("scsi: aha1542: convert to DMA mapping API") Signed-off-by: James Bottomley Reviewed-by: Randy Dunlap Signed-off-by: Martin K. Petersen commit 7171455354eb2ed494ddb6fe50988e98bb5cfa96 Author: Steffen Maier Date: Thu Dec 6 17:31:21 2018 +0100 scsi: zfcp: improve kdoc for return of zfcp_status_read_refill() Complements v2.6.35 commit 64deb6efdc55 ("[SCSI] zfcp: Use status_read_buf_num provided by FCP channel") which replaced the hardcoded 16 with a variable value Also complements already existing fixups for above commit v2.6.35 commit 8d88cf3f3b9a ("[SCSI] zfcp: Update status read mempool") v3.10 commit 9edf7d75ee5f ("[SCSI] zfcp: status read buffers on first adapter open with link down") Signed-off-by: Steffen Maier Reviewed-by: Jens Remus Signed-off-by: Martin K. Petersen commit 60a161b7e5b2a252ff0d4c622266a7d8da1120ce Author: Steffen Maier Date: Thu Dec 6 17:31:20 2018 +0100 scsi: zfcp: fix posting too many status read buffers leading to adapter shutdown Suppose adapter (open) recovery is between opened QDIO queues and before (the end of) initial posting of status read buffers (SRBs). This time window can be seconds long due to FSF_PROT_HOST_CONNECTION_INITIALIZING causing by design looping with exponential increase sleeps in the function performing exchange config data during recovery [zfcp_erp_adapter_strat_fsf_xconf()]. Recovery triggered by local link up. Suppose an event occurs for which the FCP channel would send an unsolicited notification to zfcp by means of a previously posted SRB. We saw it with local cable pull (link down) in multi-initiator zoning with multiple NPIV-enabled subchannels of the same shared FCP channel. As soon as zfcp_erp_adapter_strategy_open_fsf() starts posting the initial status read buffers from within the adapter's ERP thread, the channel does send an unsolicited notification. Since v2.6.27 commit d26ab06ede83 ("[SCSI] zfcp: receiving an unsolicted status can lead to I/O stall"), zfcp_fsf_status_read_handler() schedules adapter->stat_work to re-fill the just consumed SRB from a work item. Now the ERP thread and the work item post SRBs in parallel. Both contexts call the helper function zfcp_status_read_refill(). The tracking of missing (to be posted / re-filled) SRBs is not thread-safe due to separate atomic_read() and atomic_dec(), in order to depend on posting success. Hence, both contexts can see atomic_read(&adapter->stat_miss) == 1. One of the two contexts posts one too many SRB. Zfcp gets QDIO_ERROR_SLSB_STATE on the output queue (trace tag "qdireq1") leading to zfcp_erp_adapter_shutdown() in zfcp_qdio_handler_error(). An obvious and seemingly clean fix would be to schedule stat_work from the ERP thread and wait for it to finish. This would serialize all SRB re-fills. However, we already have another work item wait on the ERP thread: adapter->scan_work runs zfcp_fc_scan_ports() which calls zfcp_fc_eval_gpn_ft(). The latter calls zfcp_erp_wait() to wait for all the open port recoveries during zfcp auto port scan, but in fact it waits for any pending recovery including an adapter recovery. This approach leads to a deadlock. [see also v3.19 commit 18f87a67e6d6 ("zfcp: auto port scan resiliency"); v2.6.37 commit d3e1088d6873 ("[SCSI] zfcp: No ERP escalation on gpn_ft eval"); v2.6.28 commit fca55b6fb587 ("[SCSI] zfcp: fix deadlock between wq triggered port scan and ERP") fixing v2.6.27 commit c57a39a45a76 ("[SCSI] zfcp: wait until adapter is finished with ERP during auto-port"); v2.6.27 commit cc8c282963bd ("[SCSI] zfcp: Automatically attach remote ports")] Instead make the accounting of missing SRBs atomic for parallel execution in both the ERP thread and adapter->stat_work. Signed-off-by: Steffen Maier Fixes: d26ab06ede83 ("[SCSI] zfcp: receiving an unsolicted status can lead to I/O stall") Cc: #2.6.27+ Reviewed-by: Jens Remus Signed-off-by: Martin K. Petersen commit 4b66810303f507a56d07ba9b1b264cd51c41fed6 Author: Rob Herring Date: Wed Dec 5 13:50:39 2018 -0600 scsi: sun_esp: 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. Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Signed-off-by: Rob Herring Signed-off-by: Martin K. Petersen commit 3beeabd5f2d1fc7a48cb887a298bc412789a1f68 Author: David Disseldorp Date: Wed Dec 5 13:18:38 2018 +0100 scsi: target: perform t10_wwn ID initialisation in target_alloc_device() Initialise the t10_wwn vendor, model and revision defaults when a device is allocated instead of when it's enabled. This ensures that custom vendor or model strings set prior to enablement are not later overwritten with default values. The TRANSPORT_FLAG_PASSTHROUGH conditional can be dropped for the following reasons: - target_core_pscsi overwrites the defaults in the pscsi_configure_device() callback. + the contents is then only used for ConfigFS via $pscsi_dev/statistics/scsi_lu/vend, etc. - target_core_user doesn't touch the defaults, nor are they used for anything outside of ConfigFS. Signed-off-by: David Disseldorp Reviewed-by: Roman Bolshakov Signed-off-by: Martin K. Petersen commit 2d882847280e3ae1ddc95175d0fc2006e11bb63f Author: David Disseldorp Date: Wed Dec 5 13:18:37 2018 +0100 scsi: target: remove hardcoded T10 Vendor ID in INQUIRY response Use the value stored in t10_wwn.vendor, which defaults to "LIO-ORG", but can be reconfigured via the vendor_id ConfigFS attribute. Signed-off-by: David Disseldorp Reviewed-by: Bryant G. Ly Reviewed-by: Lee Duncan Reviewed-by: Hannes Reinecke Reviewed-by: Roman Bolshakov Signed-off-by: Martin K. Petersen commit 54a6f3f6a43cf5a5ad0421e4440a4c7095e7a223 Author: David Disseldorp Date: Wed Dec 5 13:18:36 2018 +0100 scsi: target: add device vendor_id configfs attribute The vendor_id attribute will allow for the modification of the T10 Vendor Identification string returned in inquiry responses. Its value can be viewed and modified via the ConfigFS path at: target/core/$backstore/$name/wwn/vendor_id "LIO-ORG" remains the default value, which is set when the backstore device is enabled. [mkp: corrected VPD page number] Signed-off-by: David Disseldorp Reviewed-by: Roman Bolshakov Signed-off-by: Martin K. Petersen commit b2da4abf26e859c6c17b49f6f728db0eaab9bc4a Author: David Disseldorp Date: Wed Dec 5 13:18:35 2018 +0100 scsi: target: consistently null-terminate t10_wwn strings In preparation for supporting user provided vendor strings, add an extra byte to the vendor, model and revision arrays in struct t10_wwn. This ensures that the full INQUIRY data can be carried in the arrays along with a null-terminator. Change a number of array readers and writers so that they account for explicit null-termination: - The pscsi_set_inquiry_info() and emulate_model_alias_store() codepaths don't currently explicitly null-terminate; fix this. - Existing t10_wwn field dumps use for-loops which step over null-terminators for right-padding. + Use printf with width specifiers instead. Signed-off-by: David Disseldorp Reviewed-by: Roman Bolshakov Signed-off-by: Martin K. Petersen commit 0de263577de5d5e052be5f4f93334e63cc8a7f0b Author: David Disseldorp Date: Wed Dec 5 13:18:34 2018 +0100 scsi: target: use consistent left-aligned ASCII INQUIRY data spc5r17.pdf specifies: 4.3.1 ASCII data field requirements ASCII data fields shall contain only ASCII printable characters (i.e., code values 20h to 7Eh) and may be terminated with one or more ASCII null (00h) characters. ASCII data fields described as being left-aligned shall have any unused bytes at the end of the field (i.e., highest offset) and the unused bytes shall be filled with ASCII space characters (20h). LIO currently space-pads the T10 VENDOR IDENTIFICATION and PRODUCT IDENTIFICATION fields in the standard INQUIRY data. However, the PRODUCT REVISION LEVEL field in the standard INQUIRY data as well as the T10 VENDOR IDENTIFICATION field in the INQUIRY Device Identification VPD Page are zero-terminated/zero-padded. Fix this inconsistency by using space-padding for all of the above fields. Signed-off-by: David Disseldorp Reviewed-by: Christoph Hellwig Reviewed-by: Bryant G. Ly Reviewed-by: Lee Duncan Reviewed-by: Hannes Reinecke Reviewed-by: Roman Bolshakov Signed-off-by: Martin K. Petersen commit 75c1d48a338bdf3ce850166be527598017e0ebca Author: Thomas Meyer Date: Sun Dec 2 21:52:11 2018 +0100 scsi: qla2xxx: NULL check before some freeing functions is not needed NULL check before some freeing functions is not needed. Signed-off-by: Thomas Meyer Acked-by: Himanshu Madhani Signed-off-by: Martin K. Petersen commit f3e46ac47e42df29db99e331ad8f39f34789d4e4 Author: Thomas Meyer Date: Sun Dec 2 21:52:11 2018 +0100 scsi: qedf: NULL check before some freeing functions is not needed NULL check before some freeing functions is not needed. Signed-off-by: Thomas Meyer Acked-by: Manish Rangankar Signed-off-by: Martin K. Petersen commit 19c0507252c977ba8b3d2e2fe99afd2c176a993b Author: Thomas Meyer Date: Sun Dec 2 21:52:11 2018 +0100 scsi: megaraid_sas: NULL check before some freeing functions is not needed NULL check before some freeing functions is not needed. Signed-off-by: Thomas Meyer Acked-by: Sumit Saxena Signed-off-by: Martin K. Petersen commit c4e521b654e15e372a6429e269e7e907b4698224 Author: Bart Van Assche Date: Thu Nov 29 10:25:11 2018 -0800 scsi: qla2xxx: Split the __qla2x00_abort_all_cmds() function Nesting in __qla2x00_abort_all_cmds() is way too deep. Reduce the nesting level by introducing a helper function. This patch does not change any functionality. Reviewed-by: Laurence Oberman Acked-by: Himanshu Madhani Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 14e9a890ec9751f0b2aeeed385c836c773fb991a Author: Varun Prakash Date: Thu Nov 29 19:18:31 2018 +0530 scsi: csiostor: remove flush_scheduled_work() flush_scheduled_work() is not required as csio_hw_exit_workers() calls cancel_work_sync() for hw->evtq_work. Signed-off-by: Varun Prakash Signed-off-by: Martin K. Petersen commit 636db60b8e910760c283b7aa928efcc580c1f574 Author: Fedor Loshakov Date: Thu Nov 29 13:09:56 2018 +0100 scsi: zfcp: make DIX experimental, disabled, and independent of DIF Introduce separate zfcp module parameters to individually select support for: DIF which should work (zfcp.dif, which used to be DIF+DIX, disabled) or DIX+DIF which can cause trouble (zfcp.dix, new, disabled). If DIX is enabled, we warn on zfcp driver initialization. As before, this also reduces the maximum I/O request size to half, to support the worst case of merged single sector requests with one protection data scatter gather element per sector. This can impact the maximum throughput. In DIF-only mode (zfcp.dif=1 zfcp.dix=0), we can use the full maximum I/O request size as there is no protection data for zfcp. Signed-off-by: Steffen Maier Signed-off-by: Fedor Loshakov Reviewed-by: Jens Remus Signed-off-by: Martin K. Petersen commit 1ff2d8c43bc2ac78470033eae2947aec0c2e8cb6 Author: Gustavo A. R. Silva Date: Tue Nov 27 22:21:23 2018 -0600 scsi: BusLogic: mark expected switch fall-through In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. Addresses-Coverity-ID: 1056537 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva Acked-by: Khalid Aziz Signed-off-by: Martin K. Petersen commit 09a5a24ff36f906baaa51338829acca6bd8438f8 Author: Avri Altman Date: Thu Nov 22 20:04:56 2018 +0200 scsi: ufs: Remove redundant sense size definition By spec, the ufs sense data is 18 bytes long. Signed-off-by: Avri Altman Signed-off-by: Martin K. Petersen commit 7250d12d73195adbf9c3eb003b4331ce36eed038 Author: Sabyasachi Gupta Date: Thu Nov 15 22:04:04 2018 +0530 scsi: snic: Use vzalloc Replaced vmalloc + memset with vzalloc Signed-off-by: Sabyasachi Gupta Acked-by: Sesidhar Baddela Signed-off-by: Martin K. Petersen commit 58f5fa68372505c8c6e57754a370f0e7e6004513 Author: Peng Ma Date: Thu Dec 6 19:18:23 2018 +0800 arm64: dts: ls1046a: add qdma device tree nodes add the qDMA device tree nodes for LS1046A devices. Signed-off-by: Wen He Signed-off-by: Peng Ma Signed-off-by: Shawn Guo commit 29813f669d89a1a9ae2e3e2d2cf55e12ed54853f Author: Peng Ma Date: Thu Dec 6 19:18:22 2018 +0800 arm64: dts: ls1043a: add qdma device tree nodes add the qDMA device tree nodes for LS1043A devices. Signed-off-by: Wen He Signed-off-by: Peng Ma Signed-off-by: Shawn Guo commit d9a71ef086e89e411ca508a69361b38beb0aafdf Author: Ioana Ciocoi Radulescu Date: Tue Dec 4 16:33:07 2018 +0000 arm64: dts: ls1088a: Add missing dma-ranges property LS1088A has a 48-bit address size so make sure that the dma-ranges property reflects this. Signed-off-by: Ioana Radulescu Signed-off-by: Shawn Guo commit a2468676cc826be36d8f2ab3d593eea80f639c44 Author: Ioana Ciocoi Radulescu Date: Tue Dec 4 16:33:06 2018 +0000 arm64: dts: ls1088a: Move fsl-mc node The fsl-mc node should sit under the soc node, so move it to its proper location. Fixes: ac7c9ff741fb ("arm64: dts: ls1088a: add fsl-mc hardware resource manager node") Signed-off-by: Ioana Radulescu Signed-off-by: Shawn Guo commit c9a1f24304cbf6d576a0e0c379ae85e7329cd0ba Author: Viresh Kumar Date: Fri Nov 16 15:34:26 2018 +0530 arm64: dts: fsl: Add all CPUs in cooling maps Each CPU can (and does) participate in cooling down the system but the DT only captures a handful of them, normally CPU0, in the cooling maps. Things work by chance currently as under normal circumstances its the first CPU of each cluster which is used by the operating systems to probe the cooling devices. But as soon as this CPU ordering changes and any other CPU is used to bring up the cooling device, we will start seeing failures. Also the DT is rather incomplete when we list only one CPU in the cooling maps, as the hardware doesn't have any such limitations. Update cooling maps to include all devices affected by individual trip points. Signed-off-by: Viresh Kumar Signed-off-by: Shawn Guo commit 8897f3255c9c411b86482e09ccbc3e75a8a201e7 Author: Bhaskar Upadhaya Date: Wed Nov 14 05:30:52 2018 +0000 arm64: dts: Add support for NXP LS1028A SoC LS1028A contains two ARM v8 CortexA72 processor cores with 32 KB L1-D cache and 48 KB L1-I cache Features summary Two 32-bit / 64-bit ARM v8 Cortex-A72 CPUs - Arranged as single clusters of two cores sharing a 1 MB L2 cache - Speed Up to 1.3 GHz - Support for cluster power-gating. Cache coherent interconnect (CCI-400) - Hardware-managed data coherency - Up to 400 MHz 32-bit DDR4 SDRAM memory controller with ECC Two PCIe 3.0 controllers One serial ATA (SATA 3.0) controller Two high-speed USB 3.0 controllers with integrated PHY Following levels of DTSI/DTS files have been created for the LS1028A SoC family: - fsl-ls1028a.dtsi: DTS-Include file for NXP LS1028A SoC. - fsl-ls1028a-qds.dts: DTS file for NXP LS1028A QDS board. - fsl-ls1028a-rdb.dts: DTS file for NXP LS1028A RDB board Signed-off-by: Sudhanshu Gupta Signed-off-by: Rai Harninder Signed-off-by: Bhaskar Upadhaya Acked-by: Li Yang Signed-off-by: Shawn Guo commit 1fa35bc09d48de9dbbadf11e667adced9e461131 Author: Hou Zhiqiang Date: Wed Nov 7 05:35:32 2018 +0000 arm64: dts: layerscape: removed compatible string "snps,dw-pcie" Removed the wrong compatible string "snps,dw-pcie", in case match incorrect driver. Signed-off-by: Hou Zhiqiang Signed-off-by: Shawn Guo commit e3f230c066cd50010844871d62aed346dbe7c9d7 Author: Sabyasachi Gupta Date: Wed Nov 14 22:24:21 2018 +0530 scsi: fnic: Use vzalloc Replaced vmalloc + memset with vzalloc Signed-off-by: Sabyasachi Gupta Acked-by: Sesidhar Baddela Signed-off-by: Martin K. Petersen commit aa2aa88847154010157aa5957951ae826118d28c Author: Bao Xiaowei Date: Mon Nov 5 16:46:48 2018 +0800 arm64: dts: fsl: Add the status property disable PCIe Add the status property disable the PCIe, the property will be enable by bootloader. Signed-off-by: Bao Xiaowei Signed-off-by: Shawn Guo commit 26a06c6e290e0a577d82f1dd3ecdee4a838aee80 Author: Pramod Kumar Date: Tue Oct 16 07:40:29 2018 +0000 arm64: dts: ls1012a: Add FRWY-LS1012A board support LS1012A-FRWY is an ls1012a based SoC board. Key features of this board are Micro SD, USB 3.0, upto 1GB DDR, UART Signed-off-by: Pramod Kumar Signed-off-by: Shawn Guo commit 3ad9800231d4f070c580e3e3894940892a4308d0 Author: Bart Van Assche Date: Tue Nov 27 15:52:04 2018 -0800 scsi: target/core: Reduce the amount of code executed with a spinlock held Due to the "make ABORT and LUN RESET handling synchronous" patch, cmd->work is only modified from the regular command execution path and no longer asynchronously by the code that executes task management functions. Since the regular command execution code is sequential per command, no locking is required to manipulate cmd->work. Hence stop protecting cmd->work manipulations with locking. Cc: Nicholas Bellinger Cc: Mike Christie Cc: Christoph Hellwig Cc: David Disseldorp Cc: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 2c9fa49e100f962af988f1c0529231bf14905cda Author: Bart Van Assche Date: Tue Nov 27 15:52:03 2018 -0800 scsi: target/core: Make ABORT and LUN RESET handling synchronous Instead of invoking target driver callback functions from the context that handles an abort or LUN RESET task management function, only set the abort flag from that context and perform the actual abort handling from the context of the regular command processing flow. This approach has the advantage that the task management code becomes much easier to read and to verify since the number of potential race conditions against the command processing flow is strongly reduced. This patch has been tested by running the following two shell commands concurrently for about ten minutes for both the iSCSI and the SRP target drivers ($dev is an initiator device node connected with storage provided by the target driver under test): * fio with data verification enabled on a filesystem mounted on top of $dev. * while true; do sg_reset -d $dev; echo -n .; sleep .1; done Cc: Nicholas Bellinger Cc: Mike Christie Cc: Christoph Hellwig Cc: David Disseldorp Cc: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit aaa00cc93c1d0fd2693a76ea2ba375ea1ac1a7f3 Author: Bart Van Assche Date: Tue Nov 27 15:52:02 2018 -0800 scsi: target/core: Fix TAS handling for aborted commands The TASK ABORTED STATUS (TAS) bit is defined as follows in SAM: "TASK_ABORTED: this status shall be returned if a command is aborted by a command or task management function on another I_T nexus and the control mode page TAS bit is set to one". TAS handling is spread over the target core and the iSCSI target driver. If a LUN RESET is received, the target core will send the TASK_ABORTED response for all commands for which such a response has to be sent. If an ABORT TASK is received, only the iSCSI target driver will send the TASK_ABORTED response for the commands for which that response has to be sent. That is a bug since all target drivers have to honor the TAS bit. Fix this by moving the code that handles TAS from the iSCSI target driver into the target core. Additionally, if a command has been aborted, instead of sending the TASK_ABORTED status from the context that processes the SCSI command send it from the context of the ABORT TMF. The core_tmr_abort_task() change in this patch causes the CMD_T_TAS flag to be set if a TASK_ABORTED status has to be sent back to the initiator that submitted the command. If that flag has been set transport_cmd_finish_abort() will send the TASK_ABORTED response. Cc: Nicholas Bellinger Cc: Mike Christie Cc: Christoph Hellwig Cc: David Disseldorp Cc: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit fbbd49235590ca759aada500b5a935e06b7f6708 Author: Bart Van Assche Date: Tue Nov 27 15:52:01 2018 -0800 scsi: target/core: Simplify the code for aborting SCSI commands Instead of allowing the code that aborts a SCSI command to finish before all iSCSI data frames have been received, make that code wait until all iSCSI data frames have been received. Introduce a new member variable in the target driver template to communicate that information from the iSCSI target driver to the target core. This change allows to leave out the check whether or not it is already safe to send the TASK_ABORTED reply from transport_send_task_abort(). Cc: Nicholas Bellinger Cc: Mike Christie Cc: Christoph Hellwig Cc: David Disseldorp Cc: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit a014c3647a15ccb946dc6ea387a40098aeab5dc8 Author: Bart Van Assche Date: Tue Nov 27 15:52:00 2018 -0800 scsi: target/core: Make it possible to wait from more than one context for command completion This patch does not change any functionality but makes the patch that makes TMF handling synchronous easier to read. Cc: Nicholas Bellinger Cc: Mike Christie Cc: Christoph Hellwig Cc: David Disseldorp Cc: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit db5b21a24e01d35495014076700efa02d6dcbb68 Author: Bart Van Assche Date: Tue Nov 27 15:51:59 2018 -0800 scsi: target/core: Use system workqueues for TMF A quote from SAM-5: "The order in which task management requests are processed is not specified by the SCSI architecture model. The SCSI architecture model does not require in-order delivery of such task management requests or processing by the task manager in the order received. To guarantee the processing order of task management requests referencing sent to a specific logical unit, an application client should not have more than one such task management request pending to that logical unit." This means that it is safe to use the system workqueues instead of tmr_wq for processing TMFs. An intended side effect of this patch is that it enables concurrent processing of TMFs. Reviewed-by: Christoph Hellwig Cc: Nicholas Bellinger Cc: Mike Christie Cc: David Disseldorp Cc: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit ad669505c4e9db9af9faeb5c51aa399326a80d91 Author: Bart Van Assche Date: Tue Nov 27 15:51:58 2018 -0800 scsi: target/core: Make sure that target_wait_for_sess_cmds() waits long enough A session must only be released after all code that accesses the session structure has finished. Make sure that this is the case by introducing a new command counter per session that is only decremented after the .release_cmd() callback has finished. This patch fixes the following crash: BUG: KASAN: use-after-free in do_raw_spin_lock+0x1c/0x130 Read of size 4 at addr ffff8801534b16e4 by task rmdir/14805 CPU: 16 PID: 14805 Comm: rmdir Not tainted 4.18.0-rc2-dbg+ #5 Call Trace: dump_stack+0xa4/0xf5 print_address_description+0x6f/0x270 kasan_report+0x241/0x360 __asan_load4+0x78/0x80 do_raw_spin_lock+0x1c/0x130 _raw_spin_lock_irqsave+0x52/0x60 srpt_set_ch_state+0x27/0x70 [ib_srpt] srpt_disconnect_ch+0x1b/0xc0 [ib_srpt] srpt_close_session+0xa8/0x260 [ib_srpt] target_shutdown_sessions+0x170/0x180 [target_core_mod] core_tpg_del_initiator_node_acl+0xf3/0x200 [target_core_mod] target_fabric_nacl_base_release+0x25/0x30 [target_core_mod] config_item_release+0x9c/0x110 [configfs] config_item_put+0x26/0x30 [configfs] configfs_rmdir+0x3b8/0x510 [configfs] vfs_rmdir+0xb3/0x1e0 do_rmdir+0x262/0x2c0 do_syscall_64+0x77/0x230 entry_SYSCALL_64_after_hwframe+0x49/0xbe Cc: Nicholas Bellinger Cc: Mike Christie Cc: Christoph Hellwig Cc: David Disseldorp Cc: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit a95be3842c51c9ac32fe17faedf2c156ccf81bd7 Author: Bart Van Assche Date: Tue Nov 27 15:51:57 2018 -0800 scsi: target/core: Simplify transport_clear_lun_ref() Since transport_clear_lun_ref() already waits until the percpu-refcount .release() method is called, it is not necessary to wait first until percpu_ref_kill_and_confirm() has finished transitioning the refcount into atomic mode. Remove the code that waits for percpu_ref_kill_and_confirm() to complete and also the completion object that is used by that code. This patch does not change the behavior of the SCSI target code. Cc: Nicholas Bellinger Cc: Mike Christie Cc: Christoph Hellwig Cc: David Disseldorp Cc: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 5d6cd9fe318b4a6ed2ecee83306db3f543a4f9c4 Author: Bart Van Assche Date: Tue Nov 27 15:51:56 2018 -0800 scsi: target/core: Use kvcalloc() instead of open-coding it This patch does not change any functionality. Note: the code that frees sess_cmd_map already uses kvfree() so that code does not need to be modified. Reviewed-by: David Disseldorp Cc: Nicholas Bellinger Cc: Mike Christie Cc: Christoph Hellwig Cc: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit e7f411049f5164ee6db6c3434c07302846f09990 Author: Bart Van Assche Date: Tue Nov 27 15:51:55 2018 -0800 scsi: target/tcmu: Fix queue_cmd_ring() declaration This patch does not change any functionality but avoids that sparse complains about the queue_cmd_ring() function and its callers. Fixes: 6fd0ce79724d ("tcmu: prep queue_cmd_ring to be used by unmap wq") Reviewed-by: David Disseldorp Cc: Nicholas Bellinger Cc: Mike Christie Cc: Christoph Hellwig Cc: Hannes Reinecke Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 257edce66d31a345dff8ca9f1fd30c46e0f14058 Author: Masahiro Yamada Date: Wed Dec 5 16:38:35 2018 +0900 kbuild: exploit parallel building for CONFIG_HEADERS_CHECK When CONFIG_HEADERS_CHECK is enabled, the headers_check is executed as a serialized task in the vmlinux recipe. Make it independent of vmlinux so that parallel building can process the headers_check and other build targets simultaneously. Signed-off-by: Masahiro Yamada commit 5e34bd1d548d440015d5bee3326e9d74cdebecd6 Author: Masahiro Yamada Date: Wed Dec 5 16:37:53 2018 +0900 kbuild: remove a special handling for *.agh in Makefile.headersinst scripts/Makefile.headersinst takes care of *.agh just for arch/cris/include/uapi/arch-v10/arch/sv_addr.agh because renaming exported headers is difficult (or impossible). This code is no longer necessary thanks to commit c690eddc2f3b ("CRIS: Drop support for the CRIS port"). Signed-off-by: Masahiro Yamada commit 0cbe3ac439bfe3e6d0f65b006044f84ce7f3e4d0 Author: Masahiro Yamada Date: Fri Nov 30 18:15:52 2018 +0900 kconfig: remove k_invalid from expr_parse_string() return type The only possibility of k_invalid being returned was when expr_parse_sting() parsed S_OTHER type symbol. This actually never happened, and this is even clearer since S_OTHER has gone. Clean up unreachable code. Signed-off-by: Masahiro Yamada commit 2aabbed6774f231c57f8ae6bc4f856fb2a75cd6a Author: Masahiro Yamada Date: Fri Nov 30 18:15:51 2018 +0900 kconfig: remove S_OTHER symbol type and correct dependency tracking The S_OTHER type could be set only when conf_read_simple() is reading include/config/auto.conf file. For example, CONFIG_FOO=y exists in include/config/auto.conf but it is missing from the currently parsed Kconfig files, sym_lookup() allocates a new symbol, and sets its type to S_OTHER. Strangely, it will be set to S_STRING by conf_set_sym_val() a few lines below while it is obviously bool or tristate type. On the other hand, when CONFIG_BAR="bar" is being dropped from include/config/auto.conf, its type remains S_OTHER. Because for_all_symbols() omits S_OTHER symbols, conf_touch_deps() misses to touch include/config/bar.h This behavior has been a pretty mystery for me, and digging the git histroy did not help. At least, touching depfiles is broken for string type symbols. I removed S_OTHER entirely, and reimplemented it more simply. If CONFIG_FOO was visible in the previous syncconfig, but is missing now, what we want to do is quite simple; just call conf_touch_dep() to touch include/config/foo.h instead of allocating a new symbol data. Signed-off-by: Masahiro Yamada commit 1508fec82e394149212aca836dd925d7e8fa3228 Author: Masahiro Yamada Date: Fri Nov 30 18:15:50 2018 +0900 kconfig: split out code touching a file to conf_touch_dep() conf_touch_deps() iterates over symbols, touching corresponding include/config/*.h files as needed. Split the part that touches a single file into a new helper so it can be reused. The new helper, conf_touch_dep(), takes a symbol name as a parameter, and touches the corresponding include/config/*.h file. Signed-off-by: Masahiro Yamada commit 0849d212e39523e2289c2a6d685b899f944746eb Author: Masahiro Yamada Date: Fri Nov 30 18:15:49 2018 +0900 kconfig: rename conf_split_config() to conf_touch_deps() According to commit 2e3646e51b2d ("kconfig: integrate split config into silentoldconfig"), this function was named after split-include tool, which used to exist in old versions of Linux. Setting aside the historical reason, rename it into a more intuitive name. This function touches timestamp files under include/config/ in order to interact with the fixdep tool. Signed-off-by: Masahiro Yamada commit 75889e9be78febab9991f9c07fdf09d128562bf5 Author: Masahiro Yamada Date: Fri Nov 30 18:15:48 2018 +0900 kconfig: remove unneeded setsym label in conf_read_simple() The two 'goto setsym' statements are reachable only when sym == NULL. The code below the 'setsym:' label does nothing when sym == NULL since there is just one if-block guarded by 'if (sym && ...)'. Hence, 'goto setsym' can be replaced with 'continue'. Signed-off-by: Masahiro Yamada commit 83af01ba1c2d38d3075b38af2a2116eb1ebe67e6 Merge: 0fbe82e628c81 8d189159ac1e8 Author: David S. Miller Date: Fri Dec 7 16:39:03 2018 -0800 Merge branch 'tc-testing-next' Lucas Bates says: ==================== tc-testing: implement command timeouts and better results tracking Patch 1 adds a timeout feature for any command tdc launches in a subshell. This prevents tdc from hanging indefinitely. Patches 2-4 introduce a new method for tracking and generating test case results, and implements it across the core script and all applicable plugins. ==================== Signed-off-by: David S. Miller commit 8d189159ac1e8dc6d491840b3b2a9ede762269bc Author: Lucas Bates Date: Thu Dec 6 17:42:27 2018 -0500 tc-testing: gitignore, ignore generated test results Ignore any .tap or .xml test result files generated by tdc. Additionally, ignore plugin symlinks. Signed-off-by: Lucas Bates Signed-off-by: David S. Miller commit 915c158deaf97be49e71250f43e1539542217962 Author: Lucas Bates Date: Thu Dec 6 17:42:26 2018 -0500 tc-testing: Implement the TdcResults module in tdc In tdc and the valgrind plugin, begin using the TdcResults module to track executed test cases. Signed-off-by: Lucas Bates Signed-off-by: David S. Miller commit dfe465d33e7fce145746d836ddb31f0e27f28e28 Author: Lucas Bates Date: Thu Dec 6 17:42:25 2018 -0500 tc-testing: Add new TdcResults module This module includes new classes for tdc to use in keeping track of test case results, instead of generating and tracking a lengthy string. The new module can be extended to support multiple formal test result formats to be friendlier to automation. Signed-off-by: Lucas Bates Signed-off-by: David S. Miller commit d37e56df23f9e5916f95b60388c3f179c53c7102 Author: Lucas Bates Date: Thu Dec 6 17:42:24 2018 -0500 tc-testing: Add command timeout feature to tdc Using an attribute set in the tdc_config.py file, limit the amount of time tdc will wait for an executed command to complete and prevent the script from hanging entirely. This timeout will be applied to all executed commands. Signed-off-by: Lucas Bates Signed-off-by: David S. Miller commit 0fbe82e628c817e292ff588cd5847fc935e025f2 Author: yupeng Date: Wed Dec 5 18:56:28 2018 -0800 net: call sk_dst_reset when set SO_DONTROUTE after set SO_DONTROUTE to 1, the IP layer should not route packets if the dest IP address is not in link scope. But if the socket has cached the dst_entry, such packets would be routed until the sk_dst_cache expires. So we should clean the sk_dst_cache when a user set SO_DONTROUTE option. Below are server/client python scripts which could reprodue this issue: server side code: ========================================================================== import socket import struct import time s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(('0.0.0.0', 9000)) s.listen(1) sock, addr = s.accept() sock.setsockopt(socket.SOL_SOCKET, socket.SO_DONTROUTE, struct.pack('i', 1)) while True: sock.send(b'foo') time.sleep(1) ========================================================================== client side code: ========================================================================== import socket import time s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(('server_address', 9000)) while True: data = s.recv(1024) print(data) ========================================================================== Signed-off-by: yupeng Signed-off-by: David S. Miller commit 58956317c8de52009d1a38a721474c24aef74fe7 Author: David Ahern Date: Fri Dec 7 12:24:57 2018 -0800 neighbor: Improve garbage collection The existing garbage collection algorithm has a number of problems: 1. The gc algorithm will not evict PERMANENT entries as those entries are managed by userspace, yet the existing algorithm walks the entire hash table which means it always considers PERMANENT entries when looking for entries to evict. In some use cases (e.g., EVPN) there can be tens of thousands of PERMANENT entries leading to wasted CPU cycles when gc kicks in. As an example, with 32k permanent entries, neigh_alloc has been observed taking more than 4 msec per invocation. 2. Currently, when the number of neighbor entries hits gc_thresh2 and the last flush for the table was more than 5 seconds ago gc kicks in walks the entire hash table evicting *all* entries not in PERMANENT or REACHABLE state and not marked as externally learned. There is no discriminator on when the neigh entry was created or if it just moved from REACHABLE to another NUD_VALID state (e.g., NUD_STALE). It is possible for entries to be created or for established neighbor entries to be moved to STALE (e.g., an external node sends an ARP request) right before the 5 second window lapses: -----|---------x|----------|----- t-5 t t+5 If that happens those entries are evicted during gc causing unnecessary thrashing on neighbor entries and userspace caches trying to track them. Further, this contradicts the description of gc_thresh2 which says "Entries older than 5 seconds will be cleared". One workaround is to make gc_thresh2 == gc_thresh3 but that negates the whole point of having separate thresholds. 3. Clearing *all* neigh non-PERMANENT/REACHABLE/externally learned entries when gc_thresh2 is exceeded is over kill and contributes to trashing especially during startup. This patch addresses these problems as follows: 1. Use of a separate list_head to track entries that can be garbage collected along with a separate counter. PERMANENT entries are not added to this list. The gc_thresh parameters are only compared to the new counter, not the total entries in the table. The forced_gc function is updated to only walk this new gc_list looking for entries to evict. 2. Entries are added to the list head at the tail and removed from the front. 3. Entries are only evicted if they were last updated more than 5 seconds ago, adhering to the original intent of gc_thresh2. 4. Forced gc is stopped once the number of gc_entries drops below gc_thresh2. 5. Since gc checks do not apply to PERMANENT entries, gc levels are skipped when allocating a new neighbor for a PERMANENT entry. By extension this means there are no explicit limits on the number of PERMANENT entries that can be created, but this is no different than FIB entries or FDB entries. Signed-off-by: David Ahern Signed-off-by: David S. Miller commit 12edfdfc79860f42fa493f81518e040376b6a5bc Merge: 9f4c2cffd08c1 630ba007f4750 Author: David S. Miller Date: Fri Dec 7 15:57:02 2018 -0800 Merge branch 'hns3-error-handling' Salil Mehta says: ==================== net: hns3: Additions/optimizations related to HNS3 H/W err handling This patch set primarily does following addtions and optimizations related to error handling in HNS3 Ethernet driver: 1. Name changes for enable and process functions and minor loop optimizations. [PATCH 1-6] 2. Modify query and clearing of RAS errors using new set of commands because modules specific commands for clearing RCB PPP PF, SSU are obselete. [PATCH 7] 3. Deletes logging 1-bit errors for RAS in HNS3 driver as these never get reported to the driver. [PATCH 8] 4. Add handling of NIC hw errors reported through MSIx rather than PCIe AER channel. [PATCH 9] 5. Add handling for the HW RAS and MSIx errors in the modules MAC, PPP PF, MSIx SRAM, RCB and SSU. [PATCH 10-13] 6. Add handling of RoCEE RAS errors. [PATCH 14] ==================== Signed-off-by: David S. Miller commit 630ba007f4750722bc56dfebfaf1c0316c2fcb69 Author: Shiju Jose Date: Fri Dec 7 21:08:11 2018 +0000 net: hns3: add handling of RDMA RAS errors This patch handles the RDMA RAS errors. 1. Enable RAS interrupt, print error detail info and clear error status. 2. Do CORE reset to recovery when these non-fatal errors happened. Signed-off-by: Xiaofei Tan Signed-off-by: Shiju Jose Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit c3529177db471b964fbe327ffb801266f0482d64 Author: Shiju Jose Date: Fri Dec 7 21:08:10 2018 +0000 net: hns3: handle hw errors of SSU This patch enables and handles hw errors of the Storage Switch Unit(SSU). Signed-off-by: Shiju Jose Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit f69b10b317f9dd286b6f03f2d6d8d5980b8ca9bc Author: Shiju Jose Date: Fri Dec 7 21:08:09 2018 +0000 net: hns3: handle hw errors of PPU(RCB) This patch enables and handles hw RAS and MSIx errors of PPU(RCB). Signed-off-by: Shiju Jose Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 8fc9d3e3b46b1aa881d897c1405516ee8c7c6f43 Author: Shiju Jose Date: Fri Dec 7 21:08:08 2018 +0000 net: hns3: handle hw errors of PPP PF This patch handles PF hw errors of PPP(Programmable Packet Processor). Signed-off-by: Shiju Jose Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 7838f908e251497502092e625f2053398c23516b Author: Shiju Jose Date: Fri Dec 7 21:08:07 2018 +0000 net: hns3: add handling of hw errors of MAC This patch adds enable and handling of hw errors of the MAC block. Signed-off-by: Shiju Jose Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit f6162d44126ce0f601f92afc770648b73924eb6c Author: Salil Mehta Date: Fri Dec 7 21:08:06 2018 +0000 net: hns3: add handling of hw errors reported through MSIX This patch adds handling for HNS3 hardware errors(non-standard) which are reported through MSIX interrupts and not through PCIe AER channel. These MSIX reported hardware errors are handled using common misc. interrupt handler. Hardware error related registers cannot be cleared in context to the interrupt received as they require *heavy* access to hardware using IMP(Integrated Mangement Processor) commands. Hence, we defer the clearing of such error events till later time. Since, we have defered exact identification of errors we will have to defer the level of receovery/reset which might be required. Hence, a new reset type UNKNOWN reset has been introduced which effectively defers the assertion of the reset till we get hold of kind of errors at later time. Signed-off-by: Salil Mehta Signed-off-by: Shiju Jose Signed-off-by: David S. Miller commit 8bb147927c7c6caf8a26d9f5022f5744b12ea55a Author: Shiju Jose Date: Fri Dec 7 21:08:05 2018 +0000 net: hns3: deleted logging 1 bit errors This patch deletes logging 1 bit errors for the following reasons. 1. AER does not notify 1 bit errors to the device drivers. However AER reports 1 bit errors to the userspace through the trace_aer_event for logging in the rasdaemon. 2. Firmware clears the status of 1 bit errors in the hw registers. Signed-off-by: Shiju Jose Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 332fbf576579a78a769209a9e588dae0c8fc0bdb Author: Shiju Jose Date: Fri Dec 7 21:08:04 2018 +0000 net: hns3: add handling of hw ras errors using new set of commands 1. This patch adds handling of hw ras errors using new set of common commands. 2. Updated the error message tables to match the register's name and error status returned by the commands. Signed-off-by: Shiju Jose Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 481a626a603d5e234618a19abbaa889405755f46 Author: Shiju Jose Date: Fri Dec 7 21:08:03 2018 +0000 net: hns3: add optimization in the hclge_hw_error_set_state 1. This patch adds minor loop optimization in the hclge_hw_error_set_state function. 2. Adds logging module's name if it fails to configure the error interrupts. Signed-off-by: Shiju Jose Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 381c356e956627d387b7f0944d7616175057504f Author: Shiju Jose Date: Fri Dec 7 21:08:02 2018 +0000 net: hns3: rename process_hw_error function This patch renames process_hw_error function to handle_hw_ras_error function to match the purpose of the function. This is because hw errors reported through ras and msix interrupts will be handled separately. Signed-off-by: Shiju Jose Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 166b04c3ee31994a133fc27393c99aee7e7164d7 Author: Shiju Jose Date: Fri Dec 7 21:08:01 2018 +0000 net: hns3: deletes unnecessary settings of the descriptor data This patch deletes unnecessary setting of the descriptor data to 0 for disabling error interrupts because it is already done by the hclge_cmd_setup_basic_desc function. Signed-off-by: Shiju Jose Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit f3fa4a94dbc2f2b6ee05295bc92457e545c95131 Author: Shiju Jose Date: Fri Dec 7 21:08:00 2018 +0000 net: hns3: re-enable error interrupts on hw reset This patch adds calling hclge_hw_error_set_state function to re-enable the error interrupts those will be disabled on the hw reset. Signed-off-by: Shiju Jose Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 98da4027afa626221466adf43e627e8668802884 Author: Shiju Jose Date: Fri Dec 7 21:07:59 2018 +0000 net: hns3: rename enable error interrupt functions This patch - renames the enable error interrupt functions. The reason is that these functions are used for both enable and disable error interrupts. - removes redundant logs from the enable error interrupt functions. Signed-off-by: Shiju Jose Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit fe0f7d698d5dce6195b034e1c5f4ea1633d42387 Author: Shiju Jose Date: Fri Dec 7 21:07:58 2018 +0000 net: hns3: remove existing process error functions and reorder hw_blk table 1.The command interface for queryng and clearing hw errors is changed, which requires the new process error functions to be added. This patch removes all the current process error functions and associated definitions. The new functions to handle ras errors would be added in this patch set. 2. Fixed order issue of the hw_blk table. Signed-off-by: Shiju Jose Signed-off-by: Salil Mehta Signed-off-by: David S. Miller commit 22666cc1481ae3814d9c7718418cc4a3aa7d90c3 Author: Christian König Date: Wed Sep 26 11:50:09 2018 +0200 drm/amdgpu: move IV prescreening into the GMC code The GMC/VM subsystem is causing the faults, so move the handling here as well. Signed-off-by: Christian König Reviewed-by: Felix Kuehling Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit a655dad4b2f94e0d880f2e4ea45251092d836f36 Author: Christian König Date: Wed Sep 26 11:15:36 2018 +0200 drm/amdgpu: remove VM fault_credit handling printk_ratelimit() is much better suited to limit the number of reported VM faults. Signed-off-by: Christian König Reviewed-by: Felix Kuehling Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 2026057736e9134c524ad85b526005944034e00f Author: Christian König Date: Wed Sep 26 11:08:32 2018 +0200 drm/amdgpu: send IVs to the KFD only after processing them v3 This allows us to filter out VM faults in the GMC code. v2: don't filter out all faults v3: fix copy&paste typo, send all IV to the KFD, don't change message level Signed-off-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit b408a548846f2343716351d55a6c9af9e73ec32c Author: Felix Kuehling Date: Tue Nov 20 21:44:27 2018 -0500 drm/amdkfd: Add support for doorbell BOs This allows user mode to map doorbell pages into GPUVM address space. That way GPUs can submit to user mode queues (self-dispatch). Acked-by: Alex Deucher Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit 1dde0ea95b782425b95455d487cb44991525a1d1 Author: Felix Kuehling Date: Tue Nov 20 21:00:29 2018 -0500 drm/amdkfd: Add DMABuf import functionality This is used for interoperability between ROCm compute and graphics APIs. It allows importing graphics driver BOs into the ROCm SVM address space for zero-copy GPU access. The API is split into two steps (query and import) to allow user mode to manage the virtual address space allocation for the imported buffer. Acked-by: Alex Deucher Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit 3704d56e1a64bb0e951815f91149ae7bb726aa76 Author: Felix Kuehling Date: Tue Nov 20 20:52:37 2018 -0500 drm/amdkfd: Add NULL-pointer check top_dev->gpu is NULL for CPUs. Avoid dereferencing it if NULL. Acked-by: Alex Deucher Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit 611736d8447c0c48a172db0b968dddae60696a72 Author: Felix Kuehling Date: Mon Nov 19 20:05:54 2018 -0500 drm/amdgpu: Add KFD VRAM limit checking We don't want KFD processes evicting each other over VRAM usage. Therefore prevent overcommitting VRAM among KFD applications with a per-GPU limit. Also leave enough room for page tables on top of the application memory usage. Acked-by: Alex Deucher Signed-off-by: Felix Kuehling Reviewed-by: Eric Huang Signed-off-by: Alex Deucher commit 5634e38cda7ba47f9e0f372cf1e1729a845d3348 Author: Kuehling, Felix Date: Fri Dec 7 22:07:20 2018 +0000 drm/amdgpu: Workaround build failure due to trace conflict Avoid including mmu_context.h in amdgpu_amdkfd.h since that may be included in other header files that define traces. This leads to conflicts due to traces defined in other headers included via mmu_context.h. Acked-by: Alex Deucher Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit 9ed9203c3ee7acd3f6e2acb3f1f691366847c8b5 Author: hersen wu Date: Wed Nov 28 16:55:47 2018 -0500 drm/amd/powerplay: rv dal-pplib interface refactor powerplay part [WHY] clarify dal input parameters to pplib interface, remove un-used parameters. dal knows exactly which parameters needed and their effects at pplib and smu sides. current dal sequence for dcn1_update_clock to pplib: 1.smu10_display_clock_voltage_request for dcefclk 2.smu10_display_clock_voltage_request for fclk 3.phm_store_dal_configuration_data { set_min_deep_sleep_dcfclk set_active_display_count store_cc6_data --- this data never be referenced new sequence will be: 1. set_display_count --- need add new pplib interface 2. set_min_deep_sleep_dcfclk -- new pplib interface 3. set_hard_min_dcfclk_by_freq 4. set_hard_min_fclk_by_freq after this code refactor, smu10_display_clock_voltage_request, phm_store_dal_configuration_data will not be needed for rv. [HOW] step 1: add new functions at pplib interface step 2: add new functions at amdgpu dm and dc Signed-off-by: hersen wu Reviewed-by: Rex Zhu Signed-off-by: Alex Deucher commit 49ebca798696a6a5da02a562cd1fd0e645264511 Author: wentalou Date: Thu Dec 6 10:29:52 2018 +0800 drm/amdgpu: Skip ring soft recovery when fence was NULL amdgpu_ring_soft_recovery would have Call-Trace, when s_fence->parent was NULL inside amdgpu_job_timedout. Check fence first, as drm_sched_hw_job_reset did. Signed-off-by: Wentao Lou Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 53450efd6eb9e3155e16c14ce2ece387fc2d65e7 Author: Xiangliang Yu Date: Wed Dec 5 14:36:33 2018 +0800 drm/amdgpu/psp: Destroy psp ring when doing gpu reset PSP ring need to be destroy before starting reinit for vf. This patche move it from hypervisor driver into guest. Signed-off-by: Xiangliang Yu Signed-off-by: Frank Min Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 5ec996dfb6a19f3ea6d7ab9e74e9f32954af8466 Author: Xiangliang Yu Date: Wed Dec 5 11:23:43 2018 +0800 drm/amdgpu/psp: Add support VMR ring for VF PSP only support VMR ring for SRIOV vf since v45 and all commands will be send to VMR ring for executing. VMR ring use C2PMSG 101 ~ 103 instead of C2PMSG 64 ~ 71. Signed-off-by: Xiangliang Yu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit d63cda5bfcd341b86c07beb5919107aae0d9ba99 Author: Xiangliang Yu Date: Tue Dec 4 15:13:28 2018 +0800 drm/amdgpu/psp: Get psp fw version through reading register If PSP FW is running already, driver will not load PSP FW again and skip it. So psp fw version is not correct if reading it from FW binary file, need to get right version from register. Signed-off-by: Xiangliang Yu Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 07daa8a0784e3085c4c8e282a83dd8c92bf59b53 Author: Christian König Date: Mon Sep 24 13:35:08 2018 +0200 drm/amdgpu: always reserve one more shared slot for pipelined BO moves This allows us to drop the extra reserve in TTM. Signed-off-by: Christian König Reviewed-by: Michel Dänzer Reviewed-by: Junwei Zhang Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 0aa7aa24cc11720a05b4492345f0adba8373c226 Author: Christian König Date: Fri Sep 21 18:09:59 2018 +0200 drm/amdgpu: always reserve two slots for the VM And drop the now superflous extra reservations. Signed-off-by: Christian König Reviewed-by: Michel Dänzer Reviewed-by: Junwei Zhang Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 049aca4363d8af87cab8d53de5401602db3b9999 Author: Christian König Date: Wed Sep 19 16:54:35 2018 +0200 drm/amdgpu: fix using shared fence for exported BOs v2 It is perfectly possible that the BO list is created before the BO is exported. While at it clean up setting shared to one instead of true. v2: add comment and simplify logic Signed-off-by: Christian König Reviewed-by: Michel Dänzer Reviewed-by: Huang Rui Acked-by: Junwei Zhang Signed-off-by: Alex Deucher commit a9f34c70fd168b164aadffd46bb757ded52e25b9 Author: Christian König Date: Wed Sep 19 16:25:08 2018 +0200 drm/ttm: allow reserving more than one shared slot v3 Let's support simultaneous submissions to multiple engines. v2: rename the field to num_shared and fix up all users v3: rebased Signed-off-by: Christian König Reviewed-by: Michel Dänzer Reviewed-by: Junwei Zhang Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit c50fe0c5b174153669fd437c1c5fde724b3bc7f4 Author: Aaron Liu Date: Wed Dec 5 11:07:55 2018 +0800 drm/amdgpu: both support PCO FP5/AM4 rlc fw For Picasso && AM4 SOCKET board, we use picasso_rlc_am4.bin For Picasso && FP5 SOCKET board, we use picasso_rlc.bin Judgment method: PCO AM4: revision >= 0xC8 && revision <= 0xCF or revision >= 0xD8 && revision <= 0xDF otherwise is PCO FP5 Signed-off-by: Aaron Liu Reviewed-by: Alex Deucher Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 34c08da2097abe99cdc4757194f10a0c51148ce3 Author: Alex Deucher Date: Thu Nov 29 19:35:14 2018 -0500 drm/amdgpu/powerplay: check MC firmware for FFC support Check if the MC firmware supports FFC and tell the SMC so mclk switching is handled properly. Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit c6296f5a658974169261ed8fe75887e7552174af Author: Alex Deucher Date: Thu Nov 29 19:34:27 2018 -0500 drm/amdgpu/powerplay: update smu7_ppsmc.h Add new messages for polaris. Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 8b3e6f8999f8d704fccce225b9455b3fa639d1c9 Author: Carlo Caione Date: Fri Dec 7 10:52:30 2018 +0000 arm64: dts: meson: Fix IRQ trigger type for macirq A long running stress test on a custom board shipping an AXG SoCs and a Realtek RTL8211F PHY revealed that after a few hours the connection speed would drop drastically, from ~1000Mbps to ~3Mbps. At the same time the 'macirq' (eth0) IRQ would stop being triggered at all and as consequence the GMAC IRQs never ACKed. After a painful investigation the problem seemed to be due to a wrong defined IRQ type for the GMAC IRQ that should be LEVEL_HIGH instead of EDGE_RISING. The change in the macirq IRQ type also solved another long standing issue affecting this SoC/PHY where EEE was causing the network connection to die after stressing it with iperf3 (even though much sooner). It's now possible to remove the 'eee-broken-1000t' quirk as well. Fixes: feb3cbea0946 ("ARM64: dts: meson-gxbb-odroidc2: fix GbE tx link breakage") Fixes: 6d28d577510f ("ARM64: dts: meson-axg: fix ethernet stability issue") Reviewed-by: Jerome Brunet Tested-by: Jerome Brunet Acked-by: Neil Armstrong Signed-off-by: Carlo Caione Signed-off-by: Kevin Hilman commit cbddb02e37b8bad058e1c552d4db87aa4d7c9582 Author: Carlo Caione Date: Sat Dec 1 16:43:01 2018 +0000 arm64: dts: meson-axg: Enable GPIO interrupt controller Enable the GPIO interrupt controller for the AXG SoCs. Signed-off-by: Carlo Caione Reviewed-by: Jerome Brunet Tested-by: Jerome Brunet Signed-off-by: Kevin Hilman commit de7c2fa5fc9f74a2777b3bc6397a227be755f203 Author: Carlo Caione Date: Wed Dec 5 15:52:07 2018 +0000 arm64: dts: meson-axg: s400: Enable PHY interrupt Now that the GPIO controller has been enabled also on AXG we can hook up the GPIO interrupt for the PHY. Tested-by: Jerome Brunet Signed-off-by: Carlo Caione Signed-off-by: Kevin Hilman commit 9af3f5cf9d64a056eca53bc643f6288ad28bbbb5 Author: Yuval Shaia Date: Thu Dec 6 14:48:18 2018 +0200 RDMA/core: Validate port number in query_pkey verb Before calling the driver's function let's make sure port is valid. Signed-off-by: Yuval Shaia Signed-off-by: Jason Gunthorpe commit 6baefa1aa46f0e90aefbd13b8c926e89068fabba Merge: 17f6c83fb5ebf c099f3f413f35 Author: Alexei Starovoitov Date: Fri Dec 7 13:30:49 2018 -0800 Merge branch 'support-alu32_arsh' Jiong Wang says: ==================== BPF_ALU | BPF_ARSH | BPF_* were rejected by commit: 7891a87efc71 ("bpf: arsh is not supported in 32 bit alu thus reject it"). As explained in the commit message, this is due to there is no complete support for them on interpreter and various JIT compilation back-ends. This patch set is a follow-up which completes the missing bits. This also pave the way for running bpf program compiled with ALU32 instruction enabled by specifing -mattr=+alu32 to LLVM for which case there is likely to have more BPF_ALU | BPF_ARSH insns that will trigger the rejection code. test_verifier.c is updated accordingly. I have tested this patch set on x86-64 and NFP, I need help of review and test on the arch changes (mips/ppc/s390). Note, there might be merge confict on mips change which is better to be applied on top of: commit: 20b880a05f06 ("mips: bpf: fix encoding bug for mm_srlv32_op"), which is on mips-fixes branch at the moment. Thanks. v1->v2: - Fix ppc implementation bug. Should zero high bits explicitly. ==================== Signed-off-by: Alexei Starovoitov commit c099f3f413f354ecdd518e4be6a232592e91d5b9 Author: Jiong Wang Date: Wed Dec 5 13:52:36 2018 -0500 selftests: bpf: update testcases for BPF_ALU | BPF_ARSH "arsh32 on imm" and "arsh32 on reg" now are accepted. Also added two new testcases to make sure arsh32 won't be treated as arsh64 during interpretation or JIT code-gen for which case the high bits will be moved into low halve that the testcases could catch them. Reviewed-by: Jakub Kicinski Signed-off-by: Jiong Wang Signed-off-by: Alexei Starovoitov commit c49f7dbd4f9c2c49df7fc0f5b50c1350ee7e01ee Author: Jiong Wang Date: Wed Dec 5 13:52:35 2018 -0500 bpf: verifier remove the rejection on BPF_ALU | BPF_ARSH This patch remove the rejection on BPF_ALU | BPF_ARSH as we have supported them on interpreter and all JIT back-ends Reviewed-by: Jakub Kicinski Signed-off-by: Jiong Wang Signed-off-by: Alexei Starovoitov commit 2dc6b100f928aac8d7532bf7112d3f8d3f952bad Author: Jiong Wang Date: Wed Dec 5 13:52:34 2018 -0500 bpf: interpreter support BPF_ALU | BPF_ARSH This patch implements interpreting BPF_ALU | BPF_ARSH. Do arithmetic right shift on low 32-bit sub-register, and zero the high 32 bits. Reviewed-by: Jakub Kicinski Signed-off-by: Jiong Wang Signed-off-by: Alexei Starovoitov commit 84708c1386770e957347d847522a4aac22ea04dc Author: Jiong Wang Date: Wed Dec 5 13:52:33 2018 -0500 nfp: bpf: implement jitting of BPF_ALU | BPF_ARSH | BPF_* BPF_X support needs indirect shift mode, please see code comments for details. Reviewed-by: Jakub Kicinski Signed-off-by: Jiong Wang Signed-off-by: Alexei Starovoitov commit f860203b010ab11995b3073a96cc0d04e520129e Author: Jiong Wang Date: Wed Dec 5 13:52:32 2018 -0500 s390: bpf: implement jitting of BPF_ALU | BPF_ARSH | BPF_* This patch implements code-gen for BPF_ALU | BPF_ARSH | BPF_*. Cc: Martin Schwidefsky Cc: Heiko Carstens Signed-off-by: Jiong Wang Signed-off-by: Alexei Starovoitov commit 44cf43c04bb5f7c688608ff4136b13f2a8a7a129 Author: Jiong Wang Date: Wed Dec 5 13:52:31 2018 -0500 ppc: bpf: implement jitting of BPF_ALU | BPF_ARSH | BPF_* This patch implements code-gen for BPF_ALU | BPF_ARSH | BPF_*. Cc: Naveen N. Rao Cc: Sandipan Das Signed-off-by: Jiong Wang Reviewed-by: Sandipan Das Signed-off-by: Alexei Starovoitov commit ee94b90c8acaa593b627f5f3fe93e076e7779f5c Author: Jiong Wang Date: Wed Dec 5 13:52:30 2018 -0500 mips: bpf: implement jitting of BPF_ALU | BPF_ARSH | BPF_X Jitting of BPF_K is supported already, but not BPF_X. This patch complete the support for the latter on both MIPS and microMIPS. Cc: Paul Burton Cc: linux-mips@vger.kernel.org Acked-by: Paul Burton Signed-off-by: Jiong Wang Signed-off-by: Alexei Starovoitov commit 17f6c83fb5ebf7db4fcc94a5be4c22d5a7bfe428 Author: Jiong Wang Date: Mon Dec 3 17:27:54 2018 -0500 mips: bpf: fix encoding bug for mm_srlv32_op For micro-mips, srlv inside POOL32A encoding space should use 0x50 sub-opcode, NOT 0x90. Some early version ISA doc describes the encoding as 0x90 for both srlv and srav, this looks to me was a typo. I checked Binutils libopcode implementation which is using 0x50 for srlv and 0x90 for srav. v1->v2: - Keep mm_srlv32_op sorted by value. Fixes: f31318fdf324 ("MIPS: uasm: Add srlv uasm instruction") Cc: Markos Chandras Cc: Paul Burton Cc: linux-mips@vger.kernel.org Acked-by: Jakub Kicinski Acked-by: Song Liu Signed-off-by: Jiong Wang Signed-off-by: Alexei Starovoitov commit bec2f7cbb73eadf5e1cc7d54ecb0980ede244257 Author: Arnd Bergmann Date: Tue Apr 17 17:23:35 2018 +0200 y2038: futex: Add support for __kernel_timespec This prepares sys_futex for y2038 safe calling: the native syscall is changed to receive a __kernel_timespec argument, which will be switched to 64-bit time_t in the future. All the internal time handling gets changed to timespec64, and the compat_sys_futex entry point is moved under the CONFIG_COMPAT_32BIT_TIME check to provide compatibility for existing 32-bit architectures. Signed-off-by: Arnd Bergmann commit 04e7712f4460585e5eed5b853fd8b82a9943958f Author: Arnd Bergmann Date: Tue Apr 17 16:31:07 2018 +0200 y2038: futex: Move compat implementation into futex.c We are going to share the compat_sys_futex() handler between 64-bit architectures and 32-bit architectures that need to deal with both 32-bit and 64-bit time_t, and this is easier if both entry points are in the same file. In fact, most other system call handlers do the same thing these days, so let's follow the trend here and merge all of futex_compat.c into futex.c. In the process, a few minor changes have to be done to make sure everything still makes sense: handle_futex_death() and futex_cmpxchg_enabled() become local symbol, and the compat version of the fetch_robust_entry() function gets renamed to compat_fetch_robust_entry() to avoid a symbol clash. This is intended as a purely cosmetic patch, no behavior should change. Signed-off-by: Arnd Bergmann commit 9f4c2cffd08c102107992cd01c12c4a53475baf6 Merge: 6b241e411607a 55939b262a61d Author: David S. Miller Date: Fri Dec 7 12:59:09 2018 -0800 Merge branch 'mlxsw-Un-offload-FDB-on-NVE-detach-attach' Ido Schimmel says: ==================== mlxsw: Un/offload FDB on NVE detach/attach Petr says: When a VXLAN device is attached to a bridge of a driver capable of offloading such, or upped, the FDB entries already present at the device need to be offloaded. Similarly when an offloaded VXLAN device ceases being interesting (it is downed, or detached, or a front-panel port netdevice is detached from the bridge that the VXLAN device is attached to), any offloaded FDB entries need to be unoffloaded and unmarked. This attach / detach processing is implemented in this patchset. In patch #1, a code pattern is extracted into a named function for easier reuse. In patch #2, vxlan_fdb_replay() is added to send SWITCHDEV_VXLAN_FDB_ADD_TO_DEVICE for each FDB entry with a given VNI. The intention is that the offloading driver will interpret these events like any other and thus offload the FDB entries that existed prior to VXLAN attach. In patches #3 and #4, the functions vxlan_fdb_clear_offload() resp. br_fdb_clear_offload() are added. These clear the offloaded flag at matching FDB entries. In patches #5-#9, we introduce FID-type-specific and NVE-type-specific ops necessary to properly abstract invocations of the replay/clear functions. Finally patch #10 implements the FDB management. In patch #11, the mlxsw-specific test case is extended to check that the management of offload marks under the newly-supported situations is correct. Patch #12, from Ido, exercises the new code paths in actual functional test. v2: - Patch #1: - Modify vxlan_fdb_switchdev_notifier_info() to initialize the structure through a passed-in pointer argument, instead of returning it as a value. - Patch #2: - Adapt to API change in vxlan_fdb_switchdev_notifier_info() ==================== Signed-off-by: David S. Miller commit 55939b262a61d35d3ccde8a388976b946d654dcf Author: Ido Schimmel Date: Fri Dec 7 19:55:20 2018 +0000 selftests: forwarding: Add PVID test case for VXLAN with VLAN-aware bridges When using VLAN-aware bridges with VXLAN, the VLAN that is mapped to the VNI of the VXLAN device is that which is configured as "pvid untagged" on the corresponding bridge port. When these flags are toggled or when the VLAN is deleted entirely, remote hosts should not be able to receive packets from the VTEP. Add a test case for above mentioned scenarios. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 0efe9ed98d15146becded107965b4e2f6b3aa805 Author: Petr Machata Date: Fri Dec 7 19:55:18 2018 +0000 selftests: mlxsw: vxlan: Test FDB un/marking on VXLAN join/leave When a VXLAN device is attached to an offloaded bridge, or when a front-panel port is attached to a bridge that already has a VXLAN device, mlxsw should offload the existing offloadable FDB entries. Similarly when VXLAN device is downed, the FDB entries are unoffloaded, and the marks thus need to be cleared. Similarly when a front-panel port device is attached to a bridge with a VXLAN device, or when VLAN flags are tweaked on a VXLAN port attached to a VLAN-aware bridge. Test that the replaying / clearing logic works by observing transitions in presence of offload marks under different scenarios. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 8a5969d8a83d86f3542355eedcad67d47feafdab Author: Petr Machata Date: Fri Dec 7 19:55:17 2018 +0000 mlxsw: spectrum_nve: Un/offload FDB on nve_fid_disable/enable Any existing NVE FDB entries need to be offloaded when NVE is enabled for a given FID. Recent patches have added fdb_replay op for this, so just invoke it from mlxsw_sp_nve_fid_enable(). When NVE is disabled on a FID, any existing FDB offloaded marks need to be cleared on NVE device as well as on its bridge master. An op to handle this, fdb_clear_offload, has been added to FID ops and NVE ops in previous patches. Add code to resolve the NVE device, NVE type, and dispatch to both fdb_clear_offload ops. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 83de78831b99582c0de13d7d2a5849b6bab962c8 Author: Petr Machata Date: Fri Dec 7 19:55:15 2018 +0000 mlxsw: spectrum: Add mlxsw_sp_fid_ops.fdb_clear_offload If there are any offloaded FDB entries at bridge master of an NVE device at the time that it's un-offloaded, their offloaded marks need to be cleared. How that is done depends on whether the bridge in question is vlan aware. Therefore add a per-FID-type operation. Implement the operation for the 802.1q and 802.1d bridges. Add and publish a function mlxsw_sp_fid_fdb_clear_offload() to dispatch to the new operation according to FID type. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit b73ef0e0ee30e14104f1eb19471df462ccaae4b3 Author: Petr Machata Date: Fri Dec 7 19:55:14 2018 +0000 mlxsw: spectrum_nve: Add mlxsw_sp_nve_ops.fdb_clear_offload If there are any offloaded FDB entries at an NVE device at the time that it's un-offloaded, their offloaded marks need to be cleared. How that is done depends on NVE device type, and therefore add a per-NVE-type operation. Implement the operation for the sole NVE device type currently supported by mlxsw, VXLAN. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit a6ef5a48a32fe87af947e22973a409870bc63d0d Author: Petr Machata Date: Fri Dec 7 19:55:12 2018 +0000 mlxsw: spectrum_nve: Add mlxsw_sp_nve_ops.fdb_replay A replay of FDB needs to be performed so that the FDB entries existing at the NVE device are offloaded. How the replay is done depends on NVE device type, and therefore add a per-NVE-type operation. Implement the operation for the sole NVE device type currently supported by mlxsw, VXLAN. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 34139ede051ea8a10643c615076cb9dadc2a0942 Author: Petr Machata Date: Fri Dec 7 19:55:11 2018 +0000 mlxsw: spectrum_switchdev: Publish mlxsw_sp_switchdev_notifier The notifier block will need to be passed to vxlan_fdb_replay() in a follow-up patch. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 2a36c12520683b17ce3fff674446313482e5ab5e Author: Petr Machata Date: Fri Dec 7 19:55:09 2018 +0000 mlxsw: spectrum: Track NVE type at FIDs A follow-up patch will add support for replay and for clearing of offload marks. These are NVE type-sensitive operations, and to be able to dispatch them properly, a FID needs to know what NVE type is attached to it. Therefore, track the NVE type at struct mlxsw_sp_fid. Extend mlxsw_sp_fid_vni_set() to take it as an argument, and add mlxsw_sp_fid_nve_type(). Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 43920edf3b24b0a3d136019c816e84ffcbef83ab Author: Petr Machata Date: Fri Dec 7 19:55:07 2018 +0000 bridge: Add br_fdb_clear_offload() When a driver unoffloads all FDB entries en bloc, it's inefficient to send the switchdev notification one by one. Add a helper that unsets the offload flag on FDB entries on a given bridge port and VLAN. Signed-off-by: Petr Machata Acked-by: Nikolay Aleksandrov Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit e5ff4b1952893fb75aa75067fce31c8567341ed7 Author: Petr Machata Date: Fri Dec 7 19:55:06 2018 +0000 vxlan: Add vxlan_fdb_clear_offload() When a driver unoffloads all FDB entries en bloc, it's inefficient to send the switchdev notification one by one. Add a helper that walks the FDB table, unsetting the offload flag on RDST with a given VNI. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 4f89f5b5353cae2e056713e823819f24cad92bc3 Author: Petr Machata Date: Fri Dec 7 19:55:04 2018 +0000 vxlan: Add vxlan_fdb_replay() When a VXLAN device becomes relevant to a driver (such as when it is attached to an offloaded bridge), the driver will generally need to walk the existing FDB entries and offload them. Add a function vxlan_fdb_replay() to call a given notifier block for each FDB entry with a given VNI. Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit ff23b91ce1ae686e436e9926de1fda3342ef26f8 Author: Petr Machata Date: Fri Dec 7 19:55:03 2018 +0000 vxlan: Add a function to init switchdev_notifier_vxlan_fdb_info There are currently two places that need to initialize the notifier info structure, and one more is coming next when vxlan_fdb_replay() is introduced. These three instances have / will have very similar code that is easy to abstract away into a named function. Add such function, vxlan_fdb_switchdev_notifier_info(), and call it from vxlan_fdb_switchdev_call_notifiers() and vxlan_fdb_find_uc(). Signed-off-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 6b241e411607a8f78bee74b96655e9d7835ea8ba Merge: ef2df7fc11f88 391637676fc9a Author: David S. Miller Date: Fri Dec 7 12:49:10 2018 -0800 Merge branch 'net-aquantia-add-RSS-configuration' Igor Russkikh says: ==================== net: aquantia: add RSS configuration In this patchset few bugs related to RSS are fixed and RSS table and hash key configuration is added. We also do increase max number of HW rings upto 8. v2: removed extra arg check ==================== Signed-off-by: David S. Miller commit 391637676fc9a2d545e51efbb11dd8dc3faf604f Author: Dmitry Bogdanov Date: Fri Dec 7 14:00:22 2018 +0000 net: aquantia: add support of RSS configuration Add support of configuration of RSS hash key and RSS indirection table. Signed-off-by: Dmitry Bogdanov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit a8c69ca79217c8f1d070e470066cc24d8f866d6e Author: Dmitry Bogdanov Date: Fri Dec 7 14:00:17 2018 +0000 net: aquantia: fix initialization of RSS table Now RSS indirection table is initialized before setting up the number of hw queues, consequently the table may be filled by non existing queues. This patch moves the initialization when the number of hw queues is known. Signed-off-by: Dmitry Bogdanov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 71a963cfc50b0309ca3192c7258569e0d5477ab0 Author: Dmitry Bogdanov Date: Fri Dec 7 14:00:15 2018 +0000 net: aquantia: increase max number of hw queues Increase the upper limit of the hw queues up to 8. This makes RSS better on multiheaded cpus. This is a maximum AQC hardware supports in one traffic class. The actual value is still limited by a number of available cpu cores. Signed-off-by: Dmitry Bogdanov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit 474fb1150d40780e71f0b569aeac4f375df3af3d Author: Dmitry Bogdanov Date: Fri Dec 7 14:00:11 2018 +0000 net: aquantia: fix RSS table and key sizes Set RSS indirection table and RSS hash key sizes to their real size. Signed-off-by: Dmitry Bogdanov Signed-off-by: Igor Russkikh Signed-off-by: David S. Miller commit a41f85b6017ee20952a60e4330bcae2527fe2c2a Merge: 651022382c7f8 6e6da2039c822 Author: Stephen Boyd Date: Fri Dec 7 12:38:48 2018 -0800 Merge tag 'sunxi-clk-for-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-allwinner Pull Allwinner clock changes from Maxime Ripard: - Sigma Delta modulation for the A33 audio clocks - Support for the F1c100s SoC - Rework of the oscillator tree - H6 display engine clocks * tag 'sunxi-clk-for-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi-ng: a33: Set CLK_SET_RATE_PARENT for all audio module clocks clk: sunxi-ng: a33: Use sigma-delta modulation for audio PLL clk: sunxi-ng: h3: Allow parent change for ve clock clk: sunxi-ng: add support for suniv F1C100s SoC dt-bindings: clock: Add Allwinner suniv F1C100s CCU clk: sunxi-ng: h3/h5: Fix CSI_MCLK parent clk: sunxi-ng: r40: Force LOSC parent to RTC LOSC output clk: sunxi-ng: sun50i: a64: Use sigma-delta modulation for audio PLL clk: sunxi-ng: a64: Fix gate bit of DSI DPHY clk: sunxi-ng: Enable DE2_CCU for SUN8I and SUN50I clk: sunxi-ng: Add support for H6 DE3 clocks dt-bindings: clock: sun8i-de2: Add H6 DE3 clock description clk: sunxi-ng: h6: Set video PLLs limits clk: sunxi-ng: Use u64 for calculation of NM rate clk: sunxi-ng: Adjust MP clock parent rate when allowed clk: sunxi-ng: sun50i: h6: Fix MMC clock mux width clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock commit 60baf75e3f5b76043c25328ac0c5320aaef5ea41 Merge: 1ef06003a50ca 36c4da4f552a1 Author: Stephen Boyd Date: Fri Dec 7 12:34:11 2018 -0800 Merge tag 'clk-renesas-for-v4.21-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: - Add support for CPEX (timer) clocks on various R-Car Gen3 and RZ/G2 SoCs - Add support for SDHI HS400 clocks on early revisions of R-Car H3 and M3-W - Miscellaneous fixes based on the Hardware Manual Errata * tag 'clk-renesas-for-v4.21-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: rcar-gen3: Add HS400 quirk for SD clock clk: renesas: rcar-gen3: Add documentation for SD clocks clk: renesas: rcar-gen3: Set state when registering SD clocks clk: renesas: r8a77995: Simplify PLL3 multiplier/divider clk: renesas: r8a77995: Add missing CPEX clock clk: renesas: r8a77995: Remove non-existent SSP clocks clk: renesas: r8a77995: Remove non-existent VIN5-7 module clocks clk: renesas: r8a77995: Correct parent clock of DU clk: renesas: r8a77990: Correct parent clock of DU clk: renesas: r8a77970: Add CPEX clock clk: renesas: r8a77965: Add CPEX clock clk: renesas: r8a7796: Add CPEX clock clk: renesas: r8a7795: Add CPEX clock clk: renesas: r8a774a1: Add CPEX clock dt-bindings: clock: r8a7796: Remove CSIREF clock dt-bindings: clock: r8a7795: Remove CSIREF clock commit fe15bcc6e23f4d5273dfbc056bae8710723f03d0 Merge: e7521d82b3359 7e11b911b520d Author: Jason Gunthorpe Date: Fri Dec 7 13:25:12 2018 -0700 Merge branch 'mlx5-packet-credit-fc' into rdma.git Danit Goldberg says: Packet based credit mode Packet based credit mode is an alternative end-to-end credit mode for QPs set during their creation. Credits are transported from the responder to the requester to optimize the use of its receive resources. In packet-based credit mode, credits are issued on a per packet basis. The advantage of this feature comes while sending large RDMA messages through switches that are short in memory. The first commit exposes QP creation flag and the HCA capability. The second commit adds support for a new DV QP creation flag. The last commit report packet based credit mode capability via the MLX5DV device capabilities. * branch 'mlx5-packet-credit-fc': IB/mlx5: Report packet based credit mode device capability IB/mlx5: Add packet based credit mode support net/mlx5: Expose packet based credit mode Signed-off-by: Jason Gunthorpe commit 7e11b911b520de6a3189fafa94740f5fde2a2c98 Author: Danit Goldberg Date: Fri Nov 30 13:22:06 2018 +0200 IB/mlx5: Report packet based credit mode device capability Report packet based credit mode capability via the mlx5 DV interface. Signed-off-by: Danit Goldberg Reviewed-by: Majd Dibbiny Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 569c665150156e44ecbd92af47a6d3fd4e2e4690 Author: Danit Goldberg Date: Fri Nov 30 13:22:05 2018 +0200 IB/mlx5: Add packet based credit mode support The device can support two credit modes, message based (default) and packet based. In order to enable packet based mode, the QP should be created with special flag that indicates this. This patch adds support for the new DV QP creation flag that can be used for RC QPs in order to change the credit mode. Signed-off-by: Danit Goldberg Reviewed-by: Majd Dibbiny Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 1504b91c819359b574b55c269c850352260b8d19 Author: Manu Gautam Date: Thu May 31 16:17:10 2018 +0530 arm64: dts: msm8996: Use dwc3-qcom glue driver for USB Move from dwc3-of-simple to dwc3-qcom glue driver to support peripheral mode which requires qscratch wrapper programming on VBUS event. Fixes: a4333c3a6ba9 ("usb: dwc3: Add Qualcomm DWC3 glue driver") Signed-off-by: Manu Gautam Tested-by: Vivek Gautam Signed-off-by: Andy Gross commit 818046ebe2a7b9d5517588e08df7eaeb858decb7 Author: Andy Gross Date: Fri Dec 7 12:27:48 2018 -0600 arm64: dts: qcom: msm8998: Fixup clock to use xo_board This patch sets the msm8998 xo clock name back to xo_board. Recent clock tree changes fixed the clock tree and the change to the xo name is causing issues where msm8998 boards do not boot properly. Let's change it back and leave the xo label on it. Fixes: 634da3307b08 (arm64: dts: qcom: msm8998: correct xo clock name) Signed-off-by: Andy Gross Reviewed-by: Bjorn Andersson Reviewed-by: Stephen Boyd Reviewed-by: Jeffrey Hugo commit 24c8e4b85399b00f4ae96e7957b0eeaa374e9380 Author: Marek Szyprowski Date: Fri Dec 7 11:09:52 2018 +0100 ARM: multi_v7_defconfig: Add TOSHIBA TC358764 bridge driver Add DRM bridge driver for TOSHIBA TC358764 chip used in LCD panel for Samsung Exynos5250-based Arndale board. Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit 47bf095d16df60eb3aad406607ccdbedac65a98c Author: Marek Szyprowski Date: Fri Dec 7 11:09:51 2018 +0100 ARM: multi_v7_defconfig: Add MAX8952 regulator driver Add regulator driver for MAX8952 PMIC chip used on Samsung UniversalC210 board. Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit e49698328732907b16c21f40ef26b3f9b7580c8f Author: Marek Szyprowski Date: Fri Dec 7 11:09:50 2018 +0100 ARM: exynos_defconfig: Add TOSHIBA TC358764 bridge driver Add DRM bridge driver for TOSHIBA TC358764 chip used in LCD panel for Samsung Exynos5250-based Arndale board. Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit 6e82e64b7c5717f8051905b81936772782a6362e Author: Marek Szyprowski Date: Fri Dec 7 11:09:49 2018 +0100 ARM: exynos_defconfig: Add MAX8952 regulator driver Add regulator driver for MAX8952 PMIC chip used on Samsung UniversalC210 board. Signed-off-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski commit e159b6074c82fe31b79aad672e02fa204dbbc6d8 Author: Helen Fornazier Date: Fri Dec 7 12:56:41 2018 -0500 media: vimc: fix start stream when link is disabled If link is disabled, media_entity_remote_pad returns NULL, causing a NULL pointer deference. Ignore links that are not enabled instead. Signed-off-by: Helen Koike Signed-off-by: Mauro Carvalho Chehab commit f25b6302b294c220d5be010342f6399d89dcabf3 Author: Hans de Goede Date: Tue Dec 4 10:20:04 2018 +0100 platform/x86: touchscreen_dmi: Add info for the Mediacom Flexbook Edge 11 Add a DMI match for the Mediacom Flexbook Edge 11, this is the same hw as the Trekstor Primebook C11, so we use the same settings. Reported-by: rmbg Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit 4230509978f2921182da4e9197964dccdbe463c3 Author: Will Deacon Date: Tue Sep 18 09:39:55 2018 +0100 arm64: cmpxchg: Use "K" instead of "L" for ll/sc immediate constraint The "L" AArch64 machine constraint, which we use for the "old" value in an LL/SC cmpxchg(), generates an immediate that is suitable for a 64-bit logical instruction. However, for cmpxchg() operations on types smaller than 64 bits, this constraint can result in an invalid instruction which is correctly rejected by GAS, such as EOR W1, W1, #0xffffffff. Whilst we could special-case the constraint based on the cmpxchg size, it's far easier to change the constraint to "K" and put up with using a register for large 64-bit immediates. For out-of-line LL/SC atomics, this is all moot anyway. Reported-by: Robin Murphy Signed-off-by: Will Deacon commit 959bf2fd03b59fc107584c21425f3dc73c49f762 Author: Will Deacon Date: Thu Sep 13 15:56:16 2018 +0100 arm64: percpu: Rewrite per-cpu ops to allow use of LSE atomics Our percpu code is a bit of an inconsistent mess: * It rolls its own xchg(), but reuses cmpxchg_local() * It uses various different flavours of preempt_{enable,disable}() * It returns values even for the non-returning RmW operations * It makes no use of LSE atomics outside of the cmpxchg() ops * There are individual macros for different sizes of access, but these are all funneled through a switch statement rather than dispatched directly to the relevant case This patch rewrites the per-cpu operations to address these shortcomings. Whilst the new code is a lot cleaner, the big advantage is that we can use the non-returning ST- atomic instructions when we have LSE. Signed-off-by: Will Deacon commit b4f9209bfcd5964551de434342818334ab9c8c7e Author: Will Deacon Date: Thu Sep 13 14:28:33 2018 +0100 arm64: Avoid masking "old" for LSE cmpxchg() implementation The CAS instructions implicitly access only the relevant bits of the "old" argument, so there is no need for explicit masking via type-casting as there is in the LL/SC implementation. Move the casting into the LL/SC code and remove it altogether for the LSE implementation. Signed-off-by: Will Deacon commit 5ef3fe4cecdf82fdd71ce78988403963d01444d4 Author: Will Deacon Date: Thu Sep 13 13:30:45 2018 +0100 arm64: Avoid redundant type conversions in xchg() and cmpxchg() Our atomic instructions (either LSE atomics of LDXR/STXR sequences) natively support byte, half-word, word and double-word memory accesses so there is no need to mask the data register prior to being stored. Signed-off-by: Will Deacon commit f2fb18c7cc697c3d313e4d86ceb7d5c81c1c388d Author: Tony Lindgren Date: Wed Dec 5 14:08:37 2018 -0800 ARM: dts: Add am335x mcasp with l3 data port ranges Earlier attempt to move am335x mcasp to probe with ti-sysc interconnect target module caused audio to stop working and and the dts changes were reverted by commit 5d2632a577ba ("ARM: dts: Revert am335x mcasp ti-sysc changes"). Turns out we were missing the l3 data port ranges for mcasp. This caused mcasp dma to attempt to use wrong port address. So let's try again essentially reverting the earlier revert and adding the missing l3 data port ranges. Tested-by: Peter Ujfalusi Signed-off-by: Tony Lindgren commit 84fb6c7feb1494ebb7d1ec8b95cfb7ada0264465 Author: Russell King - ARM Linux Date: Fri Dec 7 09:17:07 2018 -0800 ARM: dts: Fix OMAP4430 SDP Ethernet startup It was noticed that unbinding and rebinding the KSZ8851 ethernet resulted in the driver reporting "failed to read device ID" at probe. Probing the reset line with a 'scope while repeatedly attempting to bind the driver in a shell loop revealed that the KSZ8851 RSTN pin is constantly held at zero, meaning the device is held in reset, and does not respond on the SPI bus. Experimentation with the startup delay on the regulator set to 50ms shows that the reset is positively released after 20ms. Schematics for this board are not available, and the traces are buried in the inner layers of the board which makes tracing where the RSTN pin extremely difficult. We can only guess that the RSTN pin is wired to a reset generator chip driven off the ethernet supply, which fits the observed behaviour. Include this delay in the regulator startup delay - effectively treating the reset as a "supply stable" indicator. This can not be modelled as a delay in the KSZ8851 driver since the reset generation is board specific - if the RSTN pin had been wired to a GPIO, reset could be released earlier via the already provided support in the KSZ8851 driver. This also got confirmed by Peter Ujfalusi based on Blaze schematics that should be very close to SDP4430: TPS22902YFPR is used as the regulator switch (gpio48 controlled): Convert arm boot_lock to raw The VOUT is routed to TPS3808G01DBV. (SCH Note: Threshold set at 90%. Vsense: 0.405V). According to the TPS3808 data sheet the RESET delay time when Ct is open (this is the case in the schema): MIN/TYP/MAX: 12/20/28 ms. Signed-off-by: Russell King Reviewed-by: Peter Ujfalusi [tony@atomide.com: updated with notes from schematics from Peter] Signed-off-by: Tony Lindgren commit 5760367298a37c459ef0b1364463d70fd9a1f972 Author: Felix Brack Date: Fri Nov 30 15:54:46 2018 +0100 ARM: dts: am335x-pdu001: Fix polarity of card detection input When a micro SD card is inserted in the PDU001 card cage, the card detection switch is opened and the corresponding GPIO input is driven by a pull-up. Hence change the active level of the card detection input from low to high. Signed-off-by: Felix Brack Signed-off-by: Tony Lindgren commit 2531b3bea791640d8c724c7a31e591ffb8083132 Merge: a763ecc15d0e3 2afdb4c41d787 Author: Tony Lindgren Date: Fri Dec 7 08:27:06 2018 -0800 Merge branch 'audio-fix' into omap-for-v4.20/fixes commit 2afdb4c41d7876e430b9bc6e2d7e2fe28609fd6a Author: Janusz Krzysztofik Date: Fri Nov 23 12:19:45 2018 +0100 ARM: OMAP1: ams-delta: Fix audio permanently muted Since commit 1137ceee76ba ("ARM: OMAP1: ams-delta: Don't request unused GPIOs"), on-board audio has appeared muted. Believed to be unused GPIO pin "hookflash1", apparently set high regardless of the corresponding bit of "latch2" port attempted to be set low during .init_machine(), has been identified as the reason. According to Amstrad E3 wiki, the purpose of the pin hasn't been clearly identified. Original Amstrad software used to produce a high pulse on it when the phone was taken off hook or recall was pressed. With the current finding, we can assume the pin provides a kind of audio mute function. Proper resolution of the issue should be done in two steps: - resolution of an issue with the pin state not reflecting the value the corresponding bit of the port was attempted to be initialized with, - extension of on-board audio driver with a new control. For now, rename the pin to "audio_mute" to reflect its function and, as a quick fix, hogg it as output low so on-board audio can produce audible sound again. Fixes: 1137ceee76ba ("ARM: OMAP1: ams-delta: Don't request unused GPIOs") Signed-off-by: Janusz Krzysztofik Signed-off-by: Tony Lindgren commit a763ecc15d0e37c3a15ff6825183061209832685 Author: Roger Quadros Date: Wed Dec 5 19:27:44 2018 +0200 ARM: dts: omap5: Fix dual-role mode on Super-Speed port OMAP5's Super-Speed USB port has a software mailbox register that needs to be fed with VBUS and ID events from an external VBUS/ID comparator. Without this, Host role will not work correctly. Fixes: 656c1a65ab55 ("ARM: dts: omap5: enable OTG role for DWC3 controller") Reported-by: H. Nikolaus Schaller Signed-off-by: Roger Quadros Signed-off-by: Tony Lindgren commit 7146a4f02635fe1b0791ce818176b1cf6b3d8a85 Author: Gao Xiang Date: Sat Dec 8 00:19:18 2018 +0800 staging: erofs: simplify `z_erofs_vle_submit_all' Previously, there are too many hacked stuffs such as `__FSIO_1', `lstgrp_noio', `lstgrp_io' out there in `z_erofs_vle_submit_all'. Revisit the whole process by properly introducing jobqueue to represent each type of queued workgroups, furthermore hide all of crazyness behind independent separated functions. After this patch, 2 independent jobqueues exist if managed cache is enabled, or 1 jobqueue if disabled. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 6afd227ca179b33ca4437502ac8847df9c43aef9 Author: Gao Xiang Date: Sat Dec 8 00:19:17 2018 +0800 staging: erofs: redefine where `owned_workgrp_t' points By design, workgroups are queued in the form of linked lists. Previously, it points to the next `z_erofs_vle_workgroup', which isn't flexible enough to simplify `z_erofs_vle_submit_all'. Let's fix it by pointing to the next `owned_workgrp_t' and use container_of to get its coresponding `z_erofs_vle_workgroup'. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 92e6efd566c4a15de9b0ad3e7954448b1ad66f42 Author: Gao Xiang Date: Sat Dec 8 00:19:16 2018 +0800 staging: erofs: refine compressed pages preload flow Currently, there are two kinds of compressed pages in erofs: 1) file pages for the in-place decompression and 2) managed pages for cached decompression. Both are all stored in grp->compressed_pages[]. For managed pages, they could already exist or could be preloaded in this round, including the following cases in detail: 1) Already valid (loaded in some previous round); 2) PAGE_UNALLOCATED, should be allocated at the time of submission; 3) Just found in the managed cache, and with an extra page ref. Currently, 1) and 3) can be distinguishable by lock_page and checking its PG_private, which is guaranteed by the reclaim path, but it's better to do a double check by using an extra tag. This patch reworks the preload flow by introducing such the tag by using tagged pointer, too many #ifdefs are removed as well. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 9248fce714d5317650b316cf418ea396562e767e Author: Gao Xiang Date: Sat Dec 8 00:19:15 2018 +0800 staging: erofs: revisit the page submission flow Previously, the submission flow works with cached compressed pages reclaim path in a tricky way, and it could be buggy if the reclaim path changes later without such tricky restrictions. For example, currently one PagePrivate(page) is evaluated without taking page lock (it only follows a wait_for_page_locked which closes such race) and no handling solves the potential page truncation case. In addition, it's also full of #ifdefs in the function, which is hard to understand and maintain. this patch fixes them all. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 672e54761025997b088d3b8e6c3bb20a71fb32f6 Author: Gao Xiang Date: Sat Dec 8 00:19:14 2018 +0800 staging: erofs: localize UNALLOCATED_CACHED_PAGE placeholder In practice, in order to do cached decompression rather than reuse them for in-place decompression and make full use of pages in page_pool instead of allocating as much as possible, an unallocated placeholder was introduce to mark all in compressed_pages[] and they will be replaced at the time of submission. Previously EROFS_UNALLOCATED_CACHED_PAGE was included in internal.h, which is unnecessary since it's only internally used in decompression subsystem, move it to unzip_vle.c and rename it to PAGE_UNALLOCATED. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit c1448fa88025872502c3f7bf2cf7365deb25bb1b Author: Gao Xiang Date: Sat Dec 8 00:19:13 2018 +0800 staging: erofs: introduce MNGD_MAPPING helper This patch introduces MNGD_MAPPING to wrap up sbi->managed_cache->i_mapping, which will be used to solve too many #ifdefs in a single function. No logic changes. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit 848bd9acdcd00c164b42b14aacec242949ecd471 Author: Gao Xiang Date: Sat Dec 8 00:19:12 2018 +0800 staging: erofs: fix use-after-free of on-stack `z_erofs_vle_unzip_io' The root cause is the race as follows: Thread #0 Thread #1 z_erofs_vle_unzip_kickoff z_erofs_submit_and_unzip struct z_erofs_vle_unzip_io io[] atomic_add_return() wait_event() [end of function] wake_up() Fix it by taking the waitqueue lock between atomic_add_return and wake_up to close such the race. kernel message: Unable to handle kernel paging request at virtual address 97f7052caa1303dc ... Workqueue: kverityd verity_work task: ffffffe32bcb8000 task.stack: ffffffe3298a0000 PC is at __wake_up_common+0x48/0xa8 LR is at __wake_up+0x3c/0x58 ... Call trace: ... [] __wake_up_common+0x48/0xa8 [] __wake_up+0x3c/0x58 [] z_erofs_vle_unzip_kickoff+0x40/0x64 [] z_erofs_vle_read_endio+0x94/0x134 [] bio_endio+0xe4/0xf8 [] dec_pending+0x134/0x32c [] clone_endio+0x90/0xf4 [] bio_endio+0xe4/0xf8 [] verity_work+0x210/0x368 [] process_one_work+0x188/0x4b4 [] worker_thread+0x140/0x458 [] kthread+0xec/0x108 [] ret_from_fork+0x10/0x1c Code: d1006273 54000260 f9400804 b9400019 (b85fc081) ---[ end trace be9dde154f677cd1 ]--- Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Signed-off-by: Greg Kroah-Hartman commit aaa21231698c0d326922a325647adf38e4f21db0 Author: Andy Shevchenko Date: Tue Nov 6 14:11:42 2018 +0200 gpio: sodaville: Convert to use SPDX identifier Reduce size of duplicated comments by switching to use SPDX identifier. No functional change. Signed-off-by: Andy Shevchenko commit cb0e9a7bda9b3989c2be0d37eb2053690a58c0a3 Author: Andy Shevchenko Date: Tue Nov 6 14:11:42 2018 +0200 gpio: sch: Convert to use SPDX identifier Reduce size of duplicated comments by switching to use SPDX identifier. No functional change. Signed-off-by: Andy Shevchenko commit 9b8bf5bfb6cebc46761fdc213928432d50061546 Author: Andy Shevchenko Date: Tue Nov 6 14:11:42 2018 +0200 gpio: pch: Convert to use SPDX identifier Reduce size of duplicated comments by switching to use SPDX identifier. No functional change. Signed-off-by: Andy Shevchenko commit 93374b76a92c1e88f3251d38a6ea36e07a2cdf86 Author: Andy Shevchenko Date: Tue Nov 6 14:11:42 2018 +0200 gpio: merrifield: Convert to use SPDX identifier Reduce size of duplicated comments by switching to use SPDX identifier. No functional change. Signed-off-by: Andy Shevchenko commit 7fa07b6f4e13bec94370efde258cfc0d892d0c58 Author: Andy Shevchenko Date: Tue Nov 6 14:11:42 2018 +0200 gpio: lynxpoint: Convert to use SPDX identifier Reduce size of duplicated comments by switching to use SPDX identifier. No functional change. Signed-off-by: Andy Shevchenko commit 917842f676961d72922332489deee8373284e624 Author: Andy Shevchenko Date: Tue Nov 6 14:11:42 2018 +0200 gpio: intel-mid: Convert to use SPDX identifier Reduce size of duplicated comments by switching to use SPDX identifier. No functional change. Signed-off-by: Andy Shevchenko commit 7ed0cf0afd603f565bb04538b21103b3dadd514c Author: Andy Shevchenko Date: Tue Nov 6 14:11:42 2018 +0200 gpio: ich: Convert to use SPDX identifier Reduce size of duplicated comments by switching to use SPDX identifier. No functional change. Signed-off-by: Andy Shevchenko commit 8700998ff6b3ae23f9421eb936d7260a17a38f5d Author: Andy Shevchenko Date: Tue Sep 4 14:26:25 2018 +0300 gpio: sodaville: Sort headers alphabetically Sort header block alphabetically for easy maintenance. Signed-off-by: Andy Shevchenko commit 3e1884f8c32f845bd74fcfa347fe8936999f471d Author: Andy Shevchenko Date: Tue Sep 4 14:26:25 2018 +0300 gpio: pch: Sort headers alphabetically Sort header block alphabetically for easy maintenance. Signed-off-by: Andy Shevchenko commit 488f270cad27fdb87b00ee22b2c4d0616d8bb135 Author: Andy Shevchenko Date: Tue Sep 4 14:26:25 2018 +0300 gpio: ich: Sort headers alphabetically Sort header block alphabetically for easy maintenance. Signed-off-by: Andy Shevchenko commit 47091b0594d95359cac907c67051c97975b6f6c9 Author: Andy Shevchenko Date: Tue Sep 4 14:26:25 2018 +0300 gpio: sch: Remove linux/init.h and sort headers There is no need to include linux/init.h when at the same time we include linux/module.h. Remove redundant inclusion. While here, sort header block alphabetically for easy maintenance. Signed-off-by: Andy Shevchenko commit 7629771f5eb8d24edeb28fda09a637d7b6fb8f03 Author: Andy Shevchenko Date: Tue Sep 4 14:26:25 2018 +0300 gpio: merrifield: Remove linux/init.h There is no need to include linux/init.h when at the same time we include linux/module.h. Remove redundant inclusion. Signed-off-by: Andy Shevchenko commit 92c286267d62c40a7bab85f303d467085954ee3b Author: Andy Shevchenko Date: Tue Sep 4 14:26:25 2018 +0300 gpio: lynxpoint: Remove linux/init.h and sort headers There is no need to include linux/init.h when at the same time we include linux/module.h. Remove redundant inclusion. While here, sort header block alphabetically for easy maintenance. Signed-off-by: Andy Shevchenko commit ddc53c40cbe7b13d1086cf3b5fdc5c074a289d18 Author: Andy Shevchenko Date: Tue Sep 4 14:26:25 2018 +0300 gpio: intel-mid: Remove linux/module.h and sort headers There is no need to include linux/module.h when at the same time we include linux/init.h. Remove redundant inclusion. While here, remove no-op macro and sort header block alphabetically for easy maintenance. Signed-off-by: Andy Shevchenko commit a3bb44bcb3a06b43940576f9749020a42d31a9c0 Author: Andy Shevchenko Date: Wed Nov 7 21:29:53 2018 +0200 gpio: pch: Remove duplicate assignments There is no need to assign the same values which core does for us anyway. Signed-off-by: Andy Shevchenko commit 0511e116b8327aa7bf621d9cee35b93ffa69c85a Author: Andy Shevchenko Date: Fri Dec 7 17:33:07 2018 +0200 gpio: pch: Remove redundant __func__ from debug print dev_dbg includes the function name & line number by default when dynamic debugging is enabled. Hence __func__ is redundant here and removed. Do the same for any messages in ->probe() since it doesn't make sense. Signed-off-by: Andy Shevchenko commit ee494cf377e142f65f202fadf0d859f8e12119fb Author: Tomasz Figa Date: Thu Dec 14 23:32:21 2017 -0500 media: v4l2-device: Link subdevices to their parent devices if available Currently v4l2_device_register_subdev_nodes() does not initialize the dev_parent field of the video_device structs it creates for subdevices being registered. This leads to __video_register_device() falling back to the parent device of associated v4l2_device struct, which often does not match the physical device the subdevice is registered for. Due to the problem above, the links between real devices and v4l-subdev nodes cannot be obtained from sysfs, which might be confusing for the userspace trying to identify the hardware. Fix this by initializing the dev_parent field of the video_device struct with the value of dev field of the v4l2_subdev struct. In case of subdevices without a parent struct device, the field will be NULL and the old behavior will be preserved by the semantics of __video_register_device(). Signed-off-by: Tomasz Figa Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 394135c1ff13ec9b5a38a36bbdb5811f2f595e94 Author: James Morse Date: Fri Dec 7 10:14:39 2018 +0000 arm64: kexec_file: forbid kdump via kexec_file_load() Now that kexec_walk_memblock() can do the crash-kernel placement itself architectures that don't support kdump via kexe_file_load() need to explicitly forbid it. We don't support this on arm64 until the kernel can add the elfcorehdr and usable-memory-range fields to the DT. Without these the crash-kernel overwrites the previous kernel's memory during startup. Add a check to refuse crash image loading. Reviewed-by: Bhupesh Sharma Signed-off-by: James Morse Signed-off-by: Will Deacon commit 16767229940fb18086430907d3cd46245c7398ac Author: Harry Cutts Date: Wed Dec 5 10:42:28 2018 +1000 HID: logitech: Use LDJ_DEVICE macro for existing Logitech mice Signed-off-by: Harry Cutts Reviewed-by: Benjamin Tissoires Signed-off-by: Peter Hutterer Verified-by: Harry Cutts Signed-off-by: Benjamin Tissoires commit 4435ff2f09a2fc43d1201d732e6e606b4d4b1ad5 Author: Harry Cutts Date: Wed Dec 5 10:42:27 2018 +1000 HID: logitech: Enable high-resolution scrolling on Logitech mice There are three features used by various Logitech mice for high-resolution scrolling: the scrolling acceleration bit in HID++ 1.0, and the x2120 and x2121 features in HID++ 2.0 and above. This patch supports all three, and uses the multiplier reported by the mouse for the HID++ 2.0+ features. The full list of product IDs of mice which support high-resolution scrolling was provided by Logitech, but the patch was tested using the following mice (using the Unifying receiver): * HID++ 1.0: Anywhere MX, Performance MX * x2120: M560 * x2121: MX Anywhere 2, MX Master 2S This patch is a combinations of the now-reverted commits 1ff2e1a44e0, d56ca9855bf9, 5fe2ccbef9d, 044ee89028 together with some extra bits for the directional and timeout-based reset. The previous patch series was in hid-input, it appears this remainder handling is logitech-specific and was moved to hid-logitech-hidpp.c and renamed accordingly. Signed-off-by: Harry Cutts Signed-off-by: Peter Hutterer Verified-by: Harry Cutts Signed-off-by: Benjamin Tissoires commit 95c3d00282ce6a4911e3050a3b48a194ba16e9e5 Author: Harry Cutts Date: Wed Dec 5 10:42:26 2018 +1000 HID: logitech: Add function to enable HID++ 1.0 "scrolling acceleration" "Scrolling acceleration" is a bit of a misnomer: it doesn't deal with acceleration at all. However, that's the name used in Logitech's spec, so I used it here. Signed-off-by: Harry Cutts Reviewed-by: Benjamin Tissoires Signed-off-by: Peter Hutterer Verified-by: Harry Cutts Signed-off-by: Benjamin Tissoires commit fef33601a321d8b7edfdd4c318b9c6c7aec6ef06 Author: Peter Hutterer Date: Wed Dec 5 10:42:25 2018 +1000 HID: logitech-hidpp: fix typo, hiddpp to hidpp Signed-off-by: Peter Hutterer Verified-by: Harry Cutts Signed-off-by: Benjamin Tissoires commit 2dc702c991e3774af9d7ce410eef410ca9e2357e Author: Peter Hutterer Date: Wed Dec 5 10:42:24 2018 +1000 HID: input: use the Resolution Multiplier for high-resolution scrolling Windows uses a magic number of 120 for a wheel click. High-resolution scroll wheels are supposed to use a fraction of 120 to signal smaller scroll steps. This is implemented by the Resolution Multiplier in the device itself. If the multiplier is present in the report descriptor, set it to the logical max and then use the resolution multiplier to calculate the high-resolution events. This is the recommendation by Microsoft, see http://msdn.microsoft.com/en-us/windows/hardware/gg487477.aspx Note that all mice encountered so far have a logical min/max of 0/1, so it's a binary "yes or no" to high-res scrolling anyway. To make userspace simpler, always enable the REL_WHEEL_HI_RES bit. Where the device doesn't support high-resolution scrolling, the value for the high-res data will simply be a multiple of 120 every time. For userspace, if REL_WHEEL_HI_RES is available that is the one to be used. Potential side-effect: a device with a Resolution Multiplier applying to other Input items will have those items set to the logical max as well. This cannot easily be worked around but it is doubtful such devices exist. Signed-off-by: Peter Hutterer Verified-by: Harry Cutts Signed-off-by: Benjamin Tissoires commit 5a4abb36f312cf83206b1b7d1308ba47cba0b3cc Author: Peter Hutterer Date: Wed Dec 5 10:42:23 2018 +1000 HID: core: process the Resolution Multiplier The Resolution Multiplier is a feature report that modifies the value of Usages within the same Logical Collection. If the multiplier is set to anything but 1, the hardware reports (value * multiplier) for the same amount of physical movement, i.e. the value we receive in the kernel is pre-multiplied. The hardware may either send a single (value * multiplier), or by sending multiplier as many reports with the same value, or a combination of these two options. For example, when the Microsoft Sculpt Ergonomic mouse Resolution Multiplier is set to 12, the Wheel sends out 12 for every detent but AC Pan sends out a value of 3 at 4 times the frequency. The effective multiplier is based on the physical min/max of the multiplier field, a logical min/max of [0,1] with a physical min/max of [1,8] means the multiplier is either 1 or 8. The Resolution Multiplier was introduced for high-resolution scrolling in Windows Vista and is commonly used on Microsoft mice. The recommendation for the Resolution Multiplier is to default to 1 for backwards compatibility. This patch adds an arbitrary upper limit at 255. The only known use case for the Resolution Multiplier is for scroll wheels where the multiplier has to be a fraction of 120 to work with Windows. Signed-off-by: Peter Hutterer Verified-by: Harry Cutts Signed-off-by: Benjamin Tissoires commit c53431eb696f3c64c12c00afb81048af54b61532 Author: Peter Hutterer Date: Wed Dec 5 10:42:22 2018 +1000 HID: core: store the collections as a basic tree For each collection parsed, store a pointer to the parent collection (if any). This makes it a lot easier to look up which collection(s) any given item is part of Signed-off-by: Peter Hutterer Verified-by: Harry Cutts Signed-off-by: Benjamin Tissoires commit 52ea899637c746984d657b508da6e3f2686adfca Author: Peter Hutterer Date: Wed Dec 5 10:42:21 2018 +1000 Input: add `REL_WHEEL_HI_RES` and `REL_HWHEEL_HI_RES` This event code represents scroll reports from high-resolution wheels and is modelled after the approach Windows uses. The value 120 is one detent (wheel click) of movement. Mice with higher-resolution scrolling can send fractions of 120 which must be accumulated in userspace. Userspace can either wait for a full 120 to accumulate or scroll by fractions of one logical scroll movement as the events come in. 120 was picked as magic number because it has a high number of integer fractions that can be used by high-resolution wheels. For more information see https://docs.microsoft.com/en-us/previous-versions/windows/hardware/design/dn613912(v=vs.85) These new axes obsolete REL_WHEEL and REL_HWHEEL. The legacy axes are emulated by the kernel but the most accurate (and most granular) data is available through the new axes. Signed-off-by: Peter Hutterer Acked-by: Dmitry Torokhov Verified-by: Harry Cutts Signed-off-by: Benjamin Tissoires commit 5f6f2b9f6dbf7afb5ce4e2faaf25006e7d9d8880 Author: Andy Shevchenko Date: Tue Jul 3 03:39:03 2018 +0300 gpio: ich: Join string literals back For easy grepping on debug purposes join string literals back in the messages. While here, fix spelling typo. Signed-off-by: Andy Shevchenko commit c086bea543023329f3676492749f64914d0cf69f Author: Andy Shevchenko Date: Thu Nov 8 17:48:14 2018 +0200 gpio: ich: Convert pr_ to dev_ Instead of customized pr_ format use unified dev_ output. Signed-off-by: Andy Shevchenko commit ff4709b44cc0755ce7af4c7b3a18580f388b3bff Author: Andy Shevchenko Date: Thu Nov 8 17:37:07 2018 +0200 gpio: ich: Switch to use struct device instead of platform_device There is no need to have a pointer to struct platform_device. Instead, switch to use struct device one. Signed-off-by: Andy Shevchenko commit c5aaa316819428560dafe4429bff97459fe61fd3 Author: Andy Shevchenko Date: Wed Nov 7 23:29:41 2018 +0200 gpio: ich: Simplify error handling in ichx_write_bit() Simplify error handling in ichx_write_bit() and propagate its error code to the caller. Signed-off-by: Andy Shevchenko commit f3af44f052272b815a2803b8205acfce393ee352 Author: Andy Shevchenko Date: Tue Nov 6 14:38:55 2018 +0200 gpio: sodaville: Use for_each_set_bit() in IRQ handler This simplifies and standardizes the AB IRQ handler by using the for_each_set_bit() library function. Signed-off-by: Andy Shevchenko commit 0f4bb10857e22a657e6c8cca5d1d54b641e94628 Author: Wen Yang Date: Thu Dec 6 07:29:10 2018 -0500 media: siano: Use kmemdup instead of duplicating its function kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. This issue was detected with the help of coccinelle. Signed-off-by: Wen Yang CC: Tomoki Sekiyama CC: linux-kernel@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab commit e67ebf1b3815b2d1fc505dba182761c0be6c179d Author: Mathias Nyman Date: Fri Dec 7 16:19:36 2018 +0200 xhci: move usb2 get port status link resume handling to its own function Refactoring, no functional changes. But worth mentioning that checking for port link resume state is now behind a additional port power check. This is fine as ports can't be in resume state if port power bit is not set. xhci spec section 4.19.1.1.6 figure 34 shows that port power bit must be set for all 'Enable' substates, including U0,U1,U2,U3 (suspended), Resume, and RExit states. Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman commit a231ec41e6f6433daf4c693f169f6c5cfda8cb9d Author: Mathias Nyman Date: Fri Dec 7 16:19:35 2018 +0200 xhci: refactor U0 link state handling in get_port_status Move U0 link state handing to USB3 and USB2 specific functions Note that bus_state->resuming_ports: bus_state->resume_done[]: are only used for USB2, and don't need to cleared for USB3 ports No functional changes Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman commit 3c2ddb449a91df849b65be7509a575930c7eb5eb Author: Mathias Nyman Date: Fri Dec 7 16:19:34 2018 +0200 xhci: cleanup code that sets portstatus and portchange bits Group the code where the wPortstatus and wPortChange bits are set into one place. No functional changes Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman commit 70e9b53dfedced674d054166aae6e0366489eb86 Author: Mathias Nyman Date: Fri Dec 7 16:19:33 2018 +0200 xhci: move usb2 speficic bits to own function in get_port_status call Mostly refactoring, with the exception that USB_PORT_STAT_L1 link state is reported if xhci port link is in U2 AND port is powered. Previously we did not check if the port was powered, but according to xhci spec 4.19.1.1.6 All the 'Enabled' states, including USB_PORT_STAT_L1 (U2), U1, U0 and U3 must have Port power bit set. Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman commit 5f78a54f8d31e86aedd50f5b4d148dfeabafe88a Author: Mathias Nyman Date: Fri Dec 7 16:19:32 2018 +0200 xhci: move usb3 speficic bits to own function in get_port_status call refactoring, no functional changes Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman commit 1c2d81cc287c59161b19c5810f0091fe33448e07 Author: Mathias Nyman Date: Fri Dec 7 16:19:31 2018 +0200 xhci: remove unused hcd_index() Now that each root hub has their own bus_state strucure the hcd_undex() used to get the correct bus_state strucure is no longer needed. No functional changes Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman commit f6187f424c10210e8e9917d4b7035ddc935010f6 Author: Mathias Nyman Date: Fri Dec 7 16:19:30 2018 +0200 xhci: move bus_state structure under the xhci_hub structure. Move the bus_state structure under struct usb_hub. We need a bus_state strucure for each roothub to keep track of suspend related info for each port. Instead of keeping an array of two bus_state structures right under struct xhci, it makes more sense move them to the xhci_hub structure. No functional changes. Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman commit f1fd62a6b6c62e10ceb97432e9616b575538b699 Author: Zeng Tao Date: Fri Dec 7 16:19:29 2018 +0200 xhci: remove the unused sw_lpm_support It is introduced for the pre-0.96 xHC controllers, and the driver only support HW LPM for 1.0 and later controllers.It's not actually used now and is thought not to be used in the future any more, so just remove it. Signed-off-by: Zeng Tao Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman commit 9be93e1ab73f34953971cb1b92e79826aa274055 Author: Andy Shevchenko Date: Tue Nov 6 14:38:55 2018 +0200 gpio: pch: Use for_each_set_bit() in IRQ handler This simplifies and standardizes the AB IRQ handler by using the for_each_set_bit() library function. Signed-off-by: Andy Shevchenko commit 5719ac19fc32d892434939c1756c2f9a8322e6ef Author: Rob Herring Date: Thu Dec 6 13:11:42 2018 -0600 ARM: dts: sunxi: Fix PMU compatible strings "arm,cortex-a15-pmu" is not a valid fallback compatible string for an Cortex-A7 PMU, so drop it. Cc: Maxime Ripard Cc: Chen-Yu Tsai Signed-off-by: Rob Herring Acked-by: Will Deacon Signed-off-by: Maxime Ripard commit 00c30f42c7595fa0e8c6b71c5ed60c4b54895708 Author: Mauro Carvalho Chehab Date: Wed Dec 5 19:01:09 2018 -0500 media: rockchip vpu: remove some unused vars As complained by gcc: drivers/staging/media/rockchip/vpu/rk3288_vpu_hw_jpeg_enc.c: In function 'rk3288_vpu_jpeg_enc_set_qtable': drivers/staging/media/rockchip/vpu/rk3288_vpu_hw_jpeg_enc.c:70:10: warning: variable 'chroma_qtable_p' set but not used [-Wunused-but-set-variable] __be32 *chroma_qtable_p; ^~~~~~~~~~~~~~~ drivers/staging/media/rockchip/vpu/rk3288_vpu_hw_jpeg_enc.c:69:10: warning: variable 'luma_qtable_p' set but not used [-Wunused-but-set-variable] __be32 *luma_qtable_p; ^~~~~~~~~~~~~ drivers/staging/media/rockchip/vpu/rk3399_vpu_hw_jpeg_enc.c: In function 'rk3399_vpu_jpeg_enc_set_qtable': drivers/staging/media/rockchip/vpu/rk3399_vpu_hw_jpeg_enc.c:101:10: warning: variable 'chroma_qtable_p' set but not used [-Wunused-but-set-variable] __be32 *chroma_qtable_p; ^~~~~~~~~~~~~~~ drivers/staging/media/rockchip/vpu/rk3399_vpu_hw_jpeg_enc.c:100:10: warning: variable 'luma_qtable_p' set but not used [-Wunused-but-set-variable] __be32 *luma_qtable_p; ^~~~~~~~~~~~~ drivers/staging/media/rockchip/vpu/rockchip_vpu_enc.c: In function 'rockchip_vpu_queue_setup': drivers/staging/media/rockchip/vpu/rockchip_vpu_enc.c:522:33: warning: variable 'vpu_fmt' set but not used [-Wunused-but-set-variable] const struct rockchip_vpu_fmt *vpu_fmt; ^~~~~~~ drivers/staging/media/rockchip/vpu/rockchip_vpu_enc.c: In function 'rockchip_vpu_buf_prepare': drivers/staging/media/rockchip/vpu/rockchip_vpu_enc.c:560:33: warning: variable 'vpu_fmt' set but not used [-Wunused-but-set-variable] const struct rockchip_vpu_fmt *vpu_fmt; ^~~~~~~ Signed-off-by: Mauro Carvalho Chehab Acked-by: Ezequiel Garcia Signed-off-by: Mauro Carvalho Chehab commit e4d7b113fdccde1acf8638c5879f2a450d492303 Author: Mauro Carvalho Chehab Date: Fri Dec 7 08:03:16 2018 -0500 media: cedrus: don't initialize pointers with zero A common mistake is to assume that initializing a var with: struct foo f = { 0 }; Would initialize a zeroed struct. Actually, what this does is to initialize the first element of the struct to zero. According to C99 Standard 6.7.8.21: "If there are fewer initializers in a brace-enclosed list than there are elements or members of an aggregate, or fewer characters in a string literal used to initialize an array of known size than there are elements in the array, the remainder of the aggregate shall be initialized implicitly the same as objects that have static storage duration." So, in practice, it could zero the entire struct, but, if the first element is not an integer, it will produce warnings: drivers/staging/media/sunxi/cedrus/cedrus.c:drivers/staging/media/sunxi/cedrus/cedrus.c:78:49: warning: Using plain integer as NULL pointer drivers/staging/media/sunxi/cedrus/cedrus_dec.c:drivers/staging/media/sunxi/cedrus/cedrus_dec.c:29:35: warning: Using plain integer as NULL pointer As the right initialization would be, instead: struct foo f = { NULL }; Another way to initialize it with gcc is to use: struct foo f = {}; That seems to be a gcc extension, but clang also does the right thing, and that's a clean way for doing it. Anyway, I decided to check upstream what's the most commonly pattern. The "= {}" pattern has about 2000 entries: $ git grep -E "=\s*\{\s*\}"|wc -l 1951 The standard-C compliant pattern has about 2500 entries: $ git grep -E "=\s*\{\s*NULL\s*\}"|wc -l 137 $ git grep -E "=\s*\{\s*0\s*\}"|wc -l 2323 Meaning that developers have split options on that. So, let's opt to the simpler form. Signed-off-by: Mauro Carvalho Chehab Acked-by: Paul Kocialkowski Signed-off-by: Mauro Carvalho Chehab commit 9ed5d5fb8b432badc967decf97e4294cbb216eef Author: Mauro Carvalho Chehab Date: Fri Dec 7 06:13:48 2018 -0500 media: cetrus: return an error if alloc fails As warned by smatch: drivers/staging/media/sunxi/cedrus/cedrus.c: drivers/staging/media/sunxi/cedrus/cedrus.c:93 cedrus_init_ctrls() error: potential null dereference 'ctx->ctrls'. (kzalloc returns null) While here, remove the memset(), as kzalloc() already zeroes the struct. Signed-off-by: Mauro Carvalho Chehab Acked-by: Paul Kocialkowski Signed-off-by: Mauro Carvalho Chehab commit e82a34fa89f82509b5fe79b65fc351038c560a5b Author: Paul Kocialkowski Date: Wed Dec 5 04:24:42 2018 -0500 media: cedrus: Add device-tree compatible and variant for A64 support Add the necessary compatible for supporting the A64 SoC along with a description of the capabilities of this variant. Signed-off-by: Paul Kocialkowski Acked-by: Maxime Ripard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f7fa2b6ae13f74cfa96463a9105b7a5bdf5408a0 Author: Paul Kocialkowski Date: Wed Dec 5 04:24:41 2018 -0500 media: cedrus: Add device-tree compatible and variant for H5 support Add the necessary compatible for supporting the H5 SoC along with a description of the capabilities of this variant. Signed-off-by: Paul Kocialkowski Acked-by: Maxime Ripard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 66ca86fe37db23cfdcf1170ec05db7ab0e658073 Author: Paul Kocialkowski Date: Wed Dec 5 04:24:40 2018 -0500 media: dt-bindings: media: cedrus: Add compatibles for the A64 and H5 This introduces two new compatibles for the cedrus driver, for the A64 and H5 platforms. Signed-off-by: Paul Kocialkowski Reviewed-by: Rob Herring Acked-by: Maxime Ripard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ac11da47ff45f1f6f19c87cde6f36d9b17d42989 Author: Matt Ranostay Date: Sat Nov 24 17:03:23 2018 -0500 media: video-i2c: check if chip struct has set_power function Not all future supported video chips will always have power management support, and so it is important to check before calling set_power() is defined. Signed-off-by: Matt Ranostay Reviewed-by: Akinobu Mita Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 69d2a734c5dc7085365e752a7e8e35999c7a6c20 Author: Akinobu Mita Date: Thu Nov 22 11:13:56 2018 -0500 media: video-i2c: support runtime PM AMG88xx has a register for setting operating mode. This adds support runtime PM by changing the operating mode. The instruction for changing sleep mode to normal mode is from the reference specifications. https://docid81hrs3j1.cloudfront.net/medialibrary/2017/11/PANA-S-A0002141979-1.pdf Reviewed-by: Matt Ranostay Acked-by: Sakari Ailus Signed-off-by: Akinobu Mita Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e0fe5c7b22a8d4629ed85b668a93ff2582b93203 Author: Rob Herring Date: Wed Dec 5 14:50:42 2018 -0500 media: staging: media: imx: 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. For instances using of_node_cmp, this has the side effect of now using case sensitive comparisons. This should not matter for any FDT based system which this is. Cc: Steve Longerbeam Cc: Philipp Zabel Cc: Greg Kroah-Hartman Cc: devel@driverdev.osuosl.org Signed-off-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d138091ffca629a0914a37fde5d2253ef5f31ad2 Author: Luca Ceresoli Date: Wed Dec 5 11:55:37 2018 -0500 media: v4l2-subdev: document controls need _FL_HAS_DEVNODE Control events can be subscribed and received by the user. Therefore drivers that support controls must expose the V4L2_SUBDEV_FL_HAS_EVENTS flag. [As discussed in https://lkml.org/lkml/2018/11/27/637] Reported-by: Sakari Ailus Signed-off-by: Luca Ceresoli Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit be7e3c3684e0790a84d25b3a7b70b434342e1cc3 Author: Gabriel Francisco Mandaji Date: Sun Dec 2 08:45:38 2018 -0500 media: vivid: Improve timestamping Simulate a more precise timestamp by calculating it based on the current framerate. Signed-off-by: Gabriel Francisco Mandaji Signed-off-by: Hans Verkuil [hverkuil-cisco@xs4all.nl: replaced division by 2 with bit shift] Signed-off-by: Mauro Carvalho Chehab commit a383096c98b4b44151a9fde106b01500ccc2a060 Author: Sergei Shtylyov Date: Mon Aug 6 14:48:20 2018 -0400 media: rcar-vin: add R8A77980 support Add the R8A77980 SoC support to the R-Car VIN driver. Signed-off-by: Sergei Shtylyov Acked-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3ba37c2bcb0cb5dc9b278f730e520f61b2597fe3 Author: Sergei Shtylyov Date: Mon Aug 6 12:56:27 2018 -0400 media: rcar-csi2: add R8A77980 support Add the R-Car V3H (AKA R8A77980) SoC support to the R-Car CSI2 driver. Signed-off-by: Sergei Shtylyov Acked-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2fc6e404117e5b921097c929ba572a00e4421b50 Author: Rob Herring Date: Thu Dec 6 14:35:19 2018 -0500 media: 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. Cc: Kyungmin Park Cc: Kukjin Kim Cc: Krzysztof Kozlowski Cc: Hyun Kwon Cc: Michal Simek Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Reviewed-by: Laurent Pinchart Reviewed-by: Benoit Parrot Signed-off-by: Rob Herring Reviewed-by: Sylwester Nawrocki Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit de2563bce7a157f5296bab94f3843d7d64fb14b4 Author: Vivek Gautam Date: Wed Dec 5 03:31:51 2018 -0500 media: venus: core: Set dma maximum segment size Turning on CONFIG_DMA_API_DEBUG_SG results in the following error: [ 460.308650] ------------[ cut here ]------------ [ 460.313490] qcom-venus aa00000.video-codec: DMA-API: mapping sg segment longer than device claims to support [len=4194304] [max=65536] [ 460.326017] WARNING: CPU: 3 PID: 3555 at src/kernel/dma/debug.c:1301 debug_dma_map_sg+0x174/0x254 [ 460.338888] Modules linked in: venus_dec venus_enc videobuf2_dma_sg videobuf2_memops hci_uart btqca bluetooth venus_core v4l2_mem2mem videobuf2_v4l2 videobuf2_common ath10k_snoc ath10k_core ath lzo lzo_compress zramjoydev [ 460.375811] CPU: 3 PID: 3555 Comm: V4L2DecoderThre Tainted: G W 4.19.1 #82 [ 460.384223] Hardware name: Google Cheza (rev1) (DT) [ 460.389251] pstate: 60400009 (nZCv daif +PAN -UAO) [ 460.394191] pc : debug_dma_map_sg+0x174/0x254 [ 460.398680] lr : debug_dma_map_sg+0x174/0x254 [ 460.403162] sp : ffffff80200c37d0 [ 460.406583] x29: ffffff80200c3830 x28: 0000000000010000 [ 460.412056] x27: 00000000ffffffff x26: ffffffc0f785ea80 [ 460.417532] x25: 0000000000000000 x24: ffffffc0f4ea1290 [ 460.423001] x23: ffffffc09e700300 x22: ffffffc0f4ea1290 [ 460.428470] x21: ffffff8009037000 x20: 0000000000000001 [ 460.433936] x19: ffffff80091b0000 x18: 0000000000000000 [ 460.439411] x17: 0000000000000000 x16: 000000000000f251 [ 460.444885] x15: 0000000000000006 x14: 0720072007200720 [ 460.450354] x13: ffffff800af536e0 x12: 0000000000000000 [ 460.455822] x11: 0000000000000000 x10: 0000000000000000 [ 460.461288] x9 : 537944d9c6c48d00 x8 : 537944d9c6c48d00 [ 460.466758] x7 : 0000000000000000 x6 : ffffffc0f8d98f80 [ 460.472230] x5 : 0000000000000000 x4 : 0000000000000000 [ 460.477703] x3 : 000000000000008a x2 : ffffffc0fdb13948 [ 460.483170] x1 : ffffffc0fdb0b0b0 x0 : 000000000000007a [ 460.488640] Call trace: [ 460.491165] debug_dma_map_sg+0x174/0x254 [ 460.495307] vb2_dma_sg_alloc+0x260/0x2dc [videobuf2_dma_sg] [ 460.501150] __vb2_queue_alloc+0x164/0x374 [videobuf2_common] [ 460.507076] vb2_core_reqbufs+0xfc/0x23c [videobuf2_common] [ 460.512815] vb2_reqbufs+0x44/0x5c [videobuf2_v4l2] [ 460.517853] v4l2_m2m_reqbufs+0x44/0x78 [v4l2_mem2mem] [ 460.523144] v4l2_m2m_ioctl_reqbufs+0x1c/0x28 [v4l2_mem2mem] [ 460.528976] v4l_reqbufs+0x30/0x40 [ 460.532480] __video_do_ioctl+0x36c/0x454 [ 460.536610] video_usercopy+0x25c/0x51c [ 460.540572] video_ioctl2+0x38/0x48 [ 460.544176] v4l2_ioctl+0x60/0x74 [ 460.547602] do_video_ioctl+0x948/0x3520 [ 460.551648] v4l2_compat_ioctl32+0x60/0x98 [ 460.555872] __arm64_compat_sys_ioctl+0x134/0x20c [ 460.560718] el0_svc_common+0x9c/0xe4 [ 460.564498] el0_svc_compat_handler+0x2c/0x38 [ 460.568982] el0_svc_compat+0x8/0x18 [ 460.572672] ---[ end trace ce209b87b2f3af88 ]--- >From above warning one would deduce that the sg segment will overflow the device's capacity. In reality, the hardware can accommodate larger sg segments. So, initialize the max segment size properly to weed out this warning. Based on a similar patch sent by Sean Paul for mdss: https://patchwork.kernel.org/patch/10671457/ Signed-off-by: Vivek Gautam Acked-by: Stanimir Varbanov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2123cbd687ca0c511faa97db9f18ca55767c5684 Author: Kelvin Lawson Date: Thu Nov 29 19:07:28 2018 -0500 media: venus: Support V4L2 QP parameters in Venus encoder Support V4L2 QP parameters in Venus encoder: * V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP * V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP * V4L2_CID_MPEG_VIDEO_H264_MIN_QP * V4L2_CID_MPEG_VIDEO_H264_MAX_QP Signed-off-by: Kelvin Lawson Acked-by: Stanimir Varbanov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4e1e0eb0e0744e02fdada653463cc8010523b2f3 Author: Ezequiel Garcia Date: Thu Dec 6 14:46:39 2018 -0500 media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fields Make the core set the reserved fields to zero in vv4l2_pix_format_mplane.4l2_plane_pix_format, for _MPLANE queue types. Moving this to the core avoids having to do so in each and every driver. Suggested-by: Tomasz Figa Signed-off-by: Ezequiel Garcia Acked-by: Sakari Ailus Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8f4c20cb6ab1fc5b86707875ec3437a5bfb5b3f5 Author: Lubomir Rintel Date: Mon Dec 3 06:47:42 2018 -0500 media: marvell-ccic: trivial fix to the datasheet URL Update URL. Signed-off-by: Lubomir Rintel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ad93f09b02eea3f56b2b23e075ecb0d7062240db Author: Todor Tomov Date: Fri Nov 30 07:01:39 2018 -0500 media: MAINTAINERS: Change Todor Tomov's email address My Linaro email address with be inactive very soon so switch it to my Gmail address. Signed-off-by: Todor Tomov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 22f54602526ec9d199342da43dbb304f5726ba56 Author: Paul Kocialkowski Date: Fri Nov 30 03:16:17 2018 -0500 media: cedrus: Remove global IRQ spin lock from the driver We initially introduced a spin lock to ensure that the VPU registers are not accessed concurrently between our setup function and IRQ handler. The V4L2 M2M API ensures that only one decoding job runs at a time, so the interrupt signaling the end of decoding will not occur while the next picture is being configured. Spurious interrupts are taken care of in the handler, by checking that we have a valid M2M context and a decoding status available before marking the buffers as done. In addition, holding a spin lock could be problematic if non-atomic operations are required in the setup process for future codec support. As a result, remove the global IRQ spin lock. Signed-off-by: Paul Kocialkowski Acked-by: Maxime Ripard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fe8fb032732f6310888d7f765f593d1c337f7e36 Author: Colin Ian King Date: Thu Nov 29 05:50:38 2018 -0500 media: sun6i: fix spelling mistake "droped" -> "dropped" There are spelling mistakes in dev_dbg messages, fix them. Signed-off-by: Colin Ian King Acked-by: Maxime Ripard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 87c9f19714921df17d13c24e5d20ab04942f1a91 Author: Colin Ian King Date: Thu Nov 29 05:19:45 2018 -0500 media: pvrusb2: fix spelling mistake "statuss" -> "status" There is a spelling mistake in a pvr2_trace trace message, fix it. Signed-off-by: Colin Ian King Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 75fa6e4f83a0923fe753827d354998d448b4fd6a Author: Philipp Zabel Date: Wed Nov 28 08:01:22 2018 -0500 media: coda: fix H.264 deblocking filter controls Add support for the third loop filter mode V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY, and fix V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA and V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA controls. The filter offset controls are signed values in the -6 to 6 range and are stored into the slice header fields slice_alpha_c0_offset_div2 and slice_beta_offset_div2. The actual filter offsets FilterOffsetA/B are double their value, in range of -12 to 12. Rename variables to more closely match the nomenclature in the H.264 specification. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d338e17993f78155196af4cb780d8271996a02ac Author: Philipp Zabel Date: Wed Nov 28 08:01:21 2018 -0500 media: v4l2: clarify H.264 loop filter offset controls The venus and s5p-mfc drivers add the loop filter alpha/beta offset controls V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA/BETA with a range of -6 to +6, inclusive. This is exactly the range specified for the slice header fields slice_alpha_c0_offset_div2 and slice_beta_offset_div2, which store half the actual filter offsets FilterOffsetA/B. Clarify that this control contains the halved offsets. Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 91dc5e91edf767e27db4ee1fae19b56cd21152c0 Author: Dmitry Osipenko Date: Mon Nov 19 06:17:18 2018 -0500 media: staging: tegra-vde: Replace debug messages with trace points Trace points are much more efficient than debug messages for intensive tracing and could be conveniently enabled / disabled dynamically, hence let's replace debug messages with the trace points. This also makes code a bit cleaner. Signed-off-by: Dmitry Osipenko Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c35f0b16537c15a8fa3ff97e7c0488e683e306c8 Author: Malathi Gottam Date: Fri Nov 2 08:57:56 2018 -0400 media: venus: add support for key frame When client requests for a keyframe, set the property to hardware to generate the sync frame. Signed-off-by: Malathi Gottam Acked-by: Tomasz Figa Acked-by: Stanimir Varbanov Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d6951f582cc50ba0ad22ef46b599740966599b14 Author: Russell King Date: Fri Dec 7 13:11:15 2018 +0000 ARM: fix the cockup in the previous patch The intention in the previous patch was to only place the processor tables in the .rodata section if big.Little was being built and we wanted the branch target hardening, but instead (due to the way it was tested) it ended up always placing the tables into the .rodata section. Although harmless, let's correct this anyway. Fixes: 3a4d0c2172bc ("ARM: ensure that processor vtables is not lost after boot") Signed-off-by: Russell King commit 8d31a499c60f2f276693662297ad1fe50d4959f1 Author: Malcolm Priestley Date: Wed Dec 5 14:14:31 2018 -0500 media: lmedm04: Move interrupt buffer to priv buffer. Interrupt is always present throughout life time of driver and there is no dma element move this buffer to private area of driver. Signed-off-by: Malcolm Priestley Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 87bd0e034e84bdfd8037efb337cb6ad006329793 Author: Malcolm Priestley Date: Wed Dec 5 14:11:57 2018 -0500 media: lmedm04: Add missing usb_free_urb to free interrupt urb. The interrupt urb is killed but never freed add the function Signed-off-by: Malcolm Priestley Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit c12b08ebbe16f0d3a96a116d86709b04c1ee8e74 Author: Yu Zhao Date: Thu Dec 6 14:39:15 2018 -0700 iommu/amd: Fix amd_iommu=force_isolation The parameter is still there but it's ignored. We need to check its value before deciding to go into passthrough mode for AMD IOMMU v2 capable device. We occasionally use this parameter to force v2 capable device into translation mode to debug memory corruption that we suspect is caused by DMA writes. To address the following comment from Joerg Roedel on the first version, v2 capability of device is completely ignored. > This breaks the iommu_v2 use-case, as it needs a direct mapping for the > devices that support it. And from Documentation/admin-guide/kernel-parameters.txt: This option does not override iommu=pt Fixes: aafd8ba0ca74 ("iommu/amd: Implement add_device and remove_device") Signed-off-by: Yu Zhao Signed-off-by: Joerg Roedel commit 0cef02031e74e1ea689b18fb8f0b0e87e0051f03 Merge: 34812fe111192 3f3327dbc5596 Author: Linus Walleij Date: Fri Dec 7 13:42:35 2018 +0100 Merge tag 'sh-pfc-for-v4.21-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: sh-pfc: Updates for v4.21 (take two) - Two small fixes for RZ/N1. commit b00b7980af8a126976105ec68664a72bb72c6db2 Author: Masahiro Yamada Date: Wed Dec 5 21:54:09 2018 +0900 gpio: uniphier: convert to SPDX License Identifier checkpatch.pl suggests to use SPDX license tag. I am happy to follow it. Signed-off-by: Masahiro Yamada Signed-off-by: Linus Walleij commit 34812fe1111929be454afb9a63f2c69e834c2d9a Author: Masahiro Yamada Date: Wed Dec 5 21:53:39 2018 +0900 pinctrl: uniphier: convert to SPDX License Identifier checkpatch.pl suggests to use SPDX license tag. I am happy to follow it. Signed-off-by: Masahiro Yamada Signed-off-by: Linus Walleij commit 6169005ceb8c715582eca70df3912cd2b351ede2 Author: Brandon Maier Date: Wed Nov 28 11:14:17 2018 -0600 gpio: zynq: Report gpio direction at boot The Zynq's gpios can be configured by the bootloader. But Linux will erroneously report all gpios as inputs unless we implement get_direction(). Signed-off-by: Brandon Maier Tested-by: Michal Simek Signed-off-by: Linus Walleij commit 396244692232fcf0881cb6ba2404be2906f47681 Author: Will Deacon Date: Thu Sep 20 10:26:40 2018 +0100 arm64: preempt: Provide our own implementation of asm/preempt.h The asm-generic/preempt.h implementation doesn't make use of the PREEMPT_NEED_RESCHED flag, since this can interact badly with load/store architectures which rely on the preempt_count word being unchanged across an interrupt. However, since we're a 64-bit architecture and the preempt count is only 32 bits wide, we can simply pack it next to the resched flag and load the whole thing in one go, so that a dec-and-test operation doesn't need to load twice. Acked-by: Peter Zijlstra (Intel) Reviewed-by: Ard Biesheuvel Signed-off-by: Will Deacon commit 08861d33d680838753f1f9d3ba9480d3651b764d Author: Will Deacon Date: Wed Sep 19 13:39:26 2018 +0100 preempt: Move PREEMPT_NEED_RESCHED definition into arch code PREEMPT_NEED_RESCHED is never used directly, so move it into the arch code where it can potentially be implemented using either a different bit in the preempt count or as an entirely separate entity. Cc: Robert Love Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Martin Schwidefsky Acked-by: Peter Zijlstra (Intel) Signed-off-by: Will Deacon commit 4f45f45b081eb37b9f8b627cc14cff67838968ab Author: Chen-Yu Tsai Date: Mon Dec 3 23:41:00 2018 +0800 pinctrl: sunxi: a64: Rename function ts0 to ts The A64 only has one TS (transport stream) controller. The datasheet also lists the function as TS_XXX instead of TS0_XXX. Rename the function names now before any there are any users. Fixes: 96851d391d02 ("drivers: pinctrl: add driver for Allwinner A64 SoC") Signed-off-by: Chen-Yu Tsai Acked-by: Maxime Ripard Signed-off-by: Linus Walleij commit 3504caa17b596c8ec62d923b2ed7d4a19d56d816 Author: Chen-Yu Tsai Date: Mon Dec 3 23:40:59 2018 +0800 pinctrl: sunxi: a64: Rename function csi0 to csi The A64 only has one CSI (camera sensor interface) controller. The datasheet also lists the function as CSI_XXX instead of CSI0_XXX. Rename the function names now before any there are any users. Fixes: 96851d391d02 ("drivers: pinctrl: add driver for Allwinner A64 SoC") Signed-off-by: Chen-Yu Tsai Acked-by: Maxime Ripard Signed-off-by: Linus Walleij commit a9d9f6b83f1bb05da849b3540e6d1f70ef1c2343 Author: Nicholas Mc Guire Date: Sun Dec 2 11:04:17 2018 +0100 pinctrl: sx150x: handle failure case of devm_kstrdup devm_kstrdup() may return NULL if internal allocation failed. Thus using label, name is unsafe without checking. Therefor in the unlikely case of allocation failure, sx150x_probe() simply returns -ENOMEM. Signed-off-by: Nicholas Mc Guire Fixes: 9e80f9064e73 ("pinctrl: Add SX150X GPIO Extender Pinctrl Driver") Signed-off-by: Linus Walleij commit 8084945d3c934cf730cd5fdfb5cc11ebfc4cc386 Author: Ladislav Michl Date: Thu Dec 6 22:06:38 2018 +0100 ASoC: max9867: Add copyright and module author Driver rewritten, assign copyright notice and change module author as original one remains silent and I want to be notified about bugs. Signed-off-by: Ladislav Michl Signed-off-by: Mark Brown commit ce55698d32329b83ea695e0011b58d1bc11189b8 Author: Cheng-Yi Chiang Date: Wed Nov 28 17:00:36 2018 +0800 ASoC: sdm845: Add configuration for headset codec Set DAI format and sysclk for headset codec. Signed-off-by: Cheng-Yi Chiang Acked-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit 09b382007aa54dbe2cc142ef78d69b9a7645fcd6 Author: Cheng-Yi Chiang Date: Wed Nov 28 17:00:35 2018 +0800 ASoC: sdm845: Add TDM configuration for speaker Set TDM time slots and DAI format for speaker codec. Signed-off-by: Cheng-Yi Chiang Acked-by: Srinivas Kandagatla Signed-off-by: Mark Brown commit bc2610a6c4c92f0bf6bbf4c6641407536f30daaf Author: Ladislav Michl Date: Tue Dec 4 19:21:33 2018 +0100 ASoC: max9867: Fix signal paths Sound capture and line bypass currently do not work as well as some mixer controls. Fix that by building proper audio paths and adjusting volume controls to match datasheet. Signed-off-by: Ladislav Michl Signed-off-by: Mark Brown commit 715ee1916b95bfd0773487397a0354ad9a4660e6 Author: Ladislav Michl Date: Tue Dec 4 19:21:04 2018 +0100 ASoC: max9867: Calculate LRCLK divider Drop "Common NI Values Table" and calculate LRCLK divider, then add allowed rate constraints based on master clock frequency. Signed-off-by: Ladislav Michl Signed-off-by: Mark Brown commit 29f58ff06795a923407d011d4721eaf3e8d39acc Author: Ladislav Michl Date: Tue Dec 4 19:19:51 2018 +0100 ASoC: max9867: Fix power management Implement set_bias_level to drive shutdown bit, so device is put to sleep when unused. Signed-off-by: Ladislav Michl Signed-off-by: Mark Brown commit 8efc1afd7e0570d9bb37f5127f0742304a8ad2fc Author: Ladislav Michl Date: Tue Dec 4 19:18:17 2018 +0100 ASoC: max9867: Remove useless assignment ret is assigned later, no need to initialize it. Signed-off-by: Ladislav Michl Signed-off-by: Mark Brown commit 611a1c69f8ca85fc656f09d0cd56f5934e2af5fb Author: Thierry Reding Date: Thu Dec 6 19:00:17 2018 +0100 arm64: tegra: Set reg property for display-hub on Tegra194 Technically the display-hub driver could access registers via the specified region, though it practice it will do so via the display controllers' register regions. Signed-off-by: Thierry Reding commit ffa1ad89ddf2c17d777dc2abc4aa81832030df8e Author: Thierry Reding Date: Thu Dec 6 19:00:16 2018 +0100 arm64: tegra: Set reg property for display-hub on Tegra186 Technically the display-hub driver could access registers via the specified region, though it practice it will do so via the display controllers' register regions. Signed-off-by: Thierry Reding commit 1528e40fd7d382e9668d3a1876a83d30bb04d554 Author: Greg Kroah-Hartman Date: Fri Dec 7 12:56:04 2018 +0100 Revert "sysctl: clean up nr_pdflush_threads leftover" This reverts commit 77cab92a2cb15bcbdd7be0af773799e92d6a8546. Heiko reports that this breaks building of strace, which isn't ok. Reported-by: Heiko Carstens Cc: Rafael Aquini Cc: William Kucharski Signed-off-by: Greg Kroah-Hartman commit 7bbd1fc0e9f1281f9a7122dbfd6641b523c4e4ed Author: NeilBrown Date: Fri Nov 30 10:04:08 2018 +1100 fs/locks: remove unnecessary white space. - spaces before tabs, - spaces at the end of lines, - multiple blank lines, - blank lines before EXPORT_SYMBOL, can all go. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields Signed-off-by: Jeff Layton commit cb03f94ffb070b13bc0fa58b4ef4fdb558418d27 Author: NeilBrown Date: Fri Nov 30 10:04:08 2018 +1100 fs/locks: merge posix_unblock_lock() and locks_delete_block() posix_unblock_lock() is not specific to posix locks, and behaves nearly identically to locks_delete_block() - the former returning a status while the later doesn't. So discard posix_unblock_lock() and use locks_delete_block() instead, after giving that function an appropriate return value. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields Signed-off-by: Jeff Layton commit fd7732e033e30b3a586923b57e338c859e17858a Author: NeilBrown Date: Fri Nov 30 10:04:08 2018 +1100 fs/locks: create a tree of dependent requests. When we find an existing lock which conflicts with a request, and the request wants to wait, we currently add the request to a list. When the lock is removed, the whole list is woken. This can cause the thundering-herd problem. To reduce the problem, we make use of the (new) fact that a pending request can itself have a list of blocked requests. When we find a conflict, we look through the existing blocked requests. If any one of them blocks the new request, the new request is attached below that request, otherwise it is added to the list of blocked requests, which are now known to be mutually non-conflicting. This way, when the lock is released, only a set of non-conflicting locks will be woken, the rest can stay asleep. If the lock request cannot be granted and the request needs to be requeued, all the other requests it blocks will then be woken To make this more concrete: If you have a many-core machine, and have many threads all wanting to briefly lock a give file (udev is known to do this), you can get quite poor performance. When one thread releases a lock, it wakes up all other threads that are waiting (classic thundering-herd) - one will get the lock and the others go to sleep. When you have few cores, this is not very noticeable: by the time the 4th or 5th thread gets enough CPU time to try to claim the lock, the earlier threads have claimed it, done what was needed, and released. So with few cores, many of the threads don't end up contending. With 50+ cores, lost of threads can get the CPU at the same time, and the contention can easily be measured. This patchset creates a tree of pending lock requests in which siblings don't conflict and each lock request does conflict with its parent. When a lock is released, only requests which don't conflict with each other a woken. Testing shows that lock-acquisitions-per-second is now fairly stable even as the number of contending process goes to 1000. Without this patch, locks-per-second drops off steeply after a few 10s of processes. There is a small cost to this extra complexity. At 20 processes running a particular test on 72 cores, the lock acquisitions per second drops from 1.8 million to 1.4 million with this patch. For 100 processes, this patch still provides 1.4 million while without this patch there are about 700,000. Reported-and-tested-by: Martin Wilck Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields Signed-off-by: Jeff Layton commit c0e15908979d269a8263b0c0a222b894b9f403e9 Author: NeilBrown Date: Fri Nov 30 10:04:08 2018 +1100 fs/locks: change all *_conflict() functions to return bool. posix_locks_conflict() and flock_locks_conflict() both return int. leases_conflict() returns bool. This inconsistency will cause problems for the next patch if not fixed. So change posix_locks_conflict() and flock_locks_conflict() to return bool. Also change the locks_conflict() helper. And convert some return (foo); to return foo; Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields Signed-off-by: Jeff Layton commit 16306a61d3b7c433c7a127ec6224867b88ece687 Author: NeilBrown Date: Fri Nov 30 10:04:08 2018 +1100 fs/locks: always delete_block after waiting. Now that requests can block other requests, we need to be careful to always clean up those blocked requests. Any time that we wait for a request, we might have other requests attached, and when we stop waiting, we must clean them up. If the lock was granted, the requests might have been moved to the new lock, though when merged with a pre-exiting lock, this might not happen. In all cases we don't want blocked locks to remain attached, so we remove them to be safe. Signed-off-by: NeilBrown Reviewed-by: J. Bruce Fields Tested-by: syzbot+a4a3d526b4157113ec6a@syzkaller.appspotmail.com Tested-by: kernel test robot Signed-off-by: Jeff Layton commit 36c4da4f552a126bb29a95dc5c9608795491e32a Author: Niklas Söderlund Date: Thu Nov 29 01:39:49 2018 +0100 clk: renesas: rcar-gen3: Add HS400 quirk for SD clock On H3 (ES1.x, ES2.0) and M3-W (ES1.0, ES1.1) the clock setting for HS400 needs a quirk to function properly. The reason for the quirk is that there are two settings which produces same divider value for the SDn clock. On the effected boards the one currently selected results in HS400 not working. This change uses the same method as the Gen2 CPG driver and simply ignores the first clock setting as this is the offending one when selecting the settings. Which of the two possible settings is used have no effect for SDR104. Signed-off-by: Niklas Söderlund Tested-by: Wolfram Sang Acked-by: Wolfram Sang Signed-off-by: Geert Uytterhoeven commit e2f4dd1f5b51b4dab813aa6e4db44e87aa750393 Author: Niklas Söderlund Date: Thu Nov 29 01:39:48 2018 +0100 clk: renesas: rcar-gen3: Add documentation for SD clocks Document the known use cases of the different clock settings. This is useful as different SoC and ES versions use different settings to do the same thing as there is more than one combination to achieve the same SDn clock speed. Signed-off-by: Niklas Söderlund Reviewed-by: Wolfram Sang Signed-off-by: Geert Uytterhoeven commit ecda0a09fa9933bcd67e33c952f778f0872392ed Author: Niklas Söderlund Date: Thu Nov 29 01:15:38 2018 +0100 clk: renesas: rcar-gen3: Set state when registering SD clocks The driver tries to figure out which state a SD clock is in when the clock is registered, instead of setting a known state. This can be problematic for two reasons. 1. If the clock driver can't figure out the state of the clock, registration of the clock fails, and setting of a known state by a clock user is not possible. 2. The state of the clock depends on if and how the bootloader configured it. The driver only checks that the rate is known, not if the clock is stopped or not for example. Fix this by setting a known state and making sure the clock is stopped. Signed-off-by: Niklas Söderlund Tested-by: Wolfram Sang Acked-by: Wolfram Sang Signed-off-by: Geert Uytterhoeven commit e854747d7593c03c03ee785a04dce9b301ae3a9a Author: Kailang Yang Date: Wed Nov 28 15:32:45 2018 +0800 ALSA: hda/realtek - Enable headset button support for new codec This patch will enable headset button for new Chrome platform. Signed-off-by: Kailang Yang Signed-off-by: Takashi Iwai commit 911761c2304327a39ec9372be812a9648bd35c09 Author: Takashi Iwai Date: Wed Nov 28 14:25:37 2018 +0100 ALSA: hda - Add jack button support Extend some structs to add the support for jack button changes. Now snd_hda_jack_add_kctl() receives two more arguments: the jack type and the jack keymaps. Both are optional, and when zero are passed, the function behaves just like before. For reporting button state changes, you'd need to update jack->button_state bits accordingly, typically in the jack callback. Then the value OR'ed with button_state and the jack plug state is passed to snd_jack_report(). Note that currently the code assumes only the one-shot button events, i.e. it tries to send the button release soon after sending the button event. If a driver really supports the button release handling by itself, we may need to introduce some flag to control this behavior in future. Signed-off-by: Takashi Iwai commit e6ce180fa6df519b1e24dab9d1fcbe32ce618a5e Author: Takashi Iwai Date: Wed Nov 28 14:17:58 2018 +0100 ALSA: hda - Add jack pointer and unsolicited event bits to callback For allowing the callee to evaluate the associated jack information and the unsolicited event data, add the new fields to hda_jack_callback. They can be used, for example, to retrieve the headset button state in the callback. Signed-off-by: Takashi Iwai commit 2bff7e97ebbb1119e9f22936706294f4e85d4db6 Merge: 157ab88ef64a2 bde1a7459623a Author: Takashi Iwai Date: Fri Dec 7 11:40:00 2018 +0100 Merge branch 'for-linus' into for-next Back-merge for applying the more HD-audio quirks on top of the latest code. Signed-off-by: Takashi Iwai commit 0819dc72ea70a90ad2a070e76708ee53bac47caa Author: Yangtao Li Date: Fri Nov 30 11:36:17 2018 -0500 pinctrl: Change to use DEFINE_SHOW_ATTRIBUTE macro Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Linus Walleij commit 9904f0325ec3d57b823b4c9cd569eed9fc1ef1f7 Author: Yangtao Li Date: Fri Nov 30 11:22:46 2018 -0500 gpio: ks8695: Change to use DEFINE_SHOW_ATTRIBUTE macro Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Linus Walleij commit 38842572df1c79213b99e0c3472ce95aa5d152cf Author: Mathieu Malaterre Date: Tue Dec 4 21:10:57 2018 +0100 mtd: rawnand: jz4780: annotate implicit fall throughs There is a plan to build the kernel with -Wimplicit-fallthrough and these places in the code produced warnings. Fix them up. Signed-off-by: Mathieu Malaterre Signed-off-by: Miquel Raynal commit 25fbc9e8d3673d372ad6ae44a8d4f850879f50ad Author: Thierry Reding Date: Fri Nov 23 13:43:41 2018 +0100 dt-bindings: tegra186-gpio: Add Tegra186 specific prefix Subsequent generations of Tegra, such as Tegra194, contain a completely different set of GPIOs. In order to clarify that the Tegra186 defines are indeed specific to Tegra186, change the prefix from TEGRA_ to TEGRA186_. Note that for now we need to keep the old definitions in place to avoid breaking compilation in file that use this header. Once all users have been converted to use the new defines, the old ones can be removed. Also note that this is only a naming change and doesn't affect device tree ABI. Signed-off-by: Thierry Reding Acked-by: Jon Hunter commit c93c613214ac70c87beab5422a60077bf126b855 Author: Chuanhong Guo Date: Wed Nov 28 21:07:25 2018 +0800 mtd: spinand: add support for GigaDevice GD5FxGQ4xA Add support for GigaDevice GD5F1G/2G/4GQ4xA SPI NAND. Signed-off-by: Chuanhong Guo Reviewed-by: Frieder Schrempf Signed-off-by: Miquel Raynal commit 7b6a9b28ecf2fd2e2f5dcdb6d4fa8044b48bdb74 Author: Boris Brezillon Date: Tue Nov 20 10:02:39 2018 +0100 mtd: rawnand: Deprecate the dummy_controller field We try to force NAND controller drivers to properly separate the NAND controller object from the NAND chip one, so let's deprecate the dummy controller object embedded in nand_chip to encourage them to create their own instance. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 419e5b84a4be6c796e421b82e9673e2fa1ec1b07 Author: Boris Brezillon Date: Tue Nov 20 10:02:38 2018 +0100 mtd: rawnand: vf610: Add an SPDX tag to replace the license text Replace the license text by an SPDX tag. Signed-off-by: Boris Brezillon Reviewed-by: Stefan Agner Signed-off-by: Miquel Raynal commit da59b4538c4cddfcd77e1c3e45e087d6b757729b Author: Boris Brezillon Date: Tue Nov 20 10:02:37 2018 +0100 mtd: rawnand: vf610: Stop using the dummy controller obj The dummy controller is kept around to support old drivers. Let's patch this one and declare our own nand_controller instance. Signed-off-by: Boris Brezillon Reviewed-by: Stefan Agner Signed-off-by: Miquel Raynal commit 4440f781969dcc28d8af0e66a6d6d741845bb67b Author: Boris Brezillon Date: Tue Nov 20 10:02:36 2018 +0100 mtd: rawnand: vf610: Stop passing mtd_info to internal functions Mimic what has been done in the core and avoid passing mtd_info object internally. Signed-off-by: Boris Brezillon Reviewed-by: Stefan Agner Signed-off-by: Miquel Raynal commit e96fd5ce5ffab81ca1153eda28805dd3f073f03e Author: Vladimir Zapolskiy Date: Thu Nov 29 00:48:40 2018 +0200 dt-bindings: gpio: lpc18xx: describe interrupt controllers of GPIO controller From LPC18xx and LPC43xx User Manuals the GPIO controller consists of the following weakly connected blocks: * GPIO pin interrupt block at 0x40087000, * GPIO GROUP0 interrupt block at 0x40088000, * GPIO GROUP1 interrupt block at 0x40089000, * GPIO port block at 0x400F4000. While all 4 sub-controller blocks have their own I/O addresses, moreover all 3 interrupt blocks are APB0 peripherals and high-speed GPIO block is an AHB slave, according to the hardware manual interrupt controllers and GPIO controller block are seen as a single device, all 4 sub-controllers have the shared reset signal RGU #28 and the same shared clock to access registers CLK_Mx_GPIO on CCU1. The change adds descriptions of the currently missing interrupt controller blocks found on GPIO controller, new added properties are 'reg-names', 'resets', 'interrupt-controller' and '#interrupt-cells', also the example is updated to reflect the changes in device tree binding description. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Linus Walleij commit fc43f45ed563f517e9bd1ddc9d0a2fecf3cd2808 Author: Boris Brezillon Date: Tue Nov 20 10:02:35 2018 +0100 mtd: rawnand: fsmc: Fix all coding style issues reported by checkpatch checkpatch reports a bunch of coding style issues. Let's fix them all in one step. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit bb6963449f3d43e1162359895005ada3db02c9de Author: Boris Brezillon Date: Tue Nov 20 10:02:34 2018 +0100 mtd: rawnand: fsmc: Add an SPDX tag to replace the license text Add an SPDX GPL-2.0 tag and update MODULE_LICENSE() to match the license text. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit ad71148c1804c334544068514bc318bfd3490334 Author: Boris Brezillon Date: Tue Nov 20 10:02:33 2018 +0100 mtd: rawnand: fsmc: Stop using the dummy controller obj The dummy controller is kept around to support old drivers. Let's patch this one and declare our own nand_controller instance. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 1e809f7ef4d2402e31e4bc2f76753b9d3b1e0b6c Author: Boris Brezillon Date: Tue Nov 20 10:02:32 2018 +0100 mtd: rawnand: fsmc: Make conversion from chip to fsmc consistent nand_to_fsmc() is used almost everywhere except in fsmc_setup_data_interface() where nand_get_controller_data() is used instead. Make that consistent and drop the nand_set_controller_data() call in the probe path. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 5b47f407810369e21f2c3123c13e29ff8609a7e4 Author: Boris Brezillon Date: Tue Nov 20 10:02:31 2018 +0100 mtd: rawnand: fsmc: Fix the fsmc_nand_data kernel-doc The kernel-doc describing struct fsmc_nand_data is not in sync with the struct itself. Add missing entries and drop invalid ones. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit bfc535f44089d6574ee4fba1c7683980020c24fb Author: Boris Brezillon Date: Tue Nov 20 10:02:30 2018 +0100 mtd: rawnand: fsmc: Stop passing mtd_info objects to internal functions Mimic what has been done in the core and stop passing mtd_info objects to internal functions. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 5ddabfe8d3ded5dd5e760bf66ebb4241e5314e8d Author: Vladimir Zapolskiy Date: Thu Nov 29 00:48:41 2018 +0200 gpio: lpc18xx: add GPIO pin interrupt controller support The change adds support of LPC18xx/LPC43xx GPIO pin interrupt controller block within SoC GPIO controller. The new interrupt controller driver allows to configure and capture edge or level interrupts on 8 arbitrary selectedinput GPIO pins, and lift the signals to be reported as NVIC rising edge interrupts. Configuration of a particular GPIO pin to serve as interrupt and its mapping to an interrupt on NVIC is done by SCU pin controller, for more details see description of 'nxp,gpio-pin-interrupt' device tree property of a GPIO pin [1]. From LPC18xx and LPC43xx User Manuals the GPIO controller consists of the following blocks: * GPIO pin interrupt block at 0x40087000, this change adds its support, * GPIO GROUP0 interrupt block at 0x40088000, * GPIO GROUP1 interrupt block at 0x40089000, * GPIO port block at 0x400F4000, it is supported by the original driver. While all 4 sub-controller blocks have their own I/O addresses, moreover all 3 interrupt blocks are APB0 peripherals and high-speed GPIO block is an AHB slave, according to the hardware manual the GPIO controller is seen as a single block, and 4 sub-controllers have the shared reset signal RGU #28 and clock to register interface CLK_CPU_GPIO on CCU1. Likely support of two GPIO group interrupt blocks won't be added in short term, because the mechanism to mask several interrupt sources is not well defined. [1] Documentation/devicetree/bindings/pinctrl/nxp,lpc1850-scu.txt Signed-off-by: Vladimir Zapolskiy Signed-off-by: Linus Walleij commit 985d8d5c76dcdc8f4c8ceea8fae71e4a45a0a200 Author: Vladimir Zapolskiy Date: Thu Nov 29 00:28:48 2018 +0200 gpio: lpc18xx: use resource managed interface to register GPIO controller Slightly simplify deregistration of the GPIO controller driver. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Linus Walleij commit 9dd1a30cb4881328ae568f6c060446b52539a2dd Author: Vladimir Zapolskiy Date: Thu Nov 29 00:28:47 2018 +0200 gpio: lpc18xx: add struct device local variable This is a non-functional change, it simplifies multiple access to 'struct device' pointer derived from a platform device pointer, the new local variable will also be used in the following changes. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Linus Walleij commit 9b34d05aa9c8cdd516762f2b06c22fcd05a14072 Author: Vladimir Zapolskiy Date: Thu Nov 29 00:28:46 2018 +0200 gpio: lpc18xx: use SPDX license identifier Replace GPLv2 header with the SPDX identifier. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Linus Walleij commit a109c2dbb571b10bb9969285b646f57309c98251 Author: Nicholas Mc Guire Date: Tue Nov 27 18:00:18 2018 +0100 gpio: mt7621: pass mediatek_gpio_bank_probe() failure up the stack The error cases of mediatek_gpio_bank_probe() would go unnoticed (except for the dev_err() messages). The probe function should return an error if one of the banks failed to initialize properly indicated by not returning non-0. Fixes: 4ba9c3afda41 ("gpio: mt7621: Add a driver for MT7621") Signed-off-by: Nicholas Mc Guire Acked-by: Sean Wang Signed-off-by: Linus Walleij commit 59d646c775d6ae688ee90fda9f2a4270c47b7490 Author: Nicholas Mc Guire Date: Wed Nov 21 19:06:12 2018 +0100 gpio: mt7621: report failure of devm_kasprintf() kasprintf() may return NULL on failure of internal allocation thus the assigned label is not safe if not explicitly checked. On error mediatek_gpio_bank_probe() returns negative values so -ENOMEM in the (unlikely) failure case should be fine here. Fixes: 4ba9c3afda41 ("gpio: mt7621: Add a driver for MT7621") Signed-off-by: Nicholas Mc Guire Reviewed-by: Bartosz Golaszewski Acked-by: Sean Wang Signed-off-by: Linus Walleij commit 5fb3dc114706b557c3f6c385640f8fc1a03c2889 Author: Masahiro Yamada Date: Wed Nov 28 14:27:37 2018 +0900 mtd: rawnand: denali: remove denali_reset_banks() In nand_scan_ident(), the controller driver resets every NAND chip. This is done by sending NAND_CMD_RESET. The Denali IP provides another way to do the equivalent thing; if a bit is set in the DEVICE_RESET register, the controller sends the RESET command to the corresponding device. denali_reset_banks() uses it to reset all devices beforehand. This redundant reset sequence was needed to know the actual number of chips before calling nand_scan_ident(); if DEVICE_RESET fails, there is no chip in that chip select. Then, denali_reset_banks() sets denali->max_banks to the number of detected chips. As commit f486287d2372 ("mtd: nand: denali: fix bank reset function to detect the number of chips") explained, nand_scan_ident() issued Set Features (0xEF) command to all CS lines, some of which may not be connected with a chip. Then, the driver would wait for R/B# response, which never happens. This problem was solved by commit 107b7d6a7ad4 ("mtd: rawnand: avoid setting again the timings to mode 0 after a reset"). In the current code, nand_setup_data_interface() is called from nand_scan_tail(), which is invoked after the chip detection. Now, we can really remove the redundant denali_nand_banks() by simply passing the maximum number of chip selects supported by this IP (typically 4 or 8) to nand_scan(). Let's leave all the chip detection process to nand_scan_ident(). Signed-off-by: Masahiro Yamada Signed-off-by: Miquel Raynal commit a2a05c2f530c663f6f23cee1e57dc6d45a11a9e9 Author: Masahiro Yamada Date: Wed Nov 28 14:27:36 2018 +0900 mtd: rawnand: denali: remove ->dev_ready() hook The Denali NAND IP has no way to read out the current signal level of the R/B# pin. Instead, denali_dev_ready() checks if the R/B# transition has already happened. (The INTR__INT_ACT interrupt is asserted at the rising edge of the R/B# pin.) It is not a correct way to implement the ->dev_ready() hook. In fact, it has a drawback; in the nand_scan_ident phase, the chip detection iterates over maxchips until it fails to find a homogeneous chip. For the last loop, nand_reset() fails if no chip is there. If ->dev_ready hook exists, nand_command(_lp) calls nand_wait_ready() after NAND_CMD_RESET. However, we know denali_dev_ready() never returns 1 unless there exists a chip that toggles R/B# in that chip select. Then, nand_wait_ready() just ends up with wasting 400 msec, in the end, shows the "timeout while waiting for chip to become ready" warning. Let's remove the mis-implemented dev_ready hook, and fallback to sending the NAND_CMD_STATUS and nand_wait_status_ready(), which bails out more quickly. Signed-off-by: Masahiro Yamada Signed-off-by: Miquel Raynal commit 1b489effdb6dc16f63f254ee4c0d579929089e1d Author: Miquel Raynal Date: Thu Nov 22 16:58:59 2018 +0100 mtd: rawnand: marvell: fix spelling mistake in kernel doc Correct the spelling mistake 'Regiters' -> 'Registers'. Fixes: 961ba15c48dd ("mtd: rawnand: marvell: Fix clock resource by adding a register clock") Signed-off-by: Miquel Raynal Reviewed-by: Boris Brezillon commit 48fa2f58a5d6449dc0231a994ff4f62eed86380b Author: Janusz Krzysztofik Date: Wed Nov 21 12:08:06 2018 +0100 ARM: OMAP1: ams-delta: Drop obsolete NAND resources Amstrad Delta NAND driver now uses GPIO API for data I/O so there is no need to assign memory I/O resource to the device any longer. Drop it. Signed-off-by: Janusz Krzysztofik Acked-by: Tony Lindgren Signed-off-by: Miquel Raynal commit 7416bd35008c0fbd4aff9fdb267ff67b7bc4ea77 Author: Janusz Krzysztofik Date: Wed Nov 21 12:08:05 2018 +0100 mtd: rawnand: ams-delta: Use GPIO API for data I/O Don't readw()/writew() data directly from/to GPIO port which is under control of gpio-omap driver, use GPIO consumer API instead. The driver should now work with any 8-bit bidirectional GPIO port, not only OMAP. Signed-off-by: Janusz Krzysztofik Reviewed-by: Linus Walleij Reviewed-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 9773861304f15bec54b55ff1b6e6e6a7f99ebe5b Author: Janusz Krzysztofik Date: Wed Nov 21 12:08:04 2018 +0100 mtd: rawnand: ams-delta: Request data port GPIO resource Data port used by the driver is actually an OMAP MPUIO device, already under control of gpio-omap driver. For that reason we used to not request the memory region of the port as that would fail because the region is already busy. Despite that, we are still accessing the port by just ioremapping it and performing read/write operations. Moreover, we are doing that without any proteciton from other users legally manipulating the port pins over GPIO API. The plan is to convert the driver to access the port over GPIO consumer API. Before that happens, already prevent from other users accessing the port pins by requesting an array of its GPIO descriptors. Signed-off-by: Janusz Krzysztofik Reviewed-by: Boris Brezillon Reviewed-by: Linus Walleij Signed-off-by: Miquel Raynal commit 02e1ca60f4c36c0f9635f79e172b72d811b8a627 Author: Janusz Krzysztofik Date: Wed Nov 21 12:08:03 2018 +0100 ARM: OMAP1: ams-delta: Provide GPIO lookup table for NAND data port Data port used by Amstrad Delta NAND driver is actually an OMAP MPUIO device, already under control of gpio-omap driver. The NAND driver gets access to the port by ioremapping it and performs read/write operations. That is done without any proteciton from other users legally manipulating the port pins over GPIO API. The plan is to convert the driver to access the port over GPIO consumer API. Before that is implemented, the driver can already obtain exclusive access to the port by requesting an array of its GPIO descriptors. Add respective entries to the NAND GPIO lookup table. Signed-off-by: Janusz Krzysztofik Reviewed-by: Boris Brezillon Reviewed-by: Linus Walleij Acked-by: Tony Lindgren Signed-off-by: Miquel Raynal commit 7a08dbaedd365fa4eb7c9cd504c075e3336eb0c6 Author: Boris Brezillon Date: Sun Nov 11 08:55:24 2018 +0100 mtd: rawnand: Move ->setup_data_interface() to nand_controller_ops ->setup_data_interface() is a controller specific method and should thus be placed in nand_controller_ops. In order to make that work with controllers that support keeping pre-configured timings we need to add a new NAND_KEEP_TIMINGS flag to inform the core it should skip the timings selection step. Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit f2abfeb2078b9682bfeb77f91816fcf2177b3051 Author: Boris Brezillon Date: Sun Nov 11 08:55:23 2018 +0100 mtd: rawnand: Move the ->exec_op() method to nand_controller_ops ->exec_op() is a controller method and has nothing to do in the nand_chip struct. Let's move it to the nand_controller_ops struct and adjust the core and drivers accordingly. Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit 7d6c37e90cf9013bd18240cd861b9ae7b006f91f Author: Boris Brezillon Date: Sun Nov 11 08:55:22 2018 +0100 mtd: rawnand: Deprecate the ->select_chip() hook Now that the CS line to be selected is passed to ->exec_op() and stored in chip->cur_cs and after patching all drivers implementing ->exec_op() to stop implementing this method, we can deprecate it by moving it to the nand_legacy structure. Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit 1770022ffa85e1cdba88e311493cc16d52340a59 Author: Boris Brezillon Date: Sun Nov 11 08:55:21 2018 +0100 mtd: rawnand: ams-delta: Stop implementing ->select_chip() Now that the CS to be selected is passed in nand_operation->cs, we can get rid of the ->select_chip() implementation and replace it by an internal function which is called from the chip->exec_op() hook. Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit 653c57c7da087be6448f63430e077dd9eae06188 Author: Boris Brezillon Date: Sun Nov 11 08:55:20 2018 +0100 mtd: rawnand: vf610: Stop implementing ->select_chip() Now that the CS to be selected is kept in chip->cur_cs and passed in nand_operation->cs, we can get rid of the ->select_chip() implementation and replace it by an internal function which is called from the chip->exec_op() and chip->ecc.read/write_xxx() hooks. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 2ace451cae226da8cbf9b2af28f1458e4edaa31a Author: Boris Brezillon Date: Sun Nov 11 08:55:19 2018 +0100 mtd: rawnand: tegra: Stop implementing ->select_chip() Now that the CS to be selected is kept in chip->cur_cs and passed in nand_operation->cs, we can get rid of the ->select_chip() implementation and replace it by an internal function which is called from the chip->exec_op() and chip->ecc.read/write_xxx() hooks. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit b25251414f6e007c6ce7a0f6b96542bce728ffd9 Author: Boris Brezillon Date: Sun Nov 11 08:55:18 2018 +0100 mtd: rawnand: marvell: Stop implementing ->select_chip() Now that the CS to be selected is kept in chip->cur_cs and passed in nand_operation->cs, we can get rid of the ->select_chip() implementation and replace it by an internal function which is called from the chip->exec_op() and chip->ecc.read/write_xxx() hooks. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 550b9fc4e3af5f0af687d9e7bf168c8b48cf5495 Author: Boris Brezillon Date: Sun Nov 11 08:55:17 2018 +0100 mtd: rawnand: fsmc: Stop implementing ->select_chip() Now that the CS line to assert is directly passed through the nand_operation struct we can replace the fsmc_select_chip() implementation by an internal fsmc_ce_ctrl() function which is directly called from fsmc_exec_op() Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit 02b4a52604a4d1734a666ed11f9fb43afff10656 Author: Boris Brezillon Date: Sun Nov 11 08:55:16 2018 +0100 mtd: rawnand: Make ->select_chip() optional when ->exec_op() is implemented Now that the CS to be selected on a nand_operation is passed in nand_operation->cs we can make the ->select_chip() hook optional for drivers implementing ->exec_op(). When not implemented, the core is assuming the CS line is automatically asserted/deasserted by the driver ->exec_op() implementation. Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit ae2294b10b0f066ef500954b36c94ee11c4ef20f Author: Boris Brezillon Date: Sun Nov 11 08:55:15 2018 +0100 mtd: rawnand: Pass the CS line to be selected in struct nand_operation In order to deprecate the ->select_chip hook we need to pass the CS line a NAND operations are targeting. This is done through the addition of a cs field to the nand_operation struct. We also need to keep track of the currently selected target to properly initialize op->cs, hence the ->cur_cs field addition to the nand_chip struct. Note that op->cs is not assigned in nand_exec_op() because we might rework the way we execute NAND operations in the future (adopt a queuing mechanism instead of the serialization we have right now). Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit 1d0178593d148e88d2ac1e3f09c7f7eb1c20796b Author: Boris Brezillon Date: Sun Nov 11 08:55:14 2018 +0100 mtd: rawnand: Add nand_[de]select_target() helpers Add a wrapper to prevent drivers and core code from directly calling the ->select_chip hook which we are about to deprecate. Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit 9fd6bcffe741cfd237bb4a310e8cc82457a6c541 Author: Boris Brezillon Date: Sun Nov 11 08:55:13 2018 +0100 mtd: rawnand: ams-delta: Explicitly inherit from nand_controller All NAND objects are supposed to inherit from nand_controller. The framework is providing a dummy controller object, but we're moving away from this approach in favor of explicit inheritance. Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit 876ba603c9e0fa7885f89a35ed221792caea8034 Author: Boris Brezillon Date: Sun Nov 11 08:55:12 2018 +0100 mtd: rawnand: ams-delta: Check mtd_device_register() return code mtd_device_register() can fail, and when it does we should propagate the error and cleanup what has been done before. Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit 8bbc3c0850d0668ac7cf0f5b129ffae8c810247f Author: Boris Brezillon Date: Sun Nov 11 08:55:11 2018 +0100 mtd: rawnand: ams-delta: cleanup ams_delta_init() error path Remove unused labels, rename out_mtd into err_unmap to make it clearer and return 0 instead of using a goto out at the end of the registration procedure. Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit d54445d664a1324785f40f6fd4240b7a024f4b19 Author: Boris Brezillon Date: Sun Nov 11 08:55:10 2018 +0100 mtd: rawnand: ams-delta: Fix various coding style issues Most of them were reported by checkpatch: * s/u_char/u8/ * remove unneeded blank lines * don't print warning messages when devm_kzalloc() fails * Use ! instead of == NULL * Remove invalid comment Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit 4857393d5655b93e0e7368c12bbcf1d79883155c Author: Boris Brezillon Date: Sun Nov 11 08:55:09 2018 +0100 mtd: rawnand: ams-delta: Add an SPDX tag to replace the license text Add an SPDX GPL-2.0 tag and update MODULE_LICENSE() to match the license text. Signed-off-by: Boris Brezillon Signed-off-by: Miquel Raynal commit fbb080a1fcad340a6337d850ce4ff21f84635b03 Author: Boris Brezillon Date: Sun Nov 11 08:55:08 2018 +0100 mtd: rawnand: ams-delta: Allow this driver to be compiled when COMPILE_TEST=y Drop the asm and mach headers inclusion and allow this driver to be compiled when COMPILE_TEST=y in order to increase compile-test coverage. Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit 336058c8f4c2c7991427304c8bde05acef156054 Author: Boris Brezillon Date: Sun Nov 11 08:55:07 2018 +0100 mtd: rawnand: Remove unused NAND_CONTROLLER_ALLOC flag Looks like NAND_CONTROLLER_ALLOC has been introduced a long time ago back when the dummy nand_hw_ctrl object was dynamically allocated instead of being embedded in nand_chip. We can safely get rid of this unused flag. Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit 1f2d29e634b3e7abc7b62adf6bb4a676615c02ef Author: Boris Brezillon Date: Sun Nov 11 08:55:06 2018 +0100 mtd: rawnand: Move nand_exec_op() to internal.h nand_exec_op() is only used by core code (nand_xxx.c files). Let's move this inline function in drivers/mtd/nand/raw/internals.h. Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit 996852a97bc684d7771c692364705f0aaf423ba9 Author: Boris Brezillon Date: Sun Nov 11 08:55:05 2018 +0100 mtd: rawnand: legacy: Drop useless test in nand_legacy_set_defaults() nand_legacy_set_defaults() returns directly if chip->exec_op != NULL, no need to test !chip->exec_op after that. Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit 99f3351a6d6e03a9d307bba6797150a30e2e9d2e Author: Boris Brezillon Date: Sun Nov 11 08:55:04 2018 +0100 mtd: rawnand: Reorganize code to avoid forward declarations Avoid forward declaration of nand_get_device(), nand_do_write_oob() and nand_update_bbt() by moving functions around. Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit 0813621ba898aa91984d2713251970feeca93777 Author: Boris Brezillon Date: Sun Nov 11 08:55:03 2018 +0100 mtd: rawnand: Stop passing mtd_info objects to internal functions After having reworked the rawnand API to avoid passing mtd_info objects around, let's do the same for internal functions. Signed-off-by: Boris Brezillon Tested-by: Janusz Krzysztofik Signed-off-by: Miquel Raynal commit 10949af1681d5bb5cdbcc012815c6e40eec17d02 Author: Schrempf Frieder Date: Thu Nov 8 08:32:11 2018 +0000 mtd: spinand: Add initial support for Toshiba TC58CVG2S0H Add minimal support for the Toshiba TC58CVG2S0H SPI NAND chip. Signed-off-by: Frieder Schrempf Acked-by: Clément Péron Signed-off-by: Miquel Raynal commit 46a14b1aa4a161ad5e2abf03e1035d882437252b Author: Bartosz Golaszewski Date: Mon Nov 26 09:15:58 2018 +0100 MAINTAINERS: remove a duplicate entry for gpio-mockup I'll be getting all GPIO e-mail now, so remove my name from reviewers of gpio-mockup. Signed-off-by: Bartosz Golaszewski Signed-off-by: Linus Walleij commit 8c4cf161a8b42749e986a3503f6cd4f3b5682fe3 Author: Chen-Yu Tsai Date: Fri Dec 7 16:47:19 2018 +0800 dt-bindings: rtc: sun6i-rtc: Fix register range in example The register range for the RTC extends beyond 0x54. Use the size from the user manual's memory map instead. Fixes: 9765d2d94309 ("rtc: sun6i: Add sun6i RTC driver") Signed-off-by: Chen-Yu Tsai Signed-off-by: Alexandre Belloni commit eaaa598c0a285ef3b0efa54e711a385269fe50ce Merge: 68000a0d983f5 72e9baf997286 Author: Zhang Rui Date: Fri Dec 7 16:49:50 2018 +0800 Merge branches 'for-rc' and 'thermal-core' into next commit 72e9baf997286610a2a3109e79fdb528590c5523 Author: Amit Kucheria Date: Fri Dec 7 12:25:27 2018 +0530 drivers: thermal: Move QCOM_SPMI_TEMP_ALARM into the qcom subdir This cleans up the directory a bit allowing just one place to look for thermal related drivers for QCOM platforms instead of being scattered in the root directory and the qcom/ subdirectory. Compile-tested with ARCH=arm64 defconfig and the driver explicitly enabled with menuconfig. Signed-off-by: Amit Kucheria Acked-by: Daniel Lezcano Signed-off-by: Zhang Rui commit 3e8c4d31f8eddc957ee293b3556586ee698d9a21 Author: Amit Kucheria Date: Fri Dec 7 12:25:26 2018 +0530 drivers: thermal: Move various drivers for intel platforms into a subdir This cleans up the directory a bit, now that we have several other platforms using platform-specific sub-directories. Compile-tested with ARCH=x86 defconfig and the drivers explicitly enabled with menuconfig. Signed-off-by: Amit Kucheria Acked-by: Daniel Lezcano Signed-off-by: Zhang Rui commit 48d365de7746a000afd7f9f7cc1821cbb6fe9b45 Merge: 754cac3f1c270 b1635596860dd Author: Greg Kroah-Hartman Date: Fri Dec 7 08:10:22 2018 +0100 Merge tag 'soundwire-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-next Vinod writes: soundwire updates for 4.21-rc1 A single change: - constify snd_soc_dai_ops struct by Julia * tag 'soundwire-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: intel: constify snd_soc_dai_ops structures commit 88d905e20b11f7ad841e3afddaf1d59b6693c4a1 Author: Yangtao Li Date: Sat Dec 1 04:56:30 2018 -0500 crypto: cavium/nitrox - convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Herbert Xu commit 8362ea16f69fe59c4d012f0748e586ad09391f41 Author: Atul Gupta Date: Fri Nov 30 14:32:09 2018 +0530 crypto: chcr - ESN for Inline IPSec Tx Send SPI, 64b seq nos and 64b IV with aadiv drop for inline crypto. This information is added in outgoing packet after the CPL TX PKT XT and removed by hardware. The aad, auth and cipher offsets are then adjusted for ESN enabled tunnel. Signed-off-by: Atul Gupta Signed-off-by: Herbert Xu commit c35828ea906a7c76632a0211e59c392903cd4615 Author: Atul Gupta Date: Fri Nov 30 14:31:48 2018 +0530 crypto: chcr - small packet Tx stalls the queue Immediate packets sent to hardware should include the work request length in calculating the flits. WR occupy one flit and if not accounted result in invalid request which stalls the HW queue. Cc: stable@vger.kernel.org Signed-off-by: Atul Gupta Signed-off-by: Herbert Xu commit 1f6669b9716c6c98391b0f756e060892b32b8ca7 Author: Corentin Labbe Date: Thu Nov 29 14:42:26 2018 +0000 crypto: user - Add crypto_stats_init This patch add the crypto_stats_init() function. This will permit to remove some ifdef from __crypto_register_alg(). Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 44f13133cb03ec32fc88a533673248ef5c0617e3 Author: Corentin Labbe Date: Thu Nov 29 14:42:25 2018 +0000 crypto: user - rename err_cnt parameter Since now all crypto stats are on their own structures, it is now useless to have the algorithm name in the err_cnt member. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 17c18f9e33282a170458cb5ea20759bfcb0da7d8 Author: Corentin Labbe Date: Thu Nov 29 14:42:24 2018 +0000 crypto: user - Split stats in multiple structures Like for userspace, this patch splits stats into multiple structures, one for each algorithm class. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 5fff81729f09f3d7d9be0ace50be112bd34f0bb9 Author: Corentin Labbe Date: Thu Nov 29 14:42:23 2018 +0000 crypto: user - remove intermediate variable The use of the v64 intermediate variable is useless, and removing it bring to much readable code. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit b0af91c14109d6c9c0d73428dc0512b780f41d94 Author: Corentin Labbe Date: Thu Nov 29 14:42:22 2018 +0000 crypto: user - Fix invalid stat reporting Some error count use the wrong name for getting this data. But this had not caused any reporting problem, since all error count are shared in the same union. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit f7d76e05d058b832b373237566cc1af8251371b5 Author: Corentin Labbe Date: Thu Nov 29 14:42:21 2018 +0000 crypto: user - fix use_after_free of struct xxx_request All crypto_stats functions use the struct xxx_request for feeding stats, but in some case this structure could already be freed. For fixing this, the needed parameters (len and alg) will be stored before the request being executed. Fixes: cac5818c25d0 ("crypto: user - Implement a generic crypto statistics") Reported-by: syzbot Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 76d09ea7c22f2cabf1f66ffc287c23b19b120be9 Author: Corentin Labbe Date: Thu Nov 29 14:42:20 2018 +0000 crypto: tool: getstat: convert user space example to the new crypto_user_stat uapi This patch converts the getstat example tool to the recent changes done in crypto_user_stat - changed all stats to u64 - separated struct stats for each crypto alg Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 7f0a9d5c9d1ba8ab3e5b144e52553744dc0d7471 Author: Corentin Labbe Date: Thu Nov 29 14:42:19 2018 +0000 crypto: user - split user space crypto stat structures It is cleaner to have each stat in their own structures. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 6e8e72cd206e2ba68801e4f2490f639d41808c8d Author: Corentin Labbe Date: Thu Nov 29 14:42:18 2018 +0000 crypto: user - convert all stats from u32 to u64 All the 32-bit fields need to be 64-bit. In some cases, UINT32_MAX crypto operations can be done in seconds. Reported-by: Eric Biggers Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit a6a31385364ca0f7b98ace0bad93d793f07f97f3 Author: Corentin Labbe Date: Thu Nov 29 14:42:17 2018 +0000 crypto: user - CRYPTO_STATS should depend on CRYPTO_USER CRYPTO_STATS is using CRYPTO_USER stuff, so it should depends on it. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit 2ced26078fcff26db532d6300a1b5f8ffd11a5e1 Author: Corentin Labbe Date: Thu Nov 29 14:42:16 2018 +0000 crypto: user - made crypto_user_stat optional Even if CRYPTO_STATS is set to n, some part of CRYPTO_STATS are compiled. This patch made all part of crypto_user_stat uncompiled in that case. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit c97e4df573f2434b07f08d3b93673f61158d267f Author: Paulo Flabiano Smorigo Date: Tue Nov 27 15:27:21 2018 -0200 MAINTAINERS: change NX/VMX maintainers Add Breno and Nayna as NX/VMX crypto driver maintainers. Also change my email address to my personal account and remove Leonidas since he's not working with the driver anymore. Signed-off-by: Paulo Flabiano Smorigo Signed-off-by: Herbert Xu commit 18596781e0beb6b4633cb5582308ba14c37eaaed Author: Gilad Ben-Yossef Date: Tue Nov 13 09:40:37 2018 +0000 MAINTAINERS: ccree: add co-maintainer Add Yael Chemla as co-maintainer of Arm TrustZone CryptoCell REE driver. Signed-off-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit fefbc0b4bcb3c0cc45bed906af46e7cd627ac4bc Author: Gilad Ben-Yossef Date: Tue Nov 13 09:40:36 2018 +0000 dt-bindings: crypto: ccree: add dt bindings for ccree 703 Add device tree bindings associating Arm TrustZone CryptoCell 703 with the ccree driver. Signed-off-by: Gilad Ben-Yossef Reviewed-by: Rob Herring Signed-off-by: Herbert Xu commit 1c876a90e25398a7396ff4de9074ab530e7892b4 Author: Gilad Ben-Yossef Date: Tue Nov 13 09:40:35 2018 +0000 crypto: ccree - add support for CryptoCell 703 Add support for Arm TrustZone CryptoCell 703. The 703 is a variant of the CryptoCell 713 that supports only algorithms certified by the Chinesse Office of the State Commercial Cryptography Administration (OSCCA). Signed-off-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit 3004cfd6204927c1294060b849029cf0c2651074 Author: Stephan Gerhold Date: Thu Dec 6 19:42:28 2018 +0100 Revert "usb: dwc3: pci: Use devm functions to get the phy GPIOs" Commit 211f658b7b40 ("usb: dwc3: pci: Use devm functions to get the phy GPIOs") changed the code to claim the PHY GPIOs permanently for Intel Baytrail devices. This causes issues when the actual PHY driver attempts to claim the same GPIO descriptors. For example, tusb1210 now fails to probe with: tusb1210: probe of dwc3.0.auto.ulpi failed with error -16 (EBUSY) dwc3-pci needs to turn on the PHY once before dwc3 is loaded, but usually the PHY driver will then hold the GPIOs to turn off the PHY when requested (e.g. during suspend). To fix the problem, this reverts the commit to restore the old behavior to put the GPIOs immediately after usage. Link: https://www.spinics.net/lists/linux-usb/msg174681.html Cc: stable@vger.kernel.org Signed-off-by: Stephan Gerhold Signed-off-by: Felipe Balbi commit d9d1dc817020773c010498f5f81bb49439f7c962 Author: Yangtao Li Date: Wed Dec 5 11:26:39 2018 -0500 USB: gadget: udc: s3c2410_udc: convert to DEFINE_SHOW_ATTRIBUTE Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: Yangtao Li Signed-off-by: Felipe Balbi commit 3fd3c80acc172fcaab2356c15e5e3c05758a9d51 Author: Danit Goldberg Date: Fri Nov 30 13:22:04 2018 +0200 net/mlx5: Expose packet based credit mode Packet based credit mode bit determines whether the credit mode is done per message or packet. Expose the QP creation flag and the HCA capability. Signed-off-by: Danit Goldberg Reviewed-by: Majd Dibbiny Signed-off-by: Leon Romanovsky commit 946dca8fe456564373e0ff1f40c232b534e2aaef Merge: 7a027b57f9596 e61efff4ae94f Author: Herbert Xu Date: Fri Dec 7 13:59:10 2018 +0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Merge crypto tree to pick up crypto stats API revert. commit f770e3bc236ee954a3b4052bdf55739e26ee25db Author: YueHaibing Date: Fri Dec 7 03:52:43 2018 +0000 usb: mtu3: fix dbginfo in qmu_tx_zlp_error_handler Fixes gcc '-Wunused-but-set-variable' warning: drivers/usb/mtu3/mtu3_qmu.c: In function 'qmu_tx_zlp_error_handler': drivers/usb/mtu3/mtu3_qmu.c:385:22: warning: variable 'req' set but not used [-Wunused-but-set-variable] It seems dbginfo original intention is print 'req' other than 'mreq' Acked-by: Chunfeng Yun Signed-off-by: YueHaibing Signed-off-by: Felipe Balbi commit 54d48183d21e03f780053d7129312049cb5dd591 Author: Andy Shevchenko Date: Mon Dec 3 11:28:47 2018 +0200 usb: dwc3: trace: add missing break statement to make compiler happy The missed break statement in the outer switch makes the code fall through always and thus always same value will be printed. Besides that, compiler warns about missed fall through marker: drivers/usb/dwc3/./trace.h: In function ‘trace_raw_output_dwc3_log_trb’: drivers/usb/dwc3/./trace.h:246:4: warning: this statement may fall through [-Wimplicit-fallthrough=] switch (pcm) { ^~~~~~ Add the missing break statement to work correctly without compilation warnings. Fixes: fa8d965d736b ("usb: dwc3: trace: pretty print high-bandwidth transfers too") Cc: Felipe Balbi Signed-off-by: Andy Shevchenko Signed-off-by: Felipe Balbi commit e7521d82b33593c9b3ffd1e49a7ea2999ddc2285 Author: Yuval Shaia Date: Thu Dec 6 16:02:34 2018 +0200 IB/rxe: Utilize generic function to validate port number Utilize rdma_is_port_valid to validate the given port. Signed-off-by: Yuval Shaia Signed-off-by: Jason Gunthorpe commit 1ceb25c885a291b57f2b069081599834204025a3 Author: Yuval Shaia Date: Thu Dec 6 13:04:38 2018 +0200 IB/rxe: Make function rxe_pool_cleanup return void Since the function always returns 0 make it void. Signed-off-by: Yuval Shaia Reviewed-by: Bart Van Assche Signed-off-by: Jason Gunthorpe commit c471de14eeacff6c095f81eb8901d55de7f7fb69 Author: Leon Romanovsky Date: Thu Dec 6 12:19:05 2018 +0200 RDMA/uverbs: Fix typo in string concatenation macro Update UVERBS_OBJECT() macro to properly concatenate the object name. Fixes: e502a864c352 ("IB/core: Introduce DECLARE_UVERBS_GLOBAL_METHODS") Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit d1810909d841314ba94b14dc3de9e9fbc13b046a Author: Colin Ian King Date: Sun Nov 25 23:25:24 2018 +0000 drm/i915/gvt: fix spelling mistake "Interupts" -> "Interrupts" There is a spelling mistake in an error message, fix it. Signed-off-by: Colin Ian King Signed-off-by: Zhenyu Wang commit f39a89b8f738b683e720185cdbbd1e6d626fada9 Author: Xiong Zhang Date: Thu Nov 29 16:25:54 2018 +0800 drm/i915/gvt: Fix shadow ctx ppgtt destroy function Recently gvt shadow ctx create ppgtt table and this ppgtt's root pointer is modified at workload dispatch, then we lose the original ppgtt's root pointer, this causes the ppgtt destroy function abnormal as it will release the wrong root table. This patch save i915 context ppgtt root pointer at shadow ctx creation and restore it at shadow ctx destruction. v2: Split save and restore function (Zhenyu) Fixes:4f15665ccbba("drm/i915: Add ppgtt to GVT GEM context") Signed-off-by: Xiong Zhang Signed-off-by: Zhenyu Wang commit 77453c9f2b67956911d0074e07e30a5e59e51a6e Author: Peng Hao Date: Thu Oct 4 12:04:34 2018 -0400 drm/i915/gvt: fix a typo: "registeration" -> "registration". Fix a typo in the error message reporting. Signed-off-by: Peng Hao Signed-off-by: Zhi Wang Signed-off-by: Zhenyu Wang commit d58b33638c99ae63c57ad86d8f9f34abac163c1e Author: Xinyun Liu Date: Wed Sep 19 15:28:30 2018 +0800 drm/i915/gvt: fix typo in two MI cmd annotation s/ME_SEMAPHORE_/MI_SEMAPHORE_ Signed-off-by: Xinyun Liu Signed-off-by: Zhi Wang Signed-off-by: Zhenyu Wang commit cba5ad62df9cf85218c0cd811cf68f9fd21f0d9a Author: Zhao Yan Date: Mon Sep 17 01:56:51 2018 -0400 drm/i915/gvt: update force-to-nonpriv register whitelist Host print below warning message when creating guest: "gvt: vgpu(2) Invalid FORCE_NONPRIV write 83a8". Register 0x83a8 should be in force-to-nonpriv whitelist as required by guest v2: update commit message to describe purpose of this patch in detail (zhenyu wang) Signed-off-by: Zhao Yan Signed-off-by: Zhenyu Wang commit 419822c8b83f37ea4934d5583b5c5fbe9493cfcf Author: Alex Vesker Date: Tue Dec 4 15:34:05 2018 +0200 IB/mlx5: Enable TX on a DEVX flow table Flow table can be passed as a DEVX object which is a valid destination in an EGRESS flow. Fix the original code to allow that. Fixes: a7ee18bdee83 ("RDMA/mlx5: Allow creating a matcher for a NIC TX flow table") Signed-off-by: Alex Vesker Reviewed-by: Yishai Hadas Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 0fbc9b8b4ea3f688a5da141a64f97aa33ad02ae9 Author: Qian Cai Date: Thu Nov 29 21:18:07 2018 -0500 mlx4: Use snprintf instead of complicated strcpy This fixes a compilation warning in sysfs.c drivers/infiniband/hw/mlx4/sysfs.c:360:2: warning: 'strncpy' output may be truncated copying 8 bytes from a string of length 31 [-Wstringop-truncation] By eliminating the temporary stack buffer. Signed-off-by: Qian Cai Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 9aefcabe579bca06325ad9e577a36816f57386ff Author: Mike Marciniszyn Date: Wed Nov 28 10:33:00 2018 -0800 IB/hfi1: Reduce lock contention on iowait_lock for sdma and pio Commit 4e045572e2c2 ("IB/hfi1: Add unique txwait_lock for txreq events") laid the ground work to support per resource waiting locking. This patch adds that with a lock unique to each sdma engine and pio sendcontext and makes necessary changes for verbs, PSM, and vnic to use the new locks. This is particularly beneficial for smaller messages that will exhaust resources at a faster rate. Fixes: 7724105686e7 ("IB/hfi1: add driver files") Reviewed-by: Gary Leshner Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 18912c4524385dd6532c682cb9d4f6aa39ba8d47 Author: Mike Marciniszyn Date: Wed Nov 28 10:32:48 2018 -0800 IB/hfi1: Close VNIC sdma_progress sleep window The call to sdma_progress() is called outside the wait lock. In this case, there is a race condition where sdma_progress() can return false and the sdma_engine can idle. If that happens, there will be no more sdma interrupts to cause the wakeup and the vnic_sdma xmit will hang. Fix by moving the lock to enclose the sdma_progress() call. Also, delete the tx_retry. The need for this was removed by: commit bcad29137a97 ("IB/hfi1: Serve the most starved iowait entry first") Fixes: 64551ede6cd1 ("IB/hfi1: VNIC SDMA support") Reviewed-by: Gary Leshner Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 5190f052a3654aa1120ea4f9ff3bfac430459893 Author: Mike Marciniszyn Date: Wed Nov 28 10:22:31 2018 -0800 IB/hfi1: Allow the driver to initialize QP priv struct This patch adds an interface to allow the driver to initialize the QP priv struct when the QP is created and after the qpn has been assigned. A field is added to the QP priv struct to reference the rcd and two new files are added to contain the function to initialize the rcd field so that more TID RDMA related code can be added here later. Signed-off-by: Mike Marciniszyn Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit d2e9ace47aac92a465c4ad8e0cd1f5f8422a117e Author: Kaike Wan Date: Wed Nov 28 10:22:20 2018 -0800 IB/hfi1: Add OPFN and TID RDMA capability bits The OPFN and TID RDMA capability bits are added to allow users to control which feature is enabled and disabled. Reviewed-by: Mike Marciniszyn Signed-off-by: Mitko Haralanov Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit ca95f802ef5139722acc8d30aeaab6fe5bbe939e Author: Kaike Wan Date: Wed Nov 28 10:22:09 2018 -0800 IB/hfi1: Unreserve a reserved request when it is completed Currently, When a reserved operation is completed, its entry in the send queue will not be unreserved, which leads to the miscalculation of qp->s_avail and thus the triggering of a WARN_ON call trace. This patch fixes the problem by unreserving the reserved operation when it is completed. Fixes: 856cc4c237ad ("IB/hfi1: Add the capability for reserved operations") Reviewed-by: Mike Marciniszyn Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit ff8b67fccdb65402df78a1695c38be805252cf8e Author: Ashutosh Dixit Date: Wed Nov 28 10:19:47 2018 -0800 IB/hfi1: Consider LMC in 16B/bypass ingress packet check Ingress packet check for 16B/bypass packets should consider the port LMC. Not doing this will result in packets sent to the LMC LIDs getting dropped. The check is implemented in HW for 9B packets. Reviewed-by: Mike Ruhl Signed-off-by: Ashutosh Dixit Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit dbc2970caef74e8ff41923d302aa6fb5a4812d0e Author: Michael J. Ruhl Date: Wed Nov 28 10:19:36 2018 -0800 IB/hfi1: Incorrect sizing of sge for PIO will OOPs An incorrect sge sizing in the HFI PIO path will cause an OOPs similar to this: BUG: unable to handle kernel NULL pointer dereference at (null) IP: [] hfi1_verbs_send_pio+0x3d8/0x530 [hfi1] PGD 0 Oops: 0000 1 SMP Call Trace: ? hfi1_verbs_send_dma+0xad0/0xad0 [hfi1] hfi1_verbs_send+0xdf/0x250 [hfi1] ? make_rc_ack+0xa80/0xa80 [hfi1] hfi1_do_send+0x192/0x430 [hfi1] hfi1_do_send_from_rvt+0x10/0x20 [hfi1] rvt_post_send+0x369/0x820 [rdmavt] ib_uverbs_post_send+0x317/0x570 [ib_uverbs] ib_uverbs_write+0x26f/0x420 [ib_uverbs] ? security_file_permission+0x21/0xa0 vfs_write+0xbd/0x1e0 ? mntput+0x24/0x40 SyS_write+0x7f/0xe0 system_call_fastpath+0x16/0x1b Fix by adding the missing sizing check to correctly determine the sge length. Fixes: 7724105686e7 ("IB/hfi1: add driver files") Reviewed-by: Mike Marciniszyn Signed-off-by: Michael J. Ruhl Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit dd6c6a5a2e1e7be615c81ca6d44c2e89e22cb463 Author: Michael J. Ruhl Date: Wed Nov 28 10:19:25 2018 -0800 IB/hfi1: Limit VNIC use of SDMA engines to the available count VNIC assumes that all SDMA engines have been configured for use. This is not necessarily true (i.e. if the count was constrained by the module parameter). Update VNICs usage to use the configured count, rather than the hardware count. Reviewed-by: Mike Marciniszyn Reviewed-by: Gary Leshner Signed-off-by: Michael J. Ruhl Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit fe4dd4239277486ca3a468e7bbeafd7ef3a5634e Author: Mitko Haralanov Date: Wed Nov 28 10:19:15 2018 -0800 IB/hfi1: Correctly process FECN and BECN in packets A CA is supposed to ignore FECN bits in multicast, ACK, and CNP packets. This patch corrects the behavior of the HFI1 driver in this regard by ignoring FECNs in those packet types. While fixing the above behavior, fix the extraction of the FECN and BECN bits from the packet headers for both 9B and 16B packets. Furthermore, this patch corrects the driver's response to a FECN in RDMA READ RESPONSE packets. Instead of sending an "empty" ACK, the driver now sends a CNP packet. While editing that code path, add the missing trace for CNP packets. Fixes: 88733e3b8450 ("IB/hfi1: Add 16B UD support") Fixes: f59fb9e05109 ("IB/hfi1: Fix handling of FECN marked multicast packet") Reviewed-by: Kaike Wan Reviewed-by: Mike Marciniszyn Reviewed-by: Dennis Dalessandro Signed-off-by: Mitko Haralanov Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit c1a797c0818e0122c7ec8422edd971cfec9b15ea Author: Kaike Wan Date: Wed Nov 28 10:19:04 2018 -0800 IB/hfi1: Ignore LNI errors before DC8051 transitions to Polling state When it is requested to change its physical state back to Offline while in the process to go up, DC8051 will set the ERROR field in the DC8051_DBG_ERR_INFO_SET_BY_8051 register. This ERROR field will remain until the next time when DC8051 transitions from Offline to Polling. Subsequently, when the host requests DC8051 to change its physical state to Polling again, it may receive a DC8051 interrupt with the stale ERROR field still in DC8051_DBG_ERR_INFO_SET_BY_8051. If the host link state has been changed to Polling, this stale ERROR will force the host to transition to Offline state, resulting in a vicious cycle of Polling ->Offline->Polling->Offline. On the other hand, if the host link state is still Offline when the stale ERROR is received, the stale ERROR will be ignored, and the link will come up correctly. This patch implements the correct behavior by changing host link state to Polling only after DC8051 changes its physical state to Polling. Reviewed-by: Mike Marciniszyn Signed-off-by: Krzysztof Goreczny Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 937488a85986faa743d12456970a0cbe83e3b04e Author: Kaike Wan Date: Wed Nov 28 10:14:32 2018 -0800 IB/hfi1: Dump pio info for non-user send contexts This patch dumps the pio info for non-user send contexts to assist debugging in the field. Reviewed-by: Mike Marciniczyn Reviewed-by: Mike Ruhl Signed-off-by: Kaike Wan Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 44ff3cafcd7f413e7710a58ac40cfdc3a9380097 Author: Chen-Yu Tsai Date: Mon Dec 3 22:58:25 2018 +0800 arm64: dts: allwinner: a64: Fix up RTC device node and clock references The RTC module on the A64 was claimed to be the same as on the A31, when in fact it is not. It is actually compatible to the H3's RTC. The A64's RTC has some extra crypto-related registers which the H3's does not, but the exact function of these is not clear. This patch fixes the compatible string and clock properties to conform to the updated bindings. The device node for the internal oscillator is removed, as it is internalized into the RTC device. Clock references to the IOSC and LOSC are also fixed. Acked-by: Maxime Ripard Signed-off-by: Chen-Yu Tsai commit 5f9e882825467105acafd208520b69bf95adb963 Author: Chen-Yu Tsai Date: Mon Dec 3 22:58:24 2018 +0800 ARM: dts: sun8i: r40: Add RTC device node The R40 has an RTC hardware block, which has additional registers that are not related to RTC or clock functions, and is otherwise compatible with the H3's RTC. Add a device node for it, and fix up any references to the LOSC. Acked-by: Maxime Ripard Tested-by: Corentin Labbe Signed-off-by: Chen-Yu Tsai commit 507c6e89d6c4b2cd68a8e7ff69d1a00cf74b15dd Author: Chen-Yu Tsai Date: Mon Dec 3 22:58:22 2018 +0800 ARM: dts: sunxi: h3/h5: Fix up RTC device node and clock references The RTC module on the H3 was claimed to be the same as on the A31, when in fact it is not. The A31 does not have an RTC external clock output, and its internal RC oscillator's average clock rate is not in the same range. The H5's RTC has some extra crypto-related registers compared to the H3. Their exact functions are not clear. Also the RTC-VIO regulator has different settings. This patch fixes the compatible string and clock properties to conform to the updated bindings. The device node for the internal oscillator is removed, as it is internalized into the RTC device. Clock references to the IOSC and LOSC are also fixed. Acked-by: Maxime Ripard Tested-by: Corentin Labbe Signed-off-by: Chen-Yu Tsai commit f6f4422532ad9ec9380a9936ed16b30922066a50 Author: Chen-Yu Tsai Date: Mon Dec 3 22:58:20 2018 +0800 ARM: dts: sun8i: a23/a33: Fix up RTC device node The RTC module on the A23 was claimed to be the same as on the A31, when in fact it is not. The A31 does not have an RTC external clock output, and its internal RC oscillator's average clock rate is not in the same range. The A33's RTC is the same as the A23. This patch fixes the compatible string and clock properties to conform to the updated bindings. The register range is also fixed. Acked-by: Maxime Ripard Signed-off-by: Chen-Yu Tsai commit e69aa5f9b97f7f871643336deb281db5cb14878b Merge: 1f9a5dce3548d 0b258ed1a219a Author: Dave Airlie Date: Fri Dec 7 10:46:29 2018 +1000 Merge tag 'drm-misc-next-2018-12-06' of git://anongit.freedesktop.org/drm/drm-misc into drm-next Final changes to drm-misc-next for v4.21: UAPI Changes: Core Changes: - Add dma_fence_get_stub to dma-buf, and use it in drm/syncobj. - Add and use DRM_MODESET_LOCK_BEGIN/END helpers. - Small fixes to drm_atomic_helper_resume(), drm_mode_setcrtc() and drm_atomic_helper_commit_duplicated_state() - Fix drm_atomic_state_helper.[c] extraction. Driver Changes: - Small fixes to tinydrm, vkms, meson, rcar-du, virtio, vkms, v3d, and pl111. - vc4: Allow scaling and YUV formats on cursor planes. - v3d: Enable use of the Texture Formatting Unit, and fix prime imports of buffers from other drivers. - Add support for the AUO G101EVN010 panel. - sun4i: Enable support for the H6 display engine. Signed-off-by: Dave Airlie [airlied: added drm/v3d: fix broken build to the merge commit] From: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/321be9d3-ab75-5f92-8193-e5113662edef@linux.intel.com commit ef2df7fc11f8847e9e1912c06fd9cfef1cca438c Merge: fdb8b298676a3 1ba1daed90e23 Author: David S. Miller Date: Thu Dec 6 13:26:07 2018 -0800 Merge branch 'Pass-extack-to-NETDEV_PRE_UP' Petr Machata says: ==================== Pass extack to NETDEV_PRE_UP Drivers may need to validate configuration of a device that's about to be upped. An example is mlxsw, which needs to check the configuration of a VXLAN device attached to an offloaded bridge. Should the validation fail, there's currently no way to communicate details of the failure to the user, beyond an error number. Therefore this patch set extends the NETDEV_PRE_UP event to include extack, if available. There are three vectors through which NETDEV_PRE_UP invocation can be reached. The two major ones are dev_open() and dev_change_flags(), the last is then __dev_change_flags(). In patch #1, the first access vector, dev_open() is addressed. An extack parameter is added and all users converted to use it. Before addressing the second vector, two preparatory patches propagate extack argument to the proximity of the dev_change_flags() call in VRF and IPVLAN drivers. That happens in patches #2 and #3. Then in patch #4, dev_change_flags() is treated similarly to dev_open(). Likewise in patch #5, __dev_change_flags() is extended. Then in patches #6 and #7, the extack is finally propagated all the way to the point where the notification is emitted. This change allows particularly mlxsw (which already has code to leverage extack if available) to communicate to the user error messages regarding VXLAN configuration. In patch #8, add a test case that exercises this code and checks that an error message is propagated. For example: local 192.0.2.17 remote 192.0.2.18 \ dstport 4789 nolearning noudpcsum tos inherit ttl 100 local 192.0.2.17 remote 192.0.2.18 \ dstport 4789 nolearning noudpcsum tos inherit ttl 100 Error: mlxsw_spectrum: Conflicting NVE tunnels configuration. v2: - Add David Ahern's tags. ==================== Signed-off-by: David S. Miller commit 1ba1daed90e235f297f60443128a3acfc05aac7b Author: Petr Machata Date: Thu Dec 6 17:05:48 2018 +0000 selftests: mlxsw: Add a new test extack.sh Add a testsuite dedicated to testing extack propagation and related functionality. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 40c900aa1ff580afe941ff77f327f004546f0ce7 Author: Petr Machata Date: Thu Dec 6 17:05:47 2018 +0000 net: core: dev: Attach extack to NETDEV_PRE_UP Drivers may need to validate configuration of a device that's about to be upped. Should the validation fail, there's currently no way to communicate details of the failure to the user, beyond an error number. To mend that, change __dev_open() to take an extack argument and pass it from __dev_change_flags() and dev_open(), where it was propagated in the previous patches. Change __dev_open() to call call_netdevice_notifiers_extack() so that the passed-in extack is attached to the NETDEV_PRE_UP notifier. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 263726053400b9c6671df8e87d3db9728199da13 Author: Petr Machata Date: Thu Dec 6 17:05:45 2018 +0000 net: core: dev: Add call_netdevice_notifiers_extack() In order to propagate extack through NETDEV_PRE_UP, add a new function call_netdevice_notifiers_extack() that primes the extack field of the notifier info. Convert call_netdevice_notifiers() to a simple wrapper around the new function that passes NULL for extack. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 6d0403216d030e5623de3911168fceeaac2e14d6 Author: Petr Machata Date: Thu Dec 6 17:05:43 2018 +0000 net: core: dev: Add extack argument to __dev_change_flags() In order to pass extack together with NETDEV_PRE_UP notifications, it's necessary to route the extack to __dev_open() from diverse (possibly indirect) callers. The last missing API is __dev_change_flags(). Therefore extend __dev_change_flags() with and extra extack argument and update the two existing users. Since the function declaration line is changed anyway, name the struct net_device argument to placate checkpatch. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 567c5e13be5cc74d24f5eb54cf353c2e2277189b Author: Petr Machata Date: Thu Dec 6 17:05:42 2018 +0000 net: core: dev: Add extack argument to dev_change_flags() In order to pass extack together with NETDEV_PRE_UP notifications, it's necessary to route the extack to __dev_open() from diverse (possibly indirect) callers. One prominent API through which the notification is invoked is dev_change_flags(). Therefore extend dev_change_flags() with and extra extack argument and update all users. Most of the calls end up just encoding NULL, but several sites (VLAN, ipvlan, VRF, rtnetlink) do have extack available. Since the function declaration line is changed anyway, name the other function arguments to placate checkpatch. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Reviewed-by: David Ahern Signed-off-by: David S. Miller commit cf7686a01266de84b3b825acc05026d4e55454e1 Author: Petr Machata Date: Thu Dec 6 17:05:40 2018 +0000 net: ipvlan: ipvlan_set_port_mode(): Add an extack argument A follow-up patch will extend dev_change_flags() with an extack argument. Extend ipvlan_set_port_mode() to have that argument available for the conversion. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit dc1aea1e08de3fb02c52df6e0e27095a49fb5a41 Author: Petr Machata Date: Thu Dec 6 17:05:38 2018 +0000 net: vrf: cycle_netdev(): Add an extack argument A follow-up patch will extend dev_change_flags() with an extack argument. Extend cycle_netdev() to have that argument available for the conversion. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schimmel Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 00f54e68924eaf075f3f24be18557899d347bc4a Author: Petr Machata Date: Thu Dec 6 17:05:36 2018 +0000 net: core: dev: Add extack argument to dev_open() In order to pass extack together with NETDEV_PRE_UP notifications, it's necessary to route the extack to __dev_open() from diverse (possibly indirect) callers. One prominent API through which the notification is invoked is dev_open(). Therefore extend dev_open() with and extra extack argument and update all users. Most of the calls end up just encoding NULL, but bond and team drivers have the extack readily available. Signed-off-by: Petr Machata Acked-by: Jiri Pirko Reviewed-by: Ido Schi